OSDN Git Service

drm/nouveau/bar: initialise bar2 during oneinit
authorBen Skeggs <bskeggs@redhat.com>
Tue, 31 Oct 2017 17:56:19 +0000 (03:56 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Thu, 2 Nov 2017 03:32:18 +0000 (13:32 +1000)
If we initialise BAR2 earlier, we're able to complete BAR1 setup using
the instmem fast-path.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nvkm/subdev/bar/gf100.c
drivers/gpu/drm/nouveau/nvkm/subdev/bar/nv50.c

index c6317a0..b155a7f 100644 (file)
@@ -146,6 +146,9 @@ gf100_bar_oneinit(struct nvkm_bar *base)
                ret = gf100_bar_oneinit_bar(bar, &bar->bar[0], &bar2_lock, 3);
                if (ret)
                        return ret;
+
+               bar->base.subdev.oneinit = true;
+               nvkm_bar_bar2_init(bar->base.subdev.device);
        }
 
        /* BAR1 */
index 4b912c9..cf1d0ac 100644 (file)
@@ -159,6 +159,9 @@ nv50_bar_oneinit(struct nvkm_bar *base)
        nvkm_wo32(bar->bar2, 0x14, 0x00000000);
        nvkm_done(bar->bar2);
 
+       bar->base.subdev.oneinit = true;
+       nvkm_bar_bar2_init(device);
+
        /* BAR1 */
        start = 0x0000000000ULL;
        limit = start + device->func->resource_size(device, 1);