/*1* Copyright (C) 2013 Red Hat2* Author: Rob Clark <[email protected]>3*4* Permission is hereby granted, free of charge, to any person obtaining a5* copy of this software and associated documentation files (the "Software"),6* to deal in the Software without restriction, including without limitation7* the rights to use, copy, modify, merge, publish, distribute, sublicense,8* and/or sell copies of the Software, and to permit persons to whom the9* Software is furnished to do so, subject to the following conditions:10*11* The above copyright notice and this permission notice (including the next12* paragraph) shall be included in all copies or substantial portions of the13* Software.14*15* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR16* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,17* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL18* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER19* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,20* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE21* SOFTWARE.22*/2324#ifndef __MSM_DRM_H__25#define __MSM_DRM_H__2627#include "drm.h"2829#if defined(__cplusplus)30extern "C" {31#endif3233/* Please note that modifications to all structs defined here are34* subject to backwards-compatibility constraints:35* 1) Do not use pointers, use __u64 instead for 32 bit / 64 bit36* user/kernel compatibility37* 2) Keep fields aligned to their size38* 3) Because of how drm_ioctl() works, we can add new fields at39* the end of an ioctl if some care is taken: drm_ioctl() will40* zero out the new fields at the tail of the ioctl, so a zero41* value should have a backwards compatible meaning. And for42* output params, userspace won't see the newly added output43* fields.. so that has to be somehow ok.44*/4546#define MSM_PIPE_NONE 0x0047#define MSM_PIPE_2D0 0x0148#define MSM_PIPE_2D1 0x0249#define MSM_PIPE_3D0 0x105051/* The pipe-id just uses the lower bits, so can be OR'd with flags in52* the upper 16 bits (which could be extended further, if needed, maybe53* we extend/overload the pipe-id some day to deal with multiple rings,54* but even then I don't think we need the full lower 16 bits).55*/56#define MSM_PIPE_ID_MASK 0xffff57#define MSM_PIPE_ID(x) ((x) & MSM_PIPE_ID_MASK)58#define MSM_PIPE_FLAGS(x) ((x) & ~MSM_PIPE_ID_MASK)5960/* timeouts are specified in clock-monotonic absolute times (to simplify61* restarting interrupted ioctls). The following struct is logically the62* same as 'struct timespec' but 32/64b ABI safe.63*/64struct drm_msm_timespec {65__s64 tv_sec; /* seconds */66__s64 tv_nsec; /* nanoseconds */67};6869/* Below "RO" indicates a read-only param, "WO" indicates write-only, and70* "RW" indicates a param that can be both read (GET_PARAM) and written71* (SET_PARAM)72*/73#define MSM_PARAM_GPU_ID 0x01 /* RO */74#define MSM_PARAM_GMEM_SIZE 0x02 /* RO */75#define MSM_PARAM_CHIP_ID 0x03 /* RO */76#define MSM_PARAM_MAX_FREQ 0x04 /* RO */77#define MSM_PARAM_TIMESTAMP 0x05 /* RO */78#define MSM_PARAM_GMEM_BASE 0x06 /* RO */79#define MSM_PARAM_PRIORITIES 0x07 /* RO: The # of priority levels */80#define MSM_PARAM_PP_PGTABLE 0x08 /* RO: Deprecated, always returns zero */81#define MSM_PARAM_FAULTS 0x09 /* RO */82#define MSM_PARAM_SUSPENDS 0x0a /* RO */83#define MSM_PARAM_SYSPROF 0x0b /* WO: 1 preserves perfcntrs, 2 also disables suspend */84#define MSM_PARAM_COMM 0x0c /* WO: override for task->comm */85#define MSM_PARAM_CMDLINE 0x0d /* WO: override for task cmdline */86#define MSM_PARAM_VA_START 0x0e /* RO: start of valid GPU iova range */87#define MSM_PARAM_VA_SIZE 0x0f /* RO: size of valid GPU iova range (bytes) */88#define MSM_PARAM_HIGHEST_BANK_BIT 0x10 /* RO */89#define MSM_PARAM_RAYTRACING 0x11 /* RO */90#define MSM_PARAM_UBWC_SWIZZLE 0x12 /* RO */91#define MSM_PARAM_MACROTILE_MODE 0x13 /* RO */92#define MSM_PARAM_UCHE_TRAP_BASE 0x14 /* RO */93/* PRR (Partially Resident Region) is required for sparse residency: */94#define MSM_PARAM_HAS_PRR 0x15 /* RO */95/* MSM_PARAM_EN_VM_BIND is set to 1 to enable VM_BIND ops.96*97* With VM_BIND enabled, userspace is required to allocate iova and use the98* VM_BIND ops for map/unmap ioctls. MSM_INFO_SET_IOVA and MSM_INFO_GET_IOVA99* will be rejected. (The latter does not have a sensible meaning when a BO100* can have multiple and/or partial mappings.)101*102* With VM_BIND enabled, userspace does not include a submit_bo table in the103* SUBMIT ioctl (this will be rejected), the resident set is determined by104* the the VM_BIND ops.105*106* Enabling VM_BIND will fail on devices which do not have per-process pgtables.107* And it is not allowed to disable VM_BIND once it has been enabled.108*109* Enabling VM_BIND should be done (attempted) prior to allocating any BOs or110* submitqueues of type MSM_SUBMITQUEUE_VM_BIND.111*112* Relatedly, when VM_BIND mode is enabled, the kernel will not try to recover113* from GPU faults or failed async VM_BIND ops, in particular because it is114* difficult to communicate to userspace which op failed so that userspace115* could rewind and try again. When the VM is marked unusable, the SUBMIT116* ioctl will throw -EPIPE.117*/118#define MSM_PARAM_EN_VM_BIND 0x16 /* WO, once */119120/* For backwards compat. The original support for preemption was based on121* a single ring per priority level so # of priority levels equals the #122* of rings. With drm/scheduler providing additional levels of priority,123* the number of priorities is greater than the # of rings. The param is124* renamed to better reflect this.125*/126#define MSM_PARAM_NR_RINGS MSM_PARAM_PRIORITIES127128struct drm_msm_param {129__u32 pipe; /* in, MSM_PIPE_x */130__u32 param; /* in, MSM_PARAM_x */131__u64 value; /* out (get_param) or in (set_param) */132__u32 len; /* zero for non-pointer params */133__u32 pad; /* must be zero */134};135136/*137* GEM buffers:138*/139140#define MSM_BO_SCANOUT 0x00000001 /* scanout capable */141#define MSM_BO_GPU_READONLY 0x00000002142/* Private buffers do not need to be explicitly listed in the SUBMIT143* ioctl, unless referenced by a drm_msm_gem_submit_cmd. Private144* buffers may NOT be imported/exported or used for scanout (or any145* other situation where buffers can be indefinitely pinned, but146* cases other than scanout are all kernel owned BOs which are not147* visible to userspace).148*149* In exchange for those constraints, all private BOs associated with150* a single context (drm_file) share a single dma_resv, and if there151* has been no eviction since the last submit, there are no per-BO152* bookeeping to do, significantly cutting the SUBMIT overhead.153*/154#define MSM_BO_NO_SHARE 0x00000004155#define MSM_BO_CACHE_MASK 0x000f0000156/* cache modes */157#define MSM_BO_CACHED 0x00010000158#define MSM_BO_WC 0x00020000159#define MSM_BO_UNCACHED 0x00040000 /* deprecated, use MSM_BO_WC */160#define MSM_BO_CACHED_COHERENT 0x080000161162#define MSM_BO_FLAGS (MSM_BO_SCANOUT | \163MSM_BO_GPU_READONLY | \164MSM_BO_NO_SHARE | \165MSM_BO_CACHE_MASK)166167struct drm_msm_gem_new {168__u64 size; /* in */169__u32 flags; /* in, mask of MSM_BO_x */170__u32 handle; /* out */171};172173/* Get or set GEM buffer info. The requested value can be passed174* directly in 'value', or for data larger than 64b 'value' is a175* pointer to userspace buffer, with 'len' specifying the number of176* bytes copied into that buffer. For info returned by pointer,177* calling the GEM_INFO ioctl with null 'value' will return the178* required buffer size in 'len'179*/180#define MSM_INFO_GET_OFFSET 0x00 /* get mmap() offset, returned by value */181#define MSM_INFO_GET_IOVA 0x01 /* get iova, returned by value */182#define MSM_INFO_SET_NAME 0x02 /* set the debug name (by pointer) */183#define MSM_INFO_GET_NAME 0x03 /* get debug name, returned by pointer */184#define MSM_INFO_SET_IOVA 0x04 /* set the iova, passed by value */185#define MSM_INFO_GET_FLAGS 0x05 /* get the MSM_BO_x flags */186#define MSM_INFO_SET_METADATA 0x06 /* set userspace metadata */187#define MSM_INFO_GET_METADATA 0x07 /* get userspace metadata */188189struct drm_msm_gem_info {190__u32 handle; /* in */191__u32 info; /* in - one of MSM_INFO_* */192__u64 value; /* in or out */193__u32 len; /* in or out */194__u32 pad;195};196197#define MSM_PREP_READ 0x01198#define MSM_PREP_WRITE 0x02199#define MSM_PREP_NOSYNC 0x04200#define MSM_PREP_BOOST 0x08201202#define MSM_PREP_FLAGS (MSM_PREP_READ | \203MSM_PREP_WRITE | \204MSM_PREP_NOSYNC | \205MSM_PREP_BOOST | \2060)207208struct drm_msm_gem_cpu_prep {209__u32 handle; /* in */210__u32 op; /* in, mask of MSM_PREP_x */211struct drm_msm_timespec timeout; /* in */212};213214struct drm_msm_gem_cpu_fini {215__u32 handle; /* in */216};217218/*219* Cmdstream Submission:220*/221222#define MSM_SYNCOBJ_RESET 0x00000001 /* Reset syncobj after wait. */223#define MSM_SYNCOBJ_FLAGS ( \224MSM_SYNCOBJ_RESET | \2250)226227struct drm_msm_syncobj {228__u32 handle; /* in, syncobj handle. */229__u32 flags; /* in, from MSM_SUBMIT_SYNCOBJ_FLAGS */230__u64 point; /* in, timepoint for timeline syncobjs. */231};232233/* The value written into the cmdstream is logically:234*235* ((relocbuf->gpuaddr + reloc_offset) << shift) | or236*237* When we have GPU's w/ >32bit ptrs, it should be possible to deal238* with this by emit'ing two reloc entries with appropriate shift239* values. Or a new MSM_SUBMIT_CMD_x type would also be an option.240*241* NOTE that reloc's must be sorted by order of increasing submit_offset,242* otherwise EINVAL.243*/244struct drm_msm_gem_submit_reloc {245__u32 submit_offset; /* in, offset from submit_bo */246#ifdef __cplusplus247__u32 _or; /* in, value OR'd with result */248#else249__u32 or; /* in, value OR'd with result */250#endif251__s32 shift; /* in, amount of left shift (can be negative) */252__u32 reloc_idx; /* in, index of reloc_bo buffer */253__u64 reloc_offset; /* in, offset from start of reloc_bo */254};255256/* submit-types:257* BUF - this cmd buffer is executed normally.258* IB_TARGET_BUF - this cmd buffer is an IB target. Reloc's are259* processed normally, but the kernel does not setup an IB to260* this buffer in the first-level ringbuffer261* CTX_RESTORE_BUF - only executed if there has been a GPU context262* switch since the last SUBMIT ioctl263*/264#define MSM_SUBMIT_CMD_BUF 0x0001265#define MSM_SUBMIT_CMD_IB_TARGET_BUF 0x0002266#define MSM_SUBMIT_CMD_CTX_RESTORE_BUF 0x0003267struct drm_msm_gem_submit_cmd {268__u32 type; /* in, one of MSM_SUBMIT_CMD_x */269__u32 submit_idx; /* in, index of submit_bo cmdstream buffer */270__u32 submit_offset; /* in, offset into submit_bo */271__u32 size; /* in, cmdstream size */272__u32 pad;273__u32 nr_relocs; /* in, number of submit_reloc's */274union {275__u64 relocs; /* in, ptr to array of submit_reloc's */276__u64 iova; /* cmdstream address (for VM_BIND contexts) */277};278};279280/* Each buffer referenced elsewhere in the cmdstream submit (ie. the281* cmdstream buffer(s) themselves or reloc entries) has one (and only282* one) entry in the submit->bos[] table.283*284* As a optimization, the current buffer (gpu virtual address) can be285* passed back through the 'presumed' field. If on a subsequent reloc,286* userspace passes back a 'presumed' address that is still valid,287* then patching the cmdstream for this entry is skipped. This can288* avoid kernel needing to map/access the cmdstream bo in the common289* case.290*/291#define MSM_SUBMIT_BO_READ 0x0001292#define MSM_SUBMIT_BO_WRITE 0x0002293#define MSM_SUBMIT_BO_DUMP 0x0004294#define MSM_SUBMIT_BO_NO_IMPLICIT 0x0008295296#define MSM_SUBMIT_BO_FLAGS (MSM_SUBMIT_BO_READ | \297MSM_SUBMIT_BO_WRITE | \298MSM_SUBMIT_BO_DUMP | \299MSM_SUBMIT_BO_NO_IMPLICIT)300301struct drm_msm_gem_submit_bo {302__u32 flags; /* in, mask of MSM_SUBMIT_BO_x */303__u32 handle; /* in, GEM handle */304__u64 presumed; /* in/out, presumed buffer address */305};306307/* Valid submit ioctl flags: */308#define MSM_SUBMIT_NO_IMPLICIT 0x80000000 /* disable implicit sync */309#define MSM_SUBMIT_FENCE_FD_IN 0x40000000 /* enable input fence_fd */310#define MSM_SUBMIT_FENCE_FD_OUT 0x20000000 /* enable output fence_fd */311#define MSM_SUBMIT_SUDO 0x10000000 /* run submitted cmds from RB */312#define MSM_SUBMIT_SYNCOBJ_IN 0x08000000 /* enable input syncobj */313#define MSM_SUBMIT_SYNCOBJ_OUT 0x04000000 /* enable output syncobj */314#define MSM_SUBMIT_FENCE_SN_IN 0x02000000 /* userspace passes in seqno fence */315#define MSM_SUBMIT_FLAGS ( \316MSM_SUBMIT_NO_IMPLICIT | \317MSM_SUBMIT_FENCE_FD_IN | \318MSM_SUBMIT_FENCE_FD_OUT | \319MSM_SUBMIT_SUDO | \320MSM_SUBMIT_SYNCOBJ_IN | \321MSM_SUBMIT_SYNCOBJ_OUT | \322MSM_SUBMIT_FENCE_SN_IN | \3230)324325/* Each cmdstream submit consists of a table of buffers involved, and326* one or more cmdstream buffers. This allows for conditional execution327* (context-restore), and IB buffers needed for per tile/bin draw cmds.328*/329struct drm_msm_gem_submit {330__u32 flags; /* MSM_PIPE_x | MSM_SUBMIT_x */331__u32 fence; /* out (or in with MSM_SUBMIT_FENCE_SN_IN flag) */332__u32 nr_bos; /* in, number of submit_bo's */333__u32 nr_cmds; /* in, number of submit_cmd's */334__u64 bos; /* in, ptr to array of submit_bo's */335__u64 cmds; /* in, ptr to array of submit_cmd's */336__s32 fence_fd; /* in/out fence fd (see MSM_SUBMIT_FENCE_FD_IN/OUT) */337__u32 queueid; /* in, submitqueue id */338__u64 in_syncobjs; /* in, ptr to array of drm_msm_syncobj */339__u64 out_syncobjs; /* in, ptr to array of drm_msm_syncobj */340__u32 nr_in_syncobjs; /* in, number of entries in in_syncobj */341__u32 nr_out_syncobjs; /* in, number of entries in out_syncobj. */342__u32 syncobj_stride; /* in, stride of syncobj arrays. */343__u32 pad; /*in, reserved for future use, always 0. */344};345346#define MSM_VM_BIND_OP_UNMAP 0347#define MSM_VM_BIND_OP_MAP 1348#define MSM_VM_BIND_OP_MAP_NULL 2349350#define MSM_VM_BIND_OP_DUMP 1351#define MSM_VM_BIND_OP_FLAGS ( \352MSM_VM_BIND_OP_DUMP | \3530)354355/**356* struct drm_msm_vm_bind_op - bind/unbind op to run357*/358struct drm_msm_vm_bind_op {359/** @op: one of MSM_VM_BIND_OP_x */360__u32 op;361/** @handle: GEM object handle, MBZ for UNMAP or MAP_NULL */362__u32 handle;363/** @obj_offset: Offset into GEM object, MBZ for UNMAP or MAP_NULL */364__u64 obj_offset;365/** @iova: Address to operate on */366__u64 iova;367/** @range: Number of bites to to map/unmap */368__u64 range;369/** @flags: Bitmask of MSM_VM_BIND_OP_FLAG_x */370__u32 flags;371/** @pad: MBZ */372__u32 pad;373};374375#define MSM_VM_BIND_FENCE_FD_IN 0x00000001376#define MSM_VM_BIND_FENCE_FD_OUT 0x00000002377#define MSM_VM_BIND_FLAGS ( \378MSM_VM_BIND_FENCE_FD_IN | \379MSM_VM_BIND_FENCE_FD_OUT | \3800)381382/**383* struct drm_msm_vm_bind - Input of &DRM_IOCTL_MSM_VM_BIND384*/385struct drm_msm_vm_bind {386/** @flags: in, bitmask of MSM_VM_BIND_x */387__u32 flags;388/** @nr_ops: the number of bind ops in this ioctl */389__u32 nr_ops;390/** @fence_fd: in/out fence fd (see MSM_VM_BIND_FENCE_FD_IN/OUT) */391__s32 fence_fd;392/** @queue_id: in, submitqueue id */393__u32 queue_id;394/** @in_syncobjs: in, ptr to array of drm_msm_gem_syncobj */395__u64 in_syncobjs;396/** @out_syncobjs: in, ptr to array of drm_msm_gem_syncobj */397__u64 out_syncobjs;398/** @nr_in_syncobjs: in, number of entries in in_syncobj */399__u32 nr_in_syncobjs;400/** @nr_out_syncobjs: in, number of entries in out_syncobj */401__u32 nr_out_syncobjs;402/** @syncobj_stride: in, stride of syncobj arrays */403__u32 syncobj_stride;404/** @op_stride: sizeof each struct drm_msm_vm_bind_op in @ops */405__u32 op_stride;406union {407/** @op: used if num_ops == 1 */408struct drm_msm_vm_bind_op op;409/** @ops: userptr to array of drm_msm_vm_bind_op if num_ops > 1 */410__u64 ops;411};412};413414#define MSM_WAIT_FENCE_BOOST 0x00000001415#define MSM_WAIT_FENCE_FLAGS ( \416MSM_WAIT_FENCE_BOOST | \4170)418419/* The normal way to synchronize with the GPU is just to CPU_PREP on420* a buffer if you need to access it from the CPU (other cmdstream421* submission from same or other contexts, PAGE_FLIP ioctl, etc, all422* handle the required synchronization under the hood). This ioctl423* mainly just exists as a way to implement the gallium pipe_fence424* APIs without requiring a dummy bo to synchronize on.425*/426struct drm_msm_wait_fence {427__u32 fence; /* in */428__u32 flags; /* in, bitmask of MSM_WAIT_FENCE_x */429struct drm_msm_timespec timeout; /* in */430__u32 queueid; /* in, submitqueue id */431};432433/* madvise provides a way to tell the kernel in case a buffers contents434* can be discarded under memory pressure, which is useful for userspace435* bo cache where we want to optimistically hold on to buffer allocate436* and potential mmap, but allow the pages to be discarded under memory437* pressure.438*439* Typical usage would involve madvise(DONTNEED) when buffer enters BO440* cache, and madvise(WILLNEED) if trying to recycle buffer from BO cache.441* In the WILLNEED case, 'retained' indicates to userspace whether the442* backing pages still exist.443*/444#define MSM_MADV_WILLNEED 0 /* backing pages are needed, status returned in 'retained' */445#define MSM_MADV_DONTNEED 1 /* backing pages not needed */446#define __MSM_MADV_PURGED 2 /* internal state */447448struct drm_msm_gem_madvise {449__u32 handle; /* in, GEM handle */450__u32 madv; /* in, MSM_MADV_x */451__u32 retained; /* out, whether backing store still exists */452};453454/*455* Draw queues allow the user to set specific submission parameter. Command456* submissions specify a specific submitqueue to use. ID 0 is reserved for457* backwards compatibility as a "default" submitqueue.458*459* Because VM_BIND async updates happen on the CPU, they must run on a460* virtual queue created with the flag MSM_SUBMITQUEUE_VM_BIND. If we had461* a way to do pgtable updates on the GPU, we could drop this restriction.462*/463464#define MSM_SUBMITQUEUE_ALLOW_PREEMPT 0x00000001465#define MSM_SUBMITQUEUE_VM_BIND 0x00000002 /* virtual queue for VM_BIND ops */466467#define MSM_SUBMITQUEUE_FLAGS ( \468MSM_SUBMITQUEUE_ALLOW_PREEMPT | \469MSM_SUBMITQUEUE_VM_BIND | \4700)471472/*473* The submitqueue priority should be between 0 and MSM_PARAM_PRIORITIES-1,474* a lower numeric value is higher priority.475*/476struct drm_msm_submitqueue {477__u32 flags; /* in, MSM_SUBMITQUEUE_x */478__u32 prio; /* in, Priority level */479__u32 id; /* out, identifier */480};481482#define MSM_SUBMITQUEUE_PARAM_FAULTS 0483484struct drm_msm_submitqueue_query {485__u64 data;486__u32 id;487__u32 param;488__u32 len;489__u32 pad;490};491492#define DRM_MSM_GET_PARAM 0x00493#define DRM_MSM_SET_PARAM 0x01494#define DRM_MSM_GEM_NEW 0x02495#define DRM_MSM_GEM_INFO 0x03496#define DRM_MSM_GEM_CPU_PREP 0x04497#define DRM_MSM_GEM_CPU_FINI 0x05498#define DRM_MSM_GEM_SUBMIT 0x06499#define DRM_MSM_WAIT_FENCE 0x07500#define DRM_MSM_GEM_MADVISE 0x08501/* placeholder:502#define DRM_MSM_GEM_SVM_NEW 0x09503*/504#define DRM_MSM_SUBMITQUEUE_NEW 0x0A505#define DRM_MSM_SUBMITQUEUE_CLOSE 0x0B506#define DRM_MSM_SUBMITQUEUE_QUERY 0x0C507#define DRM_MSM_VM_BIND 0x0D508509#define DRM_IOCTL_MSM_GET_PARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_GET_PARAM, struct drm_msm_param)510#define DRM_IOCTL_MSM_SET_PARAM DRM_IOW (DRM_COMMAND_BASE + DRM_MSM_SET_PARAM, struct drm_msm_param)511#define DRM_IOCTL_MSM_GEM_NEW DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_GEM_NEW, struct drm_msm_gem_new)512#define DRM_IOCTL_MSM_GEM_INFO DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_GEM_INFO, struct drm_msm_gem_info)513#define DRM_IOCTL_MSM_GEM_CPU_PREP DRM_IOW (DRM_COMMAND_BASE + DRM_MSM_GEM_CPU_PREP, struct drm_msm_gem_cpu_prep)514#define DRM_IOCTL_MSM_GEM_CPU_FINI DRM_IOW (DRM_COMMAND_BASE + DRM_MSM_GEM_CPU_FINI, struct drm_msm_gem_cpu_fini)515#define DRM_IOCTL_MSM_GEM_SUBMIT DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_GEM_SUBMIT, struct drm_msm_gem_submit)516#define DRM_IOCTL_MSM_WAIT_FENCE DRM_IOW (DRM_COMMAND_BASE + DRM_MSM_WAIT_FENCE, struct drm_msm_wait_fence)517#define DRM_IOCTL_MSM_GEM_MADVISE DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_GEM_MADVISE, struct drm_msm_gem_madvise)518#define DRM_IOCTL_MSM_SUBMITQUEUE_NEW DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_SUBMITQUEUE_NEW, struct drm_msm_submitqueue)519#define DRM_IOCTL_MSM_SUBMITQUEUE_CLOSE DRM_IOW (DRM_COMMAND_BASE + DRM_MSM_SUBMITQUEUE_CLOSE, __u32)520#define DRM_IOCTL_MSM_SUBMITQUEUE_QUERY DRM_IOW (DRM_COMMAND_BASE + DRM_MSM_SUBMITQUEUE_QUERY, struct drm_msm_submitqueue_query)521#define DRM_IOCTL_MSM_VM_BIND DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_VM_BIND, struct drm_msm_vm_bind)522523#if defined(__cplusplus)524}525#endif526527#endif /* __MSM_DRM_H__ */528529530