Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1765586pxb; Thu, 16 Sep 2021 15:15:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzM5IOMS8Xv2MMUXUA4Q7uxfyCGF2wjracj/nq7jqZ8vmuylY+MEOnludRgJZ4YYNX1HK7L X-Received: by 2002:a92:dccc:: with SMTP id b12mr5325921ilr.304.1631830530742; Thu, 16 Sep 2021 15:15:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631830530; cv=none; d=google.com; s=arc-20160816; b=NQRznhQYmoBUtiqpoCNHdFTKmA7hCh3SK7E1bjjXzYWicG69dbwNILaHoH7lsLu4HC Lo8idxZohnSR4TGMZTfNc49whtej4KBTqBPXSCMfYbgYTxSHwSHm10p8QsW0F6rbXZ2B /mjHcC6Uj5UjheLIASlqdHQ4OJhTD7H7hflCShUbg8HqoUHzaYphgm1rnyhUtcp5vPhd Fh5futb/PQsJj4cYkY3+Ei0OAqnOgyXDBYfWr02eSOWOubj0VfXW7HvByxd2rTUq7Hmu nndqhKpHKTQXLs4sLyn4dScfFgri3NZBMmz70ZRHL/7eSXfpYCtEgtvzXtC+/5FWn9WU XCtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=H59QCij/sSiRhleVjlw24gGrGT02jZXSQ1Uqxw5Qzpw=; b=NB9vR5aUpuRsVPFONAI46TwB8nnpwW0XXB1D2HLOP25feeDy7HHNl6YkMAv35aarfC wbx2mQRbYHbOkGRVV7EtWkrmhnaYsI/x7cMjUgc0rsKEBZbPC15E4MBgKZaFMQw3VlwM nxy4Am94fjk+YxZpx46PZqZe7e4jQjMlyHXmUyQvQ3gll+uFhkA4i6A5TdJQFv4j++uZ soN6ILSPVNVa7aAIZ54CweZl54tGEKoHCcQzWyR3ucuKOvn+PXTjYD2mTEV5/xXvcqFG mjDfsUNKutkYiLxIPyVOzy0AFMePiKUsgiLiizyin7ZHkCPvUVHfGSNghGc1geuPaxPy uDKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=zIPJWF2d; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o16si3499530ilh.153.2021.09.16.15.15.18; Thu, 16 Sep 2021 15:15:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=zIPJWF2d; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244840AbhIPQpg (ORCPT + 99 others); Thu, 16 Sep 2021 12:45:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:51976 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244791AbhIPQjt (ORCPT ); Thu, 16 Sep 2021 12:39:49 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5164E61A07; Thu, 16 Sep 2021 16:23:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631809399; bh=X2q7Z1zfpLOSvHYiWSiDtyxDNg4a9cAdNOuSsmS1TqM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zIPJWF2dmzXirX4nMxDHQ8pgZHBblb4vMTrfAAOqoiJPxUGSQsZtatacv89wbDIJT zexF/NmCvD7t35BXO9mEMRupgvnl1UBdV+ZQfTKwOQYLocH+nA/fCv/Qa0ep3OMMuP DkhusHouEkafSL7GzJwhe9BI/OcDYbeEeaEAKcGI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Zack Rusin , Roland Scheidegger , Martin Krastev , Sasha Levin Subject: [PATCH 5.13 139/380] drm/vmwgfx: Fix subresource updates with new contexts Date: Thu, 16 Sep 2021 17:58:16 +0200 Message-Id: <20210916155808.775512190@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210916155803.966362085@linuxfoundation.org> References: <20210916155803.966362085@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Zack Rusin [ Upstream commit a12be0277316ed923411c9c80b2899ee74d2b033 ] The has_dx variable was only set during the initialization which meant that UPDATE_SUBRESOURCE was never used. We were emulating it with UPDATE_GB_IMAGE but that's always been a stop-gap. Instead of has_dx which has been deprecated a long time ago we need to check for whether shader model 4.0 or newer is available to the device. Signed-off-by: Zack Rusin Reviewed-by: Roland Scheidegger Reviewed-by: Martin Krastev Link: https://patchwork.freedesktop.org/patch/msgid/20210609172307.131929-4-zackr@vmware.com Signed-off-by: Sasha Levin --- drivers/gpu/drm/vmwgfx/vmwgfx_surface.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c b/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c index beab3e19d8e2..5ff88f8c2382 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c @@ -1883,7 +1883,6 @@ static void vmw_surface_dirty_range_add(struct vmw_resource *res, size_t start, static int vmw_surface_dirty_sync(struct vmw_resource *res) { struct vmw_private *dev_priv = res->dev_priv; - bool has_dx = 0; u32 i, num_dirty; struct vmw_surface_dirty *dirty = (struct vmw_surface_dirty *) res->dirty; @@ -1910,7 +1909,7 @@ static int vmw_surface_dirty_sync(struct vmw_resource *res) if (!num_dirty) goto out; - alloc_size = num_dirty * ((has_dx) ? sizeof(*cmd1) : sizeof(*cmd2)); + alloc_size = num_dirty * ((has_sm4_context(dev_priv)) ? sizeof(*cmd1) : sizeof(*cmd2)); cmd = VMW_CMD_RESERVE(dev_priv, alloc_size); if (!cmd) return -ENOMEM; @@ -1928,7 +1927,7 @@ static int vmw_surface_dirty_sync(struct vmw_resource *res) * DX_UPDATE_SUBRESOURCE is aware of array surfaces. * UPDATE_GB_IMAGE is not. */ - if (has_dx) { + if (has_sm4_context(dev_priv)) { cmd1->header.id = SVGA_3D_CMD_DX_UPDATE_SUBRESOURCE; cmd1->header.size = sizeof(cmd1->body); cmd1->body.sid = res->id; -- 2.30.2