egl/android: Enable HAL_PIXEL_FORMAT_RGBA_1010102 format
authorrenchenglei <chenglei.ren@intel.com>
Thu, 12 Sep 2019 05:45:31 +0000 (13:45 +0800)
committerTapani Pälli <tapani.palli@intel.com>
Thu, 12 Sep 2019 05:59:56 +0000 (05:59 +0000)
The patch adds support for HAL_PIXEL_FORMAT_RGBA_1010102 on
Android platform.

Fixes android.media.cts.DecoderTest#testVp9HdrStaticMetadata
which failed in egl due to "Unsupported native buffer format 0x2b"
on Android.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Signed-off-by: Chenglei Ren <chenglei.ren@intel.com>
src/egl/drivers/dri2/platform_android.c

index b80c075801a1b7ce0be507d58bd0c45ec9268ef0..3eb588f406163c4f84a57251874d3211322acffc 100644 (file)
@@ -120,6 +120,7 @@ get_format_bpp(int native)
        */
    case HAL_PIXEL_FORMAT_RGBX_8888:
    case HAL_PIXEL_FORMAT_BGRA_8888:
+   case HAL_PIXEL_FORMAT_RGBA_1010102:
       bpp = 4;
       break;
    case HAL_PIXEL_FORMAT_RGB_565:
@@ -147,6 +148,7 @@ static int get_fourcc(int native)
        */
    case HAL_PIXEL_FORMAT_RGBX_8888: return DRM_FORMAT_XBGR8888;
    case HAL_PIXEL_FORMAT_RGBA_FP16: return DRM_FORMAT_ABGR16161616F;
+   case HAL_PIXEL_FORMAT_RGBA_1010102: return DRM_FORMAT_ABGR2101010;
    default:
       _eglLog(_EGL_WARNING, "unsupported native buffer format 0x%x", native);
    }
@@ -166,6 +168,7 @@ static int get_format(int format)
        */
    case HAL_PIXEL_FORMAT_RGBX_8888: return __DRI_IMAGE_FORMAT_XBGR8888;
    case HAL_PIXEL_FORMAT_RGBA_FP16: return __DRI_IMAGE_FORMAT_ABGR16161616F;
+   case HAL_PIXEL_FORMAT_RGBA_1010102: return __DRI_IMAGE_FORMAT_ABGR2101010;
    default:
       _eglLog(_EGL_WARNING, "unsupported native buffer format 0x%x", format);
    }