Re: [Libva] [PATCH 0/2] add user specified tiling/stride support, clean up assert

2014-03-18 Thread Zhao, Halley
Thanks for your comments.

The 2nd patch is so big that it is blocked by mail man, so I sent to some stake 
holders for review.
Your VA_INTEL_DEBUG=asserts sounds good, we can consider it.


-Original Message-
From: Gwenole Beauchesne [mailto:gb.de...@gmail.com] 
Sent: Wednesday, March 19, 2014 12:52 PM
To: Zhao, Halley
Cc: libva@lists.freedesktop.org
Subject: Re: [Libva] [PATCH 0/2] add user specified tiling/stride support, 
clean up assert

Hi,

2014-03-14 10:19 GMT+01:00 Zhao, Halley :

> when I implements feature for user specified tiling/stride support, 
> haihao mentioned that I'd better 'return fail' instead of assert().
> so, I tried to clean up the assert in i965_drv_video.c as well.

The assert_ret() patch did not appear on the list but was committed as 12c8122.

What Haihao mentioned was right, but what I had precisely indicated beforehand 
was to not have the VA driver fail at all in the default case too. Besides, the 
proposed patch turned down the indication of what went wrong. i.e. assert(0) is 
totally meaningless, unless you get the original source code the binary was 
built with, and look for the specified file/line number information.

The proper approach would have been to log the error in any case, possibly 
controlled by an environment variable (e.g.
VA_INTEL_DEBUG=asserts), but definitely not an assert(0) again. That way, you 
can still get informative enough bug reports. And, most importantly, you also 
get a chance to test/exercice the error handling code of upper layers in the 
general case too.

Thanks,
Gwenole.
___
Libva mailing list
Libva@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libva


Re: [Libva] [PATCH] VPP: Fix the typo error of "VV16"

2014-03-18 Thread Zhao Yakui
On Tue, 2014-03-18 at 23:01 -0600, Gwenole Beauchesne wrote:
> 2014-03-18 9:35 GMT+01:00 Zhao Yakui :
> > Thank Gwenole for finding this typo error which is caused by
> > the commit 2b5fad11a5c12d3c6ffbef15c02449a3b4e90b98.
> 
> OK, but please also schedule another patch where you have
> programmatically (script, command) replaced any instance of
> VA_FOURCC('A','B','C','D') with VA_FOURCC_ABCD instead. And, another
> patch where i965_drv_video.h (or intel_driver.h, never remember which
> one -- or new: vaapi_compat.h), you define the VA_FOURCC_xxx if it was
> not defined before, i.e. once and for all.
> 
> Something like
> #ifndef VA_FOURCC_YV16
> #define VA_FOURCC_YV16 VA_FOURCC('Y','V','1','6')
> #endif

Thanks for your advice and suggestion.

Yes. I agree with your point. We need another patch to replace the
possible definition of VA_FOURCC('A', 'B', 'C', 'D'). This will be in
schedule.


Thanks.
Yakui
> 
> Notes:
> - Don't forget any possible whitespace after the comma in the sed/perl pattern
> - Commit the patch for both master and staging branches, hence the
> "programatically"
> 
> Thanks,
> Gwenole.
> 
> > Signed-off-by: Zhao Yakui 
> > ---
> >  src/gen8_post_processing.c | 2 +-
> >  src/i965_post_processing.c | 8 
> >  2 files changed, 5 insertions(+), 5 deletions(-)
> >
> > diff --git a/src/gen8_post_processing.c b/src/gen8_post_processing.c
> > index a5b3b90..6f3afe7 100644
> > --- a/src/gen8_post_processing.c
> > +++ b/src/gen8_post_processing.c
> > @@ -566,7 +566,7 @@ gen8_pp_set_media_rw_message_surface(VADriverContextP 
> > ctx, struct i965_post_proc
> >  height[2] = obj_image->image.height / 2;
> >  pitch[2] = obj_image->image.pitches[V];
> >  offset[2] = obj_image->image.offsets[V];
> > -if (fourcc == VA_FOURCC('V', 'V', '1', '6')) {
> > +if (fourcc == VA_FOURCC('Y', 'V', '1', '6')) {
> >  width[1] = obj_image->image.width / 2;
> >  height[1] = obj_image->image.height;
> >  width[2] = obj_image->image.width / 2;
> > diff --git a/src/i965_post_processing.c b/src/i965_post_processing.c
> > index 3242257..35bc515 100755
> > --- a/src/i965_post_processing.c
> > +++ b/src/i965_post_processing.c
> > @@ -1836,7 +1836,7 @@ pp_set_media_rw_message_surface(VADriverContextP ctx, 
> > struct i965_post_processin
> >  height[2] = obj_image->image.height / 2;
> >  pitch[2] = obj_image->image.pitches[2];
> >  offset[2] = obj_image->image.offsets[2];
> > -if (fourcc == VA_FOURCC('V', 'V', '1', '6')) {
> > +if (fourcc == VA_FOURCC('Y', 'V', '1', '6')) {
> >  width[1] = obj_image->image.width / 2;
> >  height[1] = obj_image->image.height;
> >  width[2] = obj_image->image.width / 2;
> > @@ -1885,10 +1885,10 @@ 
> > gen7_pp_set_media_rw_message_surface(VADriverContextP ctx, struct 
> > i965_post_proc
> >  dri_bo *bo;
> >  int fourcc = pp_get_surface_fourcc(ctx, surface);
> >  const int U = (fourcc == VA_FOURCC('Y', 'V', '1', '2') ||
> > -   fourcc == VA_FOURCC('V', 'V', '1', '6') ||
> > +   fourcc == VA_FOURCC('Y', 'V', '1', '6') ||
> > fourcc == VA_FOURCC('I', 'M', 'C', '1')) ? 2 : 1;
> >  const int V = (fourcc == VA_FOURCC('Y', 'V', '1', '2') ||
> > -   fourcc == VA_FOURCC('V', 'V', '1', '6') ||
> > +   fourcc == VA_FOURCC('Y', 'V', '1', '6') ||
> > fourcc == VA_FOURCC('I', 'M', 'C', '1')) ? 1 : 2;
> >  int interleaved_uv = fourcc == VA_FOURCC('N', 'V', '1', '2');
> >  int packed_yuv = (fourcc == VA_FOURCC('Y', 'U', 'Y', '2') || fourcc == 
> > VA_FOURCC('U', 'Y', 'V', 'Y'));
> > @@ -1954,7 +1954,7 @@ gen7_pp_set_media_rw_message_surface(VADriverContextP 
> > ctx, struct i965_post_proc
> >  height[2] = obj_image->image.height / 2;
> >  pitch[2] = obj_image->image.pitches[V];
> >  offset[2] = obj_image->image.offsets[V];
> > -if (fourcc == VA_FOURCC('V', 'V', '1', '6')) {
> > +if (fourcc == VA_FOURCC('Y', 'V', '1', '6')) {
> >  width[1] = obj_image->image.width / 2;
> >  height[1] = obj_image->image.height;
> >  width[2] = obj_image->image.width / 2;
> > --
> > 1.8.2-rc2
> >
> > ___
> > Libva mailing list
> > Libva@lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/libva


___
Libva mailing list
Libva@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libva


Re: [Libva] [PATCH] VPP: Fix the typo error of "VV16"

2014-03-18 Thread Gwenole Beauchesne
2014-03-18 9:35 GMT+01:00 Zhao Yakui :
> Thank Gwenole for finding this typo error which is caused by
> the commit 2b5fad11a5c12d3c6ffbef15c02449a3b4e90b98.

OK, but please also schedule another patch where you have
programmatically (script, command) replaced any instance of
VA_FOURCC('A','B','C','D') with VA_FOURCC_ABCD instead. And, another
patch where i965_drv_video.h (or intel_driver.h, never remember which
one -- or new: vaapi_compat.h), you define the VA_FOURCC_xxx if it was
not defined before, i.e. once and for all.

Something like
#ifndef VA_FOURCC_YV16
#define VA_FOURCC_YV16 VA_FOURCC('Y','V','1','6')
#endif

Notes:
- Don't forget any possible whitespace after the comma in the sed/perl pattern
- Commit the patch for both master and staging branches, hence the
"programatically"

Thanks,
Gwenole.

> Signed-off-by: Zhao Yakui 
> ---
>  src/gen8_post_processing.c | 2 +-
>  src/i965_post_processing.c | 8 
>  2 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/src/gen8_post_processing.c b/src/gen8_post_processing.c
> index a5b3b90..6f3afe7 100644
> --- a/src/gen8_post_processing.c
> +++ b/src/gen8_post_processing.c
> @@ -566,7 +566,7 @@ gen8_pp_set_media_rw_message_surface(VADriverContextP 
> ctx, struct i965_post_proc
>  height[2] = obj_image->image.height / 2;
>  pitch[2] = obj_image->image.pitches[V];
>  offset[2] = obj_image->image.offsets[V];
> -if (fourcc == VA_FOURCC('V', 'V', '1', '6')) {
> +if (fourcc == VA_FOURCC('Y', 'V', '1', '6')) {
>  width[1] = obj_image->image.width / 2;
>  height[1] = obj_image->image.height;
>  width[2] = obj_image->image.width / 2;
> diff --git a/src/i965_post_processing.c b/src/i965_post_processing.c
> index 3242257..35bc515 100755
> --- a/src/i965_post_processing.c
> +++ b/src/i965_post_processing.c
> @@ -1836,7 +1836,7 @@ pp_set_media_rw_message_surface(VADriverContextP ctx, 
> struct i965_post_processin
>  height[2] = obj_image->image.height / 2;
>  pitch[2] = obj_image->image.pitches[2];
>  offset[2] = obj_image->image.offsets[2];
> -if (fourcc == VA_FOURCC('V', 'V', '1', '6')) {
> +if (fourcc == VA_FOURCC('Y', 'V', '1', '6')) {
>  width[1] = obj_image->image.width / 2;
>  height[1] = obj_image->image.height;
>  width[2] = obj_image->image.width / 2;
> @@ -1885,10 +1885,10 @@ gen7_pp_set_media_rw_message_surface(VADriverContextP 
> ctx, struct i965_post_proc
>  dri_bo *bo;
>  int fourcc = pp_get_surface_fourcc(ctx, surface);
>  const int U = (fourcc == VA_FOURCC('Y', 'V', '1', '2') ||
> -   fourcc == VA_FOURCC('V', 'V', '1', '6') ||
> +   fourcc == VA_FOURCC('Y', 'V', '1', '6') ||
> fourcc == VA_FOURCC('I', 'M', 'C', '1')) ? 2 : 1;
>  const int V = (fourcc == VA_FOURCC('Y', 'V', '1', '2') ||
> -   fourcc == VA_FOURCC('V', 'V', '1', '6') ||
> +   fourcc == VA_FOURCC('Y', 'V', '1', '6') ||
> fourcc == VA_FOURCC('I', 'M', 'C', '1')) ? 1 : 2;
>  int interleaved_uv = fourcc == VA_FOURCC('N', 'V', '1', '2');
>  int packed_yuv = (fourcc == VA_FOURCC('Y', 'U', 'Y', '2') || fourcc == 
> VA_FOURCC('U', 'Y', 'V', 'Y'));
> @@ -1954,7 +1954,7 @@ gen7_pp_set_media_rw_message_surface(VADriverContextP 
> ctx, struct i965_post_proc
>  height[2] = obj_image->image.height / 2;
>  pitch[2] = obj_image->image.pitches[V];
>  offset[2] = obj_image->image.offsets[V];
> -if (fourcc == VA_FOURCC('V', 'V', '1', '6')) {
> +if (fourcc == VA_FOURCC('Y', 'V', '1', '6')) {
>  width[1] = obj_image->image.width / 2;
>  height[1] = obj_image->image.height;
>  width[2] = obj_image->image.width / 2;
> --
> 1.8.2-rc2
>
> ___
> Libva mailing list
> Libva@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/libva
___
Libva mailing list
Libva@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libva


Re: [Libva] [PATCH 0/2] add user specified tiling/stride support, clean up assert

2014-03-18 Thread Gwenole Beauchesne
Hi,

2014-03-14 10:19 GMT+01:00 Zhao, Halley :

> when I implements feature for user specified tiling/stride support,
> haihao mentioned that I'd better 'return fail' instead of assert().
> so, I tried to clean up the assert in i965_drv_video.c as well.

The assert_ret() patch did not appear on the list but was committed as 12c8122.

What Haihao mentioned was right, but what I had precisely indicated
beforehand was to not have the VA driver fail at all in the default
case too. Besides, the proposed patch turned down the indication of
what went wrong. i.e. assert(0) is totally meaningless, unless you get
the original source code the binary was built with, and look for the
specified file/line number information.

The proper approach would have been to log the error in any case,
possibly controlled by an environment variable (e.g.
VA_INTEL_DEBUG=asserts), but definitely not an assert(0) again. That
way, you can still get informative enough bug reports. And, most
importantly, you also get a chance to test/exercice the error handling
code of upper layers in the general case too.

Thanks,
Gwenole.
___
Libva mailing list
Libva@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libva


Re: [Libva] [ANNOUNCE] libva-1.3.0.pre1

2014-03-18 Thread Gwenole Beauchesne
Hi,

2014-03-17 5:40 GMT+01:00 Xiang, Haihao :

> libva-1.3.0 is planned for release soon.  Please report any critical
> issue with

Oh, well, 1.2.2 was fine actually. If I had mentioned 0.35.0 in
another patch, that was because of the planned interface addition.
This one could have remained at 0.34.1 as scheduled. :)
___
Libva mailing list
Libva@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libva


Re: [Libva] [PATCH 1/2] va: User specified tiling and stride support.

2014-03-18 Thread Zhao Yakui
On Mon, 2014-03-17 at 00:09 -0600, Zhao, Halley wrote:
> Thanks Yakui。
> 

LGTM. this will be pushed.

thanks.
   Yakui
> 
> -Original Message-
> From: Zhao, Yakui 
> Sent: Monday, March 17, 2014 10:25 AM
> To: Zhao, Halley
> Cc: libva@lists.freedesktop.org
> Subject: Re: [Libva] [PATCH 1/2] va: User specified tiling and stride support.
> 
> On Sun, 2014-03-16 at 19:10 -0600, Zhao, Yakui wrote:
> > Hi, Halley
> > Thanks for your patch. 
> > After adding the patch, it is possible that the upper-application can 
> > pass the specific parameters when creating the surface. I agree with your 
> > point. 
> > But it seems that one thing is missing:
> >  >For the non-tiling scenario: it is still possible that 
> > upper-application specifies the pitch/height requirement. But this is 
> > missed.
> 
> After relooking at the code, it seems that the pitch/height is already 
> handled before calling the function of i965_surface_native_memory.
> So please ignore my comment.
> 
> Now this patch looks good to me.
> 
> Add: Reviewed-by: Zhao Yakui 
> 
> Thanks.
> Yakui
> 
> > 
> > Thanks.
> > Yakui
> > 
> > 
> > 
> > 
> > -Original Message-
> > From: libva-boun...@lists.freedesktop.org 
> > [mailto:libva-boun...@lists.freedesktop.org] On Behalf Of Zhao, Halley
> > Sent: Friday, March 14, 2014 5:19 PM
> > To: libva@lists.freedesktop.org
> > Subject: [Libva] [PATCH 1/2] va: User specified tiling and stride support.
> > 
> > From: "Zhao, Halley" 
> > 
> > It is done by two VASurfaceAttrib:
> >  * one is buffer attribute described by 
> > VASurfaceAttribExternalBufferDescriptor.
> >it covers strides and tiling or not.
> >  * another is buffer type to indicate that the buffer is allocated by va 
> > driver.
> >VASurfaceAttribMemoryType:VA_SURFACE_ATTRIB_MEM_TYPE_VA
> > ---
> >  src/i965_drv_video.c | 81 
> > +---
> >  src/i965_drv_video.h |  4 +++
> >  src/intel_driver.h   |  1 +
> >  3 files changed, 82 insertions(+), 4 deletions(-)  mode change 100755 
> > => 100644 src/i965_drv_video.c
> > 
> > diff --git a/src/i965_drv_video.c b/src/i965_drv_video.c old mode 
> > 100755 new mode 100644 index 0453c04..1f0ba96
> > --- a/src/i965_drv_video.c
> > +++ b/src/i965_drv_video.c
> > @@ -1009,6 +1009,39 @@ i965_suface_external_memory(VADriverContextP ctx,
> >  return VA_STATUS_SUCCESS;
> >  }
> >  
> > +/* byte-per-pixel of the first plane */ static int 
> > +bpp_1stplane_by_fourcc(unsigned int fourcc) {
> > +switch (fourcc) {
> > +case VA_FOURCC_RGBA:
> > +case VA_FOURCC_RGBX:
> > +case VA_FOURCC_BGRA:
> > +case VA_FOURCC_BGRX:
> > +case VA_FOURCC_ARGB:
> > +case VA_FOURCC_XRGB:
> > +case VA_FOURCC_ABGR:
> > +case VA_FOURCC_XBGR:
> > +case VA_FOURCC_AYUV:
> > +return 4;
> > +
> > +case VA_FOURCC_UYVY:
> > +case VA_FOURCC_YUY2:
> > +return 2;
> > +
> > +case VA_FOURCC_YV12:
> > +case VA_FOURCC_IMC3:
> > +case VA_FOURCC_IYUV:
> > +case VA_FOURCC_NV12:
> > +case VA_FOURCC_NV11:
> > +return 1;
> > +
> > +default:
> > +assert(0);
> > +return 0;
> > +}
> > +}
> > +
> >  static VAStatus
> >  i965_CreateSurfaces2(
> >  VADriverContextPctx,
> > @@ -1044,6 +1077,8 @@ i965_CreateSurfaces2(
> >  memory_type = I965_SURFACE_MEM_GEM_FLINK; /* flinked GEM 
> > handle */
> >  else if (attrib_list[i].value.value.i == 
> > VA_SURFACE_ATTRIB_MEM_TYPE_DRM_PRIME)
> >  memory_type = I965_SURFACE_MEM_DRM_PRIME; /* drm 
> > prime fd */
> > +else if (attrib_list[i].value.value.i == 
> > VA_SURFACE_ATTRIB_MEM_TYPE_VA)
> > +memory_type = I965_SURFACE_MEM_NATIVE; /* va native 
> > + memory, to be allocated */
> >  }
> >  
> >  if ((attrib_list[i].type == 
> > VASurfaceAttribExternalBufferDescriptor) && @@ -1077,6 +1112,9 @@ 
> > i965_CreateSurfaces2(
> >  obj_surface->status = VASurfaceReady;
> >  obj_surface->orig_width = width;
> >  obj_surface->orig_height = height;
> > +obj_surface->user_disable_tiling = false;
> > +obj_surface->user_h_stride_set = false;
> > +obj_surface->user_v_stride_set = false;
> >  
> >  obj_surface->subpic_render_idx = 0;
> >  for(j = 0; j < I965_MAX_SUBPIC_SUM; j++){ @@ -1096,6 +1134,34 
> > @@ i965_CreateSurfaces2(
> >  
> >  switch (memory_type) {
> >  case I965_SURFACE_MEM_NATIVE:
> > +if (memory_attibute) {
> > +if (!(memory_attibute->flags & 
> > VA_SURFACE_EXTBUF_DESC_ENABLE_TILING))
> > +obj_surface->user_disable_tiling = true;
> > +
> > +if (memory_attibute->pixel_format) {
> > +if (expected_fourcc)
> > +assert(memory_attibute->pixel_format == 
> 

Re: [Libva] [PATCH] VPP: Fix the typo error of "VV16"

2014-03-18 Thread Zhao Yakui
On Tue, 2014-03-18 at 02:35 -0600, Zhao, Yakui wrote:
> Thank Gwenole for finding this typo error which is caused by
> the commit 2b5fad11a5c12d3c6ffbef15c02449a3b4e90b98.

this will be pushed.

thanks.
   Yakui
> 
> Signed-off-by: Zhao Yakui 
> ---
>  src/gen8_post_processing.c | 2 +-
>  src/i965_post_processing.c | 8 
>  2 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/src/gen8_post_processing.c b/src/gen8_post_processing.c
> index a5b3b90..6f3afe7 100644
> --- a/src/gen8_post_processing.c
> +++ b/src/gen8_post_processing.c
> @@ -566,7 +566,7 @@ gen8_pp_set_media_rw_message_surface(VADriverContextP 
> ctx, struct i965_post_proc
>  height[2] = obj_image->image.height / 2;
>  pitch[2] = obj_image->image.pitches[V];
>  offset[2] = obj_image->image.offsets[V];
> -if (fourcc == VA_FOURCC('V', 'V', '1', '6')) {
> +if (fourcc == VA_FOURCC('Y', 'V', '1', '6')) {
>  width[1] = obj_image->image.width / 2;
>  height[1] = obj_image->image.height;
>  width[2] = obj_image->image.width / 2;
> diff --git a/src/i965_post_processing.c b/src/i965_post_processing.c
> index 3242257..35bc515 100755
> --- a/src/i965_post_processing.c
> +++ b/src/i965_post_processing.c
> @@ -1836,7 +1836,7 @@ pp_set_media_rw_message_surface(VADriverContextP ctx, 
> struct i965_post_processin
>  height[2] = obj_image->image.height / 2;
>  pitch[2] = obj_image->image.pitches[2];
>  offset[2] = obj_image->image.offsets[2];
> -if (fourcc == VA_FOURCC('V', 'V', '1', '6')) {
> +if (fourcc == VA_FOURCC('Y', 'V', '1', '6')) {
>  width[1] = obj_image->image.width / 2;
>  height[1] = obj_image->image.height;
>  width[2] = obj_image->image.width / 2;
> @@ -1885,10 +1885,10 @@ gen7_pp_set_media_rw_message_surface(VADriverContextP 
> ctx, struct i965_post_proc
>  dri_bo *bo;
>  int fourcc = pp_get_surface_fourcc(ctx, surface);
>  const int U = (fourcc == VA_FOURCC('Y', 'V', '1', '2') ||
> -   fourcc == VA_FOURCC('V', 'V', '1', '6') ||
> +   fourcc == VA_FOURCC('Y', 'V', '1', '6') ||
> fourcc == VA_FOURCC('I', 'M', 'C', '1')) ? 2 : 1;
>  const int V = (fourcc == VA_FOURCC('Y', 'V', '1', '2') ||
> -   fourcc == VA_FOURCC('V', 'V', '1', '6') ||
> +   fourcc == VA_FOURCC('Y', 'V', '1', '6') ||
> fourcc == VA_FOURCC('I', 'M', 'C', '1')) ? 1 : 2;
>  int interleaved_uv = fourcc == VA_FOURCC('N', 'V', '1', '2');
>  int packed_yuv = (fourcc == VA_FOURCC('Y', 'U', 'Y', '2') || fourcc == 
> VA_FOURCC('U', 'Y', 'V', 'Y'));
> @@ -1954,7 +1954,7 @@ gen7_pp_set_media_rw_message_surface(VADriverContextP 
> ctx, struct i965_post_proc
>  height[2] = obj_image->image.height / 2;
>  pitch[2] = obj_image->image.pitches[V];
>  offset[2] = obj_image->image.offsets[V];
> -if (fourcc == VA_FOURCC('V', 'V', '1', '6')) {
> +if (fourcc == VA_FOURCC('Y', 'V', '1', '6')) {
>  width[1] = obj_image->image.width / 2;
>  height[1] = obj_image->image.height;
>  width[2] = obj_image->image.width / 2;


___
Libva mailing list
Libva@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libva


[Libva] [PATCH] VPP: Fix the typo error of "VV16"

2014-03-18 Thread Zhao Yakui
Thank Gwenole for finding this typo error which is caused by
the commit 2b5fad11a5c12d3c6ffbef15c02449a3b4e90b98.

Signed-off-by: Zhao Yakui 
---
 src/gen8_post_processing.c | 2 +-
 src/i965_post_processing.c | 8 
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/gen8_post_processing.c b/src/gen8_post_processing.c
index a5b3b90..6f3afe7 100644
--- a/src/gen8_post_processing.c
+++ b/src/gen8_post_processing.c
@@ -566,7 +566,7 @@ gen8_pp_set_media_rw_message_surface(VADriverContextP ctx, 
struct i965_post_proc
 height[2] = obj_image->image.height / 2;
 pitch[2] = obj_image->image.pitches[V];
 offset[2] = obj_image->image.offsets[V];
-if (fourcc == VA_FOURCC('V', 'V', '1', '6')) {
+if (fourcc == VA_FOURCC('Y', 'V', '1', '6')) {
 width[1] = obj_image->image.width / 2;
 height[1] = obj_image->image.height;
 width[2] = obj_image->image.width / 2;
diff --git a/src/i965_post_processing.c b/src/i965_post_processing.c
index 3242257..35bc515 100755
--- a/src/i965_post_processing.c
+++ b/src/i965_post_processing.c
@@ -1836,7 +1836,7 @@ pp_set_media_rw_message_surface(VADriverContextP ctx, 
struct i965_post_processin
 height[2] = obj_image->image.height / 2;
 pitch[2] = obj_image->image.pitches[2];
 offset[2] = obj_image->image.offsets[2];
-if (fourcc == VA_FOURCC('V', 'V', '1', '6')) {
+if (fourcc == VA_FOURCC('Y', 'V', '1', '6')) {
 width[1] = obj_image->image.width / 2;
 height[1] = obj_image->image.height;
 width[2] = obj_image->image.width / 2;
@@ -1885,10 +1885,10 @@ gen7_pp_set_media_rw_message_surface(VADriverContextP 
ctx, struct i965_post_proc
 dri_bo *bo;
 int fourcc = pp_get_surface_fourcc(ctx, surface);
 const int U = (fourcc == VA_FOURCC('Y', 'V', '1', '2') ||
-   fourcc == VA_FOURCC('V', 'V', '1', '6') ||
+   fourcc == VA_FOURCC('Y', 'V', '1', '6') ||
fourcc == VA_FOURCC('I', 'M', 'C', '1')) ? 2 : 1;
 const int V = (fourcc == VA_FOURCC('Y', 'V', '1', '2') ||
-   fourcc == VA_FOURCC('V', 'V', '1', '6') ||
+   fourcc == VA_FOURCC('Y', 'V', '1', '6') ||
fourcc == VA_FOURCC('I', 'M', 'C', '1')) ? 1 : 2;
 int interleaved_uv = fourcc == VA_FOURCC('N', 'V', '1', '2');
 int packed_yuv = (fourcc == VA_FOURCC('Y', 'U', 'Y', '2') || fourcc == 
VA_FOURCC('U', 'Y', 'V', 'Y'));
@@ -1954,7 +1954,7 @@ gen7_pp_set_media_rw_message_surface(VADriverContextP 
ctx, struct i965_post_proc
 height[2] = obj_image->image.height / 2;
 pitch[2] = obj_image->image.pitches[V];
 offset[2] = obj_image->image.offsets[V];
-if (fourcc == VA_FOURCC('V', 'V', '1', '6')) {
+if (fourcc == VA_FOURCC('Y', 'V', '1', '6')) {
 width[1] = obj_image->image.width / 2;
 height[1] = obj_image->image.height;
 width[2] = obj_image->image.width / 2;
-- 
1.8.2-rc2

___
Libva mailing list
Libva@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libva


Re: [Libva] [PATCH Libva-intel-driver 4/4] Add the csc conversion from YV16 to NV12

2014-03-18 Thread Zhao Yakui
On Mon, 2014-03-17 at 23:06 -0600, Gwenole Beauchesne wrote:
> Hi,
> 
> 2014-03-18 1:44 GMT+01:00 Wu, Zhiwen :
> > Looks good to me, tested on baytraili.
> 
> Interesting, how? The patch doesn't do what it tells to do in several places:
> 
> >>-Original Message-
> >>From: Libva [mailto:libva-boun...@lists.freedesktop.org] On Behalf Of Zhao
> >>Yakui
> >>Sent: Monday, March 17, 2014 5:08 PM
> >>To: libva@lists.freedesktop.org
> >>Subject: [Libva] [PATCH Libva-intel-driver 4/4] Add the csc conversion from 
> >>YV16
> >>to NV12
> >>
> >>V1->V2: Follow Zhiwen's comment to add the missing code when the source
> >>V1->is
> >>YV16 image instead of YV16 surface.
> >>
> >>Reviewed-by: Wind Yuan 
> >>Tested-by:  Wind Yuan 
> >>Signed-off-by: Zhao Yakui 
> >>---
> >> src/gen8_post_processing.c |  8   src/i965_post_processing.c | 23
> >>+--
> >> 2 files changed, 29 insertions(+), 2 deletions(-)
> >>
> >>diff --git a/src/gen8_post_processing.c b/src/gen8_post_processing.c index
> >>f34392c..a5b3b90 100644
> >>--- a/src/gen8_post_processing.c
> >>+++ b/src/gen8_post_processing.c
> >>@@ -496,8 +496,10 @@
> >>gen8_pp_set_media_rw_message_surface(VADriverContextP ctx, struct
> >>i965_post_proc
> >> dri_bo *bo;
> >> int fourcc = pp_get_surface_fourcc(ctx, surface);
> >> const int U = (fourcc == VA_FOURCC('Y', 'V', '1', '2') ||
> >>+   fourcc == VA_FOURCC('Y', 'V', '1', '6') ||
> >>fourcc == VA_FOURCC('I', 'M', 'C', '1')) ? 2 : 1;
> >> const int V = (fourcc == VA_FOURCC('Y', 'V', '1', '2') ||
> >>+   fourcc == VA_FOURCC('Y', 'V', '1', '6') ||
> >>fourcc == VA_FOURCC('I', 'M', 'C', '1')) ? 1 : 2;
> >> int interleaved_uv = fourcc == VA_FOURCC('N', 'V', '1', '2');
> >> int packed_yuv = (fourcc == VA_FOURCC('Y', 'U', 'Y', '2') || fourcc ==
> >>VA_FOURCC('U', 'Y', 'V', 'Y')); @@ -564,6 +566,12 @@
> >>gen8_pp_set_media_rw_message_surface(VADriverContextP ctx, struct
> >>i965_post_proc
> >> height[2] = obj_image->image.height / 2;
> >> pitch[2] = obj_image->image.pitches[V];
> >> offset[2] = obj_image->image.offsets[V];
> >>+if (fourcc == VA_FOURCC('V', 'V', '1', '6')) {
> >>+width[1] = obj_image->image.width / 2;
> >>+height[1] = obj_image->image.height;
> >>+width[2] = obj_image->image.width / 2;
> >>+height[2] = obj_image->image.height;
> >>+}
> >> }
> >> }
> 
> This is wrong, why VV16? Besides, Haihao mentioned to use a proper
> constant. You would have avoided this error.

Hi, Gwenole
Thanks for your nice review. 
Sorry that I make such mistake during rebasing patch on the latest
branch. I will fix it ASAP.

Thanks
Yakui

> 
> >>diff --git a/src/i965_post_processing.c b/src/i965_post_processing.c index
> >>936c1a6..3242257 100755
> >>--- a/src/i965_post_processing.c
> >>+++ b/src/i965_post_processing.c
> >>@@ -1764,8 +1764,12 @@
> >>pp_set_media_rw_message_surface(VADriverContextP ctx, struct
> >>i965_post_processin
> >> dri_bo *bo;
> >> int fourcc = pp_get_surface_fourcc(ctx, surface);
> >> const int Y = 0;
> >>-const int U = fourcc == VA_FOURCC('Y', 'V', '1', '2') ? 2 : 1;
> >>-const int V = fourcc == VA_FOURCC('Y', 'V', '1', '2') ? 1 : 2;
> >>+const int U = ((fourcc == VA_FOURCC('Y', 'V', '1', '2')) ||
> >>+   (fourcc == VA_FOURCC('Y', 'V', '1', '6')))
> >>+   ? 2 : 1;
> >>+const int V = ((fourcc == VA_FOURCC('Y', 'V', '1', '2')) ||
> >>+   (fourcc == VA_FOURCC('Y', 'V', '1', '6')))
> >>+   ? 1 : 2;
> >> const int UV = 1;
> >> int interleaved_uv = fourcc == VA_FOURCC('N', 'V', '1', '2');
> >> int packed_yuv = (fourcc == VA_FOURCC('Y', 'U', 'Y', '2') || fourcc ==
> >>VA_FOURCC('U', 'Y', 'V', 'Y')); @@ -1832,6 +1836,12 @@
> >>pp_set_media_rw_message_surface(VADriverContextP ctx, struct
> >>i965_post_processin
> >> height[2] = obj_image->image.height / 2;
> >> pitch[2] = obj_image->image.pitches[2];
> >> offset[2] = obj_image->image.offsets[2];
> >>+if (fourcc == VA_FOURCC('V', 'V', '1', '6')) {
> >>+width[1] = obj_image->image.width / 2;
> >>+height[1] = obj_image->image.height;
> >>+width[2] = obj_image->image.width / 2;
> >>+height[2] = obj_image->image.height;
> >>+}
> >> }
> >> }
> 
> Same here.
> 
> >>@@ -1875,8 +1885,10 @@
> >>gen7_pp_set_media_rw_message_surface(VADriverContextP ctx, struct
> >>i965_post_proc
> >> dri_bo *bo;
> >> int fourcc = pp_get_surface_fourcc(ctx, surface);
> >> const int U = (fourcc == VA_FOURCC('Y', 'V', '1', '2') ||
> >>+   fourcc == VA_FOURCC('V', 'V', '1', '6') ||
> >>fourcc == VA_FOURCC('I', 'M', 'C', '1')) ? 2 : 1;
> >> cons