diff options
author | Rob Clark <robdclark@gmail.com> | 2014-12-18 16:01:50 -0500 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2015-01-05 07:54:38 -0500 |
commit | 88a48e297b3a3bac6022c03babfb038f1a886cea (patch) | |
tree | 8b914276b0e77e447aa3de5f4d7cefc1597911b1 /include/drm | |
parent | 95cbf110756c21397946ded181cc5ea4ab568c11 (diff) |
drm: add atomic properties
Once a driver is using atomic helpers for modeset, the next step is to
switch over to atomic properties. To do this, make sure that any
modeset objects have their ->atomic_{get,set}_property() vfuncs suitably
populated if they have custom properties (you did already remember to
plug in atomic-helper func for the legacy ->set_property() vfuncs,
right?), and then set DRIVER_ATOMIC bit in driver_features flag.
A new cap is introduced, DRM_CLIENT_CAP_ATOMIC, for the purposes of
shielding legacy userspace from atomic properties. Mostly for the
benefit of legacy DDX drivers that do silly things like getting/setting
each property at startup (since some of the new atomic properties will
be able to trigger modeset).
Signed-off-by: Rob Clark <robdclark@gmail.com>
[danvet: Squash in fixup patch to check for DRM_MODE_PROP_ATOMIC
instaed of the CAP define when filtering properties. Reported by
Tvrtko Uruslin, acked by Rob.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'include/drm')
-rw-r--r-- | include/drm/drmP.h | 4 | ||||
-rw-r--r-- | include/drm/drm_atomic.h | 3 | ||||
-rw-r--r-- | include/drm/drm_crtc.h | 2 |
3 files changed, 8 insertions, 1 deletions
diff --git a/include/drm/drmP.h b/include/drm/drmP.h index 8ba35c622e22..0f7115e988a0 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h | |||
@@ -143,6 +143,7 @@ void drm_err(const char *format, ...); | |||
143 | #define DRIVER_MODESET 0x2000 | 143 | #define DRIVER_MODESET 0x2000 |
144 | #define DRIVER_PRIME 0x4000 | 144 | #define DRIVER_PRIME 0x4000 |
145 | #define DRIVER_RENDER 0x8000 | 145 | #define DRIVER_RENDER 0x8000 |
146 | #define DRIVER_ATOMIC 0x10000 | ||
146 | 147 | ||
147 | /***********************************************************************/ | 148 | /***********************************************************************/ |
148 | /** \name Macros to make printk easier */ | 149 | /** \name Macros to make printk easier */ |
@@ -283,6 +284,8 @@ struct drm_file { | |||
283 | * in the plane list | 284 | * in the plane list |
284 | */ | 285 | */ |
285 | unsigned universal_planes:1; | 286 | unsigned universal_planes:1; |
287 | /* true if client understands atomic properties */ | ||
288 | unsigned atomic:1; | ||
286 | 289 | ||
287 | struct pid *pid; | 290 | struct pid *pid; |
288 | kuid_t uid; | 291 | kuid_t uid; |
@@ -950,6 +953,7 @@ extern void drm_master_put(struct drm_master **master); | |||
950 | extern void drm_put_dev(struct drm_device *dev); | 953 | extern void drm_put_dev(struct drm_device *dev); |
951 | extern void drm_unplug_dev(struct drm_device *dev); | 954 | extern void drm_unplug_dev(struct drm_device *dev); |
952 | extern unsigned int drm_debug; | 955 | extern unsigned int drm_debug; |
956 | extern bool drm_atomic; | ||
953 | 957 | ||
954 | /* Debugfs support */ | 958 | /* Debugfs support */ |
955 | #if defined(CONFIG_DEBUG_FS) | 959 | #if defined(CONFIG_DEBUG_FS) |
diff --git a/include/drm/drm_atomic.h b/include/drm/drm_atomic.h index d41233ccbc9e..231fb485abb3 100644 --- a/include/drm/drm_atomic.h +++ b/include/drm/drm_atomic.h | |||
@@ -63,6 +63,9 @@ int drm_atomic_connector_get_property(struct drm_connector *connector, | |||
63 | const struct drm_connector_state *state, | 63 | const struct drm_connector_state *state, |
64 | struct drm_property *property, uint64_t *val); | 64 | struct drm_property *property, uint64_t *val); |
65 | 65 | ||
66 | int drm_atomic_get_property(struct drm_mode_object *obj, | ||
67 | struct drm_property *property, uint64_t *val); | ||
68 | |||
66 | int __must_check | 69 | int __must_check |
67 | drm_atomic_set_crtc_for_plane(struct drm_plane_state *plane_state, | 70 | drm_atomic_set_crtc_for_plane(struct drm_plane_state *plane_state, |
68 | struct drm_crtc *crtc); | 71 | struct drm_crtc *crtc); |
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h index e1f34694fcff..b5ab673add29 100644 --- a/include/drm/drm_crtc.h +++ b/include/drm/drm_crtc.h | |||
@@ -63,7 +63,7 @@ struct drm_mode_object { | |||
63 | 63 | ||
64 | #define DRM_OBJECT_MAX_PROPERTY 24 | 64 | #define DRM_OBJECT_MAX_PROPERTY 24 |
65 | struct drm_object_properties { | 65 | struct drm_object_properties { |
66 | int count; | 66 | int count, atomic_count; |
67 | /* NOTE: if we ever start dynamically destroying properties (ie. | 67 | /* NOTE: if we ever start dynamically destroying properties (ie. |
68 | * not at drm_mode_config_cleanup() time), then we'd have to do | 68 | * not at drm_mode_config_cleanup() time), then we'd have to do |
69 | * a better job of detaching property from mode objects to avoid | 69 | * a better job of detaching property from mode objects to avoid |