[mutter] cogl/renderer: Set error in dmabuf constructor fallback
- From: Jonas Ådahl <jadahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] cogl/renderer: Set error in dmabuf constructor fallback
- Date: Mon, 14 Sep 2020 16:13:52 +0000 (UTC)
commit 7d822459de31bdf7239fd83d67b19ae2961ef747
Author: Jonas Ådahl <jadahl gmail com>
Date: Tue Sep 8 14:22:33 2020 +0200
cogl/renderer: Set error in dmabuf constructor fallback
When the CoglRenderer didn't set the DMA buffer constructor vfunc, we
return NULL. What we didn't do was set the error, meaning the caller
would crash if it tried to look up why DMA buffer construction failed.
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1430
cogl/cogl/cogl-renderer.c | 4 ++++
1 file changed, 4 insertions(+)
---
diff --git a/cogl/cogl/cogl-renderer.c b/cogl/cogl/cogl-renderer.c
index 3dc22c1901..b0386fa51e 100644
--- a/cogl/cogl/cogl-renderer.c
+++ b/cogl/cogl/cogl-renderer.c
@@ -31,6 +31,7 @@
#include "cogl-config.h"
+#include <gio/gio.h>
#include <stdlib.h>
#include <string.h>
@@ -768,5 +769,8 @@ cogl_renderer_create_dma_buf (CoglRenderer *renderer,
if (winsys->renderer_create_dma_buf)
return winsys->renderer_create_dma_buf (renderer, width, height, error);
+ g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
+ "CoglRenderer doesn't support creating DMA buffers");
+
return NULL;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]