[Spice-devel] [RFC v2 5/5] red-qxl: Add a new parameter to gl_scanout and gl_draw_async
Kasireddy, Vivek
vivek.kasireddy at intel.com
Tue Jan 24 06:44:08 UTC 2023
Hi Frediano,
>
> Il giorno lun 23 gen 2023 alle ore 09:01 Vivek Kasireddy
> <vivek.kasireddy at intel.com> ha scritto:
> >
> > This new parameter (named local_display) can be used by applications
> > to indicate whether they are dealing with a local or remote client.
> > This can be useful to ensure that gl_draw or other associated
> > messages are only sent to local clients.
> >
>
> It's spice server that knows if the client are local or remote,
> there's no need to have a configuration in Qemu.
[Kasireddy, Vivek] Ok, I can get rid of this parameter. However, from the
Spice server side, do you think checking for reds->config->spice_port > 0
would be a reasonable way to determine a local vs remote client?
>
> > Cc: Gerd Hoffmann <kraxel at redhat.com>
> > Cc: Marc-André Lureau <marcandre.lureau at redhat.com>
> > Cc: Dongwon Kim <dongwon.kim at intel.com>
> > Signed-off-by: Vivek Kasireddy <vivek.kasireddy at intel.com>
> > ---
> > server/red-qxl.cpp | 14 ++++++++++----
> > server/spice-qxl.h | 4 ++--
> > 2 files changed, 12 insertions(+), 6 deletions(-)
> >
> > diff --git a/server/red-qxl.cpp b/server/red-qxl.cpp
> > index 48c293ae..14380a60 100644
> > --- a/server/red-qxl.cpp
> > +++ b/server/red-qxl.cpp
> > @@ -426,7 +426,8 @@ 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)
> > + int y_0_top,
> > + uint32_t local_display)
> > {
> > RedWorkerMessageGlScanout payload = { /* empty */ };
> > spice_return_if_fail(qxl != nullptr);
> > @@ -452,7 +453,9 @@ void spice_qxl_gl_scanout(QXLInstance *qxl,
> > pthread_mutex_unlock(&qxl_state->scanout_mutex);
> >
> > /* FIXME: find a way to coallesce all pending SCANOUTs */
> > - qxl_state->send_message(payload);
> > + if (local_display) {
> > + qxl_state->send_message(payload);
> > + }
> > reds_update_client_mouse_allowed(qxl_state->reds);
> > }
> >
> > @@ -460,7 +463,8 @@ 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)
> > + uint64_t cookie,
> > + uint32_t local_display)
> > {
> > QXLState *qxl_state;
> > RedWorkerMessageGlDraw draw = {
> > @@ -482,7 +486,9 @@ void spice_qxl_gl_draw_async(QXLInstance *qxl,
> > spice_return_if_fail(qxl_state->gl_draw_cookie ==
> GL_DRAW_COOKIE_INVALID);
> >
> > qxl_state->gl_draw_cookie = cookie;
> > - qxl_state->send_message(draw);
> > + if (local_display) {
> > + qxl_state->send_message(draw);
> > + }
> > }
> >
> > void red_qxl_gl_draw_async_complete(QXLInstance *qxl)
> > diff --git a/server/spice-qxl.h b/server/spice-qxl.h
> > index bf17476b..2749f1c9 100644
> > --- a/server/spice-qxl.h
> > +++ b/server/spice-qxl.h
> > @@ -87,11 +87,11 @@ 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);
> > + int y_0_top, uint32_t local_display);
> > void spice_qxl_gl_draw_async(QXLInstance *qxl,
> > uint32_t x, uint32_t y,
> > uint32_t w, uint32_t h,
> > - uint64_t cookie);
> > + uint64_t cookie, uint32_t local_display);
> >
>
> You cannot add a parameter, this will break both API and ABI.
[Kasireddy, Vivek] Ok, I guess I'll have to figure out an alternative way
to detect local vs remote clients.
Thanks,
Vivek
>
> > /* since spice 0.14.2 */
> >
>
> Frediano
More information about the Spice-devel
mailing list