[Mesa-dev] [PATCH 18/22] st/dri2: Add buffer handling for BGR[A/X]1010102 formats.

Mario Kleiner mario.kleiner.de at gmail.com
Fri Dec 15 22:05:05 UTC 2017


Signed-off-by: Mario Kleiner <mario.kleiner.de at gmail.com>
Reviewed-by: Marek Olšák <marek.olsak at amd.com>
---
 src/gallium/state_trackers/dri/dri2.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/src/gallium/state_trackers/dri/dri2.c b/src/gallium/state_trackers/dri/dri2.c
index f7fd08d..e3b9377 100644
--- a/src/gallium/state_trackers/dri/dri2.c
+++ b/src/gallium/state_trackers/dri/dri2.c
@@ -398,10 +398,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;
@@ -485,6 +489,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;
@@ -531,6 +541,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;
-- 
2.7.4



More information about the mesa-dev mailing list