summaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2023-02-15 12:38:33 +0100
committerAlex Deucher <alexander.deucher@amd.com>2023-02-23 17:35:59 -0500
commitd24b77e444bef83155557ebf4c2b3c551f198926 (patch)
treec678e46c0f934ffe37a1a4ddd6f54a0a3dbfa431 /drivers/gpu
parent424b3d7582a2a4a7c45d405225ac70cff97f2e4a (diff)
downloadlinux-stable-d24b77e444bef83155557ebf4c2b3c551f198926.tar.gz
linux-stable-d24b77e444bef83155557ebf4c2b3c551f198926.tar.bz2
linux-stable-d24b77e444bef83155557ebf4c2b3c551f198926.zip
drm/amd/display: Pass proper parent for DM backlight device registration
The parent for the backlight device should be the drm-connector object, not the PCI device. Userspace relies on this to be able to detect which backlight class device to use on hybrid gfx devices where there may be multiple native (raw) backlight devices registered. Specifically gnome-settings-daemon expects the parent device to have an "enabled" sysfs attribute (as drm_connector devices do) and tests that this returns "enabled" when read. This aligns the parent of the backlight device with i915, nouveau, radeon. Note that drivers/gpu/drm/amd/amdgpu/atombios_encoders.c also already uses the drm_connector as parent, only amdgpu_dm.c used the PCI device as parent before this change. Note this is marked as a RFC because I don't have hw to test, so this has only been compile tested! If someone can test this on actual hw which hits the changed code path that would be great. Link: https://gitlab.gnome.org/GNOME/gnome-settings-daemon/-/issues/730 Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index c420bce47acb..49ae4ef6bbf0 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -4142,7 +4142,8 @@ static const struct backlight_ops amdgpu_dm_backlight_ops = {
};
static void
-amdgpu_dm_register_backlight_device(struct amdgpu_display_manager *dm)
+amdgpu_dm_register_backlight_device(struct amdgpu_display_manager *dm,
+ struct amdgpu_dm_connector *aconnector)
{
char bl_name[16];
struct backlight_properties props = { 0 };
@@ -4165,7 +4166,7 @@ amdgpu_dm_register_backlight_device(struct amdgpu_display_manager *dm)
adev_to_drm(dm->adev)->primary->index + dm->num_of_edps);
dm->backlight_dev[dm->num_of_edps] = backlight_device_register(bl_name,
- adev_to_drm(dm->adev)->dev,
+ aconnector->base.kdev,
dm,
&amdgpu_dm_backlight_ops,
&props);
@@ -4218,6 +4219,7 @@ static int initialize_plane(struct amdgpu_display_manager *dm,
static void register_backlight_device(struct amdgpu_display_manager *dm,
+ struct amdgpu_dm_connector *aconnector,
struct dc_link *link)
{
if ((link->connector_signal & (SIGNAL_TYPE_EDP | SIGNAL_TYPE_LVDS)) &&
@@ -4228,7 +4230,7 @@ static void register_backlight_device(struct amdgpu_display_manager *dm,
* is better then a black screen.
*/
if (!dm->backlight_dev[dm->num_of_edps])
- amdgpu_dm_register_backlight_device(dm);
+ amdgpu_dm_register_backlight_device(dm, aconnector);
if (dm->backlight_dev[dm->num_of_edps]) {
dm->backlight_link[dm->num_of_edps] = link;
@@ -4415,7 +4417,7 @@ static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev)
if (ret) {
amdgpu_dm_update_connector_after_detect(aconnector);
- register_backlight_device(dm, link);
+ register_backlight_device(dm, aconnector, link);
if (dm->num_of_edps)
update_connector_ext_caps(aconnector);