From f81690b79ea2459f18c203b74a76cb848aebbe00 Mon Sep 17 00:00:00 2001 From: jsg Date: Mon, 25 Mar 2024 11:37:18 +0000 Subject: [PATCH] fix xbacklight on amdgpu Call amdgpu_init_backlight() after drm_dev_register() otherwise the connector isn't registered yet and dm->backlight_dev is not set. tb@ mentioned this broke with the 6.6 drm update and confirmed this fixes it. Debugged with help from dtucker@ on another machine. --- sys/dev/pci/drm/amd/amdgpu/amdgpu_drv.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/sys/dev/pci/drm/amd/amdgpu/amdgpu_drv.c b/sys/dev/pci/drm/amd/amdgpu/amdgpu_drv.c index 6f3e190c9a5..d6dced83e8f 100644 --- a/sys/dev/pci/drm/amd/amdgpu/amdgpu_drv.c +++ b/sys/dev/pci/drm/amd/amdgpu/amdgpu_drv.c @@ -3491,16 +3491,15 @@ amdgpu_attachhook(struct device *self) if (adev->mode_info.mode_config_initialized && !list_empty(&adev_to_drm(adev)->mode_config.connector_list)) { - /* OpenBSD specific backlight property on connector */ - amdgpu_init_backlight(adev); - /* * in linux via amdgpu_pci_probe -> drm_dev_register - * must be after (local) backlight property added not before - * and before drm_fbdev_generic_setup() + * must be before drm_fbdev_generic_setup() */ drm_dev_register(dev, adev->flags); + /* OpenBSD specific backlight property on connector */ + amdgpu_init_backlight(adev); + /* select 8 bpp console on low vram cards */ if (adev->gmc.real_vram_size <= (32*1024*1024)) drm_fbdev_generic_setup(adev_to_drm(adev), 8); -- 2.20.1