summaryrefslogtreecommitdiff
path: root/src/gallium/winsys/svga/drm/vmw_screen.h
AgeCommit message (Collapse)AuthorFilesLines
2023-10-20svga: Unify gmr and mob surface pool managersMaaz Mombasawala1-11/+7
The svga driver contains several buffer managers with gmr* and mob* prefixes, but they are of similar functionality. The underlying vmwgfx kernel driver allocates memory of one type - mobs if supported by the virtual hardware, and gmrs otherwise - and returns an opaque pointer to userspace, so several managers are reduntant. This patch reduces the number of buffer managers by unifying similar managers and performing refactors where necessary. Signed-off-by: Maaz Mombasawala <mombasawalam@vmware.com> Reviewed-by: Charmaine Lee <charmainel@vmware.com> Reviewed-by: Zack Rusin <zackr@vmware.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25832>
2023-06-27util: include "util/compiler.h" instead of "pipe/p_compiler.h"Yonggang Luo1-1/+1
And pipe/p_compiler.h are removed as it not used any more Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Acked-by: David Heidelberg <david.heidelberg@collabora.com> Acked-by: Marek Olšák <marek.olsak@amd.com> Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23577>
2023-06-27treewide: replace usage of boolean to boolYonggang Luo1-23/+23
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Acked-by: David Heidelberg <david.heidelberg@collabora.com> Acked-by: Marek Olšák <marek.olsak@amd.com> Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23577>
2022-11-08util: Remove os/os_thread.h and replace #include "os/os_thread.h" with ↵Yonggang Luo1-1/+1
#include "util/u_thread.h" Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Reviewed-by: Jesse Natalie <jenatali@microsoft.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19557>
2022-01-18svga: Add utility to check for GL43 supportNeha Bhende1-0/+1
GL43 support in SVGA driver requires vmwgfx kernel version 2.20 and GL43 capable SVGA device. Reviewed-by: Charmaine Lee <charmainel@vmware.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14270>
2021-09-21svga: enable DRM mks-stats via hooking to the corresponding DRM ioctlsMartin Krastev1-0/+15
SVGA DRM stat calls were situated but did not actually register with the mks-stats mechanism due to absence of corresponding ioctls. The employed new ioctls in vmwgfx are DRM_VMW_MKSSTAT_ADD and DRM_VMW_MKSSTAT_REMOVE, subject to version check. Reviewed-by: Charmaine Lee <charmainel@vmware.com> (cherry picked from commit be47c077cc927c27a8c36342b47697aa81719677) (cherry picked from commit 0388afc67b830f6ab916d0839c33eb1d91d6353f) Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12873>
2020-06-05winsys/drm: Add GL4.1 support in drm winsysNeha Bhende1-0/+1
This is to check whether virtual hardware has SM5 support Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Charmaine Lee <charmainel@vmware.com> Signed-off-by: Neha Bhende <bhenden@vmware.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5317>
2020-04-29winsys/svga: Optionally avoid caching buffer mapsThomas Hellstrom1-0/+1
Mapping of graphics kernel buffers is quite costly. Therefore the svga drm winsys caches all kernel buffer maps. However, that may lead to less testing coverage of the unmap paths and (possibly) processes running out of virtual memory space. Introduce a possibility to avoid that caching by setting the environment variable SVGA_FORCE_KERNEL_UNMAPS to 1. Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by: Roland Scheidegger <sroland@vmware.com> Reviewed-by: Matthew McClure <mcclurem@vmware.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4804>
2020-01-29winsys/svga: use new ioctl for loggingRoland Scheidegger1-0/+2
Use the new ioctl for logging (rather than duplicating what the kernel is doing). This way it's also independent from the actual guest/host mechanism to do the logging. Signed-off-by: Roland Scheidegger <sroland@vmware.com> Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3614>
2019-05-17svga: Add an environment variable to force coherent surface memoryThomas Hellstrom1-0/+2
The vmwgfx driver supports emulated coherent surface memory as of version 2.16. Add en environtment variable to enable this functionality for texture- and buffer maps: SVGA_FORCE_COHERENT. This environment variable should be used for testing only. Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by: Brian Paul <brianp@vmware.com>
2019-04-30winsys/svga/drm: Include sys/types.hKhem Raj1-0/+1
vmw_screen.h uses dev_t which is defines in sys/types.h this header is required to be included for getting dev_t definition. This issue happens on musl C library, it is hidden on glibc since sys/types.h is included through another system headers Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
2018-09-10winsys/drm: Add support for quality level in surface ioctlDeepak Rawat1-6/+7
A new argument "quality level" is added in surface define v3 which represets precision settings for surface. This commit add support for quality level in DRM_VMW_GB_SURFACE_CREATE_EXT and DRM_VMW_GB_SURFACE_REF_EXT. Signed-off-by: Deepak Rawat <drawat@vmware.com> Reviewed-by: Charmaine Lee <charmainel@vmware.com> Reviewed-by: Brian Paul <brianp@vmware.com>
2018-09-10winsys/svga: Add support for new surface ioctl, multisample patternDeepak Rawat1-2/+4
Kernel driver version 2.15 added new surface ioctl named: DRM_VMW_GB_SURFACE_CREATE_EXT DRM_VMW_GB_SURFACE_REF_EXT The new ioctl has support for 64-bit svga3d_flags if DRM_VMW_PARAM_SM4_1 is available. Multisampling surface mob size calculation is added. Also synced the relevant header update. svga device modified the surface define command V3 with new parameter multisampling pattern. Adding support for that in winsys. Signed-off-by: Deepak Rawat <drawat@vmware.com> Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by: Sinclair Yeh <syeh@vmware.com> Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2018-09-05svga: sync with upstream changes to surface flagsCharmaine Lee1-3/+3
SVGA device now supports 64 bits surface flags. This patch updates the winsys interface to allow 64 bits surface flags. The linux winsys layer will for now only honor the lower 32 bits of the surface flags. Reviewed-by: Brian Paul <brianp@vmware.com>
2017-07-17winsys/svga/drm: Enable import/export fence FDSinclair Yeh1-5/+7
Enable the capability if the DRM supports it. Hook up mechanism to send and receive fence FD from the DRM. Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2017-04-07winsys/svga: use c11 thread types/functionsBrian Paul1-2/+2
Gallium no longer has wrappers for mutexes and condition variables. Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2017-04-07winsys/svga: Resolve command submission buffer contention v3Thomas Hellstrom1-1/+4
If two contexts wanted to access the same buffer at the same time, it would end up on two validation lists simultaneously, which might cause a PIPE_ERROR_RETRY when trying to validate it from one context while the other context already had it validated but not yet fenced. In that situation we could spin until the error goes away, or apply various more or less expensive locking schemes to save cpu. Here we use a scheme that briefly locks after fencing but avoids locking on validation in the non-contended case. v2: Make sure we broadcast not only on releasing buffers after fencing, but also after releasing buffers in the pb_validate_validate error path. v3: Don't broadcast on PIPE_ERROR_RETRY because that would increase the chance of starvation. Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2015-09-02svga/winsys: Add support for VGPU10Brian Paul1-5/+20
This involves a few driver modifications to keep things building. The driver may not actually run properly at this point. Signed-off-by: Brian Paul <brianp@vmware.com>
2015-07-21gallium: replace INLINE with inlineIlia Mirkin1-1/+1
Generated by running: git grep -l INLINE src/gallium/ | xargs sed -i 's/\bINLINE\b/inline/g' git grep -l INLINE src/mesa/state_tracker/ | xargs sed -i 's/\bINLINE\b/inline/g' git checkout src/gallium/state_trackers/clover/Doxyfile and manual edits to src/gallium/include/pipe/p_compiler.h src/gallium/README.portability to remove mentions of the inline define. Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Acked-by: Marek Olšák <marek.olsak@amd.com>
2014-08-12svga: Add a limit to the maximum surface sizeCharmaine Lee1-0/+1
This patch adds a limit to the maximum surface size which is based on the maximum size of a single mob. If this value is not available, the maximum surface size is by default set to 128 MB. Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-07winsys/svga: Fix prime surface references also for guest-backed surfacesThomas Hellstrom1-1/+3
Implement guest-backed surface sharing using prime fds. Previously only legacy surfaces could use this functionality. Also use the vmwgfx 2.6 single-ioctl prime fd reference if available. Cc: "10.1" <mesa-stable@lists.freedesktop.org> Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2014-02-14svga/winsys: Propagate surface shared information to the winsysThomas Hellstrom1-5/+7
The linux winsys needs to know whether a surface is shared. For guest-backed surfaces we need this information to avoid allocating a mob out of the mob cache for shared surfaces, but instead allocate a shared mob, that is never put in the mob cache, from the kernel. Also previously, all surfaces were given the "shareable" attribute when allocated from the kernel. This is too permissive for client-local surfaces. Now that we have the needed info, only set the "shareable" attribute if the client indicates that it needs to share the surface. Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by: Jakob Bornecrantz <jakob@vmware.com> Reviewed-by: Brian Paul <brianp@vmware.com> Cc: "10.1" <mesa-stable@lists.freedesktop.org>
2014-02-14svga/winsys: implement GBS supportBrian Paul1-2/+68
This is a squash commit of many commits by Thomas Hellstrom. Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com> Cc: "10.1" <mesa-stable@lists.freedesktop.org>
2012-01-10svga: Drop execbuf throttlingJakob Bornecrantz1-1/+0
This code isn't used anymore in preference for DRI2 client side swap buffers throttling or throttling done inside the xa or xorg driver. Signed-off-by: Jakob Bornecrantz <jakob@vmware.com> Reviewed-by Brian Paul <brianp@vmware.com>
2011-10-14winsys/svga: Rework buffer allocation to make it more robust v2.Thomas Hellstrom1-0/+8
Don't allow any "CPU" buffers to be allocated by the pb_fenced buffer manager, since we can't protect against failures during buffer validation. Also, add an extra slab buffer manager to allocate buffers from the kernel if there is a failure to allocate from our big buffer pool. The reason we use a slab manager for this, is to avoid allocating many very small buffers from the kernel. v2: Increased VMW_MAX_BUFFER_SIZE and fixed some comments. Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by: José Fonseca <jfonseca@vmware.com> Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2011-09-29winsys/svga: Update to vmwgfx kernel module 2.1Thomas Hellstrom1-6/+14
Introduces fence objecs and a size limit on query buffers. The possibility to map the fifo from user-space is gone, and replaced by an ioctl that reads the 3D capabilities. Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by: Jakob Bornecranz <jakob@vmware.com>
2010-05-31st/xorg, vmware: Make throttling configurable.Thomas Hellstrom1-4/+8
The xorg state tracker gets two new options to let the user choose whether to enable / disable dirty throttling and swapbuffer throttling. The default value of these options are enabled, unless the winsys supplies a customizer with other values. The customizer record has been extended to allow this, and also to set winsys-based throttling on a per- context basis. The vmware part of this patch disables the dirty throttling if the kernel supports command submission throttling, and also in that case sets kernel based throttling for everything but swapbuffers. The vmware winsys does not set throttling per context, even if it theoretically could, but instead sets throttling per screen. This should perhaps be changed, should the xorg state tracker start to use multiple rendering contexts. Kernel throttling is off by default for all new screens/contexts, so the dri state tracker is not affected. This significantly improves interactivity of the vmware xorg driver. Cherry-picked from commit a8f3b3f88acc1f0193fa740e76e9d815f07f32ab Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
2010-03-24gallium: Reorg winsys directoriesJakob Bornecrantz1-0/+140
Attached output from commit. delete mode 100644 src/gallium/winsys/drm/SConscript delete mode 100644 src/gallium/winsys/drm/i965/SConscript delete mode 100644 src/gallium/winsys/drm/intel/Makefile delete mode 100644 src/gallium/winsys/drm/intel/SConscript delete mode 100644 src/gallium/winsys/drm/nouveau/Makefile delete mode 100644 src/gallium/winsys/drm/radeon/Makefile delete mode 100644 src/gallium/winsys/drm/radeon/SConscript delete mode 100644 src/gallium/winsys/drm/vmware/Makefile delete mode 100644 src/gallium/winsys/drm/vmware/SConscript rename src/gallium/winsys/{drm/intel/gem => i915/drm}/Makefile (82%) rename src/gallium/winsys/{drm/intel/gem => i915/drm}/SConscript (100%) rename src/gallium/winsys/{drm/intel/gem => i915/drm}/intel_drm_api.c (100%) rename src/gallium/winsys/{drm/intel/gem => i915/drm}/intel_drm_batchbuffer.c (100%) rename src/gallium/winsys/{drm/intel/gem => i915/drm}/intel_drm_buffer.c (100%) rename src/gallium/winsys/{drm/intel/gem => i915/drm}/intel_drm_fence.c (100%) rename src/gallium/winsys/{drm/intel/gem => i915/drm}/intel_drm_winsys.h (100%) rename src/gallium/winsys/{drm/i965/gem => i965/drm}/Makefile (78%) rename src/gallium/winsys/{drm/i965/gem => i965/drm}/SConscript (100%) rename src/gallium/winsys/{drm/i965/gem => i965/drm}/i965_drm_api.c (98%) rename src/gallium/winsys/{drm/i965/gem => i965/drm}/i965_drm_buffer.c (100%) rename src/gallium/winsys/{drm/i965/gem => i965/drm}/i965_drm_winsys.h (100%) rename src/gallium/winsys/{drm => }/i965/xlib/Makefile (97%) rename src/gallium/winsys/{drm => }/i965/xlib/xlib_i965.c (100%) rename src/gallium/winsys/{drm => }/nouveau/drm/Makefile (79%) rename src/gallium/winsys/{drm => }/nouveau/drm/nouveau_dri.h (100%) rename src/gallium/winsys/{drm => }/nouveau/drm/nouveau_drm_api.c (100%) rename src/gallium/winsys/{drm => }/nouveau/drm/nouveau_drm_api.h (100%) rename src/gallium/winsys/{drm/radeon/core => radeon/drm}/Makefile (79%) rename src/gallium/winsys/{drm/radeon/core => radeon/drm}/SConscript (100%) rename src/gallium/winsys/{drm/radeon/core => radeon/drm}/radeon_buffer.h (100%) rename src/gallium/winsys/{drm/radeon/core => radeon/drm}/radeon_drm.c (100%) rename src/gallium/winsys/{drm/radeon/core => radeon/drm}/radeon_drm.h (100%) rename src/gallium/winsys/{drm/radeon/core => radeon/drm}/radeon_drm_buffer.c (100%) rename src/gallium/winsys/{drm/radeon/core => radeon/drm}/radeon_r300.c (100%) rename src/gallium/winsys/{drm/radeon/core => radeon/drm}/radeon_r300.h (100%) rename src/gallium/winsys/{drm/radeon/core => radeon/drm}/radeon_winsys.h (100%) rename src/gallium/winsys/{drm/vmware/core => svga/drm}/Makefile (63%) rename src/gallium/winsys/{drm/vmware/core => svga/drm}/SConscript (100%) rename src/gallium/winsys/{drm/vmware/core => svga/drm}/vmw_buffer.c (100%) rename src/gallium/winsys/{drm/vmware/core => svga/drm}/vmw_buffer.h (100%) rename src/gallium/winsys/{drm/vmware/core => svga/drm}/vmw_context.c (100%) rename src/gallium/winsys/{drm/vmware/core => svga/drm}/vmw_context.h (100%) rename src/gallium/winsys/{drm/vmware/core => svga/drm}/vmw_fence.c (100%) rename src/gallium/winsys/{drm/vmware/core => svga/drm}/vmw_fence.h (100%) rename src/gallium/winsys/{drm/vmware/core => svga/drm}/vmw_screen.c (100%) rename src/gallium/winsys/{drm/vmware/core => svga/drm}/vmw_screen.h (100%) rename src/gallium/winsys/{drm/vmware/core => svga/drm}/vmw_screen_dri.c (100%) rename src/gallium/winsys/{drm/vmware/core => svga/drm}/vmw_screen_ioctl.c (100%) rename src/gallium/winsys/{drm/vmware/core => svga/drm}/vmw_screen_pools.c (100%) rename src/gallium/winsys/{drm/vmware/core => svga/drm}/vmw_screen_svga.c (100%) rename src/gallium/winsys/{drm/vmware/core => svga/drm}/vmw_surface.c (100%) rename src/gallium/winsys/{drm/vmware/core => svga/drm}/vmw_surface.h (100%) rename src/gallium/winsys/{drm/vmware/core => svga/drm}/vmwgfx_drm.h (100%) rename src/gallium/winsys/{drm/i965 => sw}/Makefile (61%) copy src/gallium/winsys/{drm/sw => sw/drm}/Makefile (73%) rename src/gallium/winsys/{drm/sw => sw/drm}/sw_drm_api.c (98%) rename src/gallium/winsys/{drm/sw => sw/drm}/sw_drm_api.h (100%) rename src/gallium/winsys/{ => sw}/gdi/SConscript (100%) rename src/gallium/winsys/{ => sw}/gdi/gdi_sw_winsys.c (100%) rename src/gallium/winsys/{ => sw}/gdi/gdi_sw_winsys.h (100%) rename src/gallium/winsys/{ => sw}/null/Makefile (78%) rename src/gallium/winsys/{ => sw}/null/SConscript (100%) rename src/gallium/winsys/{ => sw}/null/null_sw_winsys.c (100%) rename src/gallium/winsys/{ => sw}/null/null_sw_winsys.h (100%) rename src/gallium/winsys/{drm/sw => sw/wrapper}/Makefile (65%) rename src/gallium/winsys/{drm/sw => sw/wrapper}/wrapper_sw_winsys.c (100%) rename src/gallium/winsys/{drm/sw => sw/wrapper}/wrapper_sw_winsys.h (100%) rename src/gallium/winsys/{ => sw}/xlib/Makefile (79%) rename src/gallium/winsys/{ => sw}/xlib/SConscript (100%) rename src/gallium/winsys/{ => sw}/xlib/xlib_sw_winsys.c (100%)