[Mesa-dev] [PATCH 2/6] mesa intel driver:

Eric Anholt eric at anholt.net
Fri Jun 1 14:32:33 PDT 2012


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 => 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..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 = GL_RGB;
>         image->data_type = GL_UNSIGNED_BYTE;
>         break;
> +    case __DRI_IMAGE_FORMAT_YUYV:
> +       image->format = MESA_FORMAT_YCBCR;     // XXXX no detailed YUV format in mesa yet
> +       image->internal_format = GL_LUMINANCE; // XXXX no detailed YUV format in gles2 yet
> +       image->data_type = GL_UNSIGNED_BYTE;
> +      break;
>      default:
>         free(image);
>         return NULL;

I don't like seeing these XXXs added that suggest that this commit isn't
ready.

> 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 == NULL) return;
>  
> +   if (image->format == MESA_FORMAT_YCBCR)
> +    return;
> +
>     intel_set_texture_image_region(ctx, texImage, image->region,
>  				  target, image->internal_format, image->format);
>  }

So, you don't actually attach the region to the texture?  If you don't
support rendering from the format as a texture, why is this not throwing
an error?

I don't understand yet how this series really gets used.  As far as I
understand, wayland likes to use the image directly as an overlay if
possible, but sometimes it can't.  At that point, it needs to be able to
do GL rendering using that image as a source, right?  So, how is the
compositor supposed to handle the format in that case, if it can't
texture from it?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20120601/04b9ec89/attachment-0001.pgp>


More information about the mesa-dev mailing list