]> git.hungrycats.org Git - linux/commitdiff
drm/amd/display: Add HDR workaround for specific eDP
authorAlex Hung <alex.hung@amd.com>
Fri, 6 Sep 2024 17:39:18 +0000 (11:39 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Oct 2024 10:01:08 +0000 (12:01 +0200)
commit 05af800704ee7187d9edd461ec90f3679b1c4aba upstream.

[WHY & HOW]
Some eDP panels suffer from flicking when HDR is enabled in KDE. This
quirk works around it by skipping VSC that is incompatible with eDP
panels.

Link: https://gitlab.freedesktop.org/drm/amd/-/issues/3151
Cc: Mario Limonciello <mario.limonciello@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Rodrigo Siqueira <rodrigo.siqueira@amd.com>
Signed-off-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 4d4257280d7957727998ef90ccc7b69c7cca8376)
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
drivers/gpu/drm/amd/display/dc/dc_types.h

index 9a578b1df141f233c45a14015b947fe8c4de48e6..5b60dc0db0abaeb44729e4eaf3541676c2da44ad 100644 (file)
@@ -6389,12 +6389,21 @@ create_stream_for_sink(struct drm_connector *connector,
        if (stream->signal == SIGNAL_TYPE_DISPLAY_PORT ||
            stream->signal == SIGNAL_TYPE_DISPLAY_PORT_MST ||
            stream->signal == SIGNAL_TYPE_EDP) {
+               const struct dc_edid_caps *edid_caps;
+               unsigned int disable_colorimetry = 0;
+
+               if (aconnector->dc_sink) {
+                       edid_caps = &aconnector->dc_sink->edid_caps;
+                       disable_colorimetry = edid_caps->panel_patch.disable_colorimetry;
+               }
+
                //
                // should decide stream support vsc sdp colorimetry capability
                // before building vsc info packet
                //
                stream->use_vsc_sdp_for_colorimetry = stream->link->dpcd_caps.dpcd_rev.raw >= 0x14 &&
-                                                     stream->link->dpcd_caps.dprx_feature.bits.VSC_SDP_COLORIMETRY_SUPPORTED;
+                                                     stream->link->dpcd_caps.dprx_feature.bits.VSC_SDP_COLORIMETRY_SUPPORTED &&
+                                                     !disable_colorimetry;
 
                if (stream->out_transfer_func.tf == TRANSFER_FUNCTION_GAMMA22)
                        tf = TRANSFER_FUNC_GAMMA_22;
index 2c36f3d00ca256f99186fe778eaf46a4e30739ee..3c074120456ed45159b6153e0cbbbe07c07dc6f1 100644 (file)
@@ -72,6 +72,10 @@ static void apply_edid_quirks(struct edid *edid, struct dc_edid_caps *edid_caps)
                DRM_DEBUG_DRIVER("Clearing DPCD 0x317 on monitor with panel id %X\n", panel_id);
                edid_caps->panel_patch.remove_sink_ext_caps = true;
                break;
+       case drm_edid_encode_panel_id('S', 'D', 'C', 0x4154):
+               DRM_DEBUG_DRIVER("Disabling VSC on monitor with panel id %X\n", panel_id);
+               edid_caps->panel_patch.disable_colorimetry = true;
+               break;
        default:
                return;
        }
index 0f66d00ef80f51331672b6b31d899161024d32ef..1d17d6497fec1c96e92db4b85c377141dedbc557 100644 (file)
@@ -178,6 +178,7 @@ struct dc_panel_patch {
        unsigned int skip_avmute;
        unsigned int mst_start_top_delay;
        unsigned int remove_sink_ext_caps;
+       unsigned int disable_colorimetry;
 };
 
 struct dc_edid_caps {