[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 02/29] vmsvga: Group together commands by their hand
From: |
Liran Alon |
Subject: |
[Qemu-devel] [PATCH 02/29] vmsvga: Group together commands by their handling |
Date: |
Thu, 9 Aug 2018 14:46:15 +0300 |
From: Leonid Shatz <address@hidden>
Should not change semantics.
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 | 60 ++++++++++++++++++++++++++++---------------------
1 file changed, 34 insertions(+), 26 deletions(-)
diff --git a/hw/display/vmware_vga.c b/hw/display/vmware_vga.c
index 60a672530840..f8c5b64cfd7c 100644
--- a/hw/display/vmware_vga.c
+++ b/hw/display/vmware_vga.c
@@ -607,6 +607,8 @@ static void vmsvga_fifo_run(struct vmsvga_state_s *s)
cmd_start = s->fifo_stop;
switch (cmd = vmsvga_fifo_read(s)) {
+
+ /* Implemented commands */
case SVGA_CMD_UPDATE:
case SVGA_CMD_UPDATE_VERBOSE:
len -= 5;
@@ -621,25 +623,6 @@ static void vmsvga_fifo_run(struct vmsvga_state_s *s)
vmsvga_update_rect_delayed(s, x, y, width, height);
break;
- case SVGA_CMD_RECT_FILL:
- len -= 6;
- if (len < 0) {
- goto rewind;
- }
-
- colour = vmsvga_fifo_read(s);
- x = vmsvga_fifo_read(s);
- y = vmsvga_fifo_read(s);
- width = vmsvga_fifo_read(s);
- height = vmsvga_fifo_read(s);
-#ifdef HW_FILL_ACCEL
- if (vmsvga_fill_rect(s, colour, x, y, width, height) == 0) {
- break;
- }
-#endif
- args = 0;
- goto badcmd;
-
case SVGA_CMD_RECT_COPY:
len -= 7;
if (len < 0) {
@@ -704,27 +687,52 @@ static void vmsvga_fifo_run(struct vmsvga_state_s *s)
#endif
/*
- * Other commands that we at least know the number of arguments
- * for so we can avoid FIFO desync if driver uses them illegally.
+ * Deprecated commands are neither documented in VMware SVGA
development kit
+ * nor in Linux kernel vmware-svga driver source code.
+ * If they are not encountered in real world scenarious, they should be
+ * completely removed.
*/
- case SVGA_CMD_DEFINE_ALPHA_CURSOR:
+ case SVGA_CMD_RECT_FILL:
len -= 6;
if (len < 0) {
goto rewind;
}
- vmsvga_fifo_read(s);
- vmsvga_fifo_read(s);
- vmsvga_fifo_read(s);
+
+ colour = vmsvga_fifo_read(s);
x = vmsvga_fifo_read(s);
y = vmsvga_fifo_read(s);
- args = x * y;
+ width = vmsvga_fifo_read(s);
+ height = vmsvga_fifo_read(s);
+#ifdef HW_FILL_ACCEL
+ if (vmsvga_fill_rect(s, colour, x, y, width, height) == 0) {
+ break;
+ }
+#endif
+ args = 0;
goto badcmd;
+
+ /*
+ * Unimplemented commands that we gracefully skip their
+ * arguments so we can avoid FIFO desync
+ */
case SVGA_CMD_RECT_ROP_FILL:
args = 6;
goto badcmd;
case SVGA_CMD_RECT_ROP_COPY:
args = 7;
goto badcmd;
+ case SVGA_CMD_DEFINE_ALPHA_CURSOR:
+ len -= 6;
+ if (len < 0) {
+ goto rewind;
+ }
+ vmsvga_fifo_read(s);
+ vmsvga_fifo_read(s);
+ vmsvga_fifo_read(s);
+ x = vmsvga_fifo_read(s);
+ y = vmsvga_fifo_read(s);
+ args = x * y;
+ goto badcmd;
case SVGA_CMD_DRAW_GLYPH_CLIPPED:
len -= 4;
if (len < 0) {
--
1.9.1
- [Qemu-devel] [PATCH 00/29]: vmsvga: Various fixes and enhancements, Liran Alon, 2018/08/09
- [Qemu-devel] [PATCH 01/29] vmsvga: Stop using redundant fifo pointer variable, Liran Alon, 2018/08/09
- [Qemu-devel] [PATCH 02/29] vmsvga: Group together commands by their handling,
Liran Alon <=
- [Qemu-devel] [PATCH 03/29] vmsvga: Explictly mark deprecated commands, Liran Alon, 2018/08/09
- [Qemu-devel] [PATCH 04/29] vmsvga: Do not print error message for ignored commands, Liran Alon, 2018/08/09
- [Qemu-devel] [PATCH 05/29] vmsvga: Show registers and commands on debug output as decimals, Liran Alon, 2018/08/09
- [Qemu-devel] [PATCH 06/29] vmsvga: Fix parse of SVGA_CMD_UPDATE_VERBOSE to consider additional opaque cookie, Liran Alon, 2018/08/09
- [Qemu-devel] [PATCH 07/29] vmsvga: Handle SVGA_CMD_FRONT_ROP_FILL command, Liran Alon, 2018/08/09
- [Qemu-devel] [PATCH 08/29] vmsvga: Parse SVGA_CMD_FENCE command to avoid FIFO desync, Liran Alon, 2018/08/09
- [Qemu-devel] [PATCH 09/29] vmsvga: Account for length of command word when parsing commands, Liran Alon, 2018/08/09