linux/drivers/gpu/drm/amd/display/amdgpu_dm
Hans de Goede 62f03dad76 drm/amd/display/amdgpu_dm: Pass proper parent for backlight device registration v3
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.

Changes in v3:
Make amdgpu_dm_register_backlight_device() check bl_idx != 1 before
registering the backlight since amdgpu_dm_connector_late_register()
now calls it for _all_ connectors.

Changes in v2:
Together with changing the parent, also move the registration to
drm_connector_funcs.late_register() this is necessary because the parent
device (which now is the drm_connector) must be registered before
the backlight class device is, otherwise the backlight class device ends
up without any parent set at all.

This brings the backlight class device registration timing inline with
nouveau and i915 which also use drm_connector_funcs.late_register()
for this.

Note this slightly changes backlight_device_register() error handling,
instead of not increasing dm->num_of_edps and re-using the current
bl_idx for a potential other backlight device, dm->backlight_dev[bl_idx]
is now simply left NULL on failure. This is ok because all code
looking at dm->backlight_dev[i] also checks it is not NULL.

Link: https://gitlab.gnome.org/GNOME/gnome-settings-daemon/-/issues/730
Reviewed-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2023-03-31 11:06:42 -04:00
..
amdgpu_dm_color.c Documentation/amdgpu_dm: Add DM color correction documentation 2022-08-16 18:14:32 -04:00
amdgpu_dm_crc.c drm/amdgpu/display/mst: adjust the naming of mst_port and port of aconnector 2023-01-24 13:26:12 -05:00
amdgpu_dm_crc.h drm/amd/display: Fix when disabling secure_display 2022-12-15 12:18:18 -05:00
amdgpu_dm_crtc.c drm/amd/display: add prefix to amdgpu_dm_crtc.h functions 2023-03-08 14:05:53 -05:00
amdgpu_dm_crtc.h drm/amd/display: add prefix to amdgpu_dm_crtc.h functions 2023-03-08 14:05:53 -05:00
amdgpu_dm_debugfs.c drm/amd/display: convert link.h functions to function pointer style 2023-03-14 15:35:03 -04:00
amdgpu_dm_debugfs.h drm/amd/display: Move connector debugfs to drm 2022-05-23 11:27:44 +03:00
amdgpu_dm_hdcp.c drm/amd/display: Fix HDCP failing to enable after suspend 2023-03-13 17:27:48 -04:00
amdgpu_dm_hdcp.h drm/amd/display: phase2 enable mst hdcp multiple displays 2023-01-17 15:41:19 -05:00
amdgpu_dm_helpers.c drm/amd/display/amdgpu_dm/amdgpu_dm_helpers: Move defines out to where they are actually used 2023-03-22 00:48:00 -04:00
amdgpu_dm_irq_params.h drm/amd/display: Implement secure display on DCN21 2022-10-27 14:42:32 -04:00
amdgpu_dm_irq.c drm/amd/display: do not disable an invalid irq source in hdp finish 2022-05-10 17:53:12 -04:00
amdgpu_dm_irq.h drm/amd/display: Support for DMUB AUX 2021-05-10 18:06:44 -04:00
amdgpu_dm_mst_types.c drm/amd/display: make is_synaptics_cascaded_panamera static 2023-03-22 00:47:59 -04:00
amdgpu_dm_mst_types.h drm/amd/display: Take FEC Overhead into Timeslot Calculation 2023-03-14 15:35:39 -04:00
amdgpu_dm_plane.c drm/amd/display: add prefix to amdgpu_dm_plane.h functions 2023-03-08 14:04:45 -05:00
amdgpu_dm_plane.h drm/amd/display: add prefix to amdgpu_dm_plane.h functions 2023-03-08 14:04:45 -05:00
amdgpu_dm_pp_smu.c drm/amd/pm: create a new holder for those APIs used only by legacy ASICs(si/kv) 2022-01-14 17:51:14 -05:00
amdgpu_dm_psr.c drm/amd/display: Pass DSC slice height to PSR FW 2023-01-24 13:26:25 -05:00
amdgpu_dm_psr.h drm/amd/display: Delay PSR entry 2021-06-21 17:45:14 -04:00
amdgpu_dm_services.c drm/amd/display: Decouple amdgpu_dm_trace from service 2020-10-26 13:33:59 -04:00
amdgpu_dm_trace.h drm/amd/display: Add events log to trace OPTC lock and unlock 2022-10-24 14:36:06 -04:00
amdgpu_dm.c drm/amd/display/amdgpu_dm: Pass proper parent for backlight device registration v3 2023-03-31 11:06:42 -04:00
amdgpu_dm.h drm/amd/display/amdgpu_dm: Add a bl_idx to amdgpu_dm_connector 2023-03-31 11:06:41 -04:00
dc_fpu.c drm/amd/display: add DCN support for ARM64 2022-11-04 16:05:54 -04:00
dc_fpu.h drm/amd/display: Add DC_FP helper to check FPU state 2021-08-05 21:17:59 -04:00
Makefile drm/amd/display: Rename DCN config to FP 2023-03-07 14:22:40 -05:00