diff options
author | Jonas Ã…dahl <jadahl@gmail.com> | 2022-06-10 17:01:35 +0200 |
---|---|---|
committer | Marge Bot <marge-bot@gnome.org> | 2023-03-01 23:57:32 +0000 |
commit | af5d67251baef2a86c22f9565cd36985e888165c (patch) | |
tree | b6dcb15ee8e6e5065473550442d7e641d792089b | |
parent | 625a9e274aad0f8455cf01848b7a6e096ef2c273 (diff) | |
download | mutter-af5d67251baef2a86c22f9565cd36985e888165c.tar.gz |
cogl/scanout: Add 'scanout-failed' signal
This will later be emitted when a scanout failed, e.g. by the not-test commit
failing for some reason, or drmModePageFlip() failing even if the
pre-conditions for scanout in the simple KMS backend passed.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2854>
-rw-r--r-- | cogl/cogl/cogl-scanout.c | 23 | ||||
-rw-r--r-- | cogl/cogl/cogl-scanout.h | 5 |
2 files changed, 28 insertions, 0 deletions
diff --git a/cogl/cogl/cogl-scanout.c b/cogl/cogl/cogl-scanout.c index cfd4bfd7e..11b6b2bd2 100644 --- a/cogl/cogl/cogl-scanout.c +++ b/cogl/cogl/cogl-scanout.c @@ -29,11 +29,27 @@ #include "cogl-scanout.h" +enum +{ + SCANOUT_FAILED, + + N_SIGNALS +}; + +static guint signals[N_SIGNALS]; + G_DEFINE_INTERFACE (CoglScanout, cogl_scanout, G_TYPE_OBJECT) static void cogl_scanout_default_init (CoglScanoutInterface *iface) { + signals[SCANOUT_FAILED] = + g_signal_new ("scanout-failed", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + 0, NULL, NULL, NULL, + G_TYPE_NONE, 1, + COGL_TYPE_ONSCREEN); } gboolean @@ -54,3 +70,10 @@ cogl_scanout_blit_to_framebuffer (CoglScanout *scanout, else return FALSE; } + +void +cogl_scanout_notify_failed (CoglScanout *scanout, + CoglOnscreen *onscreen) +{ + g_signal_emit (scanout, signals[SCANOUT_FAILED], 0, onscreen); +} diff --git a/cogl/cogl/cogl-scanout.h b/cogl/cogl/cogl-scanout.h index d458a84fe..22e6266aa 100644 --- a/cogl/cogl/cogl-scanout.h +++ b/cogl/cogl/cogl-scanout.h @@ -30,6 +30,7 @@ #include "cogl/cogl-types.h" #include "cogl/cogl-framebuffer.h" +#include "cogl/cogl-onscreen.h" #include <glib-object.h> @@ -56,4 +57,8 @@ gboolean cogl_scanout_blit_to_framebuffer (CoglScanout *scanout, int y, GError **error); +COGL_EXPORT +void cogl_scanout_notify_failed (CoglScanout *scanout, + CoglOnscreen *onscreen); + #endif /* COGL_SCANOUT_H */ |