<div dir="ltr">Hi Julien,<div class="gmail_extra"><br><div class="gmail_quote">On Thu, Oct 29, 2015 at 10:34 AM, Julien Isorce <span dir="ltr"><<a href="mailto:julien.isorce@gmail.com" target="_blank">julien.isorce@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><span class="">On 29 October 2015 at 17:22, Sean V Kelley <span dir="ltr"><<a href="mailto:sean.v.kelley@intel.com" target="_blank">sean.v.kelley@intel.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><span>On Thu, Oct 29, 2015 at 9:53 AM, Julien Isorce <span dir="ltr"><<a href="mailto:j.isorce@samsung.com" target="_blank">j.isorce@samsung.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Also add RGBA, RGBX and BGRX.<br>
Also extend ChromaToPipe and implement PipeToYCbCr.<br>
<br>
Note that gstreamer-vaapi check all the VAImageFormat fields.<br>
<br>
Signed-off-by: Julien Isorce <<a href="mailto:j.isorce@samsung.com" target="_blank">j.isorce@samsung.com</a>><br></blockquote><div><br></div></span><div>Hi Julien,</div></div></div></div></blockquote><div><br></div></span><div>Hi Sean,<br> <br></div><span class=""><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><br></div><div>Am I missing something here in terms of these patches? I see gallium, state-tracker, etc. I'm looking at Mesa patches right?</div></div></div></div></blockquote><div><br></div></span><div>Yes these are patches to extend existing vaapi backend provided by mesa. Maybe at some point the efforts should be joined with <a href="http://cgit.freedesktop.org/vaapi/intel-driver/" target="_blank">http://cgit.freedesktop.org/vaapi/intel-driver/</a>. I mean, it would be great if vaapi-intel-driver maintainers could start improving mesa-vaapi instead. To gradually move from this specific backend to the generic one in mesa. It is generic in a sense it does not use libdrm directly but a common wrapper in between. So the same vaapi backend in mesa is working for all gallium drivers.<br><br>If this was your question behind :)<br></div></div></div></div></blockquote><div><br></div><div><br></div><div>Yes, that is great to see you making contributions here. We will take a look. Thanks by the way for copying this list. I'm not frequently monitoring the Mesa list.</div><div><br></div><div>Cheers,</div><div><br></div><div>Sean</div><div><br></div><div><br></div><div><br></div><div> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><br></div><div>Cheers<span class="HOEnZb"><font color="#888888"><br></font></span></div><span class="HOEnZb"><font color="#888888"><div>Julien<br></div></font></span><div><div class="h5"><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><br></div><div>Thanks,</div><div><br></div><div>Sean</div><div><div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
---<br>
src/gallium/state_trackers/va/image.c | 18 +++++++++++---<br>
src/gallium/state_trackers/va/va_private.h | 38 +++++++++++++++++++++++++++++-<br>
2 files changed, 52 insertions(+), 4 deletions(-)<br>
<br>
diff --git a/src/gallium/state_trackers/va/image.c b/src/gallium/state_trackers/va/image.c<br>
index b37a971..84d94c8 100644<br>
--- a/src/gallium/state_trackers/va/image.c<br>
+++ b/src/gallium/state_trackers/va/image.c<br>
@@ -37,14 +37,21 @@<br>
<br>
#include "va_private.h"<br>
<br>
-static const VAImageFormat formats[VL_VA_MAX_IMAGE_FORMATS] =<br>
+static const VAImageFormat formats[] =<br>
{<br>
{VA_FOURCC('N','V','1','2')},<br>
{VA_FOURCC('I','4','2','0')},<br>
{VA_FOURCC('Y','V','1','2')},<br>
{VA_FOURCC('Y','U','Y','V')},<br>
{VA_FOURCC('U','Y','V','Y')},<br>
- {VA_FOURCC('B','G','R','A')}<br>
+ {.fourcc = VA_FOURCC('B','G','R','A'), .byte_order = VA_LSB_FIRST, 32, 32,<br>
+ 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000},<br>
+ {.fourcc = VA_FOURCC('R','G','B','A'), .byte_order = VA_LSB_FIRST, 32, 32,<br>
+ 0x000000ff, 0x0000ff00, 0x00ff0000, 0xff000000},<br>
+ {.fourcc = VA_FOURCC('B','G','R','X'), .byte_order = VA_LSB_FIRST, 32, 24,<br>
+ 0x00ff0000, 0x0000ff00, 0x000000ff, 0x00000000},<br>
+ {.fourcc = VA_FOURCC('R','G','B','X'), .byte_order = VA_LSB_FIRST, 32, 24,<br>
+ 0x000000ff, 0x0000ff00, 0x00ff0000, 0x00000000}<br>
};<br>
<br>
static void<br>
@@ -72,6 +79,8 @@ vlVaQueryImageFormats(VADriverContextP ctx, VAImageFormat *format_list, int *num<br>
enum pipe_format format;<br>
int i;<br>
<br>
+ STATIC_ASSERT(ARRAY_SIZE(formats) == VL_VA_MAX_IMAGE_FORMATS);<br>
+<br>
if (!ctx)<br>
return VA_STATUS_ERROR_INVALID_CONTEXT;<br>
<br>
@@ -80,7 +89,7 @@ vlVaQueryImageFormats(VADriverContextP ctx, VAImageFormat *format_list, int *num<br>
<br>
*num_formats = 0;<br>
pscreen = VL_VA_PSCREEN(ctx);<br>
- for (i = 0; i < VL_VA_MAX_IMAGE_FORMATS; ++i) {<br>
+ for (i = 0; i < ARRAY_SIZE(formats); ++i) {<br>
format = YCbCrToPipe(formats[i].fourcc);<br>
if (pscreen->is_video_format_supported(pscreen, format,<br>
PIPE_VIDEO_PROFILE_UNKNOWN,<br>
@@ -149,6 +158,9 @@ vlVaCreateImage(VADriverContextP ctx, VAImageFormat *format, int width, int heig<br>
break;<br>
<br>
case VA_FOURCC('B','G','R','A'):<br>
+ case VA_FOURCC('R','G','B','A'):<br>
+ case VA_FOURCC('B','G','R','X'):<br>
+ case VA_FOURCC('R','G','B','X'):<br>
img->num_planes = 1;<br>
img->pitches[0] = w * 4;<br>
img->offsets[0] = 0;<br>
diff --git a/src/gallium/state_trackers/va/va_private.h b/src/gallium/state_trackers/va/va_private.h<br>
index 93af1be..6a0bd41 100644<br>
--- a/src/gallium/state_trackers/va/va_private.h<br>
+++ b/src/gallium/state_trackers/va/va_private.h<br>
@@ -46,12 +46,14 @@<br>
#define VL_VA_DRIVER(ctx) ((vlVaDriver *)ctx->pDriverData)<br>
#define VL_VA_PSCREEN(ctx) (VL_VA_DRIVER(ctx)->vscreen->pscreen)<br>
<br>
-#define VL_VA_MAX_IMAGE_FORMATS 6<br>
+#define VL_VA_MAX_IMAGE_FORMATS 9<br>
<br>
static inline enum pipe_video_chroma_format<br>
ChromaToPipe(int format)<br>
{<br>
switch (format) {<br>
+ case VA_RT_FORMAT_YUV400:<br>
+ return PIPE_VIDEO_CHROMA_FORMAT_400;<br>
case VA_RT_FORMAT_YUV420:<br>
return PIPE_VIDEO_CHROMA_FORMAT_420;<br>
case VA_RT_FORMAT_YUV422:<br>
@@ -80,12 +82,46 @@ YCbCrToPipe(unsigned format)<br>
return PIPE_FORMAT_UYVY;<br>
case VA_FOURCC('B','G','R','A'):<br>
return PIPE_FORMAT_B8G8R8A8_UNORM;<br>
+ case VA_FOURCC('R','G','B','A'):<br>
+ return PIPE_FORMAT_R8G8B8A8_UNORM;<br>
+ case VA_FOURCC('B','G','R','X'):<br>
+ return PIPE_FORMAT_B8G8R8X8_UNORM;<br>
+ case VA_FOURCC('R','G','B','X'):<br>
+ return PIPE_FORMAT_R8G8B8X8_UNORM;<br>
default:<br>
assert(0);<br>
return PIPE_FORMAT_NONE;<br>
}<br>
}<br>
<br>
+static inline unsigned<br>
+PipeToYCbCr(enum pipe_format p_format)<br>
+{<br>
+ switch (p_format) {<br>
+ case PIPE_FORMAT_NV12:<br>
+ return VA_FOURCC('N','V','1','2');<br>
+ case PIPE_FORMAT_IYUV:<br>
+ return VA_FOURCC('I','4','2','0');<br>
+ case PIPE_FORMAT_YV12:<br>
+ return VA_FOURCC('Y','V','1','2');<br>
+ case PIPE_FORMAT_UYVY:<br>
+ return VA_FOURCC('U','Y','V','Y');<br>
+ case PIPE_FORMAT_YUYV:<br>
+ return VA_FOURCC('Y','U','Y','V');<br>
+ case PIPE_FORMAT_B8G8R8A8_UNORM:<br>
+ return VA_FOURCC('B','G','R','A');<br>
+ case PIPE_FORMAT_R8G8B8A8_UNORM:<br>
+ return VA_FOURCC('R','G','B','A');<br>
+ case PIPE_FORMAT_B8G8R8X8_UNORM:<br>
+ return VA_FOURCC('B','G','R','X');<br>
+ case PIPE_FORMAT_R8G8B8X8_UNORM:<br>
+ return VA_FOURCC('R','G','B','X');<br>
+ default:<br>
+ assert(0);<br>
+ return -1;<br>
+ }<br>
+}<br>
+<br>
static inline VAProfile<br>
PipeToProfile(enum pipe_video_profile profile)<br>
{<br>
<span><font color="#888888">--<br>
1.9.1<br>
<br>
_______________________________________________<br>
Libva mailing list<br>
<a href="mailto:Libva@lists.freedesktop.org" target="_blank">Libva@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/libva" rel="noreferrer" target="_blank">http://lists.freedesktop.org/mailman/listinfo/libva</a><br>
</font></span></blockquote></div></div></div><span><font color="#888888"><br><br clear="all"><div><br></div>-- <br><div>Sean V. Kelley <<a href="mailto:sean.v.kelley@intel.com" target="_blank">sean.v.kelley@intel.com</a>><br>Open Source Technology Center / SSG<br>Intel Corp.<br></div>
</font></span></div></div>
<br>_______________________________________________<br>
Libva mailing list<br>
<a href="mailto:Libva@lists.freedesktop.org" target="_blank">Libva@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/libva" rel="noreferrer" target="_blank">http://lists.freedesktop.org/mailman/listinfo/libva</a><br>
<br></blockquote></div></div></div><br></div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Sean V. Kelley <<a href="mailto:sean.v.kelley@intel.com" target="_blank">sean.v.kelley@intel.com</a>><br>Open Source Technology Center / SSG<br>Intel Corp.<br></div>
</div></div>