aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/drm/drm.h13
-rw-r--r--include/drm/drm_mode.h14
-rw-r--r--tests/modetest/modetest.c1
-rw-r--r--xf86drmMode.c3
4 files changed, 24 insertions, 7 deletions
diff --git a/include/drm/drm.h b/include/drm/drm.h
index 768b7db9..e22ffe23 100644
--- a/include/drm/drm.h
+++ b/include/drm/drm.h
@@ -630,10 +630,17 @@ struct drm_get_cap {
630/** 630/**
631 * DRM_CLIENT_CAP_UNIVERSAL_PLANES 631 * DRM_CLIENT_CAP_UNIVERSAL_PLANES
632 * 632 *
633 * if set to 1, the DRM core will expose the full universal plane list 633 * If set to 1, the DRM core will expose all planes (overlay, primary, and
634 * (including primary and cursor planes). 634 * cursor) to userspace.
635 */ 635 */
636#define DRM_CLIENT_CAP_UNIVERSAL_PLANES 2 636#define DRM_CLIENT_CAP_UNIVERSAL_PLANES 2
637
638/**
639 * DRM_CLIENT_CAP_ATOMIC
640 *
641 * If set to 1, the DRM core will expose atomic properties to userspace
642 */
643#define DRM_CLIENT_CAP_ATOMIC 3
637 644
638/** DRM_IOCTL_SET_CLIENT_CAP ioctl argument type */ 645/** DRM_IOCTL_SET_CLIENT_CAP ioctl argument type */
639struct drm_set_client_cap { 646struct drm_set_client_cap {
diff --git a/include/drm/drm_mode.h b/include/drm/drm_mode.h
index 1c3f6200..abe7a9c6 100644
--- a/include/drm/drm_mode.h
+++ b/include/drm/drm_mode.h
@@ -259,6 +259,13 @@ struct drm_mode_get_connector {
259#define DRM_MODE_PROP_OBJECT DRM_MODE_PROP_TYPE(1) 259#define DRM_MODE_PROP_OBJECT DRM_MODE_PROP_TYPE(1)
260#define DRM_MODE_PROP_SIGNED_RANGE DRM_MODE_PROP_TYPE(2) 260#define DRM_MODE_PROP_SIGNED_RANGE DRM_MODE_PROP_TYPE(2)
261 261
262/* the PROP_ATOMIC flag is used to hide properties from userspace that
263 * is not aware of atomic properties. This is mostly to work around
264 * older userspace (DDX drivers) that read/write each prop they find,
265 * witout being aware that this could be triggering a lengthy modeset.
266 */
267#define DRM_MODE_PROP_ATOMIC 0x80000000
268
262struct drm_mode_property_enum { 269struct drm_mode_property_enum {
263 __u64 value; 270 __u64 value;
264 char name[DRM_PROP_NAME_LEN]; 271 char name[DRM_PROP_NAME_LEN];
@@ -510,14 +517,15 @@ struct drm_mode_destroy_dumb {
510/* page-flip flags are valid, plus: */ 517/* page-flip flags are valid, plus: */
511#define DRM_MODE_ATOMIC_TEST_ONLY 0x0100 518#define DRM_MODE_ATOMIC_TEST_ONLY 0x0100
512#define DRM_MODE_ATOMIC_NONBLOCK 0x0200 519#define DRM_MODE_ATOMIC_NONBLOCK 0x0200
520#define DRM_MODE_ATOMIC_ALLOW_MODESET 0x0400
513 521
514#define DRM_MODE_ATOMIC_FLAGS (\ 522#define DRM_MODE_ATOMIC_FLAGS (\
515 DRM_MODE_PAGE_FLIP_EVENT |\ 523 DRM_MODE_PAGE_FLIP_EVENT |\
516 DRM_MODE_PAGE_FLIP_ASYNC |\ 524 DRM_MODE_PAGE_FLIP_ASYNC |\
517 DRM_MODE_ATOMIC_TEST_ONLY |\ 525 DRM_MODE_ATOMIC_TEST_ONLY |\
518 DRM_MODE_ATOMIC_NONBLOCK) 526 DRM_MODE_ATOMIC_NONBLOCK |\
527 DRM_MODE_ATOMIC_ALLOW_MODESET)
519 528
520/* FIXME come up with some sane error reporting mechanism? */
521struct drm_mode_atomic { 529struct drm_mode_atomic {
522 __u32 flags; 530 __u32 flags;
523 __u32 count_objs; 531 __u32 count_objs;
@@ -525,7 +533,7 @@ struct drm_mode_atomic {
525 __u64 count_props_ptr; 533 __u64 count_props_ptr;
526 __u64 props_ptr; 534 __u64 props_ptr;
527 __u64 prop_values_ptr; 535 __u64 prop_values_ptr;
528 __u64 blob_values_ptr; 536 __u64 reserved;
529 __u64 user_data; 537 __u64 user_data;
530}; 538};
531 539
diff --git a/tests/modetest/modetest.c b/tests/modetest/modetest.c
index c86650e7..8c0db6db 100644
--- a/tests/modetest/modetest.c
+++ b/tests/modetest/modetest.c
@@ -562,6 +562,7 @@ static struct resources *get_resources(struct device *dev)
562 memset(res, 0, sizeof *res); 562 memset(res, 0, sizeof *res);
563 563
564 drmSetClientCap(dev->fd, DRM_CLIENT_CAP_UNIVERSAL_PLANES, 1); 564 drmSetClientCap(dev->fd, DRM_CLIENT_CAP_UNIVERSAL_PLANES, 1);
565 drmSetClientCap(dev->fd, DRM_CLIENT_CAP_ATOMIC, 1);
565 566
566 res->res = drmModeGetResources(dev->fd); 567 res->res = drmModeGetResources(dev->fd);
567 if (!res->res) { 568 if (!res->res) {
diff --git a/xf86drmMode.c b/xf86drmMode.c
index 7f3bc5e8..e373c4cd 100644
--- a/xf86drmMode.c
+++ b/xf86drmMode.c
@@ -1385,7 +1385,8 @@ int drmModePropertySetCommit(int fd, uint32_t flags, void *user_data,
1385 atomic.count_props_ptr = VOID2U64(count_props_ptr); 1385 atomic.count_props_ptr = VOID2U64(count_props_ptr);
1386 atomic.props_ptr = VOID2U64(props_ptr); 1386 atomic.props_ptr = VOID2U64(props_ptr);
1387 atomic.prop_values_ptr = VOID2U64(prop_values_ptr); 1387 atomic.prop_values_ptr = VOID2U64(prop_values_ptr);
1388 atomic.blob_values_ptr = VOID2U64(blob_values_ptr); 1388// TODO:
1389// atomic.blob_values_ptr = VOID2U64(blob_values_ptr);
1389 atomic.user_data = VOID2U64(user_data); 1390 atomic.user_data = VOID2U64(user_data);
1390 1391
1391 ret = DRM_IOCTL(fd, DRM_IOCTL_MODE_ATOMIC, &atomic); 1392 ret = DRM_IOCTL(fd, DRM_IOCTL_MODE_ATOMIC, &atomic);