From d9b8ab64b687fbe31fb52087386a79d3c6164ba1 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Nov 03 2016 05:42:29 +0000 Subject: import clutter-1.20.0-10.el7 --- diff --git a/SOURCES/Allow-setting-up-quad-buffer-stereo-output.patch b/SOURCES/Allow-setting-up-quad-buffer-stereo-output.patch index a253cd1..0534e0e 100644 --- a/SOURCES/Allow-setting-up-quad-buffer-stereo-output.patch +++ b/SOURCES/Allow-setting-up-quad-buffer-stereo-output.patch @@ -20,10 +20,9 @@ https://bugzilla.gnome.org/show_bug.cgi?id=732706 clutter/x11/clutter-x11.h | 3 + 2 files changed, 131 insertions(+), 40 deletions(-) -diff --git a/clutter/x11/clutter-backend-x11.c b/clutter/x11/clutter-backend-x11.c -index c9478c4..14eda35 100644 ---- a/clutter/x11/clutter-backend-x11.c -+++ b/clutter/x11/clutter-backend-x11.c +diff -up clutter-1.20.0/clutter/x11/clutter-backend-x11.c.quadbuffer-stereo clutter-1.20.0/clutter/x11/clutter-backend-x11.c +--- clutter-1.20.0/clutter/x11/clutter-backend-x11.c.quadbuffer-stereo 2014-09-22 06:01:08.000000000 -0400 ++++ clutter-1.20.0/clutter/x11/clutter-backend-x11.c 2016-02-02 15:09:15.962579511 -0500 @@ -93,6 +93,7 @@ static const gchar *atom_names[] = { static gboolean _no_xevent_retrieval = FALSE; static gboolean clutter_enable_xinput = TRUE; @@ -32,7 +31,7 @@ index c9478c4..14eda35 100644 static Display *_foreign_dpy = NULL; /* options */ -@@ -688,6 +689,59 @@ clutter_backend_x11_get_renderer (ClutterBackend *backend, +@@ -688,6 +689,59 @@ clutter_backend_x11_get_renderer (Clutte return renderer; } @@ -92,19 +91,19 @@ index c9478c4..14eda35 100644 static CoglDisplay * clutter_backend_x11_get_display (ClutterBackend *backend, CoglRenderer *renderer, -@@ -695,56 +749,38 @@ clutter_backend_x11_get_display (ClutterBackend *backend, +@@ -695,56 +749,38 @@ clutter_backend_x11_get_display (Clutter GError **error) { CoglOnscreenTemplate *onscreen_template; - GError *internal_error = NULL; - CoglDisplay *display; - gboolean res; -- -- CLUTTER_NOTE (BACKEND, "Alpha on Cogl swap chain: %s", -- clutter_enable_argb ? "enabled" : "disabled"); + CoglDisplay *display = NULL; + gboolean res = FALSE; +- CLUTTER_NOTE (BACKEND, "Alpha on Cogl swap chain: %s", +- clutter_enable_argb ? "enabled" : "disabled"); +- - cogl_swap_chain_set_has_alpha (swap_chain, clutter_enable_argb); + CLUTTER_NOTE (BACKEND, "Creating CoglDisplay, alpha=%s, stereo=%s", + clutter_enable_argb ? "enabled" : "disabled", @@ -121,14 +120,15 @@ index c9478c4..14eda35 100644 - "Creation of a context with a ARGB visual failed: %s", - internal_error != NULL ? internal_error->message - : "Unknown reason"); +- +- g_clear_error (&internal_error); + /* It's possible that the current renderer doesn't support transparency + * or doesn't support stereo, so we try the different combinations. + */ + if (clutter_enable_argb && clutter_enable_stereo) + res = check_onscreen_template (renderer, swap_chain, onscreen_template, + TRUE, TRUE, error); - -- g_clear_error (&internal_error); ++ + /* Prioritize stereo over alpha */ + if (!res && clutter_enable_stereo) + res = check_onscreen_template (renderer, swap_chain, onscreen_template, @@ -161,12 +161,12 @@ index c9478c4..14eda35 100644 - g_error_free (internal_error); - cogl_object_unref (onscreen_template); +- +- return NULL; +- } + if (res) + display = cogl_display_new (renderer, onscreen_template); -- return NULL; -- } -- - display = cogl_display_new (renderer, onscreen_template); cogl_object_unref (onscreen_template); @@ -230,20 +230,18 @@ index c9478c4..14eda35 100644 XVisualInfo * _clutter_backend_x11_get_visual_info (ClutterBackendX11 *backend_x11) { -diff --git a/clutter/x11/clutter-x11.h b/clutter/x11/clutter-x11.h -index b0ab8a1..4fb2b35 100644 ---- a/clutter/x11/clutter-x11.h -+++ b/clutter/x11/clutter-x11.h -@@ -156,6 +156,9 @@ void clutter_x11_set_use_argb_visual (gboolean use_argb); - CLUTTER_AVAILABLE_IN_ALL +diff -up clutter-1.20.0/clutter/x11/clutter-x11.h.quadbuffer-stereo clutter-1.20.0/clutter/x11/clutter-x11.h +--- clutter-1.20.0/clutter/x11/clutter-x11.h.quadbuffer-stereo 2014-09-22 06:01:08.000000000 -0400 ++++ clutter-1.20.0/clutter/x11/clutter-x11.h 2016-02-02 15:09:59.630275599 -0500 +@@ -157,6 +157,11 @@ CLUTTER_AVAILABLE_IN_ALL gboolean clutter_x11_get_use_argb_visual (void); + CLUTTER_AVAILABLE_IN_ALL +void clutter_x11_set_use_stereo_stage (gboolean use_stereo); ++CLUTTER_AVAILABLE_IN_ALL +gboolean clutter_x11_get_use_stereo_stage (void); + - CLUTTER_AVAILABLE_IN_ALL ++CLUTTER_AVAILABLE_IN_ALL Time clutter_x11_get_current_event_time (void); --- -2.1.0 - + CLUTTER_AVAILABLE_IN_ALL diff --git a/SOURCES/Enable-threaded-swap-wait.patch b/SOURCES/Enable-threaded-swap-wait.patch new file mode 100644 index 0000000..9e53402 --- /dev/null +++ b/SOURCES/Enable-threaded-swap-wait.patch @@ -0,0 +1,65 @@ +diff -up clutter-1.20.0/clutter/x11/clutter-backend-x11.c.enable-threaded-swap-wait clutter-1.20.0/clutter/x11/clutter-backend-x11.c +--- clutter-1.20.0/clutter/x11/clutter-backend-x11.c.enable-threaded-swap-wait 2016-06-29 15:46:54.250758214 -0400 ++++ clutter-1.20.0/clutter/x11/clutter-backend-x11.c 2016-06-29 15:47:58.573790526 -0400 +@@ -91,6 +91,7 @@ static const gchar *atom_names[] = { + + /* various flags corresponding to pre init setup calls */ + static gboolean _want_reset_on_video_memory_purge = FALSE; ++static gboolean _enable_threaded_swap_wait = FALSE; + static gboolean _no_xevent_retrieval = FALSE; + static gboolean clutter_enable_xinput = TRUE; + static gboolean clutter_enable_argb = FALSE; +@@ -688,6 +689,9 @@ clutter_backend_x11_get_renderer (Clutte + cogl_xlib_renderer_set_foreign_display (renderer, xdisplay); + cogl_xlib_renderer_request_reset_on_video_memory_purge (renderer, + _want_reset_on_video_memory_purge); ++ cogl_xlib_renderer_set_threaded_swap_wait_enabled (renderer, ++ _enable_threaded_swap_wait); ++ + return renderer; + } + +@@ -1054,6 +1058,30 @@ clutter_x11_request_reset_on_video_memor + } + + /** ++ * clutter_x11_enable_threaded_swap_wait: ++ * ++ * If the driver doesn't have a better way to wait for frame completion, ++ * and is on a whitelist of drivers where using a separate thread for ++ * frame completion is known to work, do that. XInitThreads() must be ++ * called by the application before any other Xlib calls. See docs for ++ * cogl_xlib_renderer_set_threaded_swap_wait_enabled() for more details. ++ * ++ * This function can only be called before calling clutter_init(). ++ */ ++void ++clutter_x11_enable_threaded_swap_wait (void) ++{ ++ if (_clutter_context_is_initialized ()) ++ { ++ g_warning ("%s() can only be used before calling clutter_init()", ++ G_STRFUNC); ++ return; ++ } ++ ++ _enable_threaded_swap_wait = TRUE; ++} ++ ++/** + * clutter_x11_get_default_screen: + * + * Gets the number of the default X Screen object. +diff -up clutter-1.20.0/clutter/x11/clutter-x11.h.enable-threaded-swap-wait clutter-1.20.0/clutter/x11/clutter-x11.h +--- clutter-1.20.0/clutter/x11/clutter-x11.h.enable-threaded-swap-wait 2016-06-29 15:46:54.252758246 -0400 ++++ clutter-1.20.0/clutter/x11/clutter-x11.h 2016-06-29 15:47:27.193287248 -0400 +@@ -173,6 +173,9 @@ guint clutter_x11_event_sequence_get_tou + CLUTTER_AVAILABLE_IN_ALL + void clutter_x11_request_reset_on_video_memory_purge (void); + ++CLUTTER_AVAILABLE_IN_ALL ++void clutter_x11_enable_threaded_swap_wait (void); ++ + G_END_DECLS + + #endif /* __CLUTTER_X11_H__ */ diff --git a/SOURCES/add-driver-selection-api.patch b/SOURCES/add-driver-selection-api.patch new file mode 100644 index 0000000..a9ec5e8 --- /dev/null +++ b/SOURCES/add-driver-selection-api.patch @@ -0,0 +1,591 @@ +From 5c8f7cc3af63cc98a05efec47649f6ab74ca17a0 Mon Sep 17 00:00:00 2001 +From: Adel Gadllah +Date: Sun, 26 Jul 2015 11:29:10 +0200 +Subject: [PATCH 1/7] backend: Check for a known set of drivers + +We want to use the Cogl GL3 driver, if possible, and then go through a +known list of Cogl drivers, before giving up and using COGL_DRIVER_ANY. + +Based on original patch from Emmanuele Bassi. + +We have to create and tear down the whole context when trying +out the drivers though because the extension checks do not happen +until cogl_context_init. + +https://bugzilla.gnome.org/show_bug.cgi?id=742678 +--- + clutter/clutter-backend.c | 69 ++++++++++++++++++++++++++++++++++++++--------- + 1 file changed, 56 insertions(+), 13 deletions(-) + +diff --git a/clutter/clutter-backend.c b/clutter/clutter-backend.c +index d255eee..0a4ae1a 100644 +--- a/clutter/clutter-backend.c ++++ b/clutter/clutter-backend.c +@@ -257,8 +257,9 @@ clutter_backend_real_font_changed (ClutterBackend *backend) + } + + static gboolean +-clutter_backend_real_create_context (ClutterBackend *backend, +- GError **error) ++clutter_backend_do_real_create_context (ClutterBackend *backend, ++ CoglDriver driver_id, ++ GError **error) + { + ClutterBackendClass *klass; + CoglSwapChain *swap_chain; +@@ -290,6 +291,7 @@ clutter_backend_real_create_context (ClutterBackend *backend, + #endif + + CLUTTER_NOTE (BACKEND, "Connecting the renderer"); ++ cogl_renderer_set_driver (backend->cogl_renderer, driver_id); + if (!cogl_renderer_connect (backend->cogl_renderer, &internal_error)) + goto error; + +@@ -346,10 +348,6 @@ clutter_backend_real_create_context (ClutterBackend *backend, + if (backend->cogl_context == NULL) + goto error; + +- backend->cogl_source = cogl_glib_source_new (backend->cogl_context, +- G_PRIORITY_DEFAULT); +- g_source_attach (backend->cogl_source, NULL); +- + /* the display owns the renderer and the swap chain */ + cogl_object_unref (backend->cogl_renderer); + cogl_object_unref (swap_chain); +@@ -372,16 +370,61 @@ error: + if (swap_chain != NULL) + cogl_object_unref (swap_chain); + +- if (internal_error != NULL) +- g_propagate_error (error, internal_error); +- else +- g_set_error_literal (error, CLUTTER_INIT_ERROR, +- CLUTTER_INIT_ERROR_BACKEND, +- _("Unable to initialize the Clutter backend")); +- + return FALSE; + } + ++static gboolean ++clutter_backend_real_create_context (ClutterBackend *backend, ++ GError **error) ++{ ++ static const struct { ++ const char *driver_name; ++ CoglDriver driver_id; ++ } known_drivers[] = { ++ { "GL3", COGL_DRIVER_GL3 }, ++ { "GL (Legacy)", COGL_DRIVER_GL }, ++ { "GLES 2.0", COGL_DRIVER_GLES2 }, ++ { "ANY", COGL_DRIVER_ANY }, ++ }; ++ ++ GError *internal_error = NULL; ++ int i; ++ ++ for (i = 0; i < G_N_ELEMENTS (known_drivers); i++) ++ { ++ CLUTTER_NOTE (BACKEND, "Checking for the %s driver", known_drivers[i].driver_name); ++ ++ if (clutter_backend_do_real_create_context (backend, known_drivers[i].driver_id, &internal_error)) ++ break; ++ ++ if (internal_error) ++ { ++ CLUTTER_NOTE (BACKEND, "Unable to use the %s driver: %s", ++ known_drivers[i].driver_name, ++ internal_error->message); ++ g_clear_error (&internal_error); ++ } ++ } ++ ++ if (backend->cogl_context == NULL) ++ { ++ if (internal_error != NULL) ++ g_propagate_error (error, internal_error); ++ else ++ g_set_error_literal (error, CLUTTER_INIT_ERROR, ++ CLUTTER_INIT_ERROR_BACKEND, ++ _("Unable to initialize the Clutter backend")); ++ ++ return FALSE; ++ } ++ ++ backend->cogl_source = cogl_glib_source_new (backend->cogl_context, ++ G_PRIORITY_DEFAULT); ++ g_source_attach (backend->cogl_source, NULL); ++ ++ return TRUE; ++} ++ + static void + clutter_backend_real_ensure_context (ClutterBackend *backend, + ClutterStage *stage) +-- +2.7.4 + + +From 6b9281ac7da725a1861a6418c24fcb6371d3c72b Mon Sep 17 00:00:00 2001 +From: Emmanuele Bassi +Date: Wed, 9 Dec 2015 12:45:12 +0000 +Subject: [PATCH 2/7] backend: Allow overriding the Cogl drivers chain + +We have an hardcoded list of drivers we have to go through when creating +a Cogl context. Some platforms may expose those drivers, but not be the +preferred ones. + +In order to allow users and system integrators to override the list of +drivers, we should crib the same approach used by GDK, and have an +environment variable with a list of drivers to try. + +The new environment variable is called `CLUTTER_DRIVER` and accepts a +comma-separated list of driver names, which will be tested in sequence +until one succeeds. There's also an additional '*' token which is used +to ask Clutter to fall back to the internally defined preferred list of +drivers. + +https://bugzilla.gnome.org/show_bug.cgi?id=742678 +--- + clutter/clutter-backend.c | 79 ++++++++++++++++++++++--------- + doc/reference/clutter/running-clutter.xml | 55 +++++++++++++++++++++ + 2 files changed, 111 insertions(+), 23 deletions(-) + +diff --git a/clutter/clutter-backend.c b/clutter/clutter-backend.c +index 0a4ae1a..9ee3659 100644 +--- a/clutter/clutter-backend.c ++++ b/clutter/clutter-backend.c +@@ -373,39 +373,73 @@ error: + return FALSE; + } + ++static const struct { ++ const char *driver_name; ++ const char *driver_desc; ++ CoglDriver driver_id; ++} all_known_drivers[] = { ++ { "gl3", "OpenGL 3.2 core profile", COGL_DRIVER_GL3 }, ++ { "gl", "OpenGL legacy profile", COGL_DRIVER_GL }, ++ { "gles2", "OpenGL ES 2.0", COGL_DRIVER_GLES2 }, ++ { "any", "Default Cogl driver", COGL_DRIVER_ANY }, ++}; ++ ++static char *allowed_drivers; ++ + static gboolean + clutter_backend_real_create_context (ClutterBackend *backend, + GError **error) + { +- static const struct { +- const char *driver_name; +- CoglDriver driver_id; +- } known_drivers[] = { +- { "GL3", COGL_DRIVER_GL3 }, +- { "GL (Legacy)", COGL_DRIVER_GL }, +- { "GLES 2.0", COGL_DRIVER_GLES2 }, +- { "ANY", COGL_DRIVER_ANY }, +- }; +- + GError *internal_error = NULL; ++ const char *drivers_list; ++ char **known_drivers; ++ gboolean allow_any; + int i; + +- for (i = 0; i < G_N_ELEMENTS (known_drivers); i++) +- { +- CLUTTER_NOTE (BACKEND, "Checking for the %s driver", known_drivers[i].driver_name); ++ if (allowed_drivers == NULL) ++ allowed_drivers = "*"; ++ ++ allow_any = strstr (allowed_drivers, "*") != NULL; ++ ++ drivers_list = g_getenv ("CLUTTER_DRIVER"); ++ if (drivers_list == NULL) ++ drivers_list = allowed_drivers; + +- if (clutter_backend_do_real_create_context (backend, known_drivers[i].driver_id, &internal_error)) +- break; ++ known_drivers = g_strsplit (drivers_list, ",", 0); + +- if (internal_error) ++ for (i = 0; backend->cogl_context == NULL && known_drivers[i] != NULL; i++) ++ { ++ const char *driver_name = known_drivers[i]; ++ gboolean is_any = g_str_equal (driver_name, "*"); ++ int j; ++ ++ for (j = 0; j < G_N_ELEMENTS (all_known_drivers); j++) + { +- CLUTTER_NOTE (BACKEND, "Unable to use the %s driver: %s", +- known_drivers[i].driver_name, +- internal_error->message); +- g_clear_error (&internal_error); ++ if (!allow_any && !is_any && !strstr (driver_name, all_known_drivers[j].driver_name)) ++ continue; ++ ++ if ((allow_any && is_any) || ++ (is_any && strstr (allowed_drivers, all_known_drivers[j].driver_name)) || ++ g_str_equal (all_known_drivers[j].driver_name, driver_name)) ++ { ++ CLUTTER_NOTE (BACKEND, "Checking for the %s driver", all_known_drivers[j].driver_desc); ++ ++ if (clutter_backend_do_real_create_context (backend, all_known_drivers[j].driver_id, &internal_error)) ++ break; ++ ++ if (internal_error) ++ { ++ CLUTTER_NOTE (BACKEND, "Unable to use the %s driver: %s", ++ all_known_drivers[j].driver_desc, ++ internal_error->message); ++ g_clear_error (&internal_error); ++ } ++ } + } + } + ++ g_strfreev (known_drivers); ++ + if (backend->cogl_context == NULL) + { + if (internal_error != NULL) +@@ -413,13 +447,12 @@ clutter_backend_real_create_context (ClutterBackend *backend, + else + g_set_error_literal (error, CLUTTER_INIT_ERROR, + CLUTTER_INIT_ERROR_BACKEND, +- _("Unable to initialize the Clutter backend")); ++ _("Unable to initialize the Clutter backend: no available drivers found.")); + + return FALSE; + } + +- backend->cogl_source = cogl_glib_source_new (backend->cogl_context, +- G_PRIORITY_DEFAULT); ++ backend->cogl_source = cogl_glib_source_new (backend->cogl_context, G_PRIORITY_DEFAULT); + g_source_attach (backend->cogl_source, NULL); + + return TRUE; +diff --git a/doc/reference/clutter/running-clutter.xml b/doc/reference/clutter/running-clutter.xml +index 9d1dc63..2d782b3 100644 +--- a/doc/reference/clutter/running-clutter.xml ++++ b/doc/reference/clutter/running-clutter.xml +@@ -27,6 +27,61 @@ + + + ++ CLUTTER_BACKEND ++ ++ Changes the windowing system backend used by Clutter. ++ The allowed values for this environment variable depend on ++ the configuration options used when compiling Clutter. The ++ available values are: ++ ++ x11, for the X11 backend ++ wayland, for the Wayland backend ++ win32, for the Windows backend ++ osx, for the MacOS X backend ++ gsk, for the GDK backend ++ eglnative, for the EGL/KMS backend ++ cex100, for the CEx100 backend ++ ++ All of the above options except for the eglnative ++ and cex100 backends also have an input backend. ++ ++ ++ ++ CLUTTER_INPUT_BACKEND ++ ++ Changes the input backend used by Clutter. ++ The allowed values for this environment variable depend on ++ the configuration options used when compiling Clutter. The ++ available values are: ++ ++ tslib ++ evdev ++ null ++ ++ This environment variable is only useful for setting the input ++ backend when using a windowing system backend that does not have an ++ input API, like the eglnative or the cex100 ++ windowing system backends. ++ ++ ++ ++ CLUTTER_DRIVER ++ ++ Changes the GL driver used when initializing Clutter. ++ The allowed values for this environment variable are: ++ ++ gl3, for the GL driver using a 3.2+ core profile ++ gl, for the GL driver using a legacy profile ++ gles2, for the GLES 2.0 driver ++ any, for the default chosen by Cogl ++ ++ The special '*' value can be used to ask Clutter to use the ++ default list of drivers, e.g. 'CLUTTER_DRIVER=gles2,*' will ask Clutter ++ to try the GLES 2.0 driver first, and then fall back to the default list ++ of Cogl drivers. ++ ++ ++ + CLUTTER_SCALE + + Forces the window scaling factor to that value +-- +2.7.4 + + +From e012c6823f2619d7ce85fb14a773c84b22a5b9fe Mon Sep 17 00:00:00 2001 +From: Emmanuele Bassi +Date: Wed, 9 Dec 2015 14:26:28 +0000 +Subject: [PATCH 3/7] Add a configuration option for deciding the Cogl drivers + to use + +Using environment variables only is not convenient for all platforms, +and in some cases it's beneficial to decide the default driver when +building Clutter. Cogl already has a similar configuration switch, and +since Clutter is overriding the default Cogl behaviour, it should offer +the same mechanism. + +https://bugzilla.gnome.org/show_bug.cgi?id=742678 +--- + clutter/clutter-backend.c | 2 +- + configure.ac | 9 +++++++++ + 2 files changed, 10 insertions(+), 1 deletion(-) + +diff --git a/clutter/clutter-backend.c b/clutter/clutter-backend.c +index 9ee3659..3faae3a 100644 +--- a/clutter/clutter-backend.c ++++ b/clutter/clutter-backend.c +@@ -397,7 +397,7 @@ clutter_backend_real_create_context (ClutterBackend *backend, + int i; + + if (allowed_drivers == NULL) +- allowed_drivers = "*"; ++ allowed_drivers = CLUTTER_DRIVERS; + + allow_any = strstr (allowed_drivers, "*") != NULL; + +diff --git a/configure.ac b/configure.ac +index 0a62633..fe7e085 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -534,6 +534,13 @@ dnl other tools such as glib-mkenums and gir-scanner don't end up + dnl using the define also. + AC_DEFINE([COGL_ENABLE_EXPERIMENTAL_2_0_API], [1], [Can use Cogl 2.0 API internally]) + ++AC_ARG_WITH([default-drivers], ++ [AS_HELP_STRING([--with-default-drivers=DRIVER], [Comma-separated list of Cogl drivers to use])], ++ [clutter_drivers=$withval], ++ [clutter_drivers="*"]) ++ ++AC_DEFINE_UNQUOTED([CLUTTER_DRIVERS], ["$clutter_drivers"], [List of Cogl drivers]) ++ + dnl strip leading spaces + CLUTTER_BACKENDS=${CLUTTER_BACKENDS#* } + AC_SUBST(CLUTTER_BACKENDS) +@@ -1274,6 +1281,8 @@ else + echo " Input backends: ${CLUTTER_INPUT_BACKENDS} (WARNING: Experimental backends enabled)" + fi + ++echo " Cogl drivers: $clutter_drivers" ++ + if test "x$SUPPORT_X11" = "x1"; then + echo "" + echo " - X11 backend options:" +-- +2.7.4 + + +From 486a1a8a0ddc40c7782c0b0508768b3d8baa12db Mon Sep 17 00:00:00 2001 +From: Emmanuele Bassi +Date: Thu, 10 Dec 2015 16:52:45 +0000 +Subject: [PATCH 4/7] Allow overriding the list of Cogl drivers via + configuration file + +Clutter has a configuration file that can be used to override +various settings, including the ones from environment variables. +--- + clutter/clutter-backend-private.h | 2 ++ + clutter/clutter-backend.c | 8 +++++++- + clutter/clutter-main.c | 11 +++++++++++ + 3 files changed, 20 insertions(+), 1 deletion(-) + +diff --git a/clutter/clutter-backend-private.h b/clutter/clutter-backend-private.h +index a9e7ae2..801548b 100644 +--- a/clutter/clutter-backend-private.h ++++ b/clutter/clutter-backend-private.h +@@ -142,6 +142,8 @@ gint32 _clutter_backend_get_units_serial (Clutter + + PangoDirection _clutter_backend_get_keymap_direction (ClutterBackend *backend); + ++void clutter_set_allowed_drivers (const char *drivers); ++ + G_END_DECLS + + #endif /* __CLUTTER_BACKEND_PRIVATE_H__ */ +diff --git a/clutter/clutter-backend.c b/clutter/clutter-backend.c +index 3faae3a..34c088d 100644 +--- a/clutter/clutter-backend.c ++++ b/clutter/clutter-backend.c +@@ -384,7 +384,7 @@ static const struct { + { "any", "Default Cogl driver", COGL_DRIVER_ANY }, + }; + +-static char *allowed_drivers; ++static const char *allowed_drivers; + + static gboolean + clutter_backend_real_create_context (ClutterBackend *backend, +@@ -1492,3 +1492,9 @@ _clutter_backend_get_keymap_direction (ClutterBackend *backend) + + return PANGO_DIRECTION_NEUTRAL; + } ++ ++void ++clutter_set_allowed_drivers (const char *drivers) ++{ ++ allowed_drivers = g_strdup (drivers); ++} +diff --git a/clutter/clutter-main.c b/clutter/clutter-main.c +index 444ceba..11d5150 100644 +--- a/clutter/clutter-main.c ++++ b/clutter/clutter-main.c +@@ -229,6 +229,17 @@ clutter_config_read_from_key_file (GKeyFile *keyfile) + if (!g_key_file_has_group (keyfile, ENVIRONMENT_GROUP)) + return; + ++ str_value = ++ g_key_file_get_string (keyfile, ENVIRONMENT_GROUP, ++ "Drivers", ++ &key_error); ++ if (key_error != NULL) ++ g_clear_error (&key_error); ++ else ++ clutter_set_allowed_drivers (str_value); ++ ++ g_free (str_value); ++ + bool_value = + g_key_file_get_boolean (keyfile, ENVIRONMENT_GROUP, + "ShowFps", +-- +2.7.4 + + +From f09847882c87b94225d14c058a34bb7faedacd09 Mon Sep 17 00:00:00 2001 +From: Rui Matos +Date: Thu, 11 Aug 2016 15:35:59 +0200 +Subject: [PATCH 5/7] Make clutter_set_allowed_drivers() public + +We'll need to call it from mutter. +--- + clutter/clutter-backend-private.h | 2 -- + clutter/clutter-backend.h | 3 +++ + 2 files changed, 3 insertions(+), 2 deletions(-) + +diff --git a/clutter/clutter-backend-private.h b/clutter/clutter-backend-private.h +index 801548b..a9e7ae2 100644 +--- a/clutter/clutter-backend-private.h ++++ b/clutter/clutter-backend-private.h +@@ -142,8 +142,6 @@ gint32 _clutter_backend_get_units_serial (Clutter + + PangoDirection _clutter_backend_get_keymap_direction (ClutterBackend *backend); + +-void clutter_set_allowed_drivers (const char *drivers); +- + G_END_DECLS + + #endif /* __CLUTTER_BACKEND_PRIVATE_H__ */ +diff --git a/clutter/clutter-backend.h b/clutter/clutter-backend.h +index e14d5d2..c7dfc24 100644 +--- a/clutter/clutter-backend.h ++++ b/clutter/clutter-backend.h +@@ -78,6 +78,9 @@ CLUTTER_AVAILABLE_IN_1_8 + CoglContext * clutter_backend_get_cogl_context (ClutterBackend *backend); + #endif + ++CLUTTER_AVAILABLE_IN_ALL ++void clutter_set_allowed_drivers (const char *drivers); ++ + G_END_DECLS + + #endif /* __CLUTTER_BACKEND_H__ */ +-- +2.7.4 + + +From aa79960d2e79141f0caaa27a48468ed67acd30b2 Mon Sep 17 00:00:00 2001 +From: Rui Matos +Date: Thu, 11 Aug 2016 15:50:30 +0200 +Subject: [PATCH 6/7] backend: Revert to using the gl driver by default instead + of gl3 + +Some applications (e.g. totem) don't work well (or at all) with the +gl3 driver without modifications and it's safer to keep clutter +behaving the same as it did when RHEL 7 launched so let's switch the +default driver back to gl. +--- + clutter/clutter-backend.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/clutter/clutter-backend.c b/clutter/clutter-backend.c +index 34c088d..15a1d05 100644 +--- a/clutter/clutter-backend.c ++++ b/clutter/clutter-backend.c +@@ -378,8 +378,8 @@ static const struct { + const char *driver_desc; + CoglDriver driver_id; + } all_known_drivers[] = { +- { "gl3", "OpenGL 3.2 core profile", COGL_DRIVER_GL3 }, + { "gl", "OpenGL legacy profile", COGL_DRIVER_GL }, ++ { "gl3", "OpenGL 3.2 core profile", COGL_DRIVER_GL3 }, + { "gles2", "OpenGL ES 2.0", COGL_DRIVER_GLES2 }, + { "any", "Default Cogl driver", COGL_DRIVER_ANY }, + }; +-- +2.7.4 + + +From 03db9fc0b5035c1c74132b6f33468e8670802558 Mon Sep 17 00:00:00 2001 +From: "Owen W. Taylor" +Date: Wed, 29 Jun 2016 17:03:46 -0400 +Subject: [PATCH 7/7] Don't create the Cogl GLib source multiple times + +Since the check for backend->cogl_context was accidentally moved +to clutter_backend_do_real_create_context, the Glib source that +is created at the end of clutter_backend_do_create_context() is +created and added each time create_context() is called, though +create_context() is supposed to be idempotent. + +https://bugzilla.gnome.org/show_bug.cgi?id=768243 +--- + clutter/clutter-backend.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/clutter/clutter-backend.c b/clutter/clutter-backend.c +index 15a1d05..56f2bf2 100644 +--- a/clutter/clutter-backend.c ++++ b/clutter/clutter-backend.c +@@ -265,9 +265,6 @@ clutter_backend_do_real_create_context (ClutterBackend *backend, + CoglSwapChain *swap_chain; + GError *internal_error; + +- if (backend->cogl_context != NULL) +- return TRUE; +- + klass = CLUTTER_BACKEND_GET_CLASS (backend); + + swap_chain = NULL; +@@ -396,6 +393,9 @@ clutter_backend_real_create_context (ClutterBackend *backend, + gboolean allow_any; + int i; + ++ if (backend->cogl_context != NULL) ++ return TRUE; ++ + if (allowed_drivers == NULL) + allowed_drivers = CLUTTER_DRIVERS; + +-- +2.7.4 + diff --git a/SOURCES/video-memory-purge.patch b/SOURCES/video-memory-purge.patch new file mode 100644 index 0000000..95e3483 --- /dev/null +++ b/SOURCES/video-memory-purge.patch @@ -0,0 +1,81 @@ +From a01f454edf05c1204ea4be23fd79576fa7c5b5ff Mon Sep 17 00:00:00 2001 +From: Rui Matos +Date: Tue, 21 Jun 2016 17:40:15 +0200 +Subject: [PATCH] clutter/x11: Add API to request video memory purges to be + reported + +--- + clutter/x11/clutter-backend-x11.c | 28 +++++++++++++++++++++++++++- + clutter/x11/clutter-x11.h | 3 +++ + 2 files changed, 30 insertions(+), 1 deletion(-) + +diff --git a/clutter/x11/clutter-backend-x11.c b/clutter/x11/clutter-backend-x11.c +index 14eda35..eb0d643 100644 +--- a/clutter/x11/clutter-backend-x11.c ++++ b/clutter/x11/clutter-backend-x11.c +@@ -90,6 +90,7 @@ static const gchar *atom_names[] = { + #define N_ATOM_NAMES G_N_ELEMENTS (atom_names) + + /* various flags corresponding to pre init setup calls */ ++static gboolean _want_reset_on_video_memory_purge = FALSE; + static gboolean _no_xevent_retrieval = FALSE; + static gboolean clutter_enable_xinput = TRUE; + static gboolean clutter_enable_argb = FALSE; +@@ -685,7 +686,8 @@ clutter_backend_x11_get_renderer (ClutterBackend *backend, + + /* set the display object we're using */ + cogl_xlib_renderer_set_foreign_display (renderer, xdisplay); +- ++ cogl_xlib_renderer_request_reset_on_video_memory_purge (renderer, ++ _want_reset_on_video_memory_purge); + return renderer; + } + +@@ -1028,6 +1030,30 @@ clutter_x11_has_event_retrieval (void) + } + + /** ++ * clutter_x11_request_reset_on_video_memory_purge: ++ * ++ * If the GL driver supports the NV_robustness_video_memory_purge ++ * extension, this call lets applications request that it gets ++ * initialized, thus allowing cogl_get_graphics_reset_status() to ++ * report memory purged errors if they happen. Checking for the ++ * graphics reset status is the application's responsibility. ++ * ++ * This function can only be called before calling clutter_init(). ++ */ ++void ++clutter_x11_request_reset_on_video_memory_purge (void) ++{ ++ if (_clutter_context_is_initialized ()) ++ { ++ g_warning ("%s() can only be used before calling clutter_init()", ++ G_STRFUNC); ++ return; ++ } ++ ++ _want_reset_on_video_memory_purge = TRUE; ++} ++ ++/** + * clutter_x11_get_default_screen: + * + * Gets the number of the default X Screen object. +diff --git a/clutter/x11/clutter-x11.h b/clutter/x11/clutter-x11.h +index 4fb2b35..817cd85 100644 +--- a/clutter/x11/clutter-x11.h ++++ b/clutter/x11/clutter-x11.h +@@ -168,6 +168,9 @@ gint clutter_x11_event_get_key_group (const ClutterEvent *event); + CLUTTER_AVAILABLE_IN_ALL + guint clutter_x11_event_sequence_get_touch_detail (const ClutterEventSequence *sequence); + ++CLUTTER_AVAILABLE_IN_ALL ++void clutter_x11_request_reset_on_video_memory_purge (void); ++ + G_END_DECLS + + #endif /* __CLUTTER_X11_H__ */ +-- +2.7.4 + diff --git a/SPECS/clutter.spec b/SPECS/clutter.spec index 5b005a7..076b6f6 100644 --- a/SPECS/clutter.spec +++ b/SPECS/clutter.spec @@ -8,7 +8,7 @@ Name: clutter Version: 1.20.0 -Release: 4%{?dist} +Release: 10%{?dist} Summary: Open Source software library for creating rich graphical user interfaces Group: Development/Libraries @@ -18,15 +18,20 @@ Source0: http://download.gnome.org/sources/clutter/1.20/clutter-%{version} # https://bugzilla.gnome.org/show_bug.cgi?id=732706 Patch7: Allow-setting-up-quad-buffer-stereo-output.patch +Patch8: add-driver-selection-api.patch +Patch9: video-memory-purge.patch + +Patch10: Enable-threaded-swap-wait.patch + BuildRequires: glib2-devel mesa-libGL-devel pkgconfig pango-devel BuildRequires: cairo-gobject-devel gdk-pixbuf2-devel atk-devel -BuildRequires: cogl-devel >= 1.15.1 +BuildRequires: cogl-devel >= 1.18.2-12 BuildRequires: gobject-introspection-devel >= 0.9.6 BuildRequires: gtk3-devel BuildRequires: json-glib-devel >= 0.12.0 BuildRequires: libXcomposite-devel BuildRequires: libXdamage-devel -BuildRequires: libXi-devel +BuildRequires: libXi-devel >= 1.7.4 BuildRequires: gettext-devel %if 0%{?with_wayland} BuildRequires: libgudev1-devel @@ -81,6 +86,9 @@ the functionality of the installed clutter package. %prep %setup -q %patch7 -p1 -b .quadbuffer-stereo +%patch8 -p1 -b .add-driver-selection-api +%patch9 -p1 -b .video-memory-purge +%patch10 -p1 -b .enable-threaded-swap-wait %build autoreconf @@ -135,7 +143,36 @@ make check %{?_smp_mflags} V=1 %endif %changelog -* Fri Jul 17 2015 Florian Müllner - 1.20.0-4 +* Thu Aug 11 2016 Rui Matos - 1.20.0-10 +- Add patches to make the backend driver selection explicit instead of + changing the default to gl3 + Resolves: #1361251 + +* Mon Jul 18 2016 Rui Matos - 1.20.0-9 +- Require a cogl version that provides all the new APIs + Related: rhbz#1330488 + +* Wed Jun 29 2016 Owen Taylor - 1.20.0-8 +- Add a patch that adds clutter_x11_enable_threaded_swap_wait(), + enabling proper waiting for frame completion on NVIDIA. +- Add a patch to fix Cogl Glib source added multiple times. + See https://bugzilla.gnome.org/show_bug.cgi?id=768243 + Resolves: #1306801 + +* Fri Jun 17 2016 Rui Matos - 1.20.0-7 +- Add patches to support NV_robustness_video_memory_purge + Related: rhbz#1330488 + +* Tue May 10 2016 Owen Taylor - 1.20.0-6 +- Fix problem with stereo patch (missing export declarations) that resulted + in added symbols not being exported. + Resolves: #1306801 + +* Fri Mar 04 2016 Florian Müllner - 1.20.0-5 +- Request a minimum libXi version + Related: #1290446 + +* Fri Jul 17 2015 Florian Müllner - 1.20.0-4 - Rebuild with update gobject-introspection Resolves: #1236735