From nobody Wed Nov 5 10:05:25 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 (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1533815791418320.96291303005523; Thu, 9 Aug 2018 04:56:31 -0700 (PDT) Received: from localhost ([::1]:50063 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fnjYD-0004Km-I4 for importer@patchew.org; Thu, 09 Aug 2018 07:56:21 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56513) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fnjQA-0005Ml-JS for qemu-devel@nongnu.org; Thu, 09 Aug 2018 07:48:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fnjQ7-0007Xp-Vr for qemu-devel@nongnu.org; Thu, 09 Aug 2018 07:48:02 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:34506) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fnjQ7-0007Xb-Mh for qemu-devel@nongnu.org; Thu, 09 Aug 2018 07:47:59 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w79Bif4Q146062; Thu, 9 Aug 2018 11:47:58 GMT Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp2130.oracle.com with ESMTP id 2kn3jtav79-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 09 Aug 2018 11:47:58 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w79Blw3w012958 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 9 Aug 2018 11:47:58 GMT Received: from abhmp0014.oracle.com (abhmp0014.oracle.com [141.146.116.20]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w79BlvbW020163; Thu, 9 Aug 2018 11:47:57 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:57 -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=+/sZfNN8DKBn9jzVBXJtaBDV/ijQrFEVpsPLQP2MO9o=; b=lnEItzQEVDcSZboPVQbzx0D5XMzegQ+rxfv+nzMTg7txKN22UFzR+uBL3SIOZSgJA7hC IJhhVlmmtYCA6GvBgV9pU/JUQg9xzXrIV+H15zfYHzBV3EzEP/M0GKXAwdhpXz3qDaod uE/Q1dSOdI+L7w5eZanlxqvS2HUpuxenTvj2mE7XFWkcgRv3TT+DPItKky7qeUxv7oDk nkaqERsvJ9VjU5rPsrVfdq1XO8XkgAhfEC+Y/mMbqRVzQmajLGDpmKBduFnVNKvjmWLN c5N2o61nchz3ZyDcwE4GqU8ntLcVAn0GGiTN3gaylnZqu/IfYNEaRr4m2coVEDBoOVFy JA== From: Liran Alon To: qemu-devel@nongnu.org Date: Thu, 9 Aug 2018 14:46:34 +0300 Message-Id: <1533815202-11967-22-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=787 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.86 Subject: [Qemu-devel] [PATCH 21/29] vmsvga: Use AND mask bpp parameter in SVGA_CMD_DEFINE_CURSOR 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 Prefer variable names of cursor structure from VMware SVGA DevKit. In addition, make sure to use the AND mask bpp parameter in SVGA_CMD_DEFINE_CURSOR. Signed-off-by: Leonid Shatz Reviewed-by: Darren Kenny Signed-off-by: Liran Alon --- hw/display/vmware_vga.c | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/hw/display/vmware_vga.c b/hw/display/vmware_vga.c index d79b3400452b..ef2c8bdbf5be 100644 --- a/hw/display/vmware_vga.c +++ b/hw/display/vmware_vga.c @@ -616,9 +616,10 @@ struct vmsvga_cursor_definition_s { uint32_t width; uint32_t height; int id; - uint32_t bpp; int hot_x; int hot_y; + uint32_t and_mask_bpp; // Value must be 1 or equal to BITS_PER_PIXEL + uint32_t xor_mask_bpp; // Value must be 1 or equal to BITS_PER_PIXEL uint32_t and_mask[1024]; uint32_t xor_mask[4096]; }; @@ -636,7 +637,7 @@ static inline void vmsvga_cursor_define(struct vmsvga_s= tate_s *s, qc =3D cursor_alloc(c->width, c->height); qc->hot_x =3D c->hot_x; qc->hot_y =3D c->hot_y; - switch (c->bpp) { + switch (c->xor_mask_bpp) { case 1: cursor_set_mono(qc, 0xffffff, 0x000000, (void *)c->xor_mask, 1, (void *)c->and_mask); @@ -659,7 +660,7 @@ static inline void vmsvga_cursor_define(struct vmsvga_s= tate_s *s, break; default: fprintf(stderr, "%s: unhandled bpp %d, using fallback cursor\n", - __func__, c->bpp); + __func__, c->xor_mask_bpp); cursor_put(qc); qc =3D cursor_builtin_left_ptr(); } @@ -794,15 +795,18 @@ static void vmsvga_fifo_run(struct vmsvga_state_s *s) cursor.hot_y =3D vmsvga_fifo_read(s); cursor.width =3D x =3D vmsvga_fifo_read(s); cursor.height =3D y =3D vmsvga_fifo_read(s); - vmsvga_fifo_read(s); - cursor.bpp =3D vmsvga_fifo_read(s); + cursor.and_mask_bpp =3D vmsvga_fifo_read(s); + cursor.xor_mask_bpp =3D vmsvga_fifo_read(s); =20 - args =3D SVGA_BITMAP_SIZE(x, y) + SVGA_PIXMAP_SIZE(x, y, curso= r.bpp); + args =3D SVGA_PIXMAP_SIZE(x, y, cursor.and_mask_bpp) + + SVGA_PIXMAP_SIZE(x, y, cursor.xor_mask_bpp); if (cursor.width > 256 || cursor.height > 256 - || cursor.bpp > 32 - || SVGA_BITMAP_SIZE(x, y) > ARRAY_SIZE(cursor.and_mask) - || SVGA_PIXMAP_SIZE(x, y, cursor.bpp) + || cursor.and_mask_bpp > 32 + || cursor.xor_mask_bpp > 32 + || SVGA_PIXMAP_SIZE(x, y, cursor.and_mask_bpp) + > ARRAY_SIZE(cursor.and_mask) + || SVGA_PIXMAP_SIZE(x, y, cursor.xor_mask_bpp) > ARRAY_SIZE(cursor.xor_mask)) { goto badcmd; } @@ -812,10 +816,10 @@ static void vmsvga_fifo_run(struct vmsvga_state_s *s) goto rewind; } =20 - for (args =3D 0; args < SVGA_BITMAP_SIZE(x, y); args++) { + for (args =3D 0; args < SVGA_PIXMAP_SIZE(x, y, cursor.and_mask= _bpp); args++) { cursor.and_mask[args] =3D vmsvga_fifo_read_raw(s); } - for (args =3D 0; args < SVGA_PIXMAP_SIZE(x, y, cursor.bpp); ar= gs++) { + for (args =3D 0; args < SVGA_PIXMAP_SIZE(x, y, cursor.xor_mask= _bpp); args++) { cursor.xor_mask[args] =3D vmsvga_fifo_read_raw(s); } #ifdef HW_MOUSE_ACCEL --=20 1.9.1