Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1900703pxb; Thu, 16 Sep 2021 19:36:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzu/7Cf0T8+wxTRirAtBcO58+yblG2fy9MCexp59KoHGpOXDVXhV1WF3sBgfM7cWi5C8f0t X-Received: by 2002:a92:dc07:: with SMTP id t7mr6363080iln.63.1631846175027; Thu, 16 Sep 2021 19:36:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631846175; cv=none; d=google.com; s=arc-20160816; b=gP9+jVJcv2/Ko3aOqAgz5BvP/jBkg03qFDMxDGzWF2dkhbQO5lbOhPnJjYHg0Gf6qy 5kE6b01UGJJ5Sbbwc8XVLQNksHludWTTSTPws9dNbc0C1L0/xZ5ocf38shkSQcF50Q80 tols9+U6LGC1vZcXaq6ocyvyYzo+LxkoIwwlqg+fPpN/wJq67erNfea1AeqEtEPk9CnM 9ig+5Qp9GmBW9z/ap4XwuNo6Sh2SFtMc4aj4jZjjbHYDfaGYSWlj7Ig7pAO2D9jgtvej PNs/Vl0GCCy6eWoQYfrfft4bTPo1ucu0mDOC0PF3sNUmjxF4i4OoX5hZ4xRXgKl1VXcv x7zQ== 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=+Id+tTU184pbZWtI5h+qenJO9Hw03OtxEXykGMPI3MY=; b=Xj+7fb5AKQ5k0wiuw7q5lr89gwuY5FkdlAWQBKz6qw9oEryJC++a/uiOL92QVi14jM rm5qRNiklu2RPMIMyloNZNtt/UUmfV5ceobuylHSSwQc4IcNUJ9Do7CS9J+UOPcLQl+A J+lAd8dsMwqarNmpRtE2h6egokTUZWlIikUUKiald6Sn1bmCHY3g9sL2I8V4nevmigTM ZRDBsziCLBGqH+dg2jq3OJOH8vZnyQ6rhesX3IPtHK7n6j6uhgXgUrQGdL+RHLWD/Hat KJTxbJLq2AdG8IRqijlGxkmxVMqG5x+cFD6b4rtvGGvin0kMVR2+vFj0CfgJ14scgYbf MbSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=KpWSKdrF; 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 j24si4509756jaa.10.2021.09.16.19.36.04; Thu, 16 Sep 2021 19:36:15 -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=KpWSKdrF; 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 S1348079AbhIPR1M (ORCPT + 99 others); Thu, 16 Sep 2021 13:27:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:44338 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351716AbhIPRT1 (ORCPT ); Thu, 16 Sep 2021 13:19:27 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id F04CA61A0C; Thu, 16 Sep 2021 16:41:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631810485; bh=kc1FYvBpSgEy2QFyFkir9/64Xk8FZ8y5oackNASlSTc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KpWSKdrFuYUYK3rLdBGghhljeB/ZEmAHeIhAQsWTXTs99ww1uYxfd+/mheAwV7CJe NSGgN4ROMhyJlNQLUHULXifcotoyZxzuI5rZHYJ5KL29VFDoebiRKxedsuOrQFBqwq QfHgqjvNvFg2tSdAeY3goXxn0QXW76hBglkAa+nQ= 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.14 157/432] drm/vmwgfx: Fix subresource updates with new contexts Date: Thu, 16 Sep 2021 17:58:26 +0200 Message-Id: <20210916155816.068448325@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210916155810.813340753@linuxfoundation.org> References: <20210916155810.813340753@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 0835468bb2ee..47c03a276515 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c @@ -1872,7 +1872,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; @@ -1899,7 +1898,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; @@ -1917,7 +1916,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