]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/amd/display: Attach OLED property to eDP panels
authorMario Limonciello (AMD) <superm1@kernel.org>
Tue, 6 Jan 2026 17:00:17 +0000 (11:00 -0600)
committerMario Limonciello (AMD) <superm1@kernel.org>
Tue, 27 Jan 2026 18:57:29 +0000 (12:57 -0600)
amdgpu verifies that a given panel is an OLED panel from extended caps
and can provide accurate information to userspace.  Attach a property
to the DRM connector.

Reviewed-by: Leo Li <sunpeng.li@amd.com>
Link: https://patch.msgid.link/20260106170017.68158-3-superm1@kernel.org
Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

index 740711ac1037ce14eda589324a26f312f8560da6..7c51d8d7e73c0566eca5982bf80471e3ac6f4a47 100644 (file)
@@ -91,6 +91,7 @@
 #include <drm/drm_fourcc.h>
 #include <drm/drm_edid.h>
 #include <drm/drm_eld.h>
+#include <drm/drm_mode.h>
 #include <drm/drm_utils.h>
 #include <drm/drm_vblank.h>
 #include <drm/drm_audio_component.h>
@@ -3737,6 +3738,10 @@ static void update_connector_ext_caps(struct amdgpu_dm_connector *aconnector)
        caps->ext_caps = &aconnector->dc_link->dpcd_sink_ext_caps;
        caps->aux_support = false;
 
+       drm_object_property_set_value(&conn_base->base,
+                                     adev_to_drm(adev)->mode_config.panel_type_property,
+                                     caps->ext_caps->bits.oled ? DRM_MODE_PANEL_TYPE_OLED : DRM_MODE_PANEL_TYPE_UNKNOWN);
+
        if (caps->ext_caps->bits.oled == 1
            /*
             * ||
@@ -9017,6 +9022,8 @@ void amdgpu_dm_connector_init_helper(struct amdgpu_display_manager *dm,
        if (connector_type == DRM_MODE_CONNECTOR_eDP) {
                struct drm_privacy_screen *privacy_screen;
 
+               drm_connector_attach_panel_type_property(&aconnector->base);
+
                privacy_screen = drm_privacy_screen_get(adev_to_drm(adev)->dev, NULL);
                if (!IS_ERR(privacy_screen)) {
                        drm_connector_attach_privacy_screen_provider(&aconnector->base,