aboutsummaryrefslogtreecommitdiffstats
path: root/include/drm
diff options
context:
space:
mode:
authorBen Widawsky <ben@bwidawsk.net>2012-07-12 14:01:05 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2012-07-25 12:23:49 -0400
commitc0c7babc48c4f6943ed3070d04630ea3ac9272ee (patch)
tree86067dfb6b57953296e26dbf58ac8d13693c43f3 /include/drm
parent2b860db67ff3ce886fcb35289a9283a041cce6a4 (diff)
drm/i915: add register read IOCTL
The interface's immediate purpose is to do synchronous timestamp queries as required by GL_TIMESTAMP. The GPU has a register for reading the timestamp but because that would normally require root access through libpciaccess, the IOCTL can provide this service instead. Currently the implementation whitelists only the render ring timestamp register, because that is the only thing we need to expose at this time. v2: make size implicit based on the register offset Add a generation check Reviewed-by: Eric Anholt <eric@anholt.net> Cc: Jacek Lawrynowicz <jacek.lawrynowicz@intel.com> Signed-off-by: Ben Widawsky <ben@bwidawsk.net> [danvet: fixup the ioctl numerb:] Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'include/drm')
-rw-r--r--include/drm/i915_drm.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/include/drm/i915_drm.h b/include/drm/i915_drm.h
index 95648ab819ac..b923b032743f 100644
--- a/include/drm/i915_drm.h
+++ b/include/drm/i915_drm.h
@@ -205,6 +205,7 @@ typedef struct _drm_i915_sarea {
205#define DRM_I915_GEM_CONTEXT_DESTROY 0x2e 205#define DRM_I915_GEM_CONTEXT_DESTROY 0x2e
206#define DRM_I915_GEM_SET_CACHEING 0x2f 206#define DRM_I915_GEM_SET_CACHEING 0x2f
207#define DRM_I915_GEM_GET_CACHEING 0x30 207#define DRM_I915_GEM_GET_CACHEING 0x30
208#define DRM_I915_REG_READ 0x31
208 209
209#define DRM_IOCTL_I915_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_I915_INIT, drm_i915_init_t) 210#define DRM_IOCTL_I915_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_I915_INIT, drm_i915_init_t)
210#define DRM_IOCTL_I915_FLUSH DRM_IO ( DRM_COMMAND_BASE + DRM_I915_FLUSH) 211#define DRM_IOCTL_I915_FLUSH DRM_IO ( DRM_COMMAND_BASE + DRM_I915_FLUSH)
@@ -253,6 +254,7 @@ typedef struct _drm_i915_sarea {
253#define DRM_IOCTL_I915_GEM_WAIT DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_WAIT, struct drm_i915_gem_wait) 254#define DRM_IOCTL_I915_GEM_WAIT DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_WAIT, struct drm_i915_gem_wait)
254#define DRM_IOCTL_I915_GEM_CONTEXT_CREATE DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_CREATE, struct drm_i915_gem_context_create) 255#define DRM_IOCTL_I915_GEM_CONTEXT_CREATE DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_CREATE, struct drm_i915_gem_context_create)
255#define DRM_IOCTL_I915_GEM_CONTEXT_DESTROY DRM_IOW (DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_DESTROY, struct drm_i915_gem_context_destroy) 256#define DRM_IOCTL_I915_GEM_CONTEXT_DESTROY DRM_IOW (DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_DESTROY, struct drm_i915_gem_context_destroy)
257#define DRM_IOCTL_I915_REG_READ DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_REG_READ, struct drm_i915_reg_read)
256 258
257/* Allow drivers to submit batchbuffers directly to hardware, relying 259/* Allow drivers to submit batchbuffers directly to hardware, relying
258 * on the security mechanisms provided by hardware. 260 * on the security mechanisms provided by hardware.
@@ -710,7 +712,7 @@ struct drm_i915_gem_busy {
710#define I915_CACHEING_CACHED 1 712#define I915_CACHEING_CACHED 1
711 713
712struct drm_i915_gem_cacheing { 714struct drm_i915_gem_cacheing {
713 /** Handle of the buffer to check for busy */ 715 /** Handle of the buffer to set/get the cacheing level of */
714 __u32 handle; 716 __u32 handle;
715 717
716 /** Cacheing level to apply or return value */ 718 /** Cacheing level to apply or return value */
@@ -933,4 +935,8 @@ struct drm_i915_gem_context_destroy {
933 __u32 pad; 935 __u32 pad;
934}; 936};
935 937
938struct drm_i915_reg_read {
939 __u64 offset;
940 __u64 val; /* Return value */
941};
936#endif /* _I915_DRM_H_ */ 942#endif /* _I915_DRM_H_ */