From patchwork Thu Aug 9 11:46:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liran Alon X-Patchwork-Id: 10561333 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4B3FE157B for ; Thu, 9 Aug 2018 12:13:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 37AD82AF31 for ; Thu, 9 Aug 2018 12:13:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2C2A12AF43; Thu, 9 Aug 2018 12:13:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id AFF2D2AF31 for ; Thu, 9 Aug 2018 12:13:38 +0000 (UTC) Received: from localhost ([::1]:50157 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fnjov-0004Cz-Sp for patchwork-qemu-devel@patchwork.kernel.org; Thu, 09 Aug 2018 08:13:37 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56503) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fnjQ7-0005LK-V4 for qemu-devel@nongnu.org; Thu, 09 Aug 2018 07:48:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fnjQ5-0007XL-C1 for qemu-devel@nongnu.org; Thu, 09 Aug 2018 07:48:00 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:37186) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fnjQ5-0007X3-2d for qemu-devel@nongnu.org; Thu, 09 Aug 2018 07:47:57 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w79BiO5f178018; Thu, 9 Aug 2018 11:47:56 GMT 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=GwtIjzJMhao4vyGaj9oJMjftDi89NlwGqKrgdrOrSLs=; b=G1tHRA5/cfN/HTJ2DH3iPr3SDTn9fcHK/InLcLJXmJBscncdMOtNRWoDUy/met1QP0zU RD411v7WBSa1GBYETLc5VVtZshK58k9CNpyFbCR4n53yIX60YryV+36sbd8C2KH326z7 qpDZJfcrdzANIeYdVCcngjYcJBElRLw79F2G7iZOR0s+UUKQ9h/CmtiV5JgWjkyTkE+a pXalWG0BYYoB5a8BiJKjjsphWoAFaGvhWYApzwnmlXO1IuWfY3wTY2H3Av6Dvz3QEvcP eOhkCfk9Zgz8qWNM8z0xjny5DpDnCYNjOc2LYX6YaKlj9JS0Aikp8umATHuqcdeKgSaN kQ== Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp2120.oracle.com with ESMTP id 2kn43p2uxu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 09 Aug 2018 11:47:55 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w79BlssR007443 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 9 Aug 2018 11:47:55 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 w79Blshv031306; Thu, 9 Aug 2018 11:47:54 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:54 -0700 From: Liran Alon To: qemu-devel@nongnu.org Date: Thu, 9 Aug 2018 14:46:33 +0300 Message-Id: <1533815202-11967-21-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=876 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: 141.146.126.78 Subject: [Qemu-devel] [PATCH 20/29] vmsvga: Use standard names for params defining hardware cursor image 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Leonid Shatz AND/XOR mask is a standard method for defining hardware cursor images. These are also the names suggested by VMware SVGA DevKit. Signed-off-by: Leonid Shatz Reviewed-by: Darren Kenny Signed-off-by: Liran Alon --- hw/display/vmware_vga.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/hw/display/vmware_vga.c b/hw/display/vmware_vga.c index 73e373665bdb..d79b3400452b 100644 --- a/hw/display/vmware_vga.c +++ b/hw/display/vmware_vga.c @@ -619,8 +619,8 @@ struct vmsvga_cursor_definition_s { uint32_t bpp; int hot_x; int hot_y; - uint32_t mask[1024]; - uint32_t image[4096]; + uint32_t and_mask[1024]; + uint32_t xor_mask[4096]; }; #define SVGA_BITMAP_SIZE(w, h) ((((w) + 31) >> 5) * (h)) @@ -638,20 +638,20 @@ static inline void vmsvga_cursor_define(struct vmsvga_state_s *s, qc->hot_y = c->hot_y; switch (c->bpp) { case 1: - cursor_set_mono(qc, 0xffffff, 0x000000, (void *)c->image, - 1, (void *)c->mask); + cursor_set_mono(qc, 0xffffff, 0x000000, (void *)c->xor_mask, + 1, (void *)c->and_mask); #ifdef DEBUG cursor_print_ascii_art(qc, "vmware/mono"); #endif break; case 32: /* fill alpha channel from mask, set color to zero */ - cursor_set_mono(qc, 0x000000, 0x000000, (void *)c->mask, - 1, (void *)c->mask); + cursor_set_mono(qc, 0x000000, 0x000000, (void *)c->and_mask, + 1, (void *)c->and_mask); /* add in rgb values */ pixels = c->width * c->height; for (i = 0; i < pixels; i++) { - qc->data[i] |= c->image[i] & 0xffffff; + qc->data[i] |= c->xor_mask[i] & 0xffffff; } #ifdef DEBUG cursor_print_ascii_art(qc, "vmware/32bit"); @@ -801,9 +801,9 @@ static void vmsvga_fifo_run(struct vmsvga_state_s *s) if (cursor.width > 256 || cursor.height > 256 || cursor.bpp > 32 - || SVGA_BITMAP_SIZE(x, y) > ARRAY_SIZE(cursor.mask) + || SVGA_BITMAP_SIZE(x, y) > ARRAY_SIZE(cursor.and_mask) || SVGA_PIXMAP_SIZE(x, y, cursor.bpp) - > ARRAY_SIZE(cursor.image)) { + > ARRAY_SIZE(cursor.xor_mask)) { goto badcmd; } @@ -813,10 +813,10 @@ static void vmsvga_fifo_run(struct vmsvga_state_s *s) } for (args = 0; args < SVGA_BITMAP_SIZE(x, y); args++) { - cursor.mask[args] = vmsvga_fifo_read_raw(s); + cursor.and_mask[args] = vmsvga_fifo_read_raw(s); } for (args = 0; args < SVGA_PIXMAP_SIZE(x, y, cursor.bpp); args++) { - cursor.image[args] = vmsvga_fifo_read_raw(s); + cursor.xor_mask[args] = vmsvga_fifo_read_raw(s); } #ifdef HW_MOUSE_ACCEL vmsvga_cursor_define(s, &cursor);