drm/amd/display: Add a debug option HBR2CP2520 over TPS4
authorLeo Chen <sancchen@amd.com>
Fri, 21 Oct 2022 22:24:02 +0000 (18:24 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 1 Nov 2022 15:47:39 +0000 (11:47 -0400)
[Why & How] There are cases when we may need to override the hardcoded
TPS4 test pattern. Added parameters and config option to be able to
allow this.

Reviewed-by: Charlene Liu <Charlene.Liu@amd.com>
Acked-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Leo Chen <sancchen@amd.com>
Tested-by: Mark Broadworth <mark.broadworth@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/dc.h
drivers/gpu/drm/amd/display/dc/dcn31/dcn31_resource.c
drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c
drivers/gpu/drm/amd/display/dc/dcn315/dcn315_resource.c
drivers/gpu/drm/amd/display/dc/dcn316/dcn316_resource.c
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c

index 2a64064..6be110b 100644 (file)
@@ -393,6 +393,7 @@ struct dc_config {
        bool disable_dmcu;
        bool enable_4to1MPC;
        bool enable_windowed_mpo_odm;
+       bool forceHBR2CP2520; // Used for switching between test patterns TPS4 and CP2520
        uint32_t allow_edp_hotplug_detection;
        bool clamp_min_dcfclk;
        uint64_t vblank_alignment_dto_params;
index 8729d63..8f5e89c 100644 (file)
@@ -1902,6 +1902,8 @@ static bool dcn31_resource_construct(
        dc->caps.max_slave_rgb_planes = 2;
        dc->caps.post_blend_color_processing = true;
        dc->caps.force_dp_tps4_for_cp2520 = true;
+       if (dc->config.forceHBR2CP2520)
+               dc->caps.force_dp_tps4_for_cp2520 = false;
        dc->caps.dp_hpo = true;
        dc->caps.dp_hdmi21_pcon_support = true;
        dc->caps.edp_dsc_support = true;
index 85e2d87..3b3e093 100644 (file)
@@ -1770,6 +1770,8 @@ static bool dcn314_resource_construct(
        dc->caps.max_slave_rgb_planes = 2;
        dc->caps.post_blend_color_processing = true;
        dc->caps.force_dp_tps4_for_cp2520 = true;
+       if (dc->config.forceHBR2CP2520)
+               dc->caps.force_dp_tps4_for_cp2520 = false;
        dc->caps.dp_hpo = true;
        dc->caps.dp_hdmi21_pcon_support = true;
        dc->caps.edp_dsc_support = true;
index 31cbc57..96a3d41 100644 (file)
@@ -1783,6 +1783,8 @@ static bool dcn315_resource_construct(
        dc->caps.max_slave_rgb_planes = 2;
        dc->caps.post_blend_color_processing = true;
        dc->caps.force_dp_tps4_for_cp2520 = true;
+       if (dc->config.forceHBR2CP2520)
+               dc->caps.force_dp_tps4_for_cp2520 = false;
        dc->caps.dp_hpo = true;
        dc->caps.dp_hdmi21_pcon_support = true;
        dc->caps.edp_dsc_support = true;
index af3eddc..2f643cd 100644 (file)
@@ -1785,6 +1785,8 @@ static bool dcn316_resource_construct(
        dc->caps.max_slave_rgb_planes = 2;
        dc->caps.post_blend_color_processing = true;
        dc->caps.force_dp_tps4_for_cp2520 = true;
+       if (dc->config.forceHBR2CP2520)
+               dc->caps.force_dp_tps4_for_cp2520 = false;
        dc->caps.dp_hpo = true;
        dc->caps.dp_hdmi21_pcon_support = true;
        dc->caps.edp_dsc_support = true;
index 287b7fa..4ba9a86 100644 (file)
@@ -2126,6 +2126,8 @@ static bool dcn32_resource_construct(
        dc->caps.max_slave_rgb_planes = 2;
        dc->caps.post_blend_color_processing = true;
        dc->caps.force_dp_tps4_for_cp2520 = true;
+       if (dc->config.forceHBR2CP2520)
+               dc->caps.force_dp_tps4_for_cp2520 = false;
        dc->caps.dp_hpo = true;
        dc->caps.dp_hdmi21_pcon_support = true;
        dc->caps.edp_dsc_support = true;