diff options
author | Rainer Hochecker <[email protected]> | 2017-01-05 16:58:56 +0100 |
---|---|---|
committer | Ben Widawsky <[email protected]> | 2017-01-23 08:47:15 -0800 |
commit | 09b140abb532dede5de6b03b1cc3c03852c1c9e9 (patch) | |
tree | 8c0aa7210fba34a1a3a07581364dd8ef54df6dd0 /src/mesa/drivers/dri | |
parent | 1338d912f52b69f76ef75d1ad313893db77d4da8 (diff) |
dri: allow 16bit R/GR images to be exported via drm buffers
This allows eglCreateImageKHR to access P010 surfaces created by vaapi
Signed-off-by: Rainer Hochecker <[email protected]>
Acked-by: Ben Widawky <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri')
-rw-r--r-- | src/mesa/drivers/dri/common/dri_util.c | 4 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/intel_screen.c | 6 |
2 files changed, 10 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c index 209a42ab243..f92eee9081d 100644 --- a/src/mesa/drivers/dri/common/dri_util.c +++ b/src/mesa/drivers/dri/common/dri_util.c @@ -881,8 +881,12 @@ driImageFormatToGLFormat(uint32_t image_format) return MESA_FORMAT_R8G8B8X8_UNORM; case __DRI_IMAGE_FORMAT_R8: return MESA_FORMAT_R_UNORM8; + case __DRI_IMAGE_FORMAT_R16: + return MESA_FORMAT_R_UNORM16; case __DRI_IMAGE_FORMAT_GR88: return MESA_FORMAT_R8G8_UNORM; + case __DRI_IMAGE_FORMAT_GR1616: + return MESA_FORMAT_R16G16_UNORM; case __DRI_IMAGE_FORMAT_SARGB8: return MESA_FORMAT_B8G8R8A8_SRGB; case __DRI_IMAGE_FORMAT_NONE: diff --git a/src/mesa/drivers/dri/i965/intel_screen.c b/src/mesa/drivers/dri/i965/intel_screen.c index 6ae211da3a1..5f800008c17 100644 --- a/src/mesa/drivers/dri/i965/intel_screen.c +++ b/src/mesa/drivers/dri/i965/intel_screen.c @@ -239,9 +239,15 @@ static struct intel_image_format intel_image_formats[] = { { __DRI_IMAGE_FOURCC_R8, __DRI_IMAGE_COMPONENTS_R, 1, { { 0, 0, 0, __DRI_IMAGE_FORMAT_R8, 1 }, } }, + { __DRI_IMAGE_FOURCC_R16, __DRI_IMAGE_COMPONENTS_R, 1, + { { 0, 0, 0, __DRI_IMAGE_FORMAT_R16, 1 }, } }, + { __DRI_IMAGE_FOURCC_GR88, __DRI_IMAGE_COMPONENTS_RG, 1, { { 0, 0, 0, __DRI_IMAGE_FORMAT_GR88, 2 }, } }, + { __DRI_IMAGE_FOURCC_GR1616, __DRI_IMAGE_COMPONENTS_RG, 1, + { { 0, 0, 0, __DRI_IMAGE_FORMAT_GR1616, 2 }, } }, + { __DRI_IMAGE_FOURCC_YUV410, __DRI_IMAGE_COMPONENTS_Y_U_V, 3, { { 0, 0, 0, __DRI_IMAGE_FORMAT_R8, 1 }, { 1, 2, 2, __DRI_IMAGE_FORMAT_R8, 1 }, |