[Mesa-dev] [PATCH 02/11 v3] mesa intel driver:

Zhao, Halley halley.zhao at linux.intel.com
Mon Jun 18 02:11:11 PDT 2012


Thanks Paul, I have updated the patch as following.

Another colleague is working on texture support of YUYV format,
patches will come soon.


>From c036437ab676f26f8f1b788cbfafaca4b4b6005a Mon Sep 17 00:00:00 2001
From: Zhao Halley <halley.zhao at intel.com>
Date: Fri, 25 May 2012 11:36:48 +0800
Subject: [PATCH 02/10] intel: add YUYV format for dri images

 YUYV image works for overlay now
 YUYV image works for texture will come soon
---
 src/mesa/drivers/dri/intel/intel_screen.c    |   10 ++++++++++
 src/mesa/drivers/dri/intel/intel_tex_image.c |    6 ++++++
 2 files changed, 16 insertions(+), 0 deletions(-)
 mode change 100644 => 100755 src/mesa/drivers/dri/intel/intel_screen.c
 mode change 100644 => 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..3b8f81e
--- 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 = GL_RGB;
        image->data_type = GL_UNSIGNED_BYTE;
        break;
+    case __DRI_IMAGE_FORMAT_YUYV:
+       image->format = MESA_FORMAT_YCBCR;
+       image->internal_format = GL_YCBCR_MESA;
+       image->data_type = GL_UNSIGNED_BYTE;
+      break;
     default:
        free(image);
        return NULL;
@@ -343,6 +348,11 @@ intel_create_image(__DRIscreen *screen,
        image->internal_format = GL_RGB;
        image->data_type = GL_UNSIGNED_BYTE;
        break;
+   case __DRI_IMAGE_FORMAT_YUYV:
+      image->format = MESA_FORMAT_YCBCR;
+      image->internal_format = GL_YCBCR_MESA;
+      image->data_type = GL_UNSIGNED_BYTE;
+      break;
    default:
       free(image);
       return NULL;
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..643e688
--- 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 == NULL)
       return;
 
+   if (image->format == MESA_FORMAT_YCBCR) {
+      _mesa_error(&intel->ctx, GL_INVALID_OPERATION, 
+        "glEGLImageTargetTexture2DOES, YUYV format isn't supported
yet");
+      return;
+    }
+
    intel_set_texture_image_region(ctx, texImage, image->region,
 				  target, image->internal_format, image->format);
 }
-- 
1.7.5.4

On Thu, 2012-06-14 at 08:37 -0600, Brian Paul wrote:
> On 06/14/2012 04:32 AM, Zhao Halley wrote:
> >   add YUYV format for dri image
> 
> Minor nit: the first line of the patch comment should be something 
> like: "intel: add YUYV format for dri images"
> 
>  >   YUYV image doesn't use for texture
> 
> ??  Can you rewrite/clarify that?
> 
> 
> > ---
> >   src/mesa/drivers/dri/intel/intel_screen.c    |   10 ++++++++++
> >   src/mesa/drivers/dri/intel/intel_tex_image.c |    6 ++++++
> >   2 files changed, 16 insertions(+), 0 deletions(-)
> >   mode change 100644 =>  100755 src/mesa/drivers/dri/intel/intel_screen.c
> >   mode change 100644 =>  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..3b8f81e
> > --- 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 = GL_RGB;
> >          image->data_type = GL_UNSIGNED_BYTE;
> >          break;
> > +    case __DRI_IMAGE_FORMAT_YUYV:
> > +       image->format = MESA_FORMAT_YCBCR;
> > +       image->internal_format = GL_YCBCR_MESA;
> > +       image->data_type = GL_UNSIGNED_BYTE;
> > +      break;
> >       default:
> >          free(image);
> >          return NULL;
> > @@ -343,6 +348,11 @@ intel_create_image(__DRIscreen *screen,
> >          image->internal_format = GL_RGB;
> >          image->data_type = GL_UNSIGNED_BYTE;
> >          break;
> > +   case __DRI_IMAGE_FORMAT_YUYV:
> > +      image->format = MESA_FORMAT_YCBCR;
> > +      image->internal_format = GL_YCBCR_MESA;
> > +      image->data_type = GL_UNSIGNED_BYTE;
> > +      break;
> >      default:
> >         free(image);
> >         return NULL;
> > 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..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 == NULL)
> >         return;
> >
> > +   if (image->format == MESA_FORMAT_YCBCR) {
> > +      _mesa_error(&intel->ctx,
> > +		  GL_INVALID_OPERATION, "glEGLImageTargetTexture2DOES, attach YUYV region to texture is not supported");
> 
> Can you wrap that call to 80 columns?
> 
> 
> > +      return;
> > +    }
> > +
> >      intel_set_texture_image_region(ctx, texImage, image->region,
> >   				  target, image->internal_format, image->format);
> >   }
> 
> 
> -Brian
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev




More information about the mesa-dev mailing list