mirror of https://gitee.com/openkylin/qemu.git
ui: add a DCLOps callback to check dmabuf support
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20210204105232.834642-13-marcandre.lureau@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
parent
a7dfbe289e
commit
d0e137bc9a
|
@ -224,6 +224,8 @@ typedef struct DisplayChangeListenerOps {
|
|||
uint32_t backing_height,
|
||||
uint32_t x, uint32_t y,
|
||||
uint32_t w, uint32_t h);
|
||||
/* optional (default to true if has dpy_gl_scanout_dmabuf) */
|
||||
bool (*dpy_has_dmabuf)(DisplayChangeListener *dcl);
|
||||
/* optional */
|
||||
void (*dpy_gl_scanout_dmabuf)(DisplayChangeListener *dcl,
|
||||
QemuDmaBuf *dmabuf);
|
||||
|
|
13
ui/console.c
13
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[] =
|
||||
|
|
Loading…
Reference in New Issue