From: jsg Date: Tue, 26 Mar 2024 11:09:02 +0000 (+0000) Subject: test bl_idx instead of the connector type to check for backlight X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=a904d29fcc66f527ee7991676fa5795a6b9398e7;p=openbsd test bl_idx instead of the connector type to check for backlight tested by tb@ --- diff --git a/sys/dev/pci/drm/amd/amdgpu/amdgpu_drv.c b/sys/dev/pci/drm/amd/amdgpu/amdgpu_drv.c index d6dced83e8f..e66e50364de 100644 --- a/sys/dev/pci/drm/amd/amdgpu/amdgpu_drv.c +++ b/sys/dev/pci/drm/amd/amdgpu/amdgpu_drv.c @@ -3448,15 +3448,16 @@ amdgpu_init_backlight(struct amdgpu_device *adev) struct backlight_device *bd = adev->dm.backlight_dev[0]; struct drm_connector_list_iter conn_iter; struct drm_connector *connector; + struct amdgpu_dm_connector *aconnector; if (bd == NULL) return; drm_connector_list_iter_begin(dev, &conn_iter); drm_for_each_connector_iter(connector, &conn_iter) { - if (connector->connector_type != DRM_MODE_CONNECTOR_LVDS && - connector->connector_type != DRM_MODE_CONNECTOR_eDP && - connector->connector_type != DRM_MODE_CONNECTOR_DSI) + aconnector = to_amdgpu_dm_connector(connector); + + if (aconnector->bl_idx == -1) continue; connector->backlight_device = bd; @@ -3464,6 +3465,8 @@ amdgpu_init_backlight(struct amdgpu_device *adev) 0, "Backlight", 0, bd->props.max_brightness); drm_object_attach_property(&connector->base, connector->backlight_property, bd->props.brightness); + + break; } drm_connector_list_iter_end(&conn_iter); }