[PATCH 2/7] mesa intel driver:

Zhao halley halley.zhao at intel.com
Thu May 24 20:36:48 PDT 2012


 add YUYV format for dri image
 YUYV image doesn't use for texture
---
 src/mesa/drivers/dri/intel/intel_screen.c    |    5 +++++
 src/mesa/drivers/dri/intel/intel_tex_image.c |    6 ++++++
 2 files changed, 11 insertions(+), 0 deletions(-)
 mode change 100644 =3D> 100755 src/mesa/drivers/dri/intel/intel_screen.c
 mode change 100644 =3D> 100755 src/mesa/drivers/dri/intel/intel_tex_image.=
c

diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/d=
ri/intel/intel_screen.c
old mode 100644
new mode 100755
index 458178f..b8d44ba
--- a/src/mesa/drivers/dri/intel/intel_screen.c
+++ b/src/mesa/drivers/dri/intel/intel_screen.c
@@ -216,6 +216,11 @@ intel_create_image_from_name(__DRIscreen *screen,
        image->internal_format =3D GL_RGB;
        image->data_type =3D GL_UNSIGNED_BYTE;
        break;
+    case __DRI_IMAGE_FORMAT_YUYV:
+       image->format =3D MESA_FORMAT_YCBCR;
+       image->internal_format =3D GL_LUMINANCE;
+       image->data_type =3D GL_UNSIGNED_BYTE;
+      break;
     default:
        free(image);
        return NULL;
diff --git a/src/mesa/drivers/dri/intel/intel_tex_image.c b/src/mesa/driver=
s/dri/intel/intel_tex_image.c
old mode 100644
new mode 100755
index 094d3cd..8b94cb1
--- a/src/mesa/drivers/dri/intel/intel_tex_image.c
+++ b/src/mesa/drivers/dri/intel/intel_tex_image.c
@@ -388,6 +388,12 @@ intel_image_target_texture_2d(struct gl_context *ctx, =
GLenum target,
    if (image =3D=3D NULL)
       return;
=20
+   if (image->format =3D=3D MESA_FORMAT_YCBCR) {
+      _mesa_error(&intel->ctx,
+		  GL_INVALID_OPERATION, "glEGLImageTargetTexture2DOES, attach YUYV regio=
n to texture is not supported");
+      return;
+    }
+
    intel_set_texture_image_region(ctx, texImage, image->region,
 				  target, image->internal_format, image->format);
 }
--=20
1.7.5.4

> -----Original Message-----
> From: Eric Anholt [mailto:eric at anholt.net]
> Sent: Saturday, June 02, 2012 5:33 AM
> To: Zhao, Halley; mesa-dev at lists.freedesktop.org
> Cc: Barnes, Jesse; Zhao, Halley
> Subject: Re: [PATCH 2/6] mesa intel driver:
>=20
> On Thu, 31 May 2012 17:23:59 +0800, Zhao halley <halley.zhao at intel.com>
> wrote:
> >  add YUYV format for dri image
> >  YUYV image doesn't use for texture
> > ---
> >  src/mesa/drivers/dri/intel/intel_screen.c    |    5 +++++
> >  src/mesa/drivers/dri/intel/intel_tex_image.c |    3 +++
> >  2 files changed, 8 insertions(+), 0 deletions(-)  mode change 100644
> > =3D> 100755 src/mesa/drivers/dri/intel/intel_screen.c
> >  mode change 100644 =3D> 100755
> > src/mesa/drivers/dri/intel/intel_tex_image.c
> >
> > diff --git a/src/mesa/drivers/dri/intel/intel_screen.c
> > b/src/mesa/drivers/dri/intel/intel_screen.c
> > old mode 100644
> > new mode 100755
> > index 458178f..5ff2e49
> > --- a/src/mesa/drivers/dri/intel/intel_screen.c
> > +++ b/src/mesa/drivers/dri/intel/intel_screen.c
> > @@ -216,6 +216,11 @@ intel_create_image_from_name(__DRIscreen
> *screen,
> >         image->internal_format =3D GL_RGB;
> >         image->data_type =3D GL_UNSIGNED_BYTE;
> >         break;
> > +    case __DRI_IMAGE_FORMAT_YUYV:
> > +       image->format =3D MESA_FORMAT_YCBCR;     // XXXX no detailed
> YUV format in mesa yet
> > +       image->internal_format =3D GL_LUMINANCE; // XXXX no detailed
> YUV format in gles2 yet
> > +       image->data_type =3D GL_UNSIGNED_BYTE;
> > +      break;
> >      default:
> >         free(image);
> >         return NULL;
>=20
> I don't like seeing these XXXs added that suggest that this commit isn't =
ready.
>=20
> > diff --git a/src/mesa/drivers/dri/intel/intel_tex_image.c
> > b/src/mesa/drivers/dri/intel/intel_tex_image.c old mode 100644 new
> > mode 100755 index 094d3cd..e5c3bdc ---
> > a/src/mesa/drivers/dri/intel/intel_tex_image.c +++
> > b/src/mesa/drivers/dri/intel/intel_tex_image.c @@ -388,6 +388,9 @@
> > intel_image_target_texture_2d(struct gl_context *ctx, GLenum target,
> > if (image =3D=3D NULL) return;
> >
> > +   if (image->format =3D=3D MESA_FORMAT_YCBCR)
> > +    return;
> > +
> >     intel_set_texture_image_region(ctx, texImage, image->region,
> >  				  target, image->internal_format, image->format);  }
>=20
> So, you don't actually attach the region to the texture?  If you don't su=
pport
> rendering from the format as a texture, why is this not throwing an error=
?
>=20
> I don't understand yet how this series really gets used.  As far as I und=
erstand,
> wayland likes to use the image directly as an overlay if possible, but so=
metimes
> it can't.  At that point, it needs to be able to do GL rendering using th=
at image
> as a source, right?  So, how is the compositor supposed to handle the for=
mat
> in that case, if it can't texture from it?


More information about the mesa-dev mailing list