From d0e137bc9ac9447e669879db4f59eb7f9f961383 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Thu, 4 Feb 2021 14:52:24 +0400 Subject: ui: add a DCLOps callback to check dmabuf support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marc-André Lureau Message-Id: <20210204105232.834642-13-marcandre.lureau@redhat.com> Signed-off-by: Gerd Hoffmann --- ui/console.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'ui') diff --git a/ui/console.c b/ui/console.c index b5bc3f7699..a645418ada 100644 --- a/ui/console.c +++ b/ui/console.c @@ -1463,6 +1463,19 @@ bool console_has_gl(QemuConsole *con) return con->gl != NULL; } +static bool displaychangelistener_has_dmabuf(DisplayChangeListener *dcl) +{ + if (dcl->ops->dpy_has_dmabuf) { + return dcl->ops->dpy_has_dmabuf(dcl); + } + + if (dcl->ops->dpy_gl_scanout_dmabuf) { + return true; + } + + return false; +} + void register_displaychangelistener(DisplayChangeListener *dcl) { static const char nodev[] = -- cgit v1.2.3