[Intel-gfx] [PATCH 03/12] drm/i915: Stage scaler request for NV12 as src format

Ville Syrjälä ville.syrjala at linux.intel.com
Thu May 21 04:27:16 PDT 2015


On Sun, May 17, 2015 at 10:10:56PM -0700, Chandra Konduru wrote:
> This patch stages a scaler request when input format
> is NV12. The same scaler does both chroma-upsampling
> and resolution scaling as needed.
> 
> Signed-off-by: Chandra Konduru <chandra.konduru at intel.com>
> ---
>  drivers/gpu/drm/i915/intel_display.c |    9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 0a2e883..1ad7d13 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -4499,9 +4499,11 @@ skl_update_scaler_users(
>  		rotation = DRM_ROTATE_0;
>  	}
>  
> -	need_scaling = intel_rotation_90_or_270(rotation) ?
> -		(src_h != dst_w || src_w != dst_h):
> -		(src_w != dst_w || src_h != dst_h);
> +	/* scaling is required when src dst sizes doesn't match or format is NV12 */
> +	need_scaling = (src_w != dst_w || src_h != dst_h ||
> +		(intel_rotation_90_or_270(rotation) &&
> +			(src_h != dst_w || src_w != dst_h)) ||

That doesn't look right. Maybe add a small helper function that has
these scaling checks so that we don't need to have them all in the same
if statement.

> +		(fb && fb->pixel_format == DRM_FORMAT_NV12));
>  
>  	/*
>  	 * if plane is being disabled or scaler is no more required or force detach
> @@ -4567,6 +4569,7 @@ skl_update_scaler_users(
>  		case DRM_FORMAT_YVYU:
>  		case DRM_FORMAT_UYVY:
>  		case DRM_FORMAT_VYUY:
> +		case DRM_FORMAT_NV12:
>  			break;
>  		default:
>  			DRM_DEBUG_KMS("PLANE:%d FB:%d unsupported scaling format 0x%x\n",
> -- 
> 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