drm/nouveau/fb/gf100-: bump size of mmu debug buffers to match big page size
authorBen Skeggs <bskeggs@redhat.com>
Tue, 8 May 2018 10:39:46 +0000 (20:39 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Fri, 18 May 2018 05:01:20 +0000 (15:01 +1000)
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nvkm/subdev/fb/gf100.c
drivers/gpu/drm/nouveau/nvkm/subdev/fb/gp100.c

index cdc4e0a2cc6bf134863f82ed010c64cfe21b2a50..e8dc4e913494a5e8791b171fce4bbe54deec08af 100644 (file)
@@ -46,10 +46,10 @@ gf100_fb_oneinit(struct nvkm_fb *base)
 {
        struct gf100_fb *fb = gf100_fb(base);
        struct nvkm_device *device = fb->base.subdev.device;
-       int ret, size = 0x1000;
+       int ret, size = 1 << (fb->base.page ? fb->base.page : 17);
 
        size = nvkm_longopt(device->cfgopt, "MmuDebugBufferSize", size);
-       size = min(size, 0x1000);
+       size = max(size, 0x1000);
 
        ret = nvkm_memory_new(device, NVKM_MEM_TARGET_INST, size, 0x1000,
                              true, &fb->base.mmu_rd);
index 147f69b30cd828ddc6d540f7d774fbe1383780e2..d0a47b9a8cd85ddd708a991498af186376f5a4b6 100644 (file)
@@ -48,7 +48,7 @@ gp100_fb_init(struct nvkm_fb *base)
        nvkm_wr32(device, 0x100cc8, nvkm_memory_addr(fb->base.mmu_wr) >> 8);
        nvkm_wr32(device, 0x100ccc, nvkm_memory_addr(fb->base.mmu_rd) >> 8);
        nvkm_mask(device, 0x100cc4, 0x00060000,
-                 max(nvkm_memory_size(fb->base.mmu_rd) >> 16, (u64)2) << 17);
+                 min(nvkm_memory_size(fb->base.mmu_rd) >> 16, (u64)2) << 17);
 }
 
 static const struct nvkm_fb_func