drm/vmwgfx: Filter modes which exceed graphics memory
authorIan Forbes <ian.forbes@broadcom.com>
Tue, 21 May 2024 18:47:17 +0000 (13:47 -0500)
committerZack Rusin <zack.rusin@broadcom.com>
Thu, 6 Jun 2024 02:10:46 +0000 (22:10 -0400)
commit426826933109093503e7ef15d49348fc5ab505fe
tree353292d05a44ae01b498d0c8c9e8c5bcb9dbba6e
parent629f2b4e05225e53125aaf7ff0b87d5d53897128
drm/vmwgfx: Filter modes which exceed graphics memory

SVGA requires individual surfaces to fit within graphics memory
(max_mob_pages) which means that modes with a final buffer size that would
exceed graphics memory must be pruned otherwise creation will fail.

Additionally llvmpipe requires its buffer height and width to be a multiple
of its tile size which is 64. As a result we have to anticipate that
llvmpipe will round up the mode size passed to it by the compositor when
it creates buffers and filter modes where this rounding exceeds graphics
memory.

This fixes an issue where VMs with low graphics memory (< 64MiB) configured
with high resolution mode boot to a black screen because surface creation
fails.

Fixes: d947d1b71deb ("drm/vmwgfx: Add and connect connector helper function")
Signed-off-by: Ian Forbes <ian.forbes@broadcom.com>
Signed-off-by: Zack Rusin <zack.rusin@broadcom.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240521184720.767-2-ian.forbes@broadcom.com
drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c