summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/drm_ioctl.c
diff options
context:
space:
mode:
authorImre Deak <imre.deak@intel.com>2012-10-23 18:53:26 +0000
committerDave Airlie <airlied@redhat.com>2012-11-20 16:06:16 +1000
commitc61eef726a78ae77b6ce223d01ea2130f465fe5c (patch)
tree7bd310556195005b5c4c1cbadadc9da1fbf5163c /drivers/gpu/drm/drm_ioctl.c
parente62f2f5acba1d466da047983ae16f6b96b68b310 (diff)
drm: add support for monotonic vblank timestamps
Jumps in the vblank and page flip event timestamps cause trouble for clients, so we should avoid them. The timestamp we get currently with gettimeofday can jump, so use instead monotonic timestamps. For backward compatibility use a module flag to revert back to using gettimeofday timestamps. Add also a DRM_CAP_TIMESTAMP_MONOTONIC flag that is simply a read only version of the module flag, so that clients can query this without depending on sysfs. Signed-off-by: Imre Deak <imre.deak@intel.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/drm_ioctl.c')
-rw-r--r--drivers/gpu/drm/drm_ioctl.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_ioctl.c b/drivers/gpu/drm/drm_ioctl.c
index 23dd97506f28..e77bd8b57df2 100644
--- a/drivers/gpu/drm/drm_ioctl.c
+++ b/drivers/gpu/drm/drm_ioctl.c
@@ -287,6 +287,9 @@ int drm_getcap(struct drm_device *dev, void *data, struct drm_file *file_priv)
req->value |= dev->driver->prime_fd_to_handle ? DRM_PRIME_CAP_IMPORT : 0;
req->value |= dev->driver->prime_handle_to_fd ? DRM_PRIME_CAP_EXPORT : 0;
break;
+ case DRM_CAP_TIMESTAMP_MONOTONIC:
+ req->value = drm_timestamp_monotonic;
+ break;
default:
return -EINVAL;
}