[Intel-gfx] [PATCH 11/15] drm/i915: Add NV12 to primary plane programming.

Konduru, Chandra chandra.konduru at intel.com
Fri Sep 4 18:10:11 PDT 2015


> > +
> > +		if (fb->pixel_format == DRM_FORMAT_NV12) {
> > +			int height_in_mem = (fb->offsets[1]/fb->pitches[0]);
> > +			/*
> > +			 * If UV starts from middle of a page, then UV start
> should
> > +			 * be programmed to beginning of that page. And offset
> into that
> > +			 * page to be programmed into y-offset
> > +			 */
> > +			tile_row_adjustment = height_in_mem % tile_height;
> > +			aux_dist = fb->pitches[0] * (height_in_mem -
> tile_row_adjustment);
> > +			aux_x_offset = DIV_ROUND_UP(x, 2);
> > +			aux_y_offset = DIV_ROUND_UP(y, 2) +
> tile_row_adjustment;
> > +			/* For tile-Yf, uv-subplane tile width is 2x of Y-subplane
> */
> > +			aux_stride = fb->modifier[0] ==
> I915_FORMAT_MOD_Yf_TILED ?
> > +				stride / 2 : stride;
> 
> The 2x part was rather well hidden in the spec. How do we deal with
> cases when the Y stride is an odd number of tiles?

It should be a round up division to take care of that scenario. 
Fixing this and resolving your other comments. 
Will be sending updated patches shortly.


More information about the Intel-gfx mailing list