From patchwork Tue Mar 15 07:29:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Hellstrom X-Patchwork-Id: 8585941 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 1FDDA9F6E1 for ; Tue, 15 Mar 2016 07:52:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5B30C201B9 for ; Tue, 15 Mar 2016 07:52:25 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 764532010F for ; Tue, 15 Mar 2016 07:52:24 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 974F96E6BC; Tue, 15 Mar 2016 07:52:13 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mx2.bahnhof.se (mx2.bahnhof.se [213.80.101.12]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5E8146E6C4 for ; Tue, 15 Mar 2016 07:52:04 +0000 (UTC) Received: from localhost (mf.bahnhof.se [213.80.101.20]) by mx2-reinject (Postfix) with ESMTP id 65DA845231; Tue, 15 Mar 2016 08:30:19 +0100 (CET) X-Virus-Scanned: by amavisd-new using ClamAV at bahnhof.se (MF2) X-Spam-Score: -0.561 X-Spam-Level: X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from mf2.bahnhof.se ([127.0.0.1]) by localhost (mf2.bahnhof.se [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6OPaRu4PlrDr; Tue, 15 Mar 2016 08:30:19 +0100 (CET) Received: from mail.shipmail.org (h-5-150-198-217.na.cust.bahnhof.se [5.150.198.217]) by mf2.bahnhof.se (Postfix) with ESMTP id 156B2940280; Tue, 15 Mar 2016 08:30:19 +0100 (CET) Received: from mail.shipmail.org (lin0.kontor.shipmail.org [127.0.0.1]) by mail.shipmail.org (Postfix) with ESMTP id D87E733807C; Tue, 15 Mar 2016 08:30:18 +0100 (CET) Received: from lin0.kontor.shipmail.org [127.0.0.1] by BitDefender SMTP Proxy on lin0.kontor.shipmail.org [127.0.0.1] for lin0.kontor.shipmail.org [127.0.0.1]; Tue, 15 Mar 2016 08:30:18 +0100 (CET) Received: from linvm2.localdomain (lin0.kontor.shipmail.org [127.0.0.1]) by mail.shipmail.org (Postfix) with ESMTP id A3B72338080; Tue, 15 Mar 2016 08:30:18 +0100 (CET) From: Thomas Hellstrom To: dri-devel@lists.freedesktop.org Subject: [PATCH 02/14] drm/vmwgfx: Fix a screen object framebuffer dirty corner case Date: Tue, 15 Mar 2016 08:29:52 +0100 Message-Id: <1458027004-3180-2-git-send-email-thellstrom@vmware.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1458027004-3180-1-git-send-email-thellstrom@vmware.com> References: <1458027004-3180-1-git-send-email-thellstrom@vmware.com> X-BitDefender-Scanner: Mail not scanned due to license constraints Cc: Thomas Hellstrom X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If there are no cliprects for a particular crtc, an invalid command would have been generated. If that's the case, instead ditch the generated command sequence. Signed-off-by: Thomas Hellstrom Reviewed-by: Sinclair Yeh --- drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c b/drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c index c5a1a08..cbc1fba 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c @@ -738,6 +738,11 @@ static void vmw_sou_surface_fifo_commit(struct vmw_kms_dirty *dirty) SVGASignedRect *blit = (SVGASignedRect *) &cmd[1]; int i; + if (!dirty->num_hits) { + vmw_fifo_commit(dirty->dev_priv, 0); + return; + } + cmd->header.id = SVGA_3D_CMD_BLIT_SURFACE_TO_SCREEN; cmd->header.size = sizeof(cmd->body) + region_size; @@ -875,6 +880,11 @@ int vmw_kms_sou_do_surface_dirty(struct vmw_private *dev_priv, */ static void vmw_sou_dmabuf_fifo_commit(struct vmw_kms_dirty *dirty) { + if (!dirty->num_hits) { + vmw_fifo_commit(dirty->dev_priv, 0); + return; + } + vmw_fifo_commit(dirty->dev_priv, sizeof(struct vmw_kms_sou_dmabuf_blit) * dirty->num_hits); @@ -967,6 +977,11 @@ out_revert: */ static void vmw_sou_readback_fifo_commit(struct vmw_kms_dirty *dirty) { + if (!dirty->num_hits) { + vmw_fifo_commit(dirty->dev_priv, 0); + return; + } + vmw_fifo_commit(dirty->dev_priv, sizeof(struct vmw_kms_sou_readback_blit) * dirty->num_hits);