qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 06/29] vmsvga: Fix parse of SVGA_CMD_UPDATE_VERBOSE


From: Liran Alon
Subject: [Qemu-devel] [PATCH 06/29] vmsvga: Fix parse of SVGA_CMD_UPDATE_VERBOSE to consider additional opaque cookie
Date: Thu, 9 Aug 2018 14:46:19 +0300

From: Leonid Shatz <address@hidden>

SVGA_CMD_UPDATE_VERBOSE has one more extra argument to fetch from command fifo,
as compared to SVGA_CMD_UPDATE command. From Linux kernel
drivers/gpu/drm/vmwgfx/device_include/svga_reg.h:
"Just like SVGA_CMD_UPDATE, but also provide a per-rectangle
'reason' value, an opaque cookie which is used by internal
debugging tools. Third party drivers should not use this
command."

Signed-off-by: Leonid Shatz <address@hidden>
Reviewed-by: Darren Kenny <address@hidden>
Signed-off-by: Liran Alon <address@hidden>
---
 hw/display/vmware_vga.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/hw/display/vmware_vga.c b/hw/display/vmware_vga.c
index 2fbb9e7f6c9f..d3a78809673d 100644
--- a/hw/display/vmware_vga.c
+++ b/hw/display/vmware_vga.c
@@ -611,8 +611,11 @@ static void vmsvga_fifo_run(struct vmsvga_state_s *s)
         switch (cmd = vmsvga_fifo_read(s)) {
 
         /* Implemented commands */
-        case SVGA_CMD_UPDATE:
         case SVGA_CMD_UPDATE_VERBOSE:
+            /* One extra word: an opaque cookie which is used for debugging */
+            len -= 1;
+            /* fall through */
+        case SVGA_CMD_UPDATE:
             len -= 5;
             if (len < 0) {
                 goto rewind;
@@ -622,6 +625,8 @@ static void vmsvga_fifo_run(struct vmsvga_state_s *s)
             y = vmsvga_fifo_read(s);
             width = vmsvga_fifo_read(s);
             height = vmsvga_fifo_read(s);
+            if (cmd == SVGA_CMD_UPDATE_VERBOSE)
+                vmsvga_fifo_read(s);
             vmsvga_update_rect_delayed(s, x, y, width, height);
             break;
 
-- 
1.9.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]