Pin the default framebuffer. The Linux drm code no longer does this since
authorkettenis <kettenis@openbsd.org>
Thu, 9 Feb 2023 17:18:21 +0000 (17:18 +0000)
committerkettenis <kettenis@openbsd.org>
Thu, 9 Feb 2023 17:18:21 +0000 (17:18 +0000)
they switched to using a shadow framebuffer and only pin the hardware
framebuffer when flushing the shadow framebuffer.  But our wdisplay(4)
and rasops(9) code expects the hardware framebuffer to be always
accessible at the same address.

Fixes the regression introduced by amdgpu_object.c rev 1.12.

ok jsg@

sys/dev/pci/drm/amd/amdgpu/amdgpu_drv.c

index f43dbed..b024bf7 100644 (file)
@@ -3532,6 +3532,7 @@ amdgpu_attachhook(struct device *self)
                fb = fb_helper->fb;
                obj = fb->obj[0];
                rbo = gem_to_amdgpu_bo(obj);
+               amdgpu_bo_pin(rbo, AMDGPU_GEM_DOMAIN_VRAM);
                amdgpu_bo_kmap(rbo, (void **)(&ri->ri_bits));
 
                ri->ri_depth = fb->format->cpp[0] * 8;