Re: [PATCH] drm: add checking DRM_FORMAT_NV12MT

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

 



On Mon, Jul 28, 2014 at 11:56:59AM -0400, Rob Clark wrote:
> On Mon, Jul 28, 2014 at 12:47 AM, Joonyoung Shim
> <jy0922.shim@xxxxxxxxxxx> wrote:
> > If user NV12MT uses as pixel format, the Addfb2 ioctl is failed because
> > of missing to check DRM_FORMAT_NV12MT. The NV12MT pixel format is
> > supported by exynos4 and some qualcomm chipset and it is used by exynos
> > drm driver.
> 
> tbh, format_check() should probably just be made to respect the
> formats advertised by all the planes..

That can't be done until all drivers are converted to primary/cursor
planes. Also I'm not sure if we should allow it even then since that
would make it quite easy to sneak in new driver specific formats
without anyone necessarily reviewing them.

> 
> BR,
> -R
> 
> > Signed-off-by: Joonyoung Shim <jy0922.shim@xxxxxxxxxxx>
> > ---
> >  drivers/gpu/drm/drm_crtc.c | 5 +++++
> >  1 file changed, 5 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
> > index 1ccf5cb..5d7bd49 100644
> > --- a/drivers/gpu/drm/drm_crtc.c
> > +++ b/drivers/gpu/drm/drm_crtc.c
> > @@ -2960,6 +2960,7 @@ static int format_check(const struct drm_mode_fb_cmd2 *r)
> >         case DRM_FORMAT_NV61:
> >         case DRM_FORMAT_NV24:
> >         case DRM_FORMAT_NV42:
> > +       case DRM_FORMAT_NV12MT:
> >         case DRM_FORMAT_YUV410:
> >         case DRM_FORMAT_YVU410:
> >         case DRM_FORMAT_YUV411:
> > @@ -4800,6 +4801,7 @@ int drm_format_num_planes(uint32_t format)
> >         case DRM_FORMAT_NV61:
> >         case DRM_FORMAT_NV24:
> >         case DRM_FORMAT_NV42:
> > +       case DRM_FORMAT_NV12MT:
> >                 return 2;
> >         default:
> >                 return 1;
> > @@ -4835,6 +4837,7 @@ int drm_format_plane_cpp(uint32_t format, int plane)
> >         case DRM_FORMAT_NV61:
> >         case DRM_FORMAT_NV24:
> >         case DRM_FORMAT_NV42:
> > +       case DRM_FORMAT_NV12MT:
> >                 return plane ? 2 : 1;
> >         case DRM_FORMAT_YUV410:
> >         case DRM_FORMAT_YVU410:
> > @@ -4878,6 +4881,7 @@ int drm_format_horz_chroma_subsampling(uint32_t format)
> >         case DRM_FORMAT_NV21:
> >         case DRM_FORMAT_NV16:
> >         case DRM_FORMAT_NV61:
> > +       case DRM_FORMAT_NV12MT:
> >         case DRM_FORMAT_YUV422:
> >         case DRM_FORMAT_YVU422:
> >         case DRM_FORMAT_YUV420:
> > @@ -4907,6 +4911,7 @@ int drm_format_vert_chroma_subsampling(uint32_t format)
> >         case DRM_FORMAT_YVU420:
> >         case DRM_FORMAT_NV12:
> >         case DRM_FORMAT_NV21:
> > +       case DRM_FORMAT_NV12MT:
> >                 return 2;
> >         default:
> >                 return 1;
> > --
> > 1.8.1.2
> >
> > _______________________________________________
> > dri-devel mailing list
> > dri-devel@xxxxxxxxxxxxxxxxxxxxx
> > http://lists.freedesktop.org/mailman/listinfo/dri-devel
> _______________________________________________
> dri-devel mailing list
> dri-devel@xxxxxxxxxxxxxxxxxxxxx
> http://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Ville Syrjälä
Intel OTC
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://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