[Intel-gfx] [PATCH 04/15] drm/i915: Set scaler mode for NV12

Ville Syrjälä ville.syrjala at linux.intel.com
Fri Sep 4 01:53:36 PDT 2015


On Wed, Aug 19, 2015 at 06:02:25PM -0700, Chandra Konduru wrote:
> This patch sets appropriate scaler mode for NV12 format.
> In this mode, skylake scaler does either chroma-upsampling or
> chroma-upsampling and resolution scaling.
> 
> Signed-off-by: Chandra Konduru <chandra.konduru at intel.com>
> ---
>  drivers/gpu/drm/i915/intel_atomic.c |    5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_atomic.c b/drivers/gpu/drm/i915/intel_atomic.c
> index 9336e80..fd3972c 100644
> --- a/drivers/gpu/drm/i915/intel_atomic.c
> +++ b/drivers/gpu/drm/i915/intel_atomic.c
> @@ -247,7 +247,10 @@ int intel_atomic_setup_scalers(struct drm_device *dev,
>  		}
>  
>  		/* set scaler mode */
> -		if (num_scalers_need == 1 && intel_crtc->pipe != PIPE_C) {
> +		if (plane_state && plane_state->base.fb &&
> +			plane_state->base.fb->pixel_format == DRM_FORMAT_NV12) {
> +			scaler_state->scalers[*scaler_id].mode = PS_SCALER_MODE_NV12;
> +		} else if (num_scalers_need == 1 && intel_crtc->pipe != PIPE_C) {
>  			/*
>  			 * when only 1 scaler is in use on either pipe A or B,
>  			 * scaler 0 operates in high quality (HQ) mode.

I was almost going to say that we don't have code like this, but then I
found it hiding in intel_atomic.c for whatever reason.

Anyway, the patch looks good so
Reviewed-by: Ville Syrjälä <ville.syrjala at linux.intel.com>

On a further note, this function could use some cleaning to move
various variables into narrower scope. Now it's rather hard to see what
is valid per iteration and what is valid across the entire loop.

> -- 
> 1.7.9.5
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Ville Syrjälä
Intel OTC


More information about the Intel-gfx mailing list