OSDN Git Service

drm/nouveau: memory type detection for the really old chipsets
authorBen Skeggs <bskeggs@redhat.com>
Sat, 10 Dec 2011 15:31:17 +0000 (01:31 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Tue, 13 Mar 2012 07:05:23 +0000 (17:05 +1000)
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nv04_fb.c
drivers/gpu/drm/nouveau/nv10_fb.c

index db16c47..d5eedd6 100644 (file)
@@ -29,6 +29,11 @@ nv04_fb_vram_init(struct drm_device *dev)
                }
        }
 
+       if ((boot0 & 0x00000038) <= 0x10)
+               dev_priv->vram_type = NV_MEM_TYPE_SGRAM;
+       else
+               dev_priv->vram_type = NV_MEM_TYPE_SDRAM;
+
        return 0;
 }
 
index 7b17dea..447d6f2 100644 (file)
@@ -35,6 +35,14 @@ nv10_fb_vram_init(struct drm_device *dev)
        u32 fifo_data = nv_rd32(dev, NV04_PFB_FIFO_DATA);
 
        dev_priv->vram_size = fifo_data & NV10_PFB_FIFO_DATA_RAM_AMOUNT_MB_MASK;
+       if (dev_priv->card_type < NV_20) {
+               u32 cfg0 = nv_rd32(dev, 0x100200);
+               if (cfg0 & 0x00000001)
+                       dev_priv->vram_type = NV_MEM_TYPE_DDR1;
+               else
+                       dev_priv->vram_type = NV_MEM_TYPE_SDRAM;
+       }
+
        return 0;
 }