summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2011-12-11 01:31:17 +1000
committerBen Skeggs <bskeggs@redhat.com>2012-03-13 17:05:23 +1000
commitddfd2da48421e6b217e8b4fa7ec967e55555ce65 (patch)
treeda5dab9c231eff7f45abdb605a8bc043de4de414
parent7ad2d31cb692597f7918fce2f52a4c1949fbcf8d (diff)
downloadblackbird-op-linux-ddfd2da48421e6b217e8b4fa7ec967e55555ce65.tar.gz
blackbird-op-linux-ddfd2da48421e6b217e8b4fa7ec967e55555ce65.zip
drm/nouveau: memory type detection for the really old chipsets
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
-rw-r--r--drivers/gpu/drm/nouveau/nv04_fb.c5
-rw-r--r--drivers/gpu/drm/nouveau/nv10_fb.c8
2 files changed, 13 insertions, 0 deletions
diff --git a/drivers/gpu/drm/nouveau/nv04_fb.c b/drivers/gpu/drm/nouveau/nv04_fb.c
index db16c47fd922..d5eedd67afe5 100644
--- a/drivers/gpu/drm/nouveau/nv04_fb.c
+++ b/drivers/gpu/drm/nouveau/nv04_fb.c
@@ -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;
}
diff --git a/drivers/gpu/drm/nouveau/nv10_fb.c b/drivers/gpu/drm/nouveau/nv10_fb.c
index 7b17dea5f62b..447d6f236526 100644
--- a/drivers/gpu/drm/nouveau/nv10_fb.c
+++ b/drivers/gpu/drm/nouveau/nv10_fb.c
@@ -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;
}
OpenPOWER on IntegriCloud