diff options
author | Rob Clark <robdclark@gmail.com> | 2014-03-03 09:42:33 -0500 |
---|---|---|
committer | Rob Clark <robdclark@gmail.com> | 2014-03-31 10:27:46 -0400 |
commit | 93ddb0d3b022dfbd963f243bd01741643cebfb28 (patch) | |
tree | c8493b496943e3f6329847229a75a1d1a82db293 /include/uapi/drm | |
parent | 060530f1ea6740eb767085008d183f89ccdd289c (diff) |
drm/msm: validate flags, etc
After reading a nice article on LWN[1], I went back and double checked
my handling of invalid-input checking. Turns out there were a couple
places I had missed.
Since the driver is fairly young, and the devices it supports are really
only just barely usable for basic stuff (serial console) with an
upstream kernel, I think we should fix this now and revert specific
parts of this patch later in the unlikely event that a regression is
reported.
[1] https://lwn.net/Articles/588444/
Signed-off-by: Rob Clark <robdclark@gmail.com>
Diffstat (limited to 'include/uapi/drm')
-rw-r--r-- | include/uapi/drm/msm_drm.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/uapi/drm/msm_drm.h b/include/uapi/drm/msm_drm.h index bf91a78a0b0e..0664c31f010c 100644 --- a/include/uapi/drm/msm_drm.h +++ b/include/uapi/drm/msm_drm.h | |||
@@ -70,6 +70,12 @@ struct drm_msm_param { | |||
70 | #define MSM_BO_WC 0x00020000 | 70 | #define MSM_BO_WC 0x00020000 |
71 | #define MSM_BO_UNCACHED 0x00040000 | 71 | #define MSM_BO_UNCACHED 0x00040000 |
72 | 72 | ||
73 | #define MSM_BO_FLAGS (MSM_BO_SCANOUT | \ | ||
74 | MSM_BO_GPU_READONLY | \ | ||
75 | MSM_BO_CACHED | \ | ||
76 | MSM_BO_WC | \ | ||
77 | MSM_BO_UNCACHED) | ||
78 | |||
73 | struct drm_msm_gem_new { | 79 | struct drm_msm_gem_new { |
74 | uint64_t size; /* in */ | 80 | uint64_t size; /* in */ |
75 | uint32_t flags; /* in, mask of MSM_BO_x */ | 81 | uint32_t flags; /* in, mask of MSM_BO_x */ |
@@ -86,6 +92,8 @@ struct drm_msm_gem_info { | |||
86 | #define MSM_PREP_WRITE 0x02 | 92 | #define MSM_PREP_WRITE 0x02 |
87 | #define MSM_PREP_NOSYNC 0x04 | 93 | #define MSM_PREP_NOSYNC 0x04 |
88 | 94 | ||
95 | #define MSM_PREP_FLAGS (MSM_PREP_READ | MSM_PREP_WRITE | MSM_PREP_NOSYNC) | ||
96 | |||
89 | struct drm_msm_gem_cpu_prep { | 97 | struct drm_msm_gem_cpu_prep { |
90 | uint32_t handle; /* in */ | 98 | uint32_t handle; /* in */ |
91 | uint32_t op; /* in, mask of MSM_PREP_x */ | 99 | uint32_t op; /* in, mask of MSM_PREP_x */ |
@@ -153,6 +161,9 @@ struct drm_msm_gem_submit_cmd { | |||
153 | */ | 161 | */ |
154 | #define MSM_SUBMIT_BO_READ 0x0001 | 162 | #define MSM_SUBMIT_BO_READ 0x0001 |
155 | #define MSM_SUBMIT_BO_WRITE 0x0002 | 163 | #define MSM_SUBMIT_BO_WRITE 0x0002 |
164 | |||
165 | #define MSM_SUBMIT_BO_FLAGS (MSM_SUBMIT_BO_READ | MSM_SUBMIT_BO_WRITE) | ||
166 | |||
156 | struct drm_msm_gem_submit_bo { | 167 | struct drm_msm_gem_submit_bo { |
157 | uint32_t flags; /* in, mask of MSM_SUBMIT_BO_x */ | 168 | uint32_t flags; /* in, mask of MSM_SUBMIT_BO_x */ |
158 | uint32_t handle; /* in, GEM handle */ | 169 | uint32_t handle; /* in, GEM handle */ |