From 4ea48d79f061e112338d3d29b741ace20f9660cf Mon Sep 17 00:00:00 2001 From: jsg Date: Tue, 26 Mar 2024 11:17:36 +0000 Subject: [PATCH] Temporarily change the connector to unregistered when adding the backlight property to avoid warnings. Matches how inteldrm_native_backlight() handles this. problem reported and fix tested by tb@ --- sys/dev/pci/drm/amd/amdgpu/amdgpu_drv.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sys/dev/pci/drm/amd/amdgpu/amdgpu_drv.c b/sys/dev/pci/drm/amd/amdgpu/amdgpu_drv.c index e66e50364de..3c0df8a235e 100644 --- a/sys/dev/pci/drm/amd/amdgpu/amdgpu_drv.c +++ b/sys/dev/pci/drm/amd/amdgpu/amdgpu_drv.c @@ -3457,15 +3457,24 @@ amdgpu_init_backlight(struct amdgpu_device *adev) drm_for_each_connector_iter(connector, &conn_iter) { aconnector = to_amdgpu_dm_connector(connector); + if (connector->registration_state != DRM_CONNECTOR_REGISTERED) + continue; + if (aconnector->bl_idx == -1) continue; + dev->registered = false; + connector->registration_state = DRM_CONNECTOR_UNREGISTERED; + connector->backlight_device = bd; connector->backlight_property = drm_property_create_range(dev, 0, "Backlight", 0, bd->props.max_brightness); drm_object_attach_property(&connector->base, connector->backlight_property, bd->props.brightness); + connector->registration_state = DRM_CONNECTOR_REGISTERED; + dev->registered = true; + break; } drm_connector_list_iter_end(&conn_iter); -- 2.20.1