[Spice-devel] [PATCH spice-server] red-parse-qxl: Avoid invalid flag usage

Frediano Ziglio fziglio at redhat.com
Fri Jun 22 16:19:59 UTC 2018


self_bitmap flag is used for some complex drawing not possible
by QXL_DRAW_COPY commands. Having this flag set causes
spice-server do draw part of the screen, copy that part on new
allocated image and reduce network optimisations with no visual
changes.
Some drivers (like Windows 10 DOD) set this flag by mistake for
this command so reset it.

Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
---
 server/red-parse-qxl.c | 4 ++++
 1 file changed, 4 insertions(+)

The only concern about this patch is that the flag could be reset
from all calls to red_get_copy_ptr/red_get_blend_ptr

diff --git a/server/red-parse-qxl.c b/server/red-parse-qxl.c
index 4a45c0f7..0bf022d5 100644
--- a/server/red-parse-qxl.c
+++ b/server/red-parse-qxl.c
@@ -1051,6 +1051,10 @@ static bool red_get_native_drawable(RedMemSlotInfo *slots, int group_id,
     case QXL_DRAW_BLEND:
         return red_get_blend_ptr(slots, group_id, &red->u.blend, &qxl->u.blend, flags);
     case QXL_DRAW_COPY:
+        /* there's no sense to have this true, this will just waste CPU and reduce optimizations
+         * for this command. Due to some bugs however some driver set self_bitmap field for this
+         * command so reset it. */
+        red->self_bitmap = false;
         return red_get_copy_ptr(slots, group_id, &red->u.copy, &qxl->u.copy, flags);
     case QXL_COPY_BITS:
         red_get_point_ptr(&red->u.copy_bits.src_pos, &qxl->u.copy_bits.src_pos);
-- 
2.17.1



More information about the Spice-devel mailing list