Allows surfaces to be updated without having to wait

Enterprise / Virtualization / SPICE - Frediano Ziglio [gmail.com] - 7 August 2021 06:46 UTC

Store pointers to surface object in "surfaces" and allows to have different surfaces with same ID in memory. The surface was keep "busy" if there was pending drawing around.

Consider the following case: 1- receive drawing command 2- queue command on DCCs 3- destroy surface 4- send draw Previously at point 4) you would have to use a surface from "surfaces" which was destroyed, that is we would have to maintain the pointer (and canvas) to the surface until reference counter was 0.

However consider this case: 1- receive drawing command 2- queue command on DCCs 3- destroy surface 4- create surface 5- send draw What would happen in point 4) ? We could not change the surface as it will be used by point 5). To avoid this the code attempts to wait the commands to release the surface. However this can be an issue, you can't force the clients to receive pending data if network is slow.

So this patch change this allowing to create surfaces while the old
version will still be used.

This is also more clean from the reference pointer prospective, as the reference is increased for a specific surface.

Note that now instead of checking for canvas to not be NULL a simple check for surface pointer is enough.

d8bca15f Allows surfaces to be updated without having to wait
server/dcc-send.cpp | 52 ++++++++++++--------
server/dcc.cpp | 11 +++--
server/display-channel-private.h | 4 +-
server/display-channel.cpp | 101 ++++++++++++++++++++++-----------------
server/display-channel.h | 8 ++--
server/video-stream.cpp | 4 +-
6 files changed, 105 insertions(+), 75 deletions(-)

Upstream: cgit.freedesktop.org


  • Share