[mutter/cherry-pick-922878ac] wayland/dma-buf: Add support for BGR_8888 formats




commit 1875403107303796b4ea511e8c10b8ad7bf66693
Author: Erfan Abdi <erfangplus gmail com>
Date:   Sun Sep 12 11:02:00 2021 +0430

    wayland/dma-buf: Add support for BGR_8888 formats
    
    Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1999>
    
    
    (cherry picked from commit 922878acc63a41b301f5958a1ddbed817d9b639b)

 src/wayland/meta-wayland-dma-buf.c | 8 ++++++++
 1 file changed, 8 insertions(+)
---
diff --git a/src/wayland/meta-wayland-dma-buf.c b/src/wayland/meta-wayland-dma-buf.c
index ce89837411..230b13bc8a 100644
--- a/src/wayland/meta-wayland-dma-buf.c
+++ b/src/wayland/meta-wayland-dma-buf.c
@@ -115,9 +115,15 @@ meta_wayland_dma_buf_realize_texture (MetaWaylandBuffer  *buffer,
     case DRM_FORMAT_XRGB8888:
       cogl_format = COGL_PIXEL_FORMAT_RGB_888;
       break;
+    case DRM_FORMAT_XBGR8888:
+      cogl_format = COGL_PIXEL_FORMAT_BGR_888;
+      break;
     case DRM_FORMAT_ARGB8888:
       cogl_format = COGL_PIXEL_FORMAT_ARGB_8888_PRE;
       break;
+    case DRM_FORMAT_ABGR8888:
+      cogl_format = COGL_PIXEL_FORMAT_ABGR_8888_PRE;
+      break;
     case DRM_FORMAT_XRGB2101010:
       cogl_format = COGL_PIXEL_FORMAT_ARGB_2101010;
       break;
@@ -702,7 +708,9 @@ dma_buf_bind (struct wl_client *client,
   wl_resource_set_implementation (resource, &dma_buf_implementation,
                                   compositor, NULL);
   send_modifiers (resource, DRM_FORMAT_ARGB8888);
+  send_modifiers (resource, DRM_FORMAT_ABGR8888);
   send_modifiers (resource, DRM_FORMAT_XRGB8888);
+  send_modifiers (resource, DRM_FORMAT_XBGR8888);
   send_modifiers (resource, DRM_FORMAT_ARGB2101010);
   send_modifiers (resource, DRM_FORMAT_ABGR2101010);
   send_modifiers (resource, DRM_FORMAT_XRGB2101010);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]