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

drm/vmwgfx: Prepare to support fence fd

Make the fields and flags available.

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

+8 -8
-5
drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
··· 4449 4449 arg.context_handle = (uint32_t) -1; 4450 4450 break; 4451 4451 case 2: 4452 - if (arg.pad64 != 0) { 4453 - DRM_ERROR("Unused IOCTL data not set to zero.\n"); 4454 - return -EINVAL; 4455 - } 4456 - break; 4457 4452 default: 4458 4453 break; 4459 4454 }
+8 -3
include/uapi/drm/vmwgfx_drm.h
··· 297 297 * @version: Allows expanding the execbuf ioctl parameters without breaking 298 298 * backwards compatibility, since user-space will always tell the kernel 299 299 * which version it uses. 300 - * @flags: Execbuf flags. None currently. 300 + * @flags: Execbuf flags. 301 + * @imported_fence_fd: FD for a fence imported from another device 301 302 * 302 303 * Argument to the DRM_VMW_EXECBUF Ioctl. 303 304 */ 304 305 305 306 #define DRM_VMW_EXECBUF_VERSION 2 307 + 308 + #define DRM_VMW_EXECBUF_FLAG_IMPORT_FENCE_FD (1 << 0) 309 + #define DRM_VMW_EXECBUF_FLAG_EXPORT_FENCE_FD (1 << 1) 306 310 307 311 struct drm_vmw_execbuf_arg { 308 312 __u64 commands; ··· 316 312 __u32 version; 317 313 __u32 flags; 318 314 __u32 context_handle; 319 - __u32 pad64; 315 + __s32 imported_fence_fd; 320 316 }; 321 317 322 318 /** ··· 332 328 * @passed_seqno: The highest seqno number processed by the hardware 333 329 * so far. This can be used to mark user-space fence objects as signaled, and 334 330 * to determine whether a fence seqno might be stale. 331 + * @fd: FD associated with the fence, -1 if not exported 335 332 * @error: This member should've been set to -EFAULT on submission. 336 333 * The following actions should be take on completion: 337 334 * error == -EFAULT: Fence communication failed. The host is synchronized. ··· 350 345 __u32 mask; 351 346 __u32 seqno; 352 347 __u32 passed_seqno; 353 - __u32 pad64; 348 + __s32 fd; 354 349 __s32 error; 355 350 }; 356 351