diff options
author | Mario Kleiner <[email protected]> | 2017-12-15 23:05:04 +0100 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2018-01-03 22:57:57 +0100 |
commit | f52aa596d4993c102fa0f9583cd9ba5487d0456f (patch) | |
tree | b0e0738d3de726a13c16d29f5d2b33922f1143e0 /src/gallium/state_trackers/dri/dri2.c | |
parent | 6e665d07eb943ffcab50c711f4d81285c9f244a7 (diff) |
st/dri2: Add format translations for BGR[A/X]1010102 formats.
Signed-off-by: Mario Kleiner <[email protected]>
Reviewed-by: Marek Olšák <[email protected]>
Signed-off-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/dri/dri2.c')
-rw-r--r-- | src/gallium/state_trackers/dri/dri2.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/gallium/state_trackers/dri/dri2.c b/src/gallium/state_trackers/dri/dri2.c index 3388b17da53..c0f0921337b 100644 --- a/src/gallium/state_trackers/dri/dri2.c +++ b/src/gallium/state_trackers/dri/dri2.c @@ -55,6 +55,8 @@ #endif static const int fourcc_formats[] = { + __DRI_IMAGE_FOURCC_ARGB2101010, + __DRI_IMAGE_FOURCC_XRGB2101010, __DRI_IMAGE_FOURCC_ARGB8888, __DRI_IMAGE_FOURCC_ABGR8888, __DRI_IMAGE_FOURCC_SARGB8888, @@ -105,6 +107,14 @@ static int convert_fourcc(int format, int *dri_components_p) format = __DRI_IMAGE_FORMAT_XBGR8888; dri_components = __DRI_IMAGE_COMPONENTS_RGB; break; + case __DRI_IMAGE_FOURCC_ARGB2101010: + format = __DRI_IMAGE_FORMAT_ARGB2101010; + dri_components = __DRI_IMAGE_COMPONENTS_RGBA; + break; + case __DRI_IMAGE_FOURCC_XRGB2101010: + format = __DRI_IMAGE_FORMAT_XRGB2101010; + dri_components = __DRI_IMAGE_COMPONENTS_RGB; + break; case __DRI_IMAGE_FOURCC_R8: format = __DRI_IMAGE_FORMAT_R8; dri_components = __DRI_IMAGE_COMPONENTS_R; @@ -170,6 +180,12 @@ static int convert_to_fourcc(int format) case __DRI_IMAGE_FORMAT_XBGR8888: format = __DRI_IMAGE_FOURCC_XBGR8888; break; + case __DRI_IMAGE_FORMAT_ARGB2101010: + format = __DRI_IMAGE_FOURCC_ARGB2101010; + break; + case __DRI_IMAGE_FORMAT_XRGB2101010: + format = __DRI_IMAGE_FOURCC_XRGB2101010; + break; case __DRI_IMAGE_FORMAT_R8: format = __DRI_IMAGE_FOURCC_R8; break; @@ -202,6 +218,12 @@ static enum pipe_format dri2_format_to_pipe_format (int format) case __DRI_IMAGE_FORMAT_ABGR8888: pf = PIPE_FORMAT_RGBA8888_UNORM; break; + case __DRI_IMAGE_FORMAT_XRGB2101010: + pf = PIPE_FORMAT_B10G10R10X2_UNORM; + break; + case __DRI_IMAGE_FORMAT_ARGB2101010: + pf = PIPE_FORMAT_B10G10R10A2_UNORM; + break; case __DRI_IMAGE_FORMAT_R8: pf = PIPE_FORMAT_R8_UNORM; break; @@ -260,6 +282,12 @@ static enum pipe_format fourcc_to_pipe_format(int fourcc) case __DRI_IMAGE_FOURCC_XBGR8888: pf = PIPE_FORMAT_RGBX8888_UNORM; break; + case __DRI_IMAGE_FOURCC_ARGB2101010: + pf = PIPE_FORMAT_B10G10R10A2_UNORM; + break; + case __DRI_IMAGE_FOURCC_XRGB2101010: + pf = PIPE_FORMAT_B10G10R10X2_UNORM; + break; case __DRI_IMAGE_FOURCC_NV12: pf = PIPE_FORMAT_NV12; |