Merge branch 'v2.6.34-rc2' into drm-linus
authorDave Airlie <airlied@redhat.com>
Wed, 31 Mar 2010 04:55:14 +0000 (14:55 +1000)
committerDave Airlie <airlied@redhat.com>
Wed, 31 Mar 2010 04:55:14 +0000 (14:55 +1000)
1  2 
drivers/gpu/drm/nouveau/nouveau_bios.c
drivers/gpu/drm/nouveau/nouveau_drv.h
drivers/gpu/drm/radeon/radeon_combios.c
drivers/gpu/drm/ttm/ttm_bo.c
drivers/gpu/drm/ttm/ttm_memory.c

index aed6068a6ca5a8c1ba351dab5499121e148c09b9,75bceee76044e8ab25b6035e690e09fa3e29f850..b5a9336a2e88f58d3e90129c631262896f0f163b
@@@ -3545,7 -3545,7 +3545,7 @@@ int nouveau_bios_parse_lvds_table(struc
         * at which modes should be set up in the dual link style.
         *
         * Following the header, the BMP (ver 0xa) table has several records,
-        * indexed by a seperate xlat table, indexed in turn by the fp strap in
+        * indexed by a separate xlat table, indexed in turn by the fp strap in
         * EXTDEV_BOOT. Each record had a config byte, followed by 6 script
         * numbers for use by INIT_SUB which controlled panel init and power,
         * and finally a dword of ms to sleep between power off and on
@@@ -5210,21 -5210,6 +5210,21 @@@ divine_connector_type(struct nvbios *bi
        return type;
  }
  
 +static void
 +apply_dcb_connector_quirks(struct nvbios *bios, int idx)
 +{
 +      struct dcb_connector_table_entry *cte = &bios->dcb.connector.entry[idx];
 +      struct drm_device *dev = bios->dev;
 +
 +      /* Gigabyte NX85T */
 +      if ((dev->pdev->device == 0x0421) &&
 +          (dev->pdev->subsystem_vendor == 0x1458) &&
 +          (dev->pdev->subsystem_device == 0x344c)) {
 +              if (cte->type == DCB_CONNECTOR_HDMI_1)
 +                      cte->type = DCB_CONNECTOR_DVI_I;
 +      }
 +}
 +
  static void
  parse_dcb_connector_table(struct nvbios *bios)
  {
        entry = conntab + conntab[1];
        cte = &ct->entry[0];
        for (i = 0; i < conntab[2]; i++, entry += conntab[3], cte++) {
 +              cte->index = i;
                if (conntab[3] == 2)
                        cte->entry = ROM16(entry[0]);
                else
                        cte->entry = ROM32(entry[0]);
  
                cte->type  = (cte->entry & 0x000000ff) >> 0;
 -              cte->index = (cte->entry & 0x00000f00) >> 8;
 +              cte->index2 = (cte->entry & 0x00000f00) >> 8;
                switch (cte->entry & 0x00033000) {
                case 0x00001000:
                        cte->gpio_tag = 0x07;
                if (cte->type == 0xff)
                        continue;
  
 +              apply_dcb_connector_quirks(bios, i);
 +
                NV_INFO(dev, "  %d: 0x%08x: type 0x%02x idx %d tag 0x%02x\n",
                        i, cte->entry, cte->type, cte->index, cte->gpio_tag);
  
                        break;
                default:
                        cte->type = divine_connector_type(bios, cte->index);
 -                      NV_WARN(dev, "unknown type, using 0x%02x", cte->type);
 +                      NV_WARN(dev, "unknown type, using 0x%02x\n", cte->type);
                        break;
                }
  
 +              if (nouveau_override_conntype) {
 +                      int type = divine_connector_type(bios, cte->index);
 +                      if (type != cte->type)
 +                              NV_WARN(dev, " -> type 0x%02x\n", cte->type);
 +              }
 +
        }
  }
  
index 5bd8071523d2871d2ea72d7b6fd199ab9c12d19c,4b9aaf2a8d0f0052bbafd498998e2c71b1e38434..d8b559011777a2094187d93a7dc836f80122ec16
@@@ -553,7 -553,7 +553,7 @@@ struct drm_nouveau_private 
        uint32_t ramro_offset;
        uint32_t ramro_size;
  
-       /* base physical adresses */
+       /* base physical addresses */
        uint64_t fb_phys;
        uint64_t fb_available_size;
        uint64_t fb_mappable_pages;
@@@ -681,7 -681,6 +681,7 @@@ extern int nouveau_uscript_tmds
  extern int nouveau_vram_pushbuf;
  extern int nouveau_vram_notify;
  extern int nouveau_fbpercrtc;
 +extern int nouveau_tv_disable;
  extern char *nouveau_tv_norm;
  extern int nouveau_reg_debug;
  extern char *nouveau_vbios;
@@@ -689,7 -688,6 +689,7 @@@ extern int nouveau_ctxfw
  extern int nouveau_ignorelid;
  extern int nouveau_nofbaccel;
  extern int nouveau_noaccel;
 +extern int nouveau_override_conntype;
  
  extern int nouveau_pci_suspend(struct pci_dev *pdev, pm_message_t pm_state);
  extern int nouveau_pci_resume(struct pci_dev *pdev);
@@@ -928,10 -926,6 +928,10 @@@ extern void nv40_fb_takedown(struct drm
  extern void nv40_fb_set_region_tiling(struct drm_device *, int, uint32_t,
                                      uint32_t, uint32_t);
  
 +/* nv50_fb.c */
 +extern int  nv50_fb_init(struct drm_device *);
 +extern void nv50_fb_takedown(struct drm_device *);
 +
  /* nv04_fifo.c */
  extern int  nv04_fifo_init(struct drm_device *);
  extern void nv04_fifo_disable(struct drm_device *);
index 6d87e70a505b94088dc38ccf3c9fe8fb225ab324,e9ea38ece37558a6bf123b18a982b06ec252872a..2becdeda68a34ae4d94d8102f33d0d87fe6de959
@@@ -531,7 -531,10 +531,7 @@@ static struct radeon_i2c_bus_rec combio
        case CHIP_RS300:
                switch (ddc_line) {
                case RADEON_GPIO_DVI_DDC:
 -                      /* in theory this should be hw capable,
 -                       * but it doesn't seem to work
 -                       */
 -                      i2c.hw_capable = false;
 +                      i2c.hw_capable = true;
                        break;
                default:
                        i2c.hw_capable = false;
@@@ -630,8 -633,6 +630,8 @@@ bool radeon_combios_get_clock_info(stru
                p1pll->reference_div = RBIOS16(pll_info + 0x10);
                p1pll->pll_out_min = RBIOS32(pll_info + 0x12);
                p1pll->pll_out_max = RBIOS32(pll_info + 0x16);
 +              p1pll->lcd_pll_out_min = p1pll->pll_out_min;
 +              p1pll->lcd_pll_out_max = p1pll->pll_out_max;
  
                if (rev > 9) {
                        p1pll->pll_in_min = RBIOS32(pll_info + 0x36);
@@@ -1353,47 -1354,47 +1353,47 @@@ bool radeon_get_legacy_connector_info_f
        rdev->mode_info.connector_table = radeon_connector_table;
        if (rdev->mode_info.connector_table == CT_NONE) {
  #ifdef CONFIG_PPC_PMAC
-               if (machine_is_compatible("PowerBook3,3")) {
+               if (of_machine_is_compatible("PowerBook3,3")) {
                        /* powerbook with VGA */
                        rdev->mode_info.connector_table = CT_POWERBOOK_VGA;
-               } else if (machine_is_compatible("PowerBook3,4") ||
-                          machine_is_compatible("PowerBook3,5")) {
+               } else if (of_machine_is_compatible("PowerBook3,4") ||
+                          of_machine_is_compatible("PowerBook3,5")) {
                        /* powerbook with internal tmds */
                        rdev->mode_info.connector_table = CT_POWERBOOK_INTERNAL;
-               } else if (machine_is_compatible("PowerBook5,1") ||
-                          machine_is_compatible("PowerBook5,2") ||
-                          machine_is_compatible("PowerBook5,3") ||
-                          machine_is_compatible("PowerBook5,4") ||
-                          machine_is_compatible("PowerBook5,5")) {
+               } else if (of_machine_is_compatible("PowerBook5,1") ||
+                          of_machine_is_compatible("PowerBook5,2") ||
+                          of_machine_is_compatible("PowerBook5,3") ||
+                          of_machine_is_compatible("PowerBook5,4") ||
+                          of_machine_is_compatible("PowerBook5,5")) {
                        /* powerbook with external single link tmds (sil164) */
                        rdev->mode_info.connector_table = CT_POWERBOOK_EXTERNAL;
-               } else if (machine_is_compatible("PowerBook5,6")) {
+               } else if (of_machine_is_compatible("PowerBook5,6")) {
                        /* powerbook with external dual or single link tmds */
                        rdev->mode_info.connector_table = CT_POWERBOOK_EXTERNAL;
-               } else if (machine_is_compatible("PowerBook5,7") ||
-                          machine_is_compatible("PowerBook5,8") ||
-                          machine_is_compatible("PowerBook5,9")) {
+               } else if (of_machine_is_compatible("PowerBook5,7") ||
+                          of_machine_is_compatible("PowerBook5,8") ||
+                          of_machine_is_compatible("PowerBook5,9")) {
                        /* PowerBook6,2 ? */
                        /* powerbook with external dual link tmds (sil1178?) */
                        rdev->mode_info.connector_table = CT_POWERBOOK_EXTERNAL;
-               } else if (machine_is_compatible("PowerBook4,1") ||
-                          machine_is_compatible("PowerBook4,2") ||
-                          machine_is_compatible("PowerBook4,3") ||
-                          machine_is_compatible("PowerBook6,3") ||
-                          machine_is_compatible("PowerBook6,5") ||
-                          machine_is_compatible("PowerBook6,7")) {
+               } else if (of_machine_is_compatible("PowerBook4,1") ||
+                          of_machine_is_compatible("PowerBook4,2") ||
+                          of_machine_is_compatible("PowerBook4,3") ||
+                          of_machine_is_compatible("PowerBook6,3") ||
+                          of_machine_is_compatible("PowerBook6,5") ||
+                          of_machine_is_compatible("PowerBook6,7")) {
                        /* ibook */
                        rdev->mode_info.connector_table = CT_IBOOK;
-               } else if (machine_is_compatible("PowerMac4,4")) {
+               } else if (of_machine_is_compatible("PowerMac4,4")) {
                        /* emac */
                        rdev->mode_info.connector_table = CT_EMAC;
-               } else if (machine_is_compatible("PowerMac10,1")) {
+               } else if (of_machine_is_compatible("PowerMac10,1")) {
                        /* mini with internal tmds */
                        rdev->mode_info.connector_table = CT_MINI_INTERNAL;
-               } else if (machine_is_compatible("PowerMac10,2")) {
+               } else if (of_machine_is_compatible("PowerMac10,2")) {
                        /* mini with external tmds */
                        rdev->mode_info.connector_table = CT_MINI_EXTERNAL;
-               } else if (machine_is_compatible("PowerMac12,1")) {
+               } else if (of_machine_is_compatible("PowerMac12,1")) {
                        /* PowerMac8,1 ? */
                        /* imac g5 isight */
                        rdev->mode_info.connector_table = CT_IMAC_G5_ISIGHT;
index 9db02bb3e3feda36174578ffc270a4bcc8a4f868,89c38c49066f2d87a69ecf58d528f2cf209a26af..dd47b2a9a791fc2f539c0df6cf797661570c47dc
@@@ -128,7 -128,7 +128,7 @@@ static struct attribute *ttm_bo_global_
        NULL
  };
  
- static struct sysfs_ops ttm_bo_global_ops = {
+ static const struct sysfs_ops ttm_bo_global_ops = {
        .show = &ttm_bo_global_show
  };
  
@@@ -1425,8 -1425,8 +1425,8 @@@ int ttm_bo_global_init(struct ttm_globa
  
        atomic_set(&glob->bo_count, 0);
  
 -      kobject_init(&glob->kobj, &ttm_bo_glob_kobj_type);
 -      ret = kobject_add(&glob->kobj, ttm_get_kobj(), "buffer_objects");
 +      ret = kobject_init_and_add(
 +              &glob->kobj, &ttm_bo_glob_kobj_type, ttm_get_kobj(), "buffer_objects");
        if (unlikely(ret != 0))
                kobject_put(&glob->kobj);
        return ret;
index f9d6b35c3b8875e51da0440b4ae44bf1b40db529,eb143e04d40242a35c99d774f981cdf610979f6b..c40e5f48e9a1ac37048e012c3b4d4de7aa6ed652
@@@ -152,7 -152,7 +152,7 @@@ static struct attribute *ttm_mem_zone_a
        NULL
  };
  
- static struct sysfs_ops ttm_mem_zone_ops = {
+ static const struct sysfs_ops ttm_mem_zone_ops = {
        .show = &ttm_mem_zone_show,
        .store = &ttm_mem_zone_store
  };
@@@ -260,8 -260,8 +260,8 @@@ static int ttm_mem_init_kernel_zone(str
        zone->used_mem = 0;
        zone->glob = glob;
        glob->zone_kernel = zone;
 -      kobject_init(&zone->kobj, &ttm_mem_zone_kobj_type);
 -      ret = kobject_add(&zone->kobj, &glob->kobj, zone->name);
 +      ret = kobject_init_and_add(
 +              &zone->kobj, &ttm_mem_zone_kobj_type, &glob->kobj, zone->name);
        if (unlikely(ret != 0)) {
                kobject_put(&zone->kobj);
                return ret;
@@@ -296,8 -296,8 +296,8 @@@ static int ttm_mem_init_highmem_zone(st
        zone->used_mem = 0;
        zone->glob = glob;
        glob->zone_highmem = zone;
 -      kobject_init(&zone->kobj, &ttm_mem_zone_kobj_type);
 -      ret = kobject_add(&zone->kobj, &glob->kobj, zone->name);
 +      ret = kobject_init_and_add(
 +              &zone->kobj, &ttm_mem_zone_kobj_type, &glob->kobj, zone->name);
        if (unlikely(ret != 0)) {
                kobject_put(&zone->kobj);
                return ret;
@@@ -343,8 -343,8 +343,8 @@@ static int ttm_mem_init_dma32_zone(stru
        zone->used_mem = 0;
        zone->glob = glob;
        glob->zone_dma32 = zone;
 -      kobject_init(&zone->kobj, &ttm_mem_zone_kobj_type);
 -      ret = kobject_add(&zone->kobj, &glob->kobj, zone->name);
 +      ret = kobject_init_and_add(
 +              &zone->kobj, &ttm_mem_zone_kobj_type, &glob->kobj, zone->name);
        if (unlikely(ret != 0)) {
                kobject_put(&zone->kobj);
                return ret;
@@@ -365,8 -365,10 +365,8 @@@ int ttm_mem_global_init(struct ttm_mem_
        glob->swap_queue = create_singlethread_workqueue("ttm_swap");
        INIT_WORK(&glob->work, ttm_shrink_work);
        init_waitqueue_head(&glob->queue);
 -      kobject_init(&glob->kobj, &ttm_mem_glob_kobj_type);
 -      ret = kobject_add(&glob->kobj,
 -                        ttm_get_kobj(),
 -                        "memory_accounting");
 +      ret = kobject_init_and_add(
 +              &glob->kobj, &ttm_mem_glob_kobj_type, ttm_get_kobj(), "memory_accounting");
        if (unlikely(ret != 0)) {
                kobject_put(&glob->kobj);
                return ret;