diff --git a/drm/nouveau/nvkm/subdev/fb/ramgf100.c b/drm/nouveau/nvkm/subdev/fb/ramgf100.c index 093223d..1858dac 100644 --- a/drm/nouveau/nvkm/subdev/fb/ramgf100.c +++ b/drm/nouveau/nvkm/subdev/fb/ramgf100.c @@ -569,6 +569,7 @@ gf100_ram_ctor(const struct nvkm_ram_func *func, struct nvkm_fb *fb, enum nvkm_ram_type type = nvkm_fb_bios_memtype(bios); bool uniform = true; int ret, i; + u64 lower; nvkm_debug(subdev, "100800: %08x\n", nvkm_rd32(device, 0x100800)); nvkm_debug(subdev, "parts %08x mask %08x\n", parts, pmask); @@ -595,6 +596,12 @@ gf100_ram_ctor(const struct nvkm_ram_func *func, struct nvkm_fb *fb, nvkm_mm_fini(&ram->vram); + lower = nvkm_rd32(device, 0x100ce0); + printk(KERN_ERR "%08x\n", (u32)lower); + lower = ((lower & 0x000003f0) >> 4) << (lower & 0x0000000f); + if (lower != size) + uniform = false; + /* if all controllers have the same amount attached, there's no holes */ if (uniform) { ret = nvkm_mm_init(&ram->vram, rsvd_head >> NVKM_RAM_MM_SHIFT, @@ -605,15 +612,15 @@ gf100_ram_ctor(const struct nvkm_ram_func *func, struct nvkm_fb *fb, } else { /* otherwise, address lowest common amount from 0GiB */ ret = nvkm_mm_init(&ram->vram, rsvd_head >> NVKM_RAM_MM_SHIFT, - ((bsize * parts) - rsvd_head) >> + (lower - rsvd_head) >> NVKM_RAM_MM_SHIFT, 1); if (ret) return ret; /* and the rest starting from (8GiB + common_size) */ - ret = nvkm_mm_init(&ram->vram, (0x0200000000ULL + bsize) >> + ret = nvkm_mm_init(&ram->vram, (0x1000000000ULL + bsize) >> NVKM_RAM_MM_SHIFT, - (size - (bsize * parts) - rsvd_tail) >> + (size - lower - rsvd_tail) >> NVKM_RAM_MM_SHIFT, 1); if (ret) return ret;