]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915: add register read IOCTL
authorBen Widawsky <ben@bwidawsk.net>
Thu, 12 Jul 2012 18:01:05 +0000 (11:01 -0700)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 25 Jul 2012 16:23:49 +0000 (18:23 +0200)
commitc99539849a77b4d4f44f6984a1a1e73b4c1fd2ac
tree86067dfb6b57953296e26dbf58ac8d13693c43f3
parentc66fe9a0264c9fd96590449d770310bef0c56247
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>
drivers/gpu/drm/i915/i915_dma.c
drivers/gpu/drm/i915/i915_drv.c
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/i915_reg.h
include/drm/i915_drm.h