[Spice-devel] [PATCH spice-server] Define a new interface for Qemu to pass EGL display

Frediano Ziglio fziglio at redhat.com
Wed Feb 22 11:29:05 UTC 2017


The new interface pass directly the EGL display to make
possible to extract texture data if necessary.
Also allows to use the same device using hardware
encoders.

Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
---
 server/red-qxl.c         | 10 ++++++++++
 server/spice-qxl.h       |  3 +++
 server/spice-server.syms |  5 +++++
 3 files changed, 18 insertions(+)

diff --git a/server/red-qxl.c b/server/red-qxl.c
index b6b3770..367a428 100644
--- a/server/red-qxl.c
+++ b/server/red-qxl.c
@@ -60,6 +60,8 @@ struct QXLState {
     RedsState *reds;
     RedWorker *worker;
 
+    void *egl_display;
+
     pthread_mutex_t scanout_mutex;
     SpiceMsgDisplayGlScanoutUnix scanout;
     struct AsyncCommand *gl_draw_async;
@@ -865,6 +867,14 @@ void red_qxl_put_gl_scanout(QXLInstance *qxl, SpiceMsgDisplayGlScanoutUnix *scan
 }
 
 SPICE_GNUC_VISIBLE
+void spice_qxl_gl_setup(QXLInstance *qxl,
+                        void *egl_display)
+{
+    QXLState *qxl_state = qxl->st;
+    qxl_state->egl_display = egl_display;
+}
+
+SPICE_GNUC_VISIBLE
 void spice_qxl_gl_scanout(QXLInstance *qxl,
                           int fd,
                           uint32_t width, uint32_t height,
diff --git a/server/spice-qxl.h b/server/spice-qxl.h
index b8910bf..07da0dc 100644
--- a/server/spice-qxl.h
+++ b/server/spice-qxl.h
@@ -114,6 +114,9 @@ void spice_qxl_gl_draw_async(QXLInstance *instance,
                              uint32_t x, uint32_t y,
                              uint32_t w, uint32_t h,
                              uint64_t cookie);
+/* since spice 0.13.4 */
+void spice_qxl_gl_setup(QXLInstance *instance,
+                        void *egl_display);
 
 typedef struct QXLDrawArea {
     uint8_t *buf;
diff --git a/server/spice-server.syms b/server/spice-server.syms
index edf04a4..8aeb40f 100644
--- a/server/spice-server.syms
+++ b/server/spice-server.syms
@@ -173,3 +173,8 @@ SPICE_SERVER_0.13.2 {
 global:
     spice_server_set_video_codecs;
 } SPICE_SERVER_0.13.1;
+
+SPICE_SERVER_0.13.4 {
+global:
+    spice_qxl_gl_setup;
+} SPICE_SERVER_0.13.2;
-- 
2.9.3



More information about the Spice-devel mailing list