From: Ville Syrjälä <[email protected]> 4:2:0 output effectively involves an extra downscale factor of 2x2 due to the chroma downsampling. Adjust the stored scaler scale factors accodingly.
Reviewed-by: Luca Coelho <[email protected]> Signed-off-by: Ville Syrjälä <[email protected]> --- drivers/gpu/drm/i915/display/skl_scaler.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/gpu/drm/i915/display/skl_scaler.c b/drivers/gpu/drm/i915/display/skl_scaler.c index 640c65818f8a..e8a8facdc300 100644 --- a/drivers/gpu/drm/i915/display/skl_scaler.c +++ b/drivers/gpu/drm/i915/display/skl_scaler.c @@ -499,6 +499,15 @@ static int intel_atomic_setup_scaler(struct intel_crtc_state *crtc_state, return -EINVAL; } + + /* + * For the purposes of prefill 4:2:0 chroma + * subsampling is considered a 2x2 downscale. + */ + if (crtc_state->output_format == INTEL_OUTPUT_FORMAT_YCBCR420) { + hscale <<= 1; + vscale <<= 1; + } } scaler_state->scalers[*scaler_id].hscale = hscale; -- 2.49.1
