diff options
-rw-r--r-- | server/red-dispatcher.c | 35 | ||||
-rw-r--r-- | server/reds.c | 1 | ||||
-rw-r--r-- | server/reds.h | 2 | ||||
-rw-r--r-- | server/spice-qxl.h | 10 | ||||
-rw-r--r-- | server/spice-server.syms | 6 |
5 files changed, 54 insertions, 0 deletions
diff --git a/server/red-dispatcher.c b/server/red-dispatcher.c index 374d5a98..009c377b 100644 --- a/server/red-dispatcher.c +++ b/server/red-dispatcher.c @@ -960,6 +960,41 @@ void spice_qxl_driver_unload(QXLInstance *instance) red_dispatcher_driver_unload(instance->st->dispatcher); } +SPICE_GNUC_VISIBLE +void spice_qxl_gl_scanout(QXLInstance *qxl, + int fd, + uint32_t width, uint32_t height, + uint32_t stride, uint32_t format, + int y_0_top) +{ + spice_return_if_fail(qxl != NULL); + spice_return_if_fail(qxl->st->gl_draw_async == NULL); + + if (qxl->st->scanout.drm_dma_buf_fd != -1) { + close(qxl->st->scanout.drm_dma_buf_fd); + } + + qxl->st->scanout = (SpiceMsgDisplayGlScanoutUnix) { + .flags = y_0_top ? SPICE_GL_SCANOUT_FLAGS_Y0TOP : 0, + .drm_dma_buf_fd = fd, + .width = width, + .height = height, + .stride = stride, + .drm_fourcc_format = format + }; +} + +SPICE_GNUC_VISIBLE +void spice_qxl_gl_draw_async(QXLInstance *qxl, + uint32_t x, uint32_t y, + uint32_t w, uint32_t h, + uint64_t cookie) +{ + spice_return_if_fail(qxl != NULL); + spice_return_if_fail(qxl->st->scanout.drm_dma_buf_fd != -1); + spice_return_if_fail(qxl->st->gl_draw_async == NULL); +} + void red_dispatcher_async_complete(struct RedDispatcher *dispatcher, AsyncCommand *async_command) { diff --git a/server/reds.c b/server/reds.c index 7ccf0f1b..5f370c04 100644 --- a/server/reds.c +++ b/server/reds.c @@ -3185,6 +3185,7 @@ SPICE_GNUC_VISIBLE int spice_server_add_interface(SpiceServer *s, qxl = SPICE_CONTAINEROF(sin, QXLInstance, base); qxl->st = spice_new0(QXLState, 1); + qxl->st->scanout.drm_dma_buf_fd = -1; qxl->st->qif = SPICE_CONTAINEROF(interface, QXLInterface, base); red_dispatcher_init(qxl); diff --git a/server/reds.h b/server/reds.h index 8ff4491b..3182382d 100644 --- a/server/reds.h +++ b/server/reds.h @@ -36,6 +36,8 @@ extern RedsState *reds; struct QXLState { QXLInterface *qif; struct RedDispatcher *dispatcher; + SpiceMsgDisplayGlScanoutUnix scanout; + struct AsyncCommand *gl_draw_async; }; struct TunnelWorker; diff --git a/server/spice-qxl.h b/server/spice-qxl.h index 3faa3a4f..b8910bf4 100644 --- a/server/spice-qxl.h +++ b/server/spice-qxl.h @@ -104,6 +104,16 @@ void spice_qxl_driver_unload(QXLInstance *instance); /* since spice 0.12.6 */ void spice_qxl_set_max_monitors(QXLInstance *instance, unsigned int max_monitors); +/* since spice 0.13.1 */ +void spice_qxl_gl_scanout(QXLInstance *instance, + int fd, + uint32_t width, uint32_t height, + uint32_t stride, uint32_t format, + int y_0_top); +void spice_qxl_gl_draw_async(QXLInstance *instance, + uint32_t x, uint32_t y, + uint32_t w, uint32_t h, + uint64_t cookie); typedef struct QXLDrawArea { uint8_t *buf; diff --git a/server/spice-server.syms b/server/spice-server.syms index 4137546c..7987d51a 100644 --- a/server/spice-server.syms +++ b/server/spice-server.syms @@ -167,3 +167,9 @@ SPICE_SERVER_0.12.7 { global: spice_server_set_keepalive_timeout; } SPICE_SERVER_0.12.6; + +SPICE_SERVER_0.13.1 { +global: + spice_qxl_gl_scanout; + spice_qxl_gl_draw_async; +} SPICE_SERVER_0.12.7; |