1
0
Fork 0

renderer/native: Try to convert and use Cogl format

Convert the CoglPixelFormat format to a DRM format, and try
and use it to create a GBM buffer.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3175>
This commit is contained in:
Georges Basile Stavracas Neto 2023-08-11 16:15:59 -03:00
parent b814aff600
commit b391ded7bf

View file

@ -955,7 +955,7 @@ meta_renderer_native_create_dma_buf (CoglRenderer *cogl_renderer,
CoglFramebuffer *dmabuf_fb;
CoglDmaBufHandle *dmabuf_handle;
if (format != COGL_PIXEL_FORMAT_BGRX_8888)
if (!meta_drm_format_from_cogl_pixel_format (format, &drm_format))
{
g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
"Native renderer doesn't support creating DMA buffer with format %s",
@ -967,7 +967,7 @@ meta_renderer_native_create_dma_buf (CoglRenderer *cogl_renderer,
flags = META_DRM_BUFFER_FLAG_NONE;
buffer = meta_render_device_allocate_dma_buf (render_device,
width, height,
DRM_FORMAT_XRGB8888,
drm_format,
flags,
error);
if (!buffer)
@ -981,7 +981,6 @@ meta_renderer_native_create_dma_buf (CoglRenderer *cogl_renderer,
offset = meta_drm_buffer_get_offset (buffer, 0);
bpp = meta_drm_buffer_get_bpp (buffer);
modifier = meta_drm_buffer_get_modifier (buffer);
drm_format = meta_drm_buffer_get_format (buffer);
dmabuf_fb =
meta_renderer_native_create_dma_buf_framebuffer (renderer_native,