From patchwork Thu Aug 9 11:46:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liran Alon X-Patchwork-Id: 10561327 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 00134157B for ; Thu, 9 Aug 2018 12:11:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E16092A450 for ; Thu, 9 Aug 2018 12:11:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D56F12AF42; Thu, 9 Aug 2018 12:11:09 +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 7F6162A450 for ; Thu, 9 Aug 2018 12:11:09 +0000 (UTC) Received: from localhost ([::1]:50146 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fnjmW-00027U-N5 for patchwork-qemu-devel@patchwork.kernel.org; Thu, 09 Aug 2018 08:11:08 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56475) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fnjQ1-0005It-Qs for qemu-devel@nongnu.org; Thu, 09 Aug 2018 07:47:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fnjPz-0007Vs-7p for qemu-devel@nongnu.org; Thu, 09 Aug 2018 07:47:53 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:34408) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fnjPy-0007Vb-RQ for qemu-devel@nongnu.org; Thu, 09 Aug 2018 07:47:51 -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 w79Bif4P146062; Thu, 9 Aug 2018 11:47:49 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=c/bQW52I37G8+7kUgvkWOH1UtRFQTgRDqdTOVUSOmX0=; b=o0lY2ym6+AdrXc00Bbs5RT+NRezIGgX1OoeSYW0ko4ndGmJEbBSkHNVkGhN5D9ybOzV1 4cP/4jMsCtYkT385XGKF0fkN+2fZkxBhaR+nmBuKLbD6P4vmSXUvNGpWZraq1HmuRdif 1bekoerNcRZtAOhgvRJ9YlZsxD6FUpx7JD5F3PJNBpAcHTzDxbDcX7cUMQRxzEvjRQ5Z XHVFwWoOKo1YtgDnybopuVTioKsU4aeCGUNfmq8VDwXBcEX7f4AvaoiQEcI907dKCGki nJYgl4FR1bnnO8y08SuEeVHrwawGcIZxBOrtMWmru4Nu3RYsmL35Jbx2EUtSIs82SqQs zA== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp2130.oracle.com with ESMTP id 2kn3jtav6r-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 09 Aug 2018 11:47:49 +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 w79BlnmX012600 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 9 Aug 2018 11:47:49 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 w79BlmRk020131; Thu, 9 Aug 2018 11:47:48 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:48 -0700 From: Liran Alon To: qemu-devel@nongnu.org Date: Thu, 9 Aug 2018 14:46:31 +0300 Message-Id: <1533815202-11967-19-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: 156.151.31.86 Subject: [Qemu-devel] [PATCH 18/29] vmsvga: Add support for SVGA_IRQFLAG_FIFO_PROGRESS 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 Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP If vmsvga supports interrupts (SVGA_CAP_IRQMASK), some guests wait for FIFO to become not full by sleeping until FIFO_PROGRESS interrupt occurs. This is the most efficient thing to do when the FIFO fills up. To support these guests, add support for SVGA_IRQFLAG_FIFO_PROGRESS. See usage example by guest in VMware SVGA development kit SVGAFIFOFull(). Reviewed-by: Darren Kenny Signed-off-by: Liran Alon --- hw/display/vmware_vga.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/hw/display/vmware_vga.c b/hw/display/vmware_vga.c index 597051ec5c92..dc5f4681f0d3 100644 --- a/hw/display/vmware_vga.c +++ b/hw/display/vmware_vga.c @@ -731,6 +731,7 @@ static void vmsvga_fifo_run(struct vmsvga_state_s *s) uint32_t cmd_start; bool cmd_ignored; bool irq_pending = false; + bool fifo_progress = false; len = vmsvga_fifo_length(s); while (len > 0 && --maxloop > 0) { @@ -930,6 +931,15 @@ static void vmsvga_fifo_run(struct vmsvga_state_s *s) s->fifo[SVGA_FIFO_STOP] = cpu_to_le32(s->fifo_stop); break; } + + if (s->fifo_stop != cmd_start) + fifo_progress = true; + } + + if ((s->irq_mask & SVGA_IRQFLAG_FIFO_PROGRESS) && + fifo_progress) { + s->irq_status |= SVGA_IRQFLAG_FIFO_PROGRESS; + irq_pending = true; } s->syncing = 0;