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

Konduru, Chandra chandra.konduru at intel.com
Thu Sep 10 12:00:24 PDT 2015


> > +static bool skl_need_scaling(int src_w, int src_h, int dst_w, int dst_h,
> > +	unsigned int rotation, uint32_t pixel_format)
> > +{
> > +	/* need a scaler when sizes doesn't match */
> > +	if (src_w != dst_w || src_h != dst_h)
> > +		return true;
> > +
> > +	/* in case of 90/270 rotation, check src width with dst height and so */
> > +	if (intel_rotation_90_or_270(rotation) &&
> > +			(src_h != dst_w || src_w != dst_h))
> > +		return true;
> > +
> > +	/* need a scaler for nv12 */
> > +	if (pixel_format == DRM_FORMAT_NV12)
> > +		return true;
> > +
> > +	return false;
> > +}
> 
> That still looks wrong to me. Let me repeat how I think it should look:
> 
> {
> 	if (format == NV12)
> 		return true;
> 
> 	if (90_or_270())
> 		return src_w != dst_h || src_h != dst_w;
> 	else
> 		return src_w != dst_w || src_h != dst_h;
> }
> 
> Otherwise looks good.
Sending updated patch shortly.


More information about the Intel-gfx mailing list