aboutsummaryrefslogtreecommitdiffstats
path: root/include/drm/drm_crtc.h
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2015-01-22 10:36:21 -0500
committerDaniel Vetter <daniel.vetter@ffwll.ch>2015-01-27 04:02:18 -0500
commiteab3bbeffd152125ae0f90863b8e9bc8eef49423 (patch)
tree544f11ec5b22e8c941b638761aeddf0431117943 /include/drm/drm_crtc.h
parent960cd9d4fef6dd9e235c0e5c0d4ed027f8a48025 (diff)
drm/atomic: Add drm_crtc_state->active
This is the infrastructure for DPMS ported to the atomic world. Fundamental changes compare to legacy DPMS are: - No more per-connector dpms state, instead there's just one per each display pipeline. So if you clone either you have to unclone first if you only want to switch off one screen, or you just switch of everything (like all desktops do). This massively reduces complexity for cloning since now there's no more half-enabled cloned configs to consider. - Only on/off, dpms standby/suspend are as dead as real CRTs. Again reduces complexity a lot. Now especially for backwards compat the really important part for dpms support is that dpms on always succeeds (except for hw death and unplugged cables ofc). Which means everything that could fail (like configuration checking, resources assignments and buffer management) must be done irrespective from ->active. ->active is really only a toggle to change the hardware state. More precisely: - Drivers MUST NOT look at ->active in their ->atomic_check callbacks. Changes to ->active MUST always suceed if nothing else changes. - Drivers using the atomic helpers MUST NOT look at ->active anywhere, period. The helpers will take care of calling the respective enable/modeset/disable hooks as necessary. As before the helpers will carefully keep track of the state and not call any hooks unecessarily, so still no double-disables or enables like with crtc helpers. - ->mode_set hooks are only called when the mode or output configuration changes, not for changes in ->active state. - Drivers which reconstruct the state objects in their ->reset hooks or through some other hw state readout infrastructure must ensure that ->active reflects actual hw state. This just implements the core bits and helper logic, a subsequent patch will implement the helper code to implement legacy dpms with this. v2: Rebase on top of the drm ioctl work: - Move crtc checks to the core check function. - Also check for ->active_changed when deciding whether a modeset might happen (for the ALLOW_MODESET mode). - Expose the ->active state with an atomic prop. v3: Review from Rob - Spelling fix in comment. - Extract needs_modeset helper to consolidate the ->mode_changed || ->active_changed checks. v4: Fixup fumble between crtc->state and crtc_state. Cc: Rob Clark <robdclark@gmail.com> Reviewed-by: Thierry Reding <treding@nvidia.com> Tested-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Diffstat (limited to 'include/drm/drm_crtc.h')
-rw-r--r--include/drm/drm_crtc.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index c4e36f60b3ef..0a738e1d4f37 100644
--- a/include/drm/drm_crtc.h
+++ b/include/drm/drm_crtc.h
@@ -253,6 +253,7 @@ struct drm_atomic_state;
253 * @enable: whether the CRTC should be enabled, gates all other state 253 * @enable: whether the CRTC should be enabled, gates all other state
254 * @active: whether the CRTC is actively displaying (used for DPMS) 254 * @active: whether the CRTC is actively displaying (used for DPMS)
255 * @mode_changed: for use by helpers and drivers when computing state updates 255 * @mode_changed: for use by helpers and drivers when computing state updates
256 * @active_changed: for use by helpers and drivers when computing state updates
256 * @plane_mask: bitmask of (1 << drm_plane_index(plane)) of attached planes 257 * @plane_mask: bitmask of (1 << drm_plane_index(plane)) of attached planes
257 * @last_vblank_count: for helpers and drivers to capture the vblank of the 258 * @last_vblank_count: for helpers and drivers to capture the vblank of the
258 * update to ensure framebuffer cleanup isn't done too early 259 * update to ensure framebuffer cleanup isn't done too early
@@ -278,6 +279,7 @@ struct drm_crtc_state {
278 /* computed state bits used by helpers and drivers */ 279 /* computed state bits used by helpers and drivers */
279 bool planes_changed : 1; 280 bool planes_changed : 1;
280 bool mode_changed : 1; 281 bool mode_changed : 1;
282 bool active_changed : 1;
281 283
282 /* attached planes bitmask: 284 /* attached planes bitmask:
283 * WARNING: transitional helpers do not maintain plane_mask so 285 * WARNING: transitional helpers do not maintain plane_mask so
@@ -1113,6 +1115,7 @@ struct drm_mode_config {
1113 struct drm_property *prop_crtc_h; 1115 struct drm_property *prop_crtc_h;
1114 struct drm_property *prop_fb_id; 1116 struct drm_property *prop_fb_id;
1115 struct drm_property *prop_crtc_id; 1117 struct drm_property *prop_crtc_id;
1118 struct drm_property *prop_active;
1116 1119
1117 /* DVI-I properties */ 1120 /* DVI-I properties */
1118 struct drm_property *dvi_i_subconnector_property; 1121 struct drm_property *dvi_i_subconnector_property;