Skip to contentSkip to conversation

drm/vmwgfx: Fix Host-Backed userspace on Guest-Backed kernel

PATCH In review Ian Forbes 2 participants 2 messages Apr 29, 2025 – Apr 30, 2025

Subsystems (3)
lore
Share & tools
lore

Ian Forbes

author
#0 lore raw

PATCH 1/1 drm/vmwgfx: Fix Host-Backed userspace on Guest-Backed kernel

Running 3D applications with SVGA_FORCE_HOST_BACKED=1 or using an ancient version of mesa was broken because the buffer was pinned in VMW_BO_DOMAIN_SYS and could not be moved to VMW_BO_DOMAIN_MOB during validation.

The compat_shader buffer should not pinned.

Fixes 668b206601c5 ("drm/vmwgfx: Stop using raw ttm_buffer_object's")
---
 drivers/gpu/drm/vmwgfx/vmwgfx_shader.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/vmwgfx/vmwgfx_shader.c +1 -1
index 7fb1c88bcc47..69dfe69ce0f8 100644
@@ -896,7 +896,7 @@ int vmw_compat_shader_add(struct vmw_private *dev_priv,
 		.busy_domain = VMW_BO_DOMAIN_SYS,
 		.bo_type = ttm_bo_type_device,
 		.size = size,
-		.pin = true,
+		.pin = false,
 		.keep_resv = true,
 	};
 
Signature · 1 line
2.49.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 18 lines · Ian Forbes

Running 3D applications with SVGA_FORCE_HOST_BACKED=1 or using an ancient version of mesa was broken because the buffer was pinned in VMW_BO_DOMAIN_SYS and could not be moved to VMW_BO_DOMAIN_MOB during validation.

The compat_shader buffer should not pinned.

Fixes 668b206601c5 ("drm/vmwgfx: Stop using raw ttm_buffer_object's")
---
 drivers/gpu/drm/vmwgfx/vmwgfx_shader.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/vmwgfx/vmwgfx_shader.c +0 -0
index 7fb1c88bcc47..69dfe69ce0f8 100644

drivers/gpu/drm/vmwgfx/vmwgfx_shader.c int vmw_compat_shader_add(struct vmw_private *dev_priv, · line 902

Quoted 8 lines
drivers/gpu/drm/vmwgfx/vmwgfx_shader.c +1 -1
@@ -896,7 +896,7 @@ int vmw_compat_shader_add(struct vmw_private *dev_priv,
 		.busy_domain = VMW_BO_DOMAIN_SYS,
 		.bo_type = ttm_bo_type_device,
 		.size = size,
-		.pin = true,
+		.pin = false,
 		.keep_resv = true,
 	};
 

Looks good.

Signature · 1 line
Maaz Mombasawala <[email protected]>