drm/amd/display: Ignore phantom DTBCLK requirement
authorAlvin Lee <alvin.lee2@amd.com>
Wed, 22 May 2024 15:10:58 +0000 (11:10 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 14 Jun 2024 20:17:14 +0000 (16:17 -0400)
[Description]
Phantom DTBCLK can be calculated different from main because phantom
has no DSC and thus will have a different output BPP. Ignore phantom
DTBCLK requirement and only consider non-phantom DTBCLK requirements.

Reviewed-by: Dillon Varone <dillon.varone@amd.com>
Acked-by: Zaeem Mohamed <zaeem.mohamed@amd.com>
Signed-off-by: Alvin Lee <alvin.lee2@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_core/dml2_core_dcn4_calcs.c

index 85eee5ab54433d1e182f7af15850fdc11471a0be..2b240a30d2ecec7e67d2652c744581ec4b6ed275 100644 (file)
@@ -7713,7 +7713,8 @@ static bool dml_core_mode_support(struct dml2_core_calcs_mode_support_ex *in_out
 
        mode_lib->ms.support.DTBCLKRequiredMoreThanSupported = false;
        for (k = 0; k < mode_lib->ms.num_active_planes; ++k) {
-               if (display_cfg->stream_descriptors[display_cfg->plane_descriptors[k].stream_index].output.output_encoder == dml2_hdmifrl) {
+               if (display_cfg->stream_descriptors[display_cfg->plane_descriptors[k].stream_index].output.output_encoder == dml2_hdmifrl &&
+                               !dml_is_phantom_pipe(&display_cfg->plane_descriptors[k])) {
                        mode_lib->ms.RequiredDTBCLK[k] = RequiredDTBCLK(
                                mode_lib->ms.RequiresDSC[k],
                                s->PixelClockBackEnd[k],
@@ -7728,6 +7729,13 @@ static bool dml_core_mode_support(struct dml2_core_calcs_mode_support_ex *in_out
                        if (mode_lib->ms.RequiredDTBCLK[k] > ((double)min_clk_table->max_clocks_khz.dtbclk / 1000)) {
                                mode_lib->ms.support.DTBCLKRequiredMoreThanSupported = true;
                        }
+               } else {
+                       /* Phantom DTBCLK can be calculated different from main because phantom has no DSC and thus
+                        * will have a different output BPP. Ignore phantom DTBCLK requirement and only consider
+                        * non-phantom DTBCLK requirements. In map_mode_to_soc_dpm we choose the highest DTBCLK
+                        * required - by setting phantom dtbclk to 0 we ignore it.
+                        */
+                       mode_lib->ms.RequiredDTBCLK[k] = 0;
                }
        }