Commit 8bee5c5c authored by Ilya Bakoulin's avatar Ilya Bakoulin Committed by Alex Deucher

drm/amd/display: Cache the use_pitch_c conditional

For clarity, save the use_pitch_c logic to a bool
Signed-off-by: default avatarIlya Bakoulin <Ilya.Bakoulin@amd.com>
Reviewed-by: default avatarEric Bernstein <eric.bernstein@amd.com>
Acked-by: default avatarLeo Li <sunpeng.li@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 69866d13
...@@ -402,11 +402,14 @@ void hubp2_program_size( ...@@ -402,11 +402,14 @@ void hubp2_program_size(
{ {
struct dcn20_hubp *hubp2 = TO_DCN20_HUBP(hubp); struct dcn20_hubp *hubp2 = TO_DCN20_HUBP(hubp);
uint32_t pitch, meta_pitch, pitch_c, meta_pitch_c; uint32_t pitch, meta_pitch, pitch_c, meta_pitch_c;
bool use_pitch_c = false;
/* Program data and meta surface pitch (calculation from addrlib) /* Program data and meta surface pitch (calculation from addrlib)
* 444 or 420 luma * 444 or 420 luma
*/ */
if (format >= SURFACE_PIXEL_FORMAT_VIDEO_BEGIN && format < SURFACE_PIXEL_FORMAT_SUBSAMPLE_END) { use_pitch_c = format >= SURFACE_PIXEL_FORMAT_VIDEO_BEGIN
&& format < SURFACE_PIXEL_FORMAT_SUBSAMPLE_END;
if (use_pitch_c) {
ASSERT(plane_size->video.chroma_pitch != 0); ASSERT(plane_size->video.chroma_pitch != 0);
/* Chroma pitch zero can cause system hang! */ /* Chroma pitch zero can cause system hang! */
...@@ -429,7 +432,8 @@ void hubp2_program_size( ...@@ -429,7 +432,8 @@ void hubp2_program_size(
REG_UPDATE_2(DCSURF_SURFACE_PITCH, REG_UPDATE_2(DCSURF_SURFACE_PITCH,
PITCH, pitch, META_PITCH, meta_pitch); PITCH, pitch, META_PITCH, meta_pitch);
if (format >= SURFACE_PIXEL_FORMAT_VIDEO_BEGIN) use_pitch_c = format >= SURFACE_PIXEL_FORMAT_VIDEO_BEGIN;
if (use_pitch_c)
REG_UPDATE_2(DCSURF_SURFACE_PITCH_C, REG_UPDATE_2(DCSURF_SURFACE_PITCH_C,
PITCH_C, pitch_c, META_PITCH_C, meta_pitch_c); PITCH_C, pitch_c, META_PITCH_C, meta_pitch_c);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment