diff options
author | Charmaine Lee <[email protected]> | 2017-10-27 15:41:37 -0700 |
---|---|---|
committer | Brian Paul <[email protected]> | 2018-09-10 13:07:30 -0600 |
commit | b5827db2eaf739b4fa620326a92561ee096df5f7 (patch) | |
tree | 408cd9903a27af15ee98ddf4d83b9edb0312870b /src/gallium/winsys/svga | |
parent | 7448bb0089530877d484c1aa96ec6155ffde0fcc (diff) |
winsys/drm: enable intra_surface_copy if HW_CAP2 is supported
With drm version 2_15, we can inquire for support of HW_CAP2.
If it is supported, we can enable intra_surface_copy support.
Reviewed-by: Brian Paul <[email protected]>
Reviewed-by: Sinclair Yeh <[email protected]>
Reviewed-by: Deepak Rawat <[email protected]>
Diffstat (limited to 'src/gallium/winsys/svga')
-rw-r--r-- | src/gallium/winsys/svga/drm/vmw_screen_ioctl.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/gallium/winsys/svga/drm/vmw_screen_ioctl.c b/src/gallium/winsys/svga/drm/vmw_screen_ioctl.c index 7d5aa007572..67d3df29c43 100644 --- a/src/gallium/winsys/svga/drm/vmw_screen_ioctl.c +++ b/src/gallium/winsys/svga/drm/vmw_screen_ioctl.c @@ -1018,14 +1018,9 @@ vmw_ioctl_init(struct vmw_winsys_screen *vws) if (vws->base.have_gb_objects && !drm_gb_capable) goto out_no_3d; - /* - * CAP2 functionality is not yet in vmwgfx. Till then, avoiding - * this code path. - */ - vws->base.have_intra_surface_copy = FALSE; - vws->base.have_vgpu10 = FALSE; vws->base.have_sm4_1 = FALSE; + vws->base.have_intra_surface_copy = FALSE; if (vws->base.have_gb_objects) { memset(&gp_arg, 0, sizeof(gp_arg)); @@ -1075,6 +1070,14 @@ vmw_ioctl_init(struct vmw_winsys_screen *vws) if (vws->ioctl.have_drm_2_15) { memset(&gp_arg, 0, sizeof(gp_arg)); + gp_arg.param = DRM_VMW_PARAM_HW_CAPS2; + ret = drmCommandWriteRead(vws->ioctl.drm_fd, DRM_VMW_GET_PARAM, + &gp_arg, sizeof(gp_arg)); + if (ret == 0 && gp_arg.value != 0) { + vws->base.have_intra_surface_copy = TRUE; + } + + memset(&gp_arg, 0, sizeof(gp_arg)); gp_arg.param = DRM_VMW_PARAM_SM4_1; ret = drmCommandWriteRead(vws->ioctl.drm_fd, DRM_VMW_GET_PARAM, &gp_arg, sizeof(gp_arg)); |