diff options
author | Neha Bhende <bhenden@vmware.com> | 2018-08-09 16:03:15 -0700 |
---|---|---|
committer | Deepak Rawat <drawat@vmware.com> | 2018-08-09 16:33:43 -0700 |
commit | a9c5e8674e54e7bb4984ca88750a44861e3e4290 (patch) | |
tree | 0f5556e60421d39aa7c198210f464af6ee58d2c4 | |
parent | e8e807364ed024b382585b5c91292aaf03911ee0 (diff) |
vmwgfx: Add CAP2 support in vmwgfx
The device exposes a new capability register. Add support for it.
Signed-off-by: Neha Bhende <bhenden@vmware.com>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
-rw-r--r-- | vmwgfx_drm.h | 1 | ||||
-rw-r--r-- | vmwgfx_drv.c | 17 | ||||
-rw-r--r-- | vmwgfx_drv.h | 1 | ||||
-rw-r--r-- | vmwgfx_ioctl.c | 3 |
4 files changed, 22 insertions, 0 deletions
diff --git a/vmwgfx_drm.h b/vmwgfx_drm.h index e0e1e4f..9c22b2e 100644 --- a/vmwgfx_drm.h +++ b/vmwgfx_drm.h @@ -93,6 +93,7 @@ #define DRM_VMW_PARAM_MAX_MOB_SIZE 10 #define DRM_VMW_PARAM_SCREEN_TARGET 11 #define DRM_VMW_PARAM_DX 12 +#define DRM_VMW_PARAM_HW_CAPS2 13 /** * enum drm_vmw_handle_type - handle type for ref ioctls diff --git a/vmwgfx_drv.c b/vmwgfx_drv.c index 970c663..45aeccf 100644 --- a/vmwgfx_drv.c +++ b/vmwgfx_drv.c @@ -276,6 +276,15 @@ MODULE_PARM_DESC(force_no_3d, "Force no 3D"); module_param_named(force_no_3d, force_no_3d, int, 0600); #endif +static void vmw_print_capabilities2(uint32_t capabilities2) +{ + DRM_INFO("Capabilities2:\n"); + if (capabilities2 & SVGA_CAP2_GROW_OTABLE) + DRM_INFO(" Grow oTable.\n"); + if (capabilities2 & SVGA_CAP2_INTRA_SURFACE_COPY) + DRM_INFO(" IntraSurface copy.\n"); +} + static void vmw_print_capabilities(uint32_t capabilities) { DRM_INFO("Capabilities:\n"); @@ -695,6 +704,12 @@ static int vmw_driver_load(struct drm_device *dev, unsigned long chipset) } dev_priv->capabilities = vmw_read(dev_priv, SVGA_REG_CAPABILITIES); + + if (dev_priv->capabilities & SVGA_CAP_CAP2_REGISTER) { + dev_priv->capabilities2 = vmw_read(dev_priv, SVGA_REG_CAP2); + } + + ret = vmw_dma_select_mode(dev_priv); if (unlikely(ret != 0)) { DRM_INFO("Restricting capabilities due to IOMMU setup.\n"); @@ -763,6 +778,8 @@ static int vmw_driver_load(struct drm_device *dev, unsigned long chipset) } vmw_print_capabilities(dev_priv->capabilities); + if (dev_priv->capabilities & SVGA_CAP_CAP2_REGISTER) + vmw_print_capabilities2(dev_priv->capabilities2); ret = vmw_dma_masks(dev_priv); if (unlikely(ret != 0)) diff --git a/vmwgfx_drv.h b/vmwgfx_drv.h index ee7abb4..5884b44 100644 --- a/vmwgfx_drv.h +++ b/vmwgfx_drv.h @@ -385,6 +385,7 @@ struct vmw_private { uint32_t initial_height; u32 *mmio_virt; uint32_t capabilities; + uint32_t capabilities2; uint32_t max_gmr_ids; uint32_t max_gmr_pages; uint32_t max_mob_pages; diff --git a/vmwgfx_ioctl.c b/vmwgfx_ioctl.c index 78e2eb2..5fd34e5 100644 --- a/vmwgfx_ioctl.c +++ b/vmwgfx_ioctl.c @@ -56,6 +56,9 @@ int vmw_getparam_ioctl(struct drm_device *dev, void *data, case DRM_VMW_PARAM_HW_CAPS: param->value = dev_priv->capabilities; break; + case DRM_VMW_PARAM_HW_CAPS2: + param->value = dev_priv->capabilities2; + break; case DRM_VMW_PARAM_FIFO_CAPS: param->value = dev_priv->fifo.capabilities; break; |