Re: [PATCH 8/9] drm/imx: ipuv3-plane: add support for YUV 4:2:2 and 4:4:4, NV12, and NV16 formats

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am Mittwoch, den 19.10.2016, 15:49 +0800 schrieb Ying Liu:
[...]
> > @@ -406,10 +425,16 @@ static void ipu_plane_atomic_update(struct drm_plane *plane,
> >         switch (fb->pixel_format) {
> >         case DRM_FORMAT_YUV420:
> >         case DRM_FORMAT_YVU420:
> > +       case DRM_FORMAT_YUV422:
> > +       case DRM_FORMAT_YVU422:
> > +       case DRM_FORMAT_YUV444:
> > +       case DRM_FORMAT_YVU444:
> >                 ubo = drm_plane_state_to_ubo(state);
> >                 vbo = drm_plane_state_to_vbo(state);
> >
> > -               if (fb->pixel_format == DRM_FORMAT_YUV420)
> > +               if (fb->pixel_format != DRM_FORMAT_YVU420 &&
> > +                   fb->pixel_format != DRM_FORMAT_YVU422 &&
> > +                   fb->pixel_format != DRM_FORMAT_YVU444)
> 
> Nit:
> This looks more straightforward, perhaps.
> 
> +               if (fb->pixel_format == DRM_FORMAT_YUV420 ||
> +                   fb->pixel_format == DRM_FORMAT_YUV422 ||
> +                   fb->pixel_format == DRM_FORMAT_YUV444)

I've inverted it at first because I mistakenly thought I'd also have to
add NV12 and NV16 to the list otherwise. I'd like to change this to:

	ubo = drm_plane_state_to_ubo(state);
	vbo = drm_plane_state_to_vbo(state);

	if (fb->pixel_format == DRM_FORMAT_YVU420 ||
	    fb->pixel_format == DRM_FORMAT_YVU422 ||
	    fb->pixel_format == DRM_FORMAT_YVU444)
		swap(ubo, vbo);
                                                                                                                                      
	ipu_cpmem_set_yuv_planar_full(ipu_plane->ipu_ch,
				      fb->pitches[1], ubo, vbo);

to make it even more obvious that we just switch the U/V buffer offsets
for YVU formats.

thanks
Philipp

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux