Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/vmwgfx: Define an overlaid handle_close ioctl.

Instead of providing an ioctl for each handle type, provide a single
handle_close ioctl, and reuse the UNREF_DMABUF ioctl.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Sinclair Yeh <syeh@vmware.com>

authored by

Thomas Hellstrom and committed by
Sinclair Yeh
2f9545ce 9f7d1480

+24
+24
include/uapi/drm/vmwgfx_drm.h
··· 41 41 #define DRM_VMW_GET_PARAM 0 42 42 #define DRM_VMW_ALLOC_DMABUF 1 43 43 #define DRM_VMW_UNREF_DMABUF 2 44 + #define DRM_VMW_HANDLE_CLOSE 2 44 45 #define DRM_VMW_CURSOR_BYPASS 3 45 46 /* guarded by DRM_VMW_PARAM_NUM_STREAMS != 0*/ 46 47 #define DRM_VMW_CONTROL_STREAM 4 ··· 1092 1091 enum drm_vmw_extended_context req; 1093 1092 struct drm_vmw_context_arg rep; 1094 1093 }; 1094 + 1095 + /*************************************************************************/ 1096 + /* 1097 + * DRM_VMW_HANDLE_CLOSE - Close a user-space handle and release its 1098 + * underlying resource. 1099 + * 1100 + * Note that this ioctl is overlaid on the DRM_VMW_UNREF_DMABUF Ioctl. 1101 + * The ioctl arguments therefore need to be identical in layout. 1102 + * 1103 + */ 1104 + 1105 + /** 1106 + * struct drm_vmw_handle_close_arg 1107 + * 1108 + * @handle: Handle to close. 1109 + * 1110 + * Argument to the DRM_VMW_HANDLE_CLOSE Ioctl. 1111 + */ 1112 + struct drm_vmw_handle_close_arg { 1113 + __u32 handle; 1114 + __u32 pad64; 1115 + }; 1116 + 1095 1117 1096 1118 #if defined(__cplusplus) 1097 1119 }