diff options
author | Zack Rusin <[email protected]> | 2024-08-16 14:32:07 -0400 |
---|---|---|
committer | Zack Rusin <[email protected]> | 2024-08-26 00:19:44 -0400 |
commit | e9fd436bb8fb9b9d31fdf07bbcdba6d30290c5e4 (patch) | |
tree | faec9e6d702ce2d84b0755293dd59367cc708796 | |
parent | 50f1199250912568606b3778dc56646c10cb7b04 (diff) |
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: d6667f0ddf46 ("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]>
-rw-r--r-- | drivers/gpu/drm/vmwgfx/vmwgfx_surface.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c b/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c index 8ae6a761c900..1625b30d9970 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c @@ -2283,9 +2283,11 @@ int vmw_dumb_create(struct drm_file *file_priv, /* * Without mob support we're just going to use raw memory buffer * because we wouldn't be able to support full surface coherency - * without mobs + * without mobs. There also no reason to support surface coherency + * without 3d (i.e. gpu usage on the host) because then all the + * contents is going to be rendered guest side. */ - if (!dev_priv->has_mob) { + if (!dev_priv->has_mob || !vmw_supports_3d(dev_priv)) { int cpp = DIV_ROUND_UP(args->bpp, 8); switch (cpp) { |