Commit 6263f0fd authored by Nikola Cornij's avatar Nikola Cornij Committed by Alex Deucher
Browse files

drm/amd/display: Consolidate two-pixels-per-container check



[why]
The condition to check for two pixels per containter has become rather
long and is used in number of places.

[how]
Move the check to a helper function.

Signed-off-by: default avatarNikola Cornij <nikola.cornij@amd.com>
Reviewed-by: default avatarEric Bernstein <Eric.Bernstein@amd.com>
Acked-by: default avatarBhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 08e1c28d
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -335,9 +335,8 @@ void optc1_program_timing(
	/* Enable stereo - only when we need to pack 3D frame. Other types
	 * of stereo handled in explicit call
	 */
	h_div_2 = (dc_crtc_timing->pixel_encoding == PIXEL_ENCODING_YCBCR420) ?
			1 : 0;

	h_div_2 = optc1_is_two_pixels_per_containter(&patched_crtc_timing);
	REG_UPDATE(OTG_H_TIMING_CNTL,
			OTG_H_TIMING_DIV_BY2, h_div_2);

@@ -1422,3 +1421,9 @@ void dcn10_timing_generator_init(struct optc *optc1)
	optc1->min_h_sync_width = 8;
	optc1->min_v_sync_width = 1;
}

bool optc1_is_two_pixels_per_containter(const struct dc_crtc_timing *timing)
{
	return timing->pixel_encoding == PIXEL_ENCODING_YCBCR420;
}
+2 −0
Original line number Diff line number Diff line
@@ -565,4 +565,6 @@ bool optc1_configure_crc(struct timing_generator *optc,
bool optc1_get_crc(struct timing_generator *optc,
		    uint32_t *r_cr, uint32_t *g_y, uint32_t *b_cb);

bool optc1_is_two_pixels_per_containter(const struct dc_crtc_timing *timing);

#endif /* __DC_TIMING_GENERATOR_DCN10_H__ */