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 2a640644003267bc2510994176f949e1d41504dc..6be110b00b24264ff9f5c5dcfc691bad6e19826e 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 8729d6305996abe5f802b0e055f1294038a7a8b2..8f5e89cb9d3ec6e609bf66d0333da03c2bc21f23 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 85e2d87a8e44bcd69072520682574238f3f4d236..3b3e093e94477e3b7d9a224361ec514bd440d66f 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 31cbc5762eab3c082b52be7163ba26a1cfb39bc4..96a3d41febffecce6333088eb41c07f8948db29f 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 af3eddc0cf32ebdb4838198588cca17332ab942f..2f643cdaf59fe17debf9c8fdc1948921b55ff6d4 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 287b7fa9bf419635c8ccb2fece5a7d2f83c29914..4ba9a86621854ce2c65b06a9c9e953bc5fca16b5 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;