summaryrefslogtreecommitdiff
path: root/src/gallium/winsys/svga
diff options
context:
space:
mode:
authorZack Rusin <zackr@vmware.com>2022-02-08 16:41:32 -0500
committerMarge Bot <emma+marge@anholt.net>2022-04-26 00:33:25 +0000
commit16019ff7ccfca0ffa710912b20e195bd7a4eae29 (patch)
treea5de8527774e8d05b79c281aaf6800ffe62664e7 /src/gallium/winsys/svga
parente5306d190a22afeb592f41dea678b1d57a0513c5 (diff)
svga: Add support for SVGAv3
SVGAv3 changes the PCI id due to differences in how PCI configuration is handled - removal of VRAM and FIFO PCI resources, switch to MMIO registers and MSI/MSI-X IRQ support but the 3D commands remain largely the same. This enables 3D/graphics acceleration support on SVGAv3. Signed-off-by: Zack Rusin <zackr@vmware.com> Reviewed-by: Charmaine Lee <charmainel@vmware.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16061>
Diffstat (limited to 'src/gallium/winsys/svga')
-rw-r--r--src/gallium/winsys/svga/drm/vmw_screen_ioctl.c10
-rw-r--r--src/gallium/winsys/svga/drm/vmwgfx_drm.h9
2 files changed, 18 insertions, 1 deletions
diff --git a/src/gallium/winsys/svga/drm/vmw_screen_ioctl.c b/src/gallium/winsys/svga/drm/vmw_screen_ioctl.c
index 3e952a96778..7b83cbce26d 100644
--- a/src/gallium/winsys/svga/drm/vmw_screen_ioctl.c
+++ b/src/gallium/winsys/svga/drm/vmw_screen_ioctl.c
@@ -1053,6 +1053,16 @@ vmw_ioctl_init(struct vmw_winsys_screen *vws)
vws->base.have_sm4_1 = FALSE;
vws->base.have_intra_surface_copy = FALSE;
+ memset(&gp_arg, 0, sizeof(gp_arg));
+ gp_arg.param = DRM_VMW_PARAM_DEVICE_ID;
+ ret = drmCommandWriteRead(vws->ioctl.drm_fd, DRM_VMW_GET_PARAM,
+ &gp_arg, sizeof(gp_arg));
+ if (ret || gp_arg.value == 0) {
+ vws->base.device_id = 0x0405; /* assume SVGA II */
+ } else {
+ vws->base.device_id = gp_arg.value;
+ }
+
if (vws->base.have_gb_objects) {
memset(&gp_arg, 0, sizeof(gp_arg));
gp_arg.param = DRM_VMW_PARAM_MAX_MOB_MEMORY;
diff --git a/src/gallium/winsys/svga/drm/vmwgfx_drm.h b/src/gallium/winsys/svga/drm/vmwgfx_drm.h
index 05763d834fb..26549c86a91 100644
--- a/src/gallium/winsys/svga/drm/vmwgfx_drm.h
+++ b/src/gallium/winsys/svga/drm/vmwgfx_drm.h
@@ -1,6 +1,6 @@
/**************************************************************************
*
- * Copyright © 2009-2021 VMware, Inc., Palo Alto, CA., USA
+ * Copyright © 2009-2022 VMware, Inc., Palo Alto, CA., USA
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
@@ -92,6 +92,12 @@ extern "C" {
*
* DRM_VMW_PARAM_SM5
* SM5 support is enabled.
+ *
+ * DRM_VMW_PARAM_GL43
+ * SM5.1+GL4.3 support is enabled.
+ *
+ * DRM_VMW_PARAM_DEVICE_ID
+ * PCI ID of the underlying SVGA device.
*/
#define DRM_VMW_PARAM_NUM_STREAMS 0
@@ -111,6 +117,7 @@ extern "C" {
#define DRM_VMW_PARAM_SM4_1 14
#define DRM_VMW_PARAM_SM5 15
#define DRM_VMW_PARAM_GL43 16
+#define DRM_VMW_PARAM_DEVICE_ID 17
/**
* enum drm_vmw_handle_type - handle type for ref ioctls