Skip to content
Snippets Groups Projects
Commit 9f14eb70 authored by Antonio Caggiano's avatar Antonio Caggiano
Browse files

virtio-gpu: Get EGL Display callback


Implement get_egl_display callback for virglrenderer.

Signed-off-by: default avatarAntonio Caggiano <antonio.caggiano@collabora.com>
parent 35d998f2
Branches
No related tags found
No related merge requests found
......@@ -18,6 +18,7 @@
#include "hw/virtio/virtio-gpu.h"
#include "hw/virtio/virtio-gpu-bswap.h"
#include "hw/virtio/virtio-iommu.h"
#include <epoxy/egl.h>
#include <virglrenderer.h>
......@@ -743,12 +744,24 @@ static int virgl_make_context_current(void *opaque, int scanout_idx,
qctx);
}
static void *virgl_get_egl_display(void *opaque)
{
return eglGetCurrentDisplay();
}
static struct virgl_renderer_callbacks virtio_gpu_3d_cbs = {
#ifdef HAVE_VIRGL_CBS_GET_EGL_DISPLAY
.version = 4,
#else
.version = 1,
#endif
.write_fence = virgl_write_fence,
.create_gl_context = virgl_create_context,
.destroy_gl_context = virgl_destroy_context,
.make_current = virgl_make_context_current,
#ifdef HAVE_VIRGL_CBS_GET_EGL_DISPLAY
.get_egl_display = virgl_get_egl_display,
#endif
};
static void virtio_gpu_print_stats(void *opaque)
......
......@@ -746,6 +746,11 @@ if not get_option('virglrenderer').auto() or have_system or have_vhost_user_gpu
cc.has_function('virgl_renderer_context_create_with_flags',
prefix: '#include <virglrenderer.h>',
dependencies: virgl))
config_host_data.set('HAVE_VIRGL_CBS_GET_EGL_DISPLAY',
cc.has_member('struct virgl_renderer_callbacks',
'get_egl_display',
prefix: '#include <virglrenderer.h>',
dependencies: virgl))
endif
curl = not_found
if not get_option('curl').auto() or have_block
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment