From nobody Wed Nov 5 10:04:46 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=oracle.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1533815839192717.2158990050897; Thu, 9 Aug 2018 04:57:19 -0700 (PDT) Received: from localhost ([::1]:50067 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fnjZ7-0005FE-V3 for importer@patchew.org; Thu, 09 Aug 2018 07:57:18 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56118) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fnjPH-0004ex-AL for qemu-devel@nongnu.org; Thu, 09 Aug 2018 07:47:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fnjPE-00072E-MX for qemu-devel@nongnu.org; Thu, 09 Aug 2018 07:47:07 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:60534) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fnjPE-000720-CB for qemu-devel@nongnu.org; Thu, 09 Aug 2018 07:47:04 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w79Bj4UZ138635; Thu, 9 Aug 2018 11:47:03 GMT Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp2120.oracle.com with ESMTP id 2kn4sq2s6k-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 09 Aug 2018 11:47:03 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w79Bl2Ck010886 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 9 Aug 2018 11:47:03 GMT Received: from abhmp0014.oracle.com (abhmp0014.oracle.com [141.146.116.20]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w79Bl21d030948; Thu, 9 Aug 2018 11:47:02 GMT Received: from liran-pc.ravello.local (/213.57.127.2) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 09 Aug 2018 04:47:02 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=corp-2018-07-02; bh=Xs9GOostt6VkUVSjbBngPMYa4MEOCFbLHcv99Kp3f+A=; b=moMobxhKxdv9S0M8DaUJLuUppCL2t+7WQ2fHfk8JMsY7x1UWChXtkyDudf1zad0j6UjR 2bBSLwf5JAip6idqsrePhO1xZdJNJcClhnwS1PvuCcN7Nn6NLwBQCJU3FoIwW681QsD4 k8xCIxRPUFwec0J+9GyRdr2nHy33tRL0RwipYMonVrDVfSSEfPkDQCmMhUdZIos/5z/6 wG+tOgr1uEwAYZ2H1wR6XUwSif69Z597y0zGULl4GxwCHG91tLFF0gYzf/IWFyX3uXWw CjCbBgo2M9jI0E74kchB3UVgG8jD7Lw68FqjICPWe2gM91WRQC1LfGOfu1FalB5G1e+v rQ== From: Liran Alon To: qemu-devel@nongnu.org Date: Thu, 9 Aug 2018 14:46:15 +0300 Message-Id: <1533815202-11967-3-git-send-email-liran.alon@oracle.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1533815202-11967-1-git-send-email-liran.alon@oracle.com> References: <1533815202-11967-1-git-send-email-liran.alon@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8979 signatures=668707 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=803 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1808090123 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 156.151.31.85 Subject: [Qemu-devel] [PATCH 02/29] vmsvga: Group together commands by their handling X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: habkost@redhat.com, mtosatti@redhat.com, Liran Alon , kraxel@redhat.com, pbonzini@redhat.com, rth@twiddle.net, Leonid Shatz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDMRC_1 RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Leonid Shatz Should not change semantics. Signed-off-by: Leonid Shatz Reviewed-by: Darren Kenny Signed-off-by: Liran Alon --- 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 =3D s->fifo_stop; =20 switch (cmd =3D vmsvga_fifo_read(s)) { + + /* Implemented commands */ case SVGA_CMD_UPDATE: case SVGA_CMD_UPDATE_VERBOSE: len -=3D 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; =20 - case SVGA_CMD_RECT_FILL: - len -=3D 6; - if (len < 0) { - goto rewind; - } - - colour =3D vmsvga_fifo_read(s); - x =3D vmsvga_fifo_read(s); - y =3D vmsvga_fifo_read(s); - width =3D vmsvga_fifo_read(s); - height =3D vmsvga_fifo_read(s); -#ifdef HW_FILL_ACCEL - if (vmsvga_fill_rect(s, colour, x, y, width, height) =3D=3D 0)= { - break; - } -#endif - args =3D 0; - goto badcmd; - case SVGA_CMD_RECT_COPY: len -=3D 7; if (len < 0) { @@ -704,27 +687,52 @@ static void vmsvga_fifo_run(struct vmsvga_state_s *s) #endif =20 /* - * 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 devel= opment kit + * nor in Linux kernel vmware-svga driver source code. + * If they are not encountered in real world scenarious, they shou= ld be + * completely removed. */ - case SVGA_CMD_DEFINE_ALPHA_CURSOR: + case SVGA_CMD_RECT_FILL: len -=3D 6; if (len < 0) { goto rewind; } - vmsvga_fifo_read(s); - vmsvga_fifo_read(s); - vmsvga_fifo_read(s); + + colour =3D vmsvga_fifo_read(s); x =3D vmsvga_fifo_read(s); y =3D vmsvga_fifo_read(s); - args =3D x * y; + width =3D vmsvga_fifo_read(s); + height =3D vmsvga_fifo_read(s); +#ifdef HW_FILL_ACCEL + if (vmsvga_fill_rect(s, colour, x, y, width, height) =3D=3D 0)= { + break; + } +#endif + args =3D 0; goto badcmd; + + /* + * Unimplemented commands that we gracefully skip their + * arguments so we can avoid FIFO desync + */ case SVGA_CMD_RECT_ROP_FILL: args =3D 6; goto badcmd; case SVGA_CMD_RECT_ROP_COPY: args =3D 7; goto badcmd; + case SVGA_CMD_DEFINE_ALPHA_CURSOR: + len -=3D 6; + if (len < 0) { + goto rewind; + } + vmsvga_fifo_read(s); + vmsvga_fifo_read(s); + vmsvga_fifo_read(s); + x =3D vmsvga_fifo_read(s); + y =3D vmsvga_fifo_read(s); + args =3D x * y; + goto badcmd; case SVGA_CMD_DRAW_GLYPH_CLIPPED: len -=3D 4; if (len < 0) { --=20 1.9.1