aboutsummaryrefslogtreecommitdiffstats
path: root/include/uapi
diff options
context:
space:
mode:
authorRob Clark <robdclark@gmail.com>2016-04-23 10:08:59 -0400
committerRob Clark <robdclark@gmail.com>2016-09-15 17:21:13 -0400
commitd9c181e22a0599fa7e27c3717f56bc1b3b020e63 (patch)
treee95318f3dc683b374328a0523bde3f80b8d0084b /include/uapi
parent1d42a3fee6e83ae6e7c83808ccdf8620fc30447e (diff)
drm/msm: extend the submit ioctl to pass in flags
We'll want to be able to pass in flags, such as asking for explicit fencing, and possibly other things down the road. Fortunately we don't need a full 32b for the pipe-id. So use the upper 16 bits for flags (which could be extended or reduced later if needed, so start adding flags from the high bits). Since anything with the upper bits set would not be a valid pipe-id, an old userspace would not set any of the upper bits, and an old kernel would reject it as an invalid pipe-id. Signed-off-by: Rob Clark <robdclark@gmail.com>
Diffstat (limited to 'include/uapi')
-rw-r--r--include/uapi/drm/msm_drm.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/include/uapi/drm/msm_drm.h b/include/uapi/drm/msm_drm.h
index 49f778de8e06..913e08cd5ceb 100644
--- a/include/uapi/drm/msm_drm.h
+++ b/include/uapi/drm/msm_drm.h
@@ -42,6 +42,15 @@ extern "C" {
42#define MSM_PIPE_2D1 0x02 42#define MSM_PIPE_2D1 0x02
43#define MSM_PIPE_3D0 0x10 43#define MSM_PIPE_3D0 0x10
44 44
45/* The pipe-id just uses the lower bits, so can be OR'd with flags in
46 * the upper 16 bits (which could be extended further, if needed, maybe
47 * we extend/overload the pipe-id some day to deal with multiple rings,
48 * but even then I don't think we need the full lower 16 bits).
49 */
50#define MSM_PIPE_ID_MASK 0xffff
51#define MSM_PIPE_ID(x) ((x) & MSM_PIPE_ID_MASK)
52#define MSM_PIPE_FLAGS(x) ((x) & ~MSM_PIPE_ID_MASK)
53
45/* timeouts are specified in clock-monotonic absolute times (to simplify 54/* timeouts are specified in clock-monotonic absolute times (to simplify
46 * restarting interrupted ioctls). The following struct is logically the 55 * restarting interrupted ioctls). The following struct is logically the
47 * same as 'struct timespec' but 32/64b ABI safe. 56 * same as 'struct timespec' but 32/64b ABI safe.
@@ -175,12 +184,16 @@ struct drm_msm_gem_submit_bo {
175 __u64 presumed; /* in/out, presumed buffer address */ 184 __u64 presumed; /* in/out, presumed buffer address */
176}; 185};
177 186
187/* Valid submit ioctl flags: */
188/* to start, nothing.. */
189#define MSM_SUBMIT_FLAGS 0
190
178/* Each cmdstream submit consists of a table of buffers involved, and 191/* Each cmdstream submit consists of a table of buffers involved, and
179 * one or more cmdstream buffers. This allows for conditional execution 192 * one or more cmdstream buffers. This allows for conditional execution
180 * (context-restore), and IB buffers needed for per tile/bin draw cmds. 193 * (context-restore), and IB buffers needed for per tile/bin draw cmds.
181 */ 194 */
182struct drm_msm_gem_submit { 195struct drm_msm_gem_submit {
183 __u32 pipe; /* in, MSM_PIPE_x */ 196 __u32 flags; /* MSM_PIPE_x | MSM_SUBMIT_x */
184 __u32 fence; /* out */ 197 __u32 fence; /* out */
185 __u32 nr_bos; /* in, number of submit_bo's */ 198 __u32 nr_bos; /* in, number of submit_bo's */
186 __u32 nr_cmds; /* in, number of submit_cmd's */ 199 __u32 nr_cmds; /* in, number of submit_cmd's */