/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ #ifndef _WASMDRM_DRM_H_ #define _WASMDRM_DRM_H_ #include "drm.h" #if defined(__cplusplus) extern "C" { #endif /* * Byte copies between user memory and a GEM object, the object named by its * mmap offset as DRM_IOCTL_MODE_MAP_DUMB returned it. * * On wasm32 a process's memory and the kernel's are separate, so mmap() of a * GEM object cannot alias the object's pages. The runtime keeps the mapping * as a copy in the process's memory instead, and moves bytes between that * copy and the object with these two calls. * * @offset: a byte offset in the device's mmap space; it must fall inside one * object the caller's file may map, and [@offset, @offset + @size) * must lie within that object. * @size: bytes to copy. 0 only validates @offset. * @data_ptr: the user buffer. */ #define DRM_WASMDRM_GEM_PWRITE 0x00 #define DRM_WASMDRM_GEM_PREAD 0x01 struct drm_wasmdrm_gem_rw { __u64 offset; __u64 size; __u64 data_ptr; }; #define DRM_IOCTL_WASMDRM_GEM_PWRITE \ DRM_IOW(DRM_COMMAND_BASE + DRM_WASMDRM_GEM_PWRITE, struct drm_wasmdrm_gem_rw) #define DRM_IOCTL_WASMDRM_GEM_PREAD \ DRM_IOW(DRM_COMMAND_BASE + DRM_WASMDRM_GEM_PREAD, struct drm_wasmdrm_gem_rw) #if defined(__cplusplus) } #endif #endif /* _WASMDRM_DRM_H_ */