Skip to content

Commit a12be02

Browse files
committed
drm/vmwgfx: Fix subresource updates with new contexts
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 <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]> Reviewed-by: Martin Krastev <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 7a7a933 commit a12be02

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/gpu/drm/vmwgfx/vmwgfx_surface.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1872,7 +1872,6 @@ static void vmw_surface_dirty_range_add(struct vmw_resource *res, size_t start,
18721872
static int vmw_surface_dirty_sync(struct vmw_resource *res)
18731873
{
18741874
struct vmw_private *dev_priv = res->dev_priv;
1875-
bool has_dx = 0;
18761875
u32 i, num_dirty;
18771876
struct vmw_surface_dirty *dirty =
18781877
(struct vmw_surface_dirty *) res->dirty;
@@ -1899,7 +1898,7 @@ static int vmw_surface_dirty_sync(struct vmw_resource *res)
18991898
if (!num_dirty)
19001899
goto out;
19011900

1902-
alloc_size = num_dirty * ((has_dx) ? sizeof(*cmd1) : sizeof(*cmd2));
1901+
alloc_size = num_dirty * ((has_sm4_context(dev_priv)) ? sizeof(*cmd1) : sizeof(*cmd2));
19031902
cmd = VMW_CMD_RESERVE(dev_priv, alloc_size);
19041903
if (!cmd)
19051904
return -ENOMEM;
@@ -1917,7 +1916,7 @@ static int vmw_surface_dirty_sync(struct vmw_resource *res)
19171916
* DX_UPDATE_SUBRESOURCE is aware of array surfaces.
19181917
* UPDATE_GB_IMAGE is not.
19191918
*/
1920-
if (has_dx) {
1919+
if (has_sm4_context(dev_priv)) {
19211920
cmd1->header.id = SVGA_3D_CMD_DX_UPDATE_SUBRESOURCE;
19221921
cmd1->header.size = sizeof(cmd1->body);
19231922
cmd1->body.sid = res->id;

0 commit comments

Comments
 (0)