From: kettenis Date: Thu, 9 Feb 2023 17:18:21 +0000 (+0000) Subject: Pin the default framebuffer. The Linux drm code no longer does this since X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=e028d9005c921fcba4e8dec9c1b878d2ab0ffbde;p=openbsd Pin the default framebuffer. The Linux drm code no longer does this since 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@ --- diff --git a/sys/dev/pci/drm/amd/amdgpu/amdgpu_drv.c b/sys/dev/pci/drm/amd/amdgpu/amdgpu_drv.c index f43dbed2c7c..b024bf7d12b 100644 --- a/sys/dev/pci/drm/amd/amdgpu/amdgpu_drv.c +++ b/sys/dev/pci/drm/amd/amdgpu/amdgpu_drv.c @@ -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;