From: Ben Skeggs Date: Wed, 2 Jun 2010 00:12:00 +0000 (+1000) Subject: drm/nv50: fix memory detection for cards with >=4GiB VRAM X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=7a2e4e03b77b929b10f3007395128a9870090653;p=openwrt%2Fstaging%2Fblogic.git drm/nv50: fix memory detection for cards with >=4GiB VRAM Signed-off-by: Ben Skeggs --- diff --git a/drivers/gpu/drm/nouveau/nouveau_mem.c b/drivers/gpu/drm/nouveau/nouveau_mem.c index 206bd1670827..2853ba0137af 100644 --- a/drivers/gpu/drm/nouveau/nouveau_mem.c +++ b/drivers/gpu/drm/nouveau/nouveau_mem.c @@ -364,9 +364,14 @@ nouveau_mem_detect(struct drm_device *dev) } else if (dev_priv->flags & (NV_NFORCE | NV_NFORCE2)) { dev_priv->vram_size = nouveau_mem_detect_nforce(dev); - } else { + } else + if (dev_priv->card_type < NV_50) { dev_priv->vram_size = nv_rd32(dev, NV04_FIFO_DATA); dev_priv->vram_size &= NV10_FIFO_DATA_RAM_AMOUNT_MB_MASK; + } else { + dev_priv->vram_size = nv_rd32(dev, NV04_FIFO_DATA); + dev_priv->vram_size |= (dev_priv->vram_size & 0xff) << 32; + dev_priv->vram_size &= 0xffffffff00; if (dev_priv->chipset == 0xaa || dev_priv->chipset == 0xac) { dev_priv->vram_sys_base = nv_rd32(dev, 0x100e10); dev_priv->vram_sys_base <<= 12;