<div dir="ltr">I resubmitted the kernel patch to lkml and cc'ed Daniel.</div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jan 2, 2017 at 10:32 AM, Daniel Vetter <span dir="ltr"><<a href="mailto:daniel@ffwll.ch" target="_blank">daniel@ffwll.ch</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Thu, Dec 29, 2016 at 04:43:34PM -0800, Ben Widawsky wrote:<br>
> On 16-12-16 21:27:51, Rainer Hochecker wrote:<br>
> > From: Rainer Hochecker <<a href="mailto:fernetmenta@online.de">fernetmenta@online.de</a>><br>
> ><br>
> > This allows eglCreateImageKHR to access P010 surfaces created by vaapi<br>
> ><br>
> > patch for drm, fourcc:<br>
> > <a href="http://paste.ubuntu.com/23638632/" rel="noreferrer" target="_blank">http://paste.ubuntu.com/<wbr>23638632/</a><br>
> ><br>
> > Signed-off-by: Rainer Hochecker <<a href="mailto:fernetmenta@online.de">fernetmenta@online.de</a>><br>
> > ---<br>
> > include/GL/internal/dri_<wbr>interface.h | 4 ++++<br>
> > src/egl/drivers/dri2/egl_dri2.<wbr>c | 10 ++++++++++<br>
> > src/mesa/drivers/dri/common/<wbr>dri_util.c | 4 ++++<br>
> > src/mesa/drivers/dri/i965/<wbr>intel_screen.c | 6 ++++++<br>
> > 4 files changed, 24 insertions(+)<br>
> ><br>
> > diff --git a/include/GL/internal/dri_<wbr>interface.h b/include/GL/internal/dri_<wbr>interface.h<br>
> > index d0b1bc6..933277e 100644<br>
> > --- a/include/GL/internal/dri_<wbr>interface.h<br>
> > +++ b/include/GL/internal/dri_<wbr>interface.h<br>
> > @@ -1121,6 +1121,8 @@ struct __DRIdri2ExtensionRec {<br>
> > #define __DRI_IMAGE_FORMAT_XRGB2101010 0x1009<br>
> > #define __DRI_IMAGE_FORMAT_ARGB2101010 0x100a<br>
> > #define __DRI_IMAGE_FORMAT_SARGB8 0x100b<br>
> > +#define __DRI_IMAGE_FORMAT_R16 0x100c<br>
> > +#define __DRI_IMAGE_FORMAT_GR16 0x100d<br>
> ><br>
> > #define __DRI_IMAGE_USE_SHARE 0x0001<br>
> > #define __DRI_IMAGE_USE_SCANOUT 0x0002<br>
> > @@ -1148,6 +1150,8 @@ struct __DRIdri2ExtensionRec {<br>
> ><br>
> > #define __DRI_IMAGE_FOURCC_R8 0x20203852<br>
> > #define __DRI_IMAGE_FOURCC_GR88 0x38385247<br>
> > +#define __DRI_IMAGE_FOURCC_R16 0x20363152<br>
> > +#define __DRI_IMAGE_FOURCC_GR16 0x36315247<br>
> > #define __DRI_IMAGE_FOURCC_RGB565 0x36314752<br>
> > #define __DRI_IMAGE_FOURCC_ARGB8888 0x34325241<br>
> > #define __DRI_IMAGE_FOURCC_XRGB8888 0x34325258<br>
> > diff --git a/src/egl/drivers/dri2/egl_<wbr>dri2.c b/src/egl/drivers/dri2/egl_<wbr>dri2.c<br>
> > index f18e9fb..f4ed022 100644<br>
> > --- a/src/egl/drivers/dri2/egl_<wbr>dri2.c<br>
> > +++ b/src/egl/drivers/dri2/egl_<wbr>dri2.c<br>
> > @@ -75,6 +75,14 @@<br>
> > #define DRM_FORMAT_GR88 fourcc_code('G', 'R', '8', '8') /* [15:0] G:R 8:8 little endian */<br>
> > #endif<br>
> ><br>
> > +#ifndef DRM_FORMAT_R16<br>
> > +#define DRM_FORMAT_R16 fourcc_code('R', '1', '6', ' ') /* [15:0] R 16 little endian */<br>
> > +#endif<br>
> > +<br>
> > +#ifndef DRM_FORMAT_GR16<br>
> > +#define DRM_FORMAT_GR16 fourcc_code('G', 'R', '1', '6') /* [31:0] R:G 16:16 little endian */<br>
> > +#endif<br>
> > +<br>
> > const __DRIuseInvalidateExtension use_invalidate = {<br>
> > .base = { __DRI_USE_INVALIDATE, 1 }<br>
> > };<br>
> > @@ -1951,6 +1959,8 @@ dri2_check_dma_buf_format(<wbr>const _EGLImageAttribs *attrs)<br>
> > case DRM_FORMAT_R8:<br>
> > case DRM_FORMAT_RG88:<br>
> > case DRM_FORMAT_GR88:<br>
> > + case DRM_FORMAT_R16:<br>
> > + case DRM_FORMAT_GR16:<br>
> > case DRM_FORMAT_RGB332:<br>
> > case DRM_FORMAT_BGR233:<br>
> > case DRM_FORMAT_XRGB4444:<br>
> > diff --git a/src/mesa/drivers/dri/common/<wbr>dri_util.c b/src/mesa/drivers/dri/common/<wbr>dri_util.c<br>
> > index 3b81799..c275c07 100644<br>
> > --- a/src/mesa/drivers/dri/common/<wbr>dri_util.c<br>
> > +++ b/src/mesa/drivers/dri/common/<wbr>dri_util.c<br>
> > @@ -877,8 +877,12 @@ driImageFormatToGLFormat(<wbr>uint32_t image_format)<br>
> > return MESA_FORMAT_R8G8B8X8_UNORM;<br>
> > case __DRI_IMAGE_FORMAT_R8:<br>
> > return MESA_FORMAT_R_UNORM8;<br>
> > + case __DRI_IMAGE_FORMAT_R16:<br>
> > + return MESA_FORMAT_R_UNORM16;<br>
> > case __DRI_IMAGE_FORMAT_GR88:<br>
> > return MESA_FORMAT_R8G8_UNORM;<br>
> > + case __DRI_IMAGE_FORMAT_GR16:<br>
> > + return MESA_FORMAT_R16G16_UNORM;<br>
> > case __DRI_IMAGE_FORMAT_SARGB8:<br>
> > return MESA_FORMAT_B8G8R8A8_SRGB;<br>
> > case __DRI_IMAGE_FORMAT_NONE:<br>
> > diff --git a/src/mesa/drivers/dri/i965/<wbr>intel_screen.c b/src/mesa/drivers/dri/i965/<wbr>intel_screen.c<br>
> > index e1c3c19..b3700c6 100644<br>
> > --- a/src/mesa/drivers/dri/i965/<wbr>intel_screen.c<br>
> > +++ b/src/mesa/drivers/dri/i965/<wbr>intel_screen.c<br>
> > @@ -236,9 +236,15 @@ static struct intel_image_format intel_image_formats[] = {<br>
> > { __DRI_IMAGE_FOURCC_R8, __DRI_IMAGE_COMPONENTS_R, 1,<br>
> > { { 0, 0, 0, __DRI_IMAGE_FORMAT_R8, 1 }, } },<br>
> ><br>
> > + { __DRI_IMAGE_FOURCC_R16, __DRI_IMAGE_COMPONENTS_R, 1,<br>
> > + { { 0, 0, 0, __DRI_IMAGE_FORMAT_R16, 1 }, } },<br>
> > +<br>
> > { __DRI_IMAGE_FOURCC_GR88, __DRI_IMAGE_COMPONENTS_RG, 1,<br>
> > { { 0, 0, 0, __DRI_IMAGE_FORMAT_GR88, 2 }, } },<br>
> ><br>
> > + { __DRI_IMAGE_FOURCC_GR16, __DRI_IMAGE_COMPONENTS_RG, 1,<br>
> > + { { 0, 0, 0, __DRI_IMAGE_FORMAT_GR16, 2 }, } },<br>
> > +<br>
> > { __DRI_IMAGE_FOURCC_YUV410, __DRI_IMAGE_COMPONENTS_Y_U_V, 3,<br>
> > { { 0, 0, 0, __DRI_IMAGE_FORMAT_R8, 1 },<br>
> > { 1, 2, 2, __DRI_IMAGE_FORMAT_R8, 1 },<br>
><br>
> This patch looks fine to me. It'd be nice to get a piglit test for it. I think<br>
> Chad added one of these last time around.<br>
><br>
> Anyone have objections?<br>
<br>
</div></div>I guess we'd need the kernel patch. Somehow that one never got to me,<br>
resubmitting is probably simplest.<br>
<span class="HOEnZb"><font color="#888888">-Daniel<br>
--<br>
Daniel Vetter<br>
Software Engineer, Intel Corporation<br>
<a href="http://blog.ffwll.ch" rel="noreferrer" target="_blank">http://blog.ffwll.ch</a><br>
</font></span></blockquote></div><br></div>