drm/vmwgfx: Work around mode set failure in 2D VMs
authorSinclair Yeh <syeh@vmware.com>
Wed, 29 Jun 2016 18:29:47 +0000 (11:29 -0700)
committerSinclair Yeh <syeh@vmware.com>
Fri, 1 Jul 2016 17:47:48 +0000 (10:47 -0700)
commit7c20d213dd3cd6295bf9162730e7a368af957854
tree68b5fb2e94855ca1bfd2b4e74875cf9d7b7e040e
parenta9cd9c044aa90ba2b31d1bf3e3432f38fb1d25fe
drm/vmwgfx: Work around mode set failure in 2D VMs

In a low-memory 2D VM, fbdev can take up a large percentage of
available memory, making them unavailable for other DRM clients.

Since we do not take fbdev into account when filtering modes,
we end up claiming to support more modes than we actually do.

As a result, users get a black screen when setting a mode too
large for current available memory.  In a low-memory VM
configuration, users can get a black screen for a mode as low
as 1024x768.

The current mode filtering mechanism keys off of
SVGA_REG_SUGGESTED_GBOBJECT_MEM_SIZE_KB, i.e. the maximum amount
of surface memory we have.  Since this value is a performance
suggestion, not a hard limit, and since there should not be much
of a performance impact for a 2D VM, rather than filtering out
more modes, we will just allow ourselves to exceed the SVGA's
performance suggestion.

Also changed assumed bpp to 32 from 16 to make sure we can
actually support all the modes listed.

Signed-off-by: Sinclair Yeh <syeh@vmware.com>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Cc: <stable@vger.kernel.org>
drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
This page took 0.028377 seconds and 5 git commands to generate.