From nobody Wed Nov 5 10:37:14 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 1533816865051288.299187398065; Thu, 9 Aug 2018 05:14:25 -0700 (PDT) Received: from localhost ([::1]:50158 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fnjpf-0004P1-Rh for importer@patchew.org; Thu, 09 Aug 2018 08:14:23 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56635) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fnjQU-0005cN-In for qemu-devel@nongnu.org; Thu, 09 Aug 2018 07:48:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fnjQR-0007hj-R2 for qemu-devel@nongnu.org; Thu, 09 Aug 2018 07:48:22 -0400 Received: from aserp2130.oracle.com ([141.146.126.79]:48654) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fnjQR-0007gx-Fu for qemu-devel@nongnu.org; Thu, 09 Aug 2018 07:48:19 -0400 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w79BidFD163073; Thu, 9 Aug 2018 11:48:18 GMT Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp2130.oracle.com with ESMTP id 2kn1nday1y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 09 Aug 2018 11:48:18 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w79BmIRD019436 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 9 Aug 2018 11:48:18 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 w79BmIh2031513; Thu, 9 Aug 2018 11:48:18 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:48:17 -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=EK2eI5yW5+h/5DyN67K6qxZ4l4NPErFn5tTJimqGS4E=; b=kVk+N0sg2GBNmTkQmkJsjFS3tYXBWmFzA1W/zluyfLBdAbTLWAOjlIQ5Cz8ZuUEOafXS N3fv7YANeOD6NCymDteOOi300HDP7SVnm1yL8xhk/o/RbdKwMlzxcIiTxQ34wUFMqkVV Os5PH5LWXDGA22lHXAzrFOf8fIh1gvK+uNb5MMVIbYVTYINkcBRQ0NWV7+AGva7w7tpC yczrfgS+D2jrEexh/Er/m8003tMH5x8hwRTin87mIvedDu7SiPnirBNvPPtuinh6/UUe DJImQf8iOkWlelS9XVnm+kKY5OM50VP7JuUj9EaC0Z7LQ3QoH7Qs1vq8olKa3c5BLeOY fQ== From: Liran Alon To: qemu-devel@nongnu.org Date: Thu, 9 Aug 2018 14:46:41 +0300 Message-Id: <1533815202-11967-29-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=999 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.79 Subject: [Qemu-devel] [PATCH 28/29] vmsvga: Introduce new function for reporting device capabilities 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 This in only code refactoring without change in semantics. Signed-off-by: Leonid Shatz Reviewed-by: Darren Kenny Signed-off-by: Liran Alon --- hw/display/vmware_vga.c | 45 +++++++++++++++++++++++++-------------------- 1 file changed, 25 insertions(+), 20 deletions(-) diff --git a/hw/display/vmware_vga.c b/hw/display/vmware_vga.c index bd7202833081..389248b4badf 100644 --- a/hw/display/vmware_vga.c +++ b/hw/display/vmware_vga.c @@ -479,6 +479,30 @@ static void cursor_update_from_fifo(struct vmsvga_stat= e_s *s) #endif } =20 +/* Report device capabilities */ +static uint32_t vmsvga_device_caps(struct vmsvga_state_s *s) +{ + uint32_t caps =3D SVGA_CAP_NONE; +#ifdef HW_RECT_ACCEL + caps |=3D SVGA_CAP_RECT_COPY; +#endif +#ifdef HW_FILL_ACCEL + caps |=3D SVGA_CAP_RECT_FILL; +#endif +#ifdef HW_MOUSE_ACCEL + if (dpy_cursor_define_supported(s->vga.con)) { + caps |=3D SVGA_CAP_ALPHA_CURSOR; + caps |=3D SVGA_CAP_CURSOR | SVGA_CAP_CURSOR_BYPASS_2 | + SVGA_CAP_CURSOR_BYPASS; + } +#endif + caps |=3D SVGA_CAP_IRQMASK; + caps |=3D SVGA_CAP_EXTENDED_FIFO; + caps |=3D SVGA_CAP_DISPLAY_TOPOLOGY; + caps |=3D SVGA_CAP_PITCHLOCK; + return caps; +} + static inline bool vmsvga_verify_rect(DisplaySurface *surface, const char *name, int x, int y, int w, int h) @@ -1140,7 +1164,6 @@ static void vmsvga_index_write(void *opaque, uint32_t= address, uint32_t index) =20 static uint32_t vmsvga_value_read(void *opaque, uint32_t address) { - uint32_t caps; struct vmsvga_state_s *s =3D opaque; DisplaySurface *surface =3D qemu_console_surface(s->vga.con); PixelFormat pf; @@ -1228,25 +1251,7 @@ static uint32_t vmsvga_value_read(void *opaque, uint= 32_t address) break; =20 case SVGA_REG_CAPABILITIES: - caps =3D SVGA_CAP_NONE; -#ifdef HW_RECT_ACCEL - caps |=3D SVGA_CAP_RECT_COPY; -#endif -#ifdef HW_FILL_ACCEL - caps |=3D SVGA_CAP_RECT_FILL; -#endif -#ifdef HW_MOUSE_ACCEL - if (dpy_cursor_define_supported(s->vga.con)) { - caps |=3D SVGA_CAP_ALPHA_CURSOR; - caps |=3D SVGA_CAP_CURSOR | SVGA_CAP_CURSOR_BYPASS_2 | - SVGA_CAP_CURSOR_BYPASS; - } -#endif - caps |=3D SVGA_CAP_EXTENDED_FIFO; - caps |=3D SVGA_CAP_IRQMASK; - caps |=3D SVGA_CAP_DISPLAY_TOPOLOGY; - caps |=3D SVGA_CAP_PITCHLOCK; - ret =3D caps; + ret =3D vmsvga_device_caps(s); break; =20 case SVGA_REG_MEM_START: { --=20 1.9.1