Skip to content

Commit e9fd436

Browse files
committed
drm/vmwgfx: Disable coherent dumb buffers without 3d
Coherent surfaces make only sense if the host renders to them using accelerated apis. Without 3d the entire content of dumb buffers stays in the guest making all of the extra work they're doing to synchronize between guest and host useless. Configurations without 3d also tend to run with very low graphics memory limits. The pinned console fb, mob cursors and graphical login manager tend to run out of 16MB graphics memory that those guests use. Fix it by making sure the coherent dumb buffers are only used on configs with 3d enabled. Signed-off-by: Zack Rusin <[email protected]> Fixes: d6667f0 ("drm/vmwgfx: Fix handling of dumb buffers") Reported-by: Christian Heusel <[email protected]> Closes: https://lore.kernel.org/all/[email protected] Cc: Broadcom internal kernel review list <[email protected]> Cc: [email protected] Cc: <[email protected]> # v6.9+ Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Reviewed-by: Martin Krastev <[email protected]> Reviewed-by: Maaz Mombasawala <[email protected]> Tested-by: Benjamin Coddington <[email protected]>
1 parent 50f1199 commit e9fd436

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/gpu/drm/vmwgfx/vmwgfx_surface.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2283,9 +2283,11 @@ int vmw_dumb_create(struct drm_file *file_priv,
22832283
/*
22842284
* Without mob support we're just going to use raw memory buffer
22852285
* because we wouldn't be able to support full surface coherency
2286-
* without mobs
2286+
* without mobs. There also no reason to support surface coherency
2287+
* without 3d (i.e. gpu usage on the host) because then all the
2288+
* contents is going to be rendered guest side.
22872289
*/
2288-
if (!dev_priv->has_mob) {
2290+
if (!dev_priv->has_mob || !vmw_supports_3d(dev_priv)) {
22892291
int cpp = DIV_ROUND_UP(args->bpp, 8);
22902292

22912293
switch (cpp) {

0 commit comments

Comments
 (0)