All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zack Rusin <zackr@vmware.com>
To: <dri-devel@lists.freedesktop.org>
Cc: Martin Krastev <krastevm@vmware.com>,
	Roland Scheidegger <sroland@vmware.com>
Subject: [PATCH 3/9] drm/vmwgfx: Fix subresource updates with new contexts
Date: Wed, 9 Jun 2021 13:23:01 -0400	[thread overview]
Message-ID: <20210609172307.131929-4-zackr@vmware.com> (raw)
In-Reply-To: <20210609172307.131929-1-zackr@vmware.com>

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 <zackr@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Martin Krastev <krastevm@vmware.com>
---
 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


  parent reply	other threads:[~2021-06-09 17:23 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-09 17:22 [PATCH 0/9] Adding support for mks-stats and some cleanups/fixes Zack Rusin
2021-06-09 17:22 ` [PATCH 1/9] drm/vmwgfx: Simplify devcaps code Zack Rusin
2021-06-09 17:23 ` [PATCH 2/9] drm/vmwgfx: Introduce VMware mks-guest-stats Zack Rusin
2021-06-09 17:23 ` Zack Rusin [this message]
2021-06-10  6:49   ` [PATCH 3/9] drm/vmwgfx: Fix subresource updates with new contexts Thomas Hellström (Intel)
2021-06-10 16:59     ` Zack Rusin
2021-06-09 17:23 ` [PATCH 4/9] drm/vmwgfx: Fix some static checker warnings Zack Rusin
2021-06-09 17:23 ` [PATCH 5/9] drm/vmwgfx: remove code that was using physical page addresses Zack Rusin
2021-06-09 17:23 ` [PATCH 6/9] drm/vmwgfx: inline access to the pages from the piter Zack Rusin
2021-06-09 17:23 ` [PATCH 7/9] drm/vmwgfx: Refactor vmw_mksstat_remove_ioctl to expect pgid match with vmw_mksstat_add_ioctl to authorise removal Zack Rusin
2021-06-09 17:23 ` [PATCH 8/9] drm/vmwgfx: Remove vmw_chipset Zack Rusin
2021-06-09 17:23 ` [PATCH 9/9] drm/vmwgfx: Fix implicit declaration error Zack Rusin
2021-06-09 17:24   ` Christian König

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210609172307.131929-4-zackr@vmware.com \
    --to=zackr@vmware.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=krastevm@vmware.com \
    --cc=sroland@vmware.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.