From 63a6ead7d9449c10fdaeebcc3e13282dc70c1e23 Mon Sep 17 00:00:00 2001 From: Pekka Paalanen Date: Tue, 16 Oct 2018 14:45:14 +0300 Subject: [PATCH] wayland-dma-buf: doc the odd format mapping This format mapping looks wrong at first hand, so explain why it is like it is. See also https://gitlab.gnome.org/GNOME/mutter/issues/323 --- 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 5f168f674..347da2484 100644 --- a/src/wayland/meta-wayland-dma-buf.c +++ b/src/wayland/meta-wayland-dma-buf.c @@ -3,6 +3,7 @@ /* * Copyright (C) 2016 Red Hat Inc. * Copyright (C) 2017 Intel Corporation + * Copyright (C) 2018 DisplayLink (UK) Ltd. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -85,6 +86,13 @@ meta_wayland_dma_buf_buffer_attach (MetaWaylandBuffer *buffer, switch (dma_buf->drm_format) { + /* + * NOTE: The cogl_format here is only used for texture color channel + * swizzling as compared to COGL_PIXEL_FORMAT_ARGB. It is *not* used + * for accessing the buffer memory. EGL will access the buffer + * memory according to the DRM fourcc code. Cogl will not mmap + * and access the buffer memory at all. + */ case DRM_FORMAT_XRGB8888: cogl_format = COGL_PIXEL_FORMAT_RGB_888; break;