summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/dev/drm2/drm.h2
-rw-r--r--sys/dev/drm2/drmP.h1
-rw-r--r--sys/dev/drm2/drm_drv.c6
-rw-r--r--sys/dev/drm2/drm_ioctl.c3
4 files changed, 12 insertions, 0 deletions
diff --git a/sys/dev/drm2/drm.h b/sys/dev/drm2/drm.h
index d7e57ad..d2eac91 100644
--- a/sys/dev/drm2/drm.h
+++ b/sys/dev/drm2/drm.h
@@ -1015,6 +1015,8 @@ struct drm_event_vblank {
#define DRM_CAP_VBLANK_HIGH_CRTC 0x2
#define DRM_CAP_DUMB_PREFERRED_DEPTH 0x3
#define DRM_CAP_DUMB_PREFER_SHADOW 0x4
+#define DRM_CAP_PRIME 0x5
+#define DRM_CAP_TIMESTAMP_MONOTONIC 0x6
#include "drm_mode.h"
diff --git a/sys/dev/drm2/drmP.h b/sys/dev/drm2/drmP.h
index 25765c4..fe2ee86 100644
--- a/sys/dev/drm2/drmP.h
+++ b/sys/dev/drm2/drmP.h
@@ -1067,6 +1067,7 @@ extern int drm_debug_flag;
extern int drm_notyet_flag;
extern unsigned int drm_vblank_offdelay;
extern unsigned int drm_timestamp_precision;
+extern unsigned int drm_timestamp_monotonic;
/* Device setup support (drm_drv.c) */
int drm_probe(device_t kdev, drm_pci_id_list_t *idlist);
diff --git a/sys/dev/drm2/drm_drv.c b/sys/dev/drm2/drm_drv.c
index c84c72a..7b00bcf 100644
--- a/sys/dev/drm2/drm_drv.c
+++ b/sys/dev/drm2/drm_drv.c
@@ -56,6 +56,12 @@ int drm_notyet_flag = 0;
unsigned int drm_vblank_offdelay = 5000; /* Default to 5000 msecs. */
unsigned int drm_timestamp_precision = 20; /* Default to 20 usecs. */
+/*
+ * Default to use monotonic timestamps for wait-for-vblank and page-flip
+ * complete events.
+ */
+unsigned int drm_timestamp_monotonic = 1;
+
static int drm_load(struct drm_device *dev);
static void drm_unload(struct drm_device *dev);
static drm_pci_id_list_t *drm_find_description(int vendor, int device,
diff --git a/sys/dev/drm2/drm_ioctl.c b/sys/dev/drm2/drm_ioctl.c
index 96dcac2..c0af376 100644
--- a/sys/dev/drm2/drm_ioctl.c
+++ b/sys/dev/drm2/drm_ioctl.c
@@ -250,6 +250,9 @@ int drm_getcap(struct drm_device *dev, void *data, struct drm_file *file_priv)
case DRM_CAP_DUMB_PREFER_SHADOW:
req->value = dev->mode_config.prefer_shadow;
break;
+ case DRM_CAP_TIMESTAMP_MONOTONIC:
+ req->value = drm_timestamp_monotonic;
+ break;
default:
return EINVAL;
}
OpenPOWER on IntegriCloud