From: Wenjing Liu Date: Wed, 17 Apr 2024 19:23:08 +0000 (-0400) Subject: drm/amd/display: use even ODM slice width for two pixels per container X-Git-Tag: v6.11-rc1~141^2~18^2~120 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0caba87a406e47d1b2d642587fa75981687cd29e;p=thirdparty%2Fkernel%2Flinux.git drm/amd/display: use even ODM slice width for two pixels per container [why] When optc uses two pixel per container, each ODM slice width must be an even number. [how] If ODM slice width is odd number increase it by 1. Reviewed-by: Rodrigo Siqueira Signed-off-by: Wenjing Liu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/display/dc/spl/dc_spl.c b/drivers/gpu/drm/amd/display/dc/spl/dc_spl.c index 2836f28fa3af0..9c6171e90163c 100644 --- a/drivers/gpu/drm/amd/display/dc/spl/dc_spl.c +++ b/drivers/gpu/drm/amd/display/dc/spl/dc_spl.c @@ -173,6 +173,9 @@ static struct spl_rect calculate_odm_slice_in_timing_active(struct spl_in *spl_i int odm_slice_width = h_active / odm_slice_count; struct spl_rect odm_rec; + if (spl_in->basic_out.use_two_pixels_per_container && (odm_slice_width % 2)) + odm_slice_width++; + odm_rec.x = odm_slice_width * odm_slice_idx; odm_rec.width = is_last_odm_slice ? /* last slice width is the reminder of h_active */ diff --git a/drivers/gpu/drm/amd/display/dc/spl/dc_spl_types.h b/drivers/gpu/drm/amd/display/dc/spl/dc_spl_types.h index a8f7fccfa16b3..49c866a558f6c 100644 --- a/drivers/gpu/drm/amd/display/dc/spl/dc_spl_types.h +++ b/drivers/gpu/drm/amd/display/dc/spl/dc_spl_types.h @@ -441,6 +441,7 @@ struct basic_out { bool always_scale; // Is always scale enabled? Required for getting SCL_MODE int max_downscale_src_width; // Required to get optimal no of taps bool alpha_en; + bool use_two_pixels_per_container; }; enum explicit_sharpness { SHARPNESS_LOW = 0,