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

Brian Paul brianp at vmware.com
Thu Jun 14 07:37:01 PDT 2012


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


More information about the mesa-dev mailing list