st/va: add support YUY2
authorPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Thu, 13 Feb 2020 18:24:43 +0000 (19:24 +0100)
committerPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Thu, 27 Feb 2020 09:01:35 +0000 (10:01 +0100)
YUY2 is a duplicate of YUYV and is used by gstreamer for 4:2:2.

Acked-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3738>

src/gallium/state_trackers/va/image.c
src/gallium/state_trackers/va/va_private.h

index 89dd5baab075497a5c83db87eeffdf3b0f631d9c..3a6a7e83d14623788ccb493458588119aed66436 100644 (file)
@@ -46,6 +46,7 @@ static const VAImageFormat formats[] =
    {VA_FOURCC('I','4','2','0')},
    {VA_FOURCC('Y','V','1','2')},
    {VA_FOURCC('Y','U','Y','V')},
+   {VA_FOURCC('Y','U','Y','2')},
    {VA_FOURCC('U','Y','V','Y')},
    {.fourcc = VA_FOURCC('B','G','R','A'), .byte_order = VA_LSB_FIRST, 32, 32,
     0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000},
@@ -160,6 +161,7 @@ vlVaCreateImage(VADriverContextP ctx, VAImageFormat *format, int width, int heig
 
    case VA_FOURCC('U','Y','V','Y'):
    case VA_FOURCC('Y','U','Y','V'):
+   case VA_FOURCC('Y','U','Y','2'):
       img->num_planes = 1;
       img->pitches[0] = w * 2;
       img->offsets[0] = 0;
index aa3b74c0b6eac72658093c701a8f29cae680d319..e3a9790103b965b1b73e412a5b4ab02ac57b063d 100644 (file)
@@ -49,7 +49,7 @@
 #define VL_VA_DRIVER(ctx) ((vlVaDriver *)ctx->pDriverData)
 #define VL_VA_PSCREEN(ctx) (VL_VA_DRIVER(ctx)->vscreen->pscreen)
 
-#define VL_VA_MAX_IMAGE_FORMATS 11
+#define VL_VA_MAX_IMAGE_FORMATS 12
 #define VL_VA_ENC_GOP_COEFF 16
 
 #define UINT_TO_PTR(x) ((void*)(uintptr_t)(x))
@@ -94,6 +94,7 @@ VaFourccToPipeFormat(unsigned format)
    case VA_FOURCC('Y','V','1','2'):
       return PIPE_FORMAT_YV12;
    case VA_FOURCC('Y','U','Y','V'):
+   case VA_FOURCC('Y','U','Y','2'):
       return PIPE_FORMAT_YUYV;
    case VA_FOURCC('U','Y','V','Y'):
       return PIPE_FORMAT_UYVY;