summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/dri
diff options
context:
space:
mode:
authorMario Kleiner <[email protected]>2017-12-15 23:05:05 +0100
committerMarek Olšák <[email protected]>2018-01-03 22:57:57 +0100
commit893723a64b36dae10df4a5e61f87f994c869e428 (patch)
treeb99eb7a83c4dfb9ffb534d633cd0ccbe3a68e224 /src/gallium/state_trackers/dri
parentf52aa596d4993c102fa0f9583cd9ba5487d0456f (diff)
st/dri2: Add buffer handling 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')
-rw-r--r--src/gallium/state_trackers/dri/dri2.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/gallium/state_trackers/dri/dri2.c b/src/gallium/state_trackers/dri/dri2.c
index c0f0921337b..d0731419522 100644
--- a/src/gallium/state_trackers/dri/dri2.c
+++ b/src/gallium/state_trackers/dri/dri2.c
@@ -405,10 +405,14 @@ dri2_drawable_get_buffers(struct dri_drawable *drawable,
* may occur as the stvis->color_format.
*/
switch(format) {
+ case PIPE_FORMAT_B10G10R10A2_UNORM:
case PIPE_FORMAT_BGRA8888_UNORM:
case PIPE_FORMAT_RGBA8888_UNORM:
depth = 32;
break;
+ case PIPE_FORMAT_B10G10R10X2_UNORM:
+ depth = 30;
+ break;
case PIPE_FORMAT_BGRX8888_UNORM:
case PIPE_FORMAT_RGBX8888_UNORM:
depth = 24;
@@ -492,6 +496,12 @@ dri_image_drawable_get_buffers(struct dri_drawable *drawable,
case PIPE_FORMAT_RGBA8888_UNORM:
image_format = __DRI_IMAGE_FORMAT_ABGR8888;
break;
+ case PIPE_FORMAT_B10G10R10X2_UNORM:
+ image_format = __DRI_IMAGE_FORMAT_XRGB2101010;
+ break;
+ case PIPE_FORMAT_B10G10R10A2_UNORM:
+ image_format = __DRI_IMAGE_FORMAT_ARGB2101010;
+ break;
default:
image_format = __DRI_IMAGE_FORMAT_NONE;
break;
@@ -538,6 +548,9 @@ dri2_allocate_buffer(__DRIscreen *sPriv,
case 32:
pf = PIPE_FORMAT_BGRA8888_UNORM;
break;
+ case 30:
+ pf = PIPE_FORMAT_B10G10R10X2_UNORM;
+ break;
case 24:
pf = PIPE_FORMAT_BGRX8888_UNORM;
break;