Skip to content

Commit faf51b2

Browse files
Fangzhi Zuoalexdeucher
authored andcommitted
drm/amd/display: Fix dcn35 8k30 Underflow/Corruption Issue
[why] odm calculation is missing for pipe split policy determination and cause Underflow/Corruption issue. [how] Add the odm calculation. Cc: Mario Limonciello <mario.limonciello@amd.com> Cc: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org Reviewed-by: Charlene Liu <charlene.liu@amd.com> Acked-by: Tom Chung <chiahsuan.chung@amd.com> Signed-off-by: Fangzhi Zuo <jerry.zuo@amd.com> Tested-by: Daniel Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent 191cb4e commit faf51b2

2 files changed

Lines changed: 13 additions & 18 deletions

File tree

drivers/gpu/drm/amd/display/dc/dml2/dml2_translation_helper.c

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -791,35 +791,28 @@ static void populate_dml_surface_cfg_from_plane_state(enum dml_project_id dml2_p
791791
}
792792
}
793793

794-
/*TODO no support for mpc combine, need rework - should calculate scaling params based on plane+stream*/
795-
static struct scaler_data get_scaler_data_for_plane(const struct dc_plane_state *in, const struct dc_state *context)
794+
static struct scaler_data get_scaler_data_for_plane(const struct dc_plane_state *in, struct dc_state *context)
796795
{
797796
int i;
798-
struct scaler_data data = { 0 };
797+
struct pipe_ctx *temp_pipe = &context->res_ctx.temp_pipe;
798+
799+
memset(temp_pipe, 0, sizeof(struct pipe_ctx));
799800

800801
for (i = 0; i < MAX_PIPES; i++) {
801802
const struct pipe_ctx *pipe = &context->res_ctx.pipe_ctx[i];
802803

803804
if (pipe->plane_state == in && !pipe->prev_odm_pipe) {
804-
const struct pipe_ctx *next_pipe = pipe->next_odm_pipe;
805-
806-
data = context->res_ctx.pipe_ctx[i].plane_res.scl_data;
807-
while (next_pipe) {
808-
data.h_active += next_pipe->plane_res.scl_data.h_active;
809-
data.recout.width += next_pipe->plane_res.scl_data.recout.width;
810-
if (in->rotation == ROTATION_ANGLE_0 || in->rotation == ROTATION_ANGLE_180) {
811-
data.viewport.width += next_pipe->plane_res.scl_data.viewport.width;
812-
} else {
813-
data.viewport.height += next_pipe->plane_res.scl_data.viewport.height;
814-
}
815-
next_pipe = next_pipe->next_odm_pipe;
816-
}
805+
temp_pipe->stream = pipe->stream;
806+
temp_pipe->plane_state = pipe->plane_state;
807+
temp_pipe->plane_res.scl_data.taps = pipe->plane_res.scl_data.taps;
808+
809+
resource_build_scaling_params(temp_pipe);
817810
break;
818811
}
819812
}
820813

821814
ASSERT(i < MAX_PIPES);
822-
return data;
815+
return temp_pipe->plane_res.scl_data;
823816
}
824817

825818
static void populate_dummy_dml_plane_cfg(struct dml_plane_cfg_st *out, unsigned int location, const struct dc_stream_state *in)
@@ -864,7 +857,7 @@ static void populate_dummy_dml_plane_cfg(struct dml_plane_cfg_st *out, unsigned
864857
out->ScalerEnabled[location] = false;
865858
}
866859

867-
static void populate_dml_plane_cfg_from_plane_state(struct dml_plane_cfg_st *out, unsigned int location, const struct dc_plane_state *in, const struct dc_state *context)
860+
static void populate_dml_plane_cfg_from_plane_state(struct dml_plane_cfg_st *out, unsigned int location, const struct dc_plane_state *in, struct dc_state *context)
868861
{
869862
const struct scaler_data scaler_data = get_scaler_data_for_plane(in, context);
870863

drivers/gpu/drm/amd/display/dc/inc/core_types.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,8 @@ struct resource_context {
469469
unsigned int hpo_dp_link_enc_to_link_idx[MAX_HPO_DP2_LINK_ENCODERS];
470470
int hpo_dp_link_enc_ref_cnts[MAX_HPO_DP2_LINK_ENCODERS];
471471
bool is_mpc_3dlut_acquired[MAX_PIPES];
472+
/* solely used for build scalar data in dml2 */
473+
struct pipe_ctx temp_pipe;
472474
};
473475

474476
struct dce_bw_output {

0 commit comments

Comments
 (0)