17ec681f3Smrg/*
27ec681f3Smrg * Copyright (C) 2013 Red Hat
37ec681f3Smrg * Author: Rob Clark <robdclark@gmail.com>
47ec681f3Smrg *
57ec681f3Smrg * Permission is hereby granted, free of charge, to any person obtaining a
67ec681f3Smrg * copy of this software and associated documentation files (the "Software"),
77ec681f3Smrg * to deal in the Software without restriction, including without limitation
87ec681f3Smrg * the rights to use, copy, modify, merge, publish, distribute, sublicense,
97ec681f3Smrg * and/or sell copies of the Software, and to permit persons to whom the
107ec681f3Smrg * Software is furnished to do so, subject to the following conditions:
117ec681f3Smrg *
127ec681f3Smrg * The above copyright notice and this permission notice (including the next
137ec681f3Smrg * paragraph) shall be included in all copies or substantial portions of the
147ec681f3Smrg * Software.
157ec681f3Smrg *
167ec681f3Smrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
177ec681f3Smrg * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
187ec681f3Smrg * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
197ec681f3Smrg * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
207ec681f3Smrg * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
217ec681f3Smrg * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
227ec681f3Smrg * SOFTWARE.
237ec681f3Smrg */
247ec681f3Smrg
257ec681f3Smrg#ifndef __MSM_DRM_H__
267ec681f3Smrg#define __MSM_DRM_H__
277ec681f3Smrg
287ec681f3Smrg#include "drm.h"
297ec681f3Smrg
307ec681f3Smrg#if defined(__cplusplus)
317ec681f3Smrgextern "C" {
327ec681f3Smrg#endif
337ec681f3Smrg
347ec681f3Smrg/* Please note that modifications to all structs defined here are
357ec681f3Smrg * subject to backwards-compatibility constraints:
367ec681f3Smrg *  1) Do not use pointers, use __u64 instead for 32 bit / 64 bit
377ec681f3Smrg *     user/kernel compatibility
387ec681f3Smrg *  2) Keep fields aligned to their size
397ec681f3Smrg *  3) Because of how drm_ioctl() works, we can add new fields at
407ec681f3Smrg *     the end of an ioctl if some care is taken: drm_ioctl() will
417ec681f3Smrg *     zero out the new fields at the tail of the ioctl, so a zero
427ec681f3Smrg *     value should have a backwards compatible meaning.  And for
437ec681f3Smrg *     output params, userspace won't see the newly added output
447ec681f3Smrg *     fields.. so that has to be somehow ok.
457ec681f3Smrg */
467ec681f3Smrg
477ec681f3Smrg#define MSM_PIPE_NONE        0x00
487ec681f3Smrg#define MSM_PIPE_2D0         0x01
497ec681f3Smrg#define MSM_PIPE_2D1         0x02
507ec681f3Smrg#define MSM_PIPE_3D0         0x10
517ec681f3Smrg
527ec681f3Smrg/* The pipe-id just uses the lower bits, so can be OR'd with flags in
537ec681f3Smrg * the upper 16 bits (which could be extended further, if needed, maybe
547ec681f3Smrg * we extend/overload the pipe-id some day to deal with multiple rings,
557ec681f3Smrg * but even then I don't think we need the full lower 16 bits).
567ec681f3Smrg */
577ec681f3Smrg#define MSM_PIPE_ID_MASK     0xffff
587ec681f3Smrg#define MSM_PIPE_ID(x)       ((x) & MSM_PIPE_ID_MASK)
597ec681f3Smrg#define MSM_PIPE_FLAGS(x)    ((x) & ~MSM_PIPE_ID_MASK)
607ec681f3Smrg
617ec681f3Smrg/* timeouts are specified in clock-monotonic absolute times (to simplify
627ec681f3Smrg * restarting interrupted ioctls).  The following struct is logically the
637ec681f3Smrg * same as 'struct timespec' but 32/64b ABI safe.
647ec681f3Smrg */
657ec681f3Smrgstruct drm_msm_timespec {
667ec681f3Smrg	__s64 tv_sec;          /* seconds */
677ec681f3Smrg	__s64 tv_nsec;         /* nanoseconds */
687ec681f3Smrg};
697ec681f3Smrg
707ec681f3Smrg#define MSM_PARAM_GPU_ID     0x01
717ec681f3Smrg#define MSM_PARAM_GMEM_SIZE  0x02
727ec681f3Smrg#define MSM_PARAM_CHIP_ID    0x03
737ec681f3Smrg#define MSM_PARAM_MAX_FREQ   0x04
747ec681f3Smrg#define MSM_PARAM_TIMESTAMP  0x05
757ec681f3Smrg#define MSM_PARAM_GMEM_BASE  0x06
767ec681f3Smrg#define MSM_PARAM_PRIORITIES 0x07  /* The # of priority levels */
777ec681f3Smrg#define MSM_PARAM_PP_PGTABLE 0x08  /* => 1 for per-process pagetables, else 0 */
787ec681f3Smrg#define MSM_PARAM_FAULTS     0x09
797ec681f3Smrg#define MSM_PARAM_SUSPENDS   0x0a
807ec681f3Smrg
817ec681f3Smrg/* For backwards compat.  The original support for preemption was based on
827ec681f3Smrg * a single ring per priority level so # of priority levels equals the #
837ec681f3Smrg * of rings.  With drm/scheduler providing additional levels of priority,
847ec681f3Smrg * the number of priorities is greater than the # of rings.  The param is
857ec681f3Smrg * renamed to better reflect this.
867ec681f3Smrg */
877ec681f3Smrg#define MSM_PARAM_NR_RINGS   MSM_PARAM_PRIORITIES
887ec681f3Smrg
897ec681f3Smrgstruct drm_msm_param {
907ec681f3Smrg	__u32 pipe;           /* in, MSM_PIPE_x */
917ec681f3Smrg	__u32 param;          /* in, MSM_PARAM_x */
927ec681f3Smrg	__u64 value;          /* out (get_param) or in (set_param) */
937ec681f3Smrg};
947ec681f3Smrg
957ec681f3Smrg/*
967ec681f3Smrg * GEM buffers:
977ec681f3Smrg */
987ec681f3Smrg
997ec681f3Smrg#define MSM_BO_SCANOUT       0x00000001     /* scanout capable */
1007ec681f3Smrg#define MSM_BO_GPU_READONLY  0x00000002
1017ec681f3Smrg#define MSM_BO_CACHE_MASK    0x000f0000
1027ec681f3Smrg/* cache modes */
1037ec681f3Smrg#define MSM_BO_CACHED        0x00010000
1047ec681f3Smrg#define MSM_BO_WC            0x00020000
1057ec681f3Smrg#define MSM_BO_UNCACHED      0x00040000 /* deprecated, use MSM_BO_WC */
1067ec681f3Smrg#define MSM_BO_CACHED_COHERENT 0x080000
1077ec681f3Smrg
1087ec681f3Smrg#define MSM_BO_FLAGS         (MSM_BO_SCANOUT | \
1097ec681f3Smrg                              MSM_BO_GPU_READONLY | \
1107ec681f3Smrg                              MSM_BO_CACHE_MASK)
1117ec681f3Smrg
1127ec681f3Smrgstruct drm_msm_gem_new {
1137ec681f3Smrg	__u64 size;           /* in */
1147ec681f3Smrg	__u32 flags;          /* in, mask of MSM_BO_x */
1157ec681f3Smrg	__u32 handle;         /* out */
1167ec681f3Smrg};
1177ec681f3Smrg
1187ec681f3Smrg/* Get or set GEM buffer info.  The requested value can be passed
1197ec681f3Smrg * directly in 'value', or for data larger than 64b 'value' is a
1207ec681f3Smrg * pointer to userspace buffer, with 'len' specifying the number of
1217ec681f3Smrg * bytes copied into that buffer.  For info returned by pointer,
1227ec681f3Smrg * calling the GEM_INFO ioctl with null 'value' will return the
1237ec681f3Smrg * required buffer size in 'len'
1247ec681f3Smrg */
1257ec681f3Smrg#define MSM_INFO_GET_OFFSET	0x00   /* get mmap() offset, returned by value */
1267ec681f3Smrg#define MSM_INFO_GET_IOVA	0x01   /* get iova, returned by value */
1277ec681f3Smrg#define MSM_INFO_SET_NAME	0x02   /* set the debug name (by pointer) */
1287ec681f3Smrg#define MSM_INFO_GET_NAME	0x03   /* get debug name, returned by pointer */
1297ec681f3Smrg
1307ec681f3Smrgstruct drm_msm_gem_info {
1317ec681f3Smrg	__u32 handle;         /* in */
1327ec681f3Smrg	__u32 info;           /* in - one of MSM_INFO_* */
1337ec681f3Smrg	__u64 value;          /* in or out */
1347ec681f3Smrg	__u32 len;            /* in or out */
1357ec681f3Smrg	__u32 pad;
1367ec681f3Smrg};
1377ec681f3Smrg
1387ec681f3Smrg#define MSM_PREP_READ        0x01
1397ec681f3Smrg#define MSM_PREP_WRITE       0x02
1407ec681f3Smrg#define MSM_PREP_NOSYNC      0x04
1417ec681f3Smrg
1427ec681f3Smrg#define MSM_PREP_FLAGS       (MSM_PREP_READ | MSM_PREP_WRITE | MSM_PREP_NOSYNC)
1437ec681f3Smrg
1447ec681f3Smrgstruct drm_msm_gem_cpu_prep {
1457ec681f3Smrg	__u32 handle;         /* in */
1467ec681f3Smrg	__u32 op;             /* in, mask of MSM_PREP_x */
1477ec681f3Smrg	struct drm_msm_timespec timeout;   /* in */
1487ec681f3Smrg};
1497ec681f3Smrg
1507ec681f3Smrgstruct drm_msm_gem_cpu_fini {
1517ec681f3Smrg	__u32 handle;         /* in */
1527ec681f3Smrg};
1537ec681f3Smrg
1547ec681f3Smrg/*
1557ec681f3Smrg * Cmdstream Submission:
1567ec681f3Smrg */
1577ec681f3Smrg
1587ec681f3Smrg/* The value written into the cmdstream is logically:
1597ec681f3Smrg *
1607ec681f3Smrg *   ((relocbuf->gpuaddr + reloc_offset) << shift) | or
1617ec681f3Smrg *
1627ec681f3Smrg * When we have GPU's w/ >32bit ptrs, it should be possible to deal
1637ec681f3Smrg * with this by emit'ing two reloc entries with appropriate shift
1647ec681f3Smrg * values.  Or a new MSM_SUBMIT_CMD_x type would also be an option.
1657ec681f3Smrg *
1667ec681f3Smrg * NOTE that reloc's must be sorted by order of increasing submit_offset,
1677ec681f3Smrg * otherwise EINVAL.
1687ec681f3Smrg */
1697ec681f3Smrgstruct drm_msm_gem_submit_reloc {
1707ec681f3Smrg	__u32 submit_offset;  /* in, offset from submit_bo */
1717ec681f3Smrg	__u32 or;             /* in, value OR'd with result */
1727ec681f3Smrg	__s32 shift;          /* in, amount of left shift (can be negative) */
1737ec681f3Smrg	__u32 reloc_idx;      /* in, index of reloc_bo buffer */
1747ec681f3Smrg	__u64 reloc_offset;   /* in, offset from start of reloc_bo */
1757ec681f3Smrg};
1767ec681f3Smrg
1777ec681f3Smrg/* submit-types:
1787ec681f3Smrg *   BUF - this cmd buffer is executed normally.
1797ec681f3Smrg *   IB_TARGET_BUF - this cmd buffer is an IB target.  Reloc's are
1807ec681f3Smrg *      processed normally, but the kernel does not setup an IB to
1817ec681f3Smrg *      this buffer in the first-level ringbuffer
1827ec681f3Smrg *   CTX_RESTORE_BUF - only executed if there has been a GPU context
1837ec681f3Smrg *      switch since the last SUBMIT ioctl
1847ec681f3Smrg */
1857ec681f3Smrg#define MSM_SUBMIT_CMD_BUF             0x0001
1867ec681f3Smrg#define MSM_SUBMIT_CMD_IB_TARGET_BUF   0x0002
1877ec681f3Smrg#define MSM_SUBMIT_CMD_CTX_RESTORE_BUF 0x0003
1887ec681f3Smrgstruct drm_msm_gem_submit_cmd {
1897ec681f3Smrg	__u32 type;           /* in, one of MSM_SUBMIT_CMD_x */
1907ec681f3Smrg	__u32 submit_idx;     /* in, index of submit_bo cmdstream buffer */
1917ec681f3Smrg	__u32 submit_offset;  /* in, offset into submit_bo */
1927ec681f3Smrg	__u32 size;           /* in, cmdstream size */
1937ec681f3Smrg	__u32 pad;
1947ec681f3Smrg	__u32 nr_relocs;      /* in, number of submit_reloc's */
1957ec681f3Smrg	__u64 relocs;         /* in, ptr to array of submit_reloc's */
1967ec681f3Smrg};
1977ec681f3Smrg
1987ec681f3Smrg/* Each buffer referenced elsewhere in the cmdstream submit (ie. the
1997ec681f3Smrg * cmdstream buffer(s) themselves or reloc entries) has one (and only
2007ec681f3Smrg * one) entry in the submit->bos[] table.
2017ec681f3Smrg *
2027ec681f3Smrg * As a optimization, the current buffer (gpu virtual address) can be
2037ec681f3Smrg * passed back through the 'presumed' field.  If on a subsequent reloc,
2047ec681f3Smrg * userspace passes back a 'presumed' address that is still valid,
2057ec681f3Smrg * then patching the cmdstream for this entry is skipped.  This can
2067ec681f3Smrg * avoid kernel needing to map/access the cmdstream bo in the common
2077ec681f3Smrg * case.
2087ec681f3Smrg */
2097ec681f3Smrg#define MSM_SUBMIT_BO_READ             0x0001
2107ec681f3Smrg#define MSM_SUBMIT_BO_WRITE            0x0002
2117ec681f3Smrg#define MSM_SUBMIT_BO_DUMP             0x0004
2127ec681f3Smrg
2137ec681f3Smrg#define MSM_SUBMIT_BO_FLAGS            (MSM_SUBMIT_BO_READ | \
2147ec681f3Smrg					MSM_SUBMIT_BO_WRITE | \
2157ec681f3Smrg					MSM_SUBMIT_BO_DUMP)
2167ec681f3Smrg
2177ec681f3Smrgstruct drm_msm_gem_submit_bo {
2187ec681f3Smrg	__u32 flags;          /* in, mask of MSM_SUBMIT_BO_x */
2197ec681f3Smrg	__u32 handle;         /* in, GEM handle */
2207ec681f3Smrg	__u64 presumed;       /* in/out, presumed buffer address */
2217ec681f3Smrg};
2227ec681f3Smrg
2237ec681f3Smrg/* Valid submit ioctl flags: */
2247ec681f3Smrg#define MSM_SUBMIT_NO_IMPLICIT   0x80000000 /* disable implicit sync */
2257ec681f3Smrg#define MSM_SUBMIT_FENCE_FD_IN   0x40000000 /* enable input fence_fd */
2267ec681f3Smrg#define MSM_SUBMIT_FENCE_FD_OUT  0x20000000 /* enable output fence_fd */
2277ec681f3Smrg#define MSM_SUBMIT_SUDO          0x10000000 /* run submitted cmds from RB */
2287ec681f3Smrg#define MSM_SUBMIT_SYNCOBJ_IN    0x08000000 /* enable input syncobj */
2297ec681f3Smrg#define MSM_SUBMIT_SYNCOBJ_OUT   0x04000000 /* enable output syncobj */
2307ec681f3Smrg#define MSM_SUBMIT_FLAGS                ( \
2317ec681f3Smrg		MSM_SUBMIT_NO_IMPLICIT   | \
2327ec681f3Smrg		MSM_SUBMIT_FENCE_FD_IN   | \
2337ec681f3Smrg		MSM_SUBMIT_FENCE_FD_OUT  | \
2347ec681f3Smrg		MSM_SUBMIT_SUDO          | \
2357ec681f3Smrg		MSM_SUBMIT_SYNCOBJ_IN    | \
2367ec681f3Smrg		MSM_SUBMIT_SYNCOBJ_OUT   | \
2377ec681f3Smrg		0)
2387ec681f3Smrg
2397ec681f3Smrg#define MSM_SUBMIT_SYNCOBJ_RESET 0x00000001 /* Reset syncobj after wait. */
2407ec681f3Smrg#define MSM_SUBMIT_SYNCOBJ_FLAGS        ( \
2417ec681f3Smrg		MSM_SUBMIT_SYNCOBJ_RESET | \
2427ec681f3Smrg		0)
2437ec681f3Smrg
2447ec681f3Smrgstruct drm_msm_gem_submit_syncobj {
2457ec681f3Smrg	__u32 handle;     /* in, syncobj handle. */
2467ec681f3Smrg	__u32 flags;      /* in, from MSM_SUBMIT_SYNCOBJ_FLAGS */
2477ec681f3Smrg	__u64 point;      /* in, timepoint for timeline syncobjs. */
2487ec681f3Smrg};
2497ec681f3Smrg
2507ec681f3Smrg/* Each cmdstream submit consists of a table of buffers involved, and
2517ec681f3Smrg * one or more cmdstream buffers.  This allows for conditional execution
2527ec681f3Smrg * (context-restore), and IB buffers needed for per tile/bin draw cmds.
2537ec681f3Smrg */
2547ec681f3Smrgstruct drm_msm_gem_submit {
2557ec681f3Smrg	__u32 flags;          /* MSM_PIPE_x | MSM_SUBMIT_x */
2567ec681f3Smrg	__u32 fence;          /* out */
2577ec681f3Smrg	__u32 nr_bos;         /* in, number of submit_bo's */
2587ec681f3Smrg	__u32 nr_cmds;        /* in, number of submit_cmd's */
2597ec681f3Smrg	__u64 bos;            /* in, ptr to array of submit_bo's */
2607ec681f3Smrg	__u64 cmds;           /* in, ptr to array of submit_cmd's */
2617ec681f3Smrg	__s32 fence_fd;       /* in/out fence fd (see MSM_SUBMIT_FENCE_FD_IN/OUT) */
2627ec681f3Smrg	__u32 queueid;        /* in, submitqueue id */
2637ec681f3Smrg	__u64 in_syncobjs;    /* in, ptr to array of drm_msm_gem_submit_syncobj */
2647ec681f3Smrg	__u64 out_syncobjs;   /* in, ptr to array of drm_msm_gem_submit_syncobj */
2657ec681f3Smrg	__u32 nr_in_syncobjs; /* in, number of entries in in_syncobj */
2667ec681f3Smrg	__u32 nr_out_syncobjs; /* in, number of entries in out_syncobj. */
2677ec681f3Smrg	__u32 syncobj_stride; /* in, stride of syncobj arrays. */
2687ec681f3Smrg	__u32 pad;            /*in, reserved for future use, always 0. */
2697ec681f3Smrg
2707ec681f3Smrg};
2717ec681f3Smrg
2727ec681f3Smrg/* The normal way to synchronize with the GPU is just to CPU_PREP on
2737ec681f3Smrg * a buffer if you need to access it from the CPU (other cmdstream
2747ec681f3Smrg * submission from same or other contexts, PAGE_FLIP ioctl, etc, all
2757ec681f3Smrg * handle the required synchronization under the hood).  This ioctl
2767ec681f3Smrg * mainly just exists as a way to implement the gallium pipe_fence
2777ec681f3Smrg * APIs without requiring a dummy bo to synchronize on.
2787ec681f3Smrg */
2797ec681f3Smrgstruct drm_msm_wait_fence {
2807ec681f3Smrg	__u32 fence;          /* in */
2817ec681f3Smrg	__u32 pad;
2827ec681f3Smrg	struct drm_msm_timespec timeout;   /* in */
2837ec681f3Smrg	__u32 queueid;         /* in, submitqueue id */
2847ec681f3Smrg};
2857ec681f3Smrg
2867ec681f3Smrg/* madvise provides a way to tell the kernel in case a buffers contents
2877ec681f3Smrg * can be discarded under memory pressure, which is useful for userspace
2887ec681f3Smrg * bo cache where we want to optimistically hold on to buffer allocate
2897ec681f3Smrg * and potential mmap, but allow the pages to be discarded under memory
2907ec681f3Smrg * pressure.
2917ec681f3Smrg *
2927ec681f3Smrg * Typical usage would involve madvise(DONTNEED) when buffer enters BO
2937ec681f3Smrg * cache, and madvise(WILLNEED) if trying to recycle buffer from BO cache.
2947ec681f3Smrg * In the WILLNEED case, 'retained' indicates to userspace whether the
2957ec681f3Smrg * backing pages still exist.
2967ec681f3Smrg */
2977ec681f3Smrg#define MSM_MADV_WILLNEED 0       /* backing pages are needed, status returned in 'retained' */
2987ec681f3Smrg#define MSM_MADV_DONTNEED 1       /* backing pages not needed */
2997ec681f3Smrg#define __MSM_MADV_PURGED 2       /* internal state */
3007ec681f3Smrg
3017ec681f3Smrgstruct drm_msm_gem_madvise {
3027ec681f3Smrg	__u32 handle;         /* in, GEM handle */
3037ec681f3Smrg	__u32 madv;           /* in, MSM_MADV_x */
3047ec681f3Smrg	__u32 retained;       /* out, whether backing store still exists */
3057ec681f3Smrg};
3067ec681f3Smrg
3077ec681f3Smrg/*
3087ec681f3Smrg * Draw queues allow the user to set specific submission parameter. Command
3097ec681f3Smrg * submissions specify a specific submitqueue to use.  ID 0 is reserved for
3107ec681f3Smrg * backwards compatibility as a "default" submitqueue
3117ec681f3Smrg */
3127ec681f3Smrg
3137ec681f3Smrg#define MSM_SUBMITQUEUE_FLAGS (0)
3147ec681f3Smrg
3157ec681f3Smrg/*
3167ec681f3Smrg * The submitqueue priority should be between 0 and MSM_PARAM_PRIORITIES-1,
3177ec681f3Smrg * a lower numeric value is higher priority.
3187ec681f3Smrg */
3197ec681f3Smrgstruct drm_msm_submitqueue {
3207ec681f3Smrg	__u32 flags;   /* in, MSM_SUBMITQUEUE_x */
3217ec681f3Smrg	__u32 prio;    /* in, Priority level */
3227ec681f3Smrg	__u32 id;      /* out, identifier */
3237ec681f3Smrg};
3247ec681f3Smrg
3257ec681f3Smrg#define MSM_SUBMITQUEUE_PARAM_FAULTS   0
3267ec681f3Smrg
3277ec681f3Smrgstruct drm_msm_submitqueue_query {
3287ec681f3Smrg	__u64 data;
3297ec681f3Smrg	__u32 id;
3307ec681f3Smrg	__u32 param;
3317ec681f3Smrg	__u32 len;
3327ec681f3Smrg	__u32 pad;
3337ec681f3Smrg};
3347ec681f3Smrg
3357ec681f3Smrg#define DRM_MSM_GET_PARAM              0x00
3367ec681f3Smrg/* placeholder:
3377ec681f3Smrg#define DRM_MSM_SET_PARAM              0x01
3387ec681f3Smrg */
3397ec681f3Smrg#define DRM_MSM_GEM_NEW                0x02
3407ec681f3Smrg#define DRM_MSM_GEM_INFO               0x03
3417ec681f3Smrg#define DRM_MSM_GEM_CPU_PREP           0x04
3427ec681f3Smrg#define DRM_MSM_GEM_CPU_FINI           0x05
3437ec681f3Smrg#define DRM_MSM_GEM_SUBMIT             0x06
3447ec681f3Smrg#define DRM_MSM_WAIT_FENCE             0x07
3457ec681f3Smrg#define DRM_MSM_GEM_MADVISE            0x08
3467ec681f3Smrg/* placeholder:
3477ec681f3Smrg#define DRM_MSM_GEM_SVM_NEW            0x09
3487ec681f3Smrg */
3497ec681f3Smrg#define DRM_MSM_SUBMITQUEUE_NEW        0x0A
3507ec681f3Smrg#define DRM_MSM_SUBMITQUEUE_CLOSE      0x0B
3517ec681f3Smrg#define DRM_MSM_SUBMITQUEUE_QUERY      0x0C
3527ec681f3Smrg
3537ec681f3Smrg#define DRM_IOCTL_MSM_GET_PARAM        DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_GET_PARAM, struct drm_msm_param)
3547ec681f3Smrg#define DRM_IOCTL_MSM_GEM_NEW          DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_GEM_NEW, struct drm_msm_gem_new)
3557ec681f3Smrg#define DRM_IOCTL_MSM_GEM_INFO         DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_GEM_INFO, struct drm_msm_gem_info)
3567ec681f3Smrg#define DRM_IOCTL_MSM_GEM_CPU_PREP     DRM_IOW (DRM_COMMAND_BASE + DRM_MSM_GEM_CPU_PREP, struct drm_msm_gem_cpu_prep)
3577ec681f3Smrg#define DRM_IOCTL_MSM_GEM_CPU_FINI     DRM_IOW (DRM_COMMAND_BASE + DRM_MSM_GEM_CPU_FINI, struct drm_msm_gem_cpu_fini)
3587ec681f3Smrg#define DRM_IOCTL_MSM_GEM_SUBMIT       DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_GEM_SUBMIT, struct drm_msm_gem_submit)
3597ec681f3Smrg#define DRM_IOCTL_MSM_WAIT_FENCE       DRM_IOW (DRM_COMMAND_BASE + DRM_MSM_WAIT_FENCE, struct drm_msm_wait_fence)
3607ec681f3Smrg#define DRM_IOCTL_MSM_GEM_MADVISE      DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_GEM_MADVISE, struct drm_msm_gem_madvise)
3617ec681f3Smrg#define DRM_IOCTL_MSM_SUBMITQUEUE_NEW    DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_SUBMITQUEUE_NEW, struct drm_msm_submitqueue)
3627ec681f3Smrg#define DRM_IOCTL_MSM_SUBMITQUEUE_CLOSE  DRM_IOW (DRM_COMMAND_BASE + DRM_MSM_SUBMITQUEUE_CLOSE, __u32)
3637ec681f3Smrg#define DRM_IOCTL_MSM_SUBMITQUEUE_QUERY  DRM_IOW (DRM_COMMAND_BASE + DRM_MSM_SUBMITQUEUE_QUERY, struct drm_msm_submitqueue_query)
3647ec681f3Smrg
3657ec681f3Smrg#if defined(__cplusplus)
3667ec681f3Smrg}
3677ec681f3Smrg#endif
3687ec681f3Smrg
3697ec681f3Smrg#endif /* __MSM_DRM_H__ */
370