parent
1a6cfb0cb4
commit
7c3ddb3108
@ -0,0 +1,89 @@
|
||||
From 3a858da28e0517a862e40ea992f8bb0f2988dc33 Mon Sep 17 00:00:00 2001
|
||||
From: Jocelyn Falempe <jfalempe@redhat.com>
|
||||
Date: Fri, 18 Oct 2024 17:19:14 +0200
|
||||
Subject: [PATCH 1/2] cogl/egl: Choose config only if needed
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
In try_create_context(), if COGL_EGL_WINSYS_FEATURE_NO_CONFIG_CONTEXT
|
||||
is set, don't try to choose an egl config.
|
||||
|
||||
Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
|
||||
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
|
||||
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4088>
|
||||
(cherry picked from commit 18085b0e402ba5a7fe9c6a06a8cbb0bfcaabebf7)
|
||||
---
|
||||
cogl/cogl/winsys/cogl-winsys-egl-private.h | 2 ++
|
||||
cogl/cogl/winsys/cogl-winsys-egl-x11.c | 1 +
|
||||
cogl/cogl/winsys/cogl-winsys-egl.c | 27 +++++++++++++---------
|
||||
3 files changed, 19 insertions(+), 11 deletions(-)
|
||||
|
||||
diff --git a/cogl/cogl/winsys/cogl-winsys-egl-private.h b/cogl/cogl/winsys/cogl-winsys-egl-private.h
|
||||
index 6a31d1ab2d..30821cc22f 100644
|
||||
--- a/cogl/cogl/winsys/cogl-winsys-egl-private.h
|
||||
+++ b/cogl/cogl/winsys/cogl-winsys-egl-private.h
|
||||
@@ -120,6 +120,8 @@ typedef struct _CoglRendererEGL
|
||||
/* vtable for platform specific parts */
|
||||
const CoglWinsysEGLVtable *platform_vtable;
|
||||
|
||||
+ gboolean needs_config;
|
||||
+
|
||||
/* Sync for latest submitted work */
|
||||
EGLSyncKHR sync;
|
||||
|
||||
diff --git a/cogl/cogl/winsys/cogl-winsys-egl-x11.c b/cogl/cogl/winsys/cogl-winsys-egl-x11.c
|
||||
index 7393f79f6a..d61e82f4de 100644
|
||||
--- a/cogl/cogl/winsys/cogl-winsys-egl-x11.c
|
||||
+++ b/cogl/cogl/winsys/cogl-winsys-egl-x11.c
|
||||
@@ -244,6 +244,7 @@ _cogl_winsys_renderer_connect (CoglRenderer *renderer,
|
||||
|
||||
egl_renderer->platform_vtable = &_cogl_winsys_egl_vtable;
|
||||
egl_renderer->sync = EGL_NO_SYNC_KHR;
|
||||
+ egl_renderer->needs_config = TRUE;
|
||||
|
||||
if (!_cogl_xlib_renderer_connect (renderer, error))
|
||||
goto error;
|
||||
diff --git a/cogl/cogl/winsys/cogl-winsys-egl.c b/cogl/cogl/winsys/cogl-winsys-egl.c
|
||||
index b37ba15316..54a402aee2 100644
|
||||
--- a/cogl/cogl/winsys/cogl-winsys-egl.c
|
||||
+++ b/cogl/cogl/winsys/cogl-winsys-egl.c
|
||||
@@ -329,19 +329,24 @@ try_create_context (CoglDisplay *display,
|
||||
|
||||
edpy = egl_renderer->edpy;
|
||||
|
||||
- if (!egl_renderer->platform_vtable->choose_config (display,
|
||||
- cfg_attribs,
|
||||
- &config,
|
||||
- &config_error))
|
||||
+ if (!(egl_renderer->private_features &
|
||||
+ COGL_EGL_WINSYS_FEATURE_NO_CONFIG_CONTEXT) ||
|
||||
+ egl_renderer->needs_config)
|
||||
{
|
||||
- g_set_error (error, COGL_WINSYS_ERROR,
|
||||
- COGL_WINSYS_ERROR_CREATE_CONTEXT,
|
||||
- "Couldn't choose config: %s", config_error->message);
|
||||
- g_error_free (config_error);
|
||||
- goto err;
|
||||
- }
|
||||
+ if (!egl_renderer->platform_vtable->choose_config (display,
|
||||
+ cfg_attribs,
|
||||
+ &config,
|
||||
+ &config_error))
|
||||
+ {
|
||||
+ g_set_error (error, COGL_WINSYS_ERROR,
|
||||
+ COGL_WINSYS_ERROR_CREATE_CONTEXT,
|
||||
+ "Couldn't choose config: %s", config_error->message);
|
||||
+ g_error_free (config_error);
|
||||
+ goto err;
|
||||
+ }
|
||||
|
||||
- egl_display->egl_config = config;
|
||||
+ egl_display->egl_config = config;
|
||||
+ }
|
||||
|
||||
if (display->renderer->driver == COGL_DRIVER_GL3)
|
||||
{
|
||||
--
|
||||
2.44.0.501.g19981daefd.dirty
|
||||
|
@ -0,0 +1,37 @@
|
||||
From e5c80f620e11e401efc8deddc09b86e4b227320e Mon Sep 17 00:00:00 2001
|
||||
From: Jocelyn Falempe <jfalempe@redhat.com>
|
||||
Date: Tue, 15 Oct 2024 14:38:55 +0200
|
||||
Subject: [PATCH 2/2] renderer/native: Add BGRX8888 format to the default list
|
||||
|
||||
On big endian machine, the native 32bits format is
|
||||
DRM_FORMAT_BGRX8888, so add this format to the list.
|
||||
|
||||
Tested on a s390x VM, using virtio-gpu driver.
|
||||
|
||||
Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
|
||||
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4088>
|
||||
(cherry picked from commit e44620c86e76f7150d756609341b97617af50258)
|
||||
---
|
||||
src/backends/native/meta-onscreen-native.c | 6 ++++++
|
||||
1 file changed, 6 insertions(+)
|
||||
|
||||
diff --git a/src/backends/native/meta-onscreen-native.c b/src/backends/native/meta-onscreen-native.c
|
||||
index 8a25fca8cc..18c18f7225 100644
|
||||
--- a/src/backends/native/meta-onscreen-native.c
|
||||
+++ b/src/backends/native/meta-onscreen-native.c
|
||||
@@ -2088,6 +2088,12 @@ choose_onscreen_egl_config (CoglOnscreen *onscreen,
|
||||
GBM_FORMAT_ABGR2101010,
|
||||
GBM_FORMAT_RGBA1010102,
|
||||
GBM_FORMAT_BGRA1010102,
|
||||
+ GBM_FORMAT_XBGR8888,
|
||||
+ GBM_FORMAT_ABGR8888,
|
||||
+ GBM_FORMAT_RGBX8888,
|
||||
+ GBM_FORMAT_RGBA8888,
|
||||
+ GBM_FORMAT_BGRX8888,
|
||||
+ GBM_FORMAT_BGRA8888,
|
||||
GBM_FORMAT_XRGB8888,
|
||||
GBM_FORMAT_ARGB8888,
|
||||
};
|
||||
--
|
||||
2.44.0.501.g19981daefd.dirty
|
||||
|
Loading…
Reference in new issue