svga: Report "VRAM" more accurately

While the concept of "VRAM" is somewhat nebulous on SVGA devices this is
the value above which some performance degradation is likely to occur.

Signed-off-by: Ian Forbes <ian.forbes@broadcom.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38818>
This commit is contained in:
Ian Forbes 2025-12-04 13:00:45 -06:00 committed by Marge Bot
parent 94d2ec975d
commit 42e797b139
3 changed files with 6 additions and 1 deletions

View file

@ -527,7 +527,7 @@ svga_init_screen_caps(struct svga_screen *svgascreen)
caps->vendor_id = 0x15ad; /* VMware Inc. */
caps->device_id = sws->device_id ? sws->device_id : 0x0405; /* assume SVGA II */
caps->video_memory = 1; /* XXX: Query the host ? */
caps->video_memory = sws->max_mob_memory_mib ? sws->max_mob_memory_mib : 1;
caps->copy_between_compressed_and_plain_formats = sws->have_vgpu10;
caps->doubles = sws->have_sm5;
caps->uma = false;

View file

@ -707,6 +707,10 @@ struct svga_winsys_screen
/** Do we support coherent surface memory? */
bool have_coherent;
/** Max MOB Memory in MiB */
uint32_t max_mob_memory_mib;
/**
* Create and define a GB shader.
*/

View file

@ -138,6 +138,7 @@ vmw_winsys_create( int fd )
goto out_no_ioctl;
vws->base.have_gb_dma = !vws->force_coherent;
vws->base.max_mob_memory_mib = vws->ioctl.max_mob_memory >> 20;
vws->base.need_to_rebind_resources = false;
vws->base.have_transfer_from_buffer_cmd = vws->base.have_vgpu10;
vws->base.have_constant_buffer_offset_cmd =