aboutsummaryrefslogtreecommitdiffstats
path: root/include/drm
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2014-11-27 09:49:39 -0500
committerDaniel Vetter <daniel.vetter@ffwll.ch>2014-12-17 14:23:23 -0500
commit07cc0ef67fa873c8d21e0b626d57753bfd190095 (patch)
tree44beb89d906d8ad625b222f3b7ea4feb87666b67 /include/drm
parentb4274fbee6fc7ca3dd1cc786456ec6fbc14f864d (diff)
drm/atomic: Introduce state->obj backpointers
Useful since this way we can pass around just the state objects and will get ther real object, too. Specifically this allows us to again simplify the parameters for set_crtc_for_plane. v2: msm already has it's own specific plane_reset hook, don't forget that one! v3: Fixup kerneldoc, reported by 0-day builder. Cc: Rob Clark <robdclark@gmail.com> Reviewed-by: Rob Clark <robdclark@gmail.com> (v2) Tested-by: Rob Clark <robdclark@gmail.com> (v2) Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Diffstat (limited to 'include/drm')
-rw-r--r--include/drm/drm_atomic.h4
-rw-r--r--include/drm/drm_crtc.h9
2 files changed, 11 insertions, 2 deletions
diff --git a/include/drm/drm_atomic.h b/include/drm/drm_atomic.h
index ad2229574dd9..e224ccfa11ca 100644
--- a/include/drm/drm_atomic.h
+++ b/include/drm/drm_atomic.h
@@ -46,8 +46,8 @@ drm_atomic_get_connector_state(struct drm_atomic_state *state,
46 struct drm_connector *connector); 46 struct drm_connector *connector);
47 47
48int __must_check 48int __must_check
49drm_atomic_set_crtc_for_plane(struct drm_atomic_state *state, 49drm_atomic_set_crtc_for_plane(struct drm_plane_state *plane_state,
50 struct drm_plane *plane, struct drm_crtc *crtc); 50 struct drm_crtc *crtc);
51void drm_atomic_set_fb_for_plane(struct drm_plane_state *plane_state, 51void drm_atomic_set_fb_for_plane(struct drm_plane_state *plane_state,
52 struct drm_framebuffer *fb); 52 struct drm_framebuffer *fb);
53int __must_check 53int __must_check
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index 4ee78212f8bf..fd8139ca629a 100644
--- a/include/drm/drm_crtc.h
+++ b/include/drm/drm_crtc.h
@@ -237,6 +237,7 @@ struct drm_atomic_state;
237 237
238/** 238/**
239 * struct drm_crtc_state - mutable CRTC state 239 * struct drm_crtc_state - mutable CRTC state
240 * @crtc: backpointer to the CRTC
240 * @enable: whether the CRTC should be enabled, gates all other state 241 * @enable: whether the CRTC should be enabled, gates all other state
241 * @active: whether the CRTC is actively displaying (used for DPMS) 242 * @active: whether the CRTC is actively displaying (used for DPMS)
242 * @mode_changed: for use by helpers and drivers when computing state updates 243 * @mode_changed: for use by helpers and drivers when computing state updates
@@ -257,6 +258,8 @@ struct drm_atomic_state;
257 * assignment, @active controls the actual hardware state. 258 * assignment, @active controls the actual hardware state.
258 */ 259 */
259struct drm_crtc_state { 260struct drm_crtc_state {
261 struct drm_crtc *crtc;
262
260 bool enable; 263 bool enable;
261 bool active; 264 bool active;
262 265
@@ -457,11 +460,14 @@ struct drm_crtc {
457 460
458/** 461/**
459 * struct drm_connector_state - mutable connector state 462 * struct drm_connector_state - mutable connector state
463 * @connector: backpointer to the connector
460 * @crtc: CRTC to connect connector to, NULL if disabled 464 * @crtc: CRTC to connect connector to, NULL if disabled
461 * @best_encoder: can be used by helpers and drivers to select the encoder 465 * @best_encoder: can be used by helpers and drivers to select the encoder
462 * @state: backpointer to global drm_atomic_state 466 * @state: backpointer to global drm_atomic_state
463 */ 467 */
464struct drm_connector_state { 468struct drm_connector_state {
469 struct drm_connector *connector;
470
465 struct drm_crtc *crtc; /* do not write directly, use drm_atomic_set_crtc_for_connector() */ 471 struct drm_crtc *crtc; /* do not write directly, use drm_atomic_set_crtc_for_connector() */
466 472
467 struct drm_encoder *best_encoder; 473 struct drm_encoder *best_encoder;
@@ -701,6 +707,7 @@ struct drm_connector {
701 707
702/** 708/**
703 * struct drm_plane_state - mutable plane state 709 * struct drm_plane_state - mutable plane state
710 * @plane: backpointer to the plane
704 * @crtc: currently bound CRTC, NULL if disabled 711 * @crtc: currently bound CRTC, NULL if disabled
705 * @fb: currently bound framebuffer 712 * @fb: currently bound framebuffer
706 * @fence: optional fence to wait for before scanning out @fb 713 * @fence: optional fence to wait for before scanning out @fb
@@ -717,6 +724,8 @@ struct drm_connector {
717 * @state: backpointer to global drm_atomic_state 724 * @state: backpointer to global drm_atomic_state
718 */ 725 */
719struct drm_plane_state { 726struct drm_plane_state {
727 struct drm_plane *plane;
728
720 struct drm_crtc *crtc; /* do not write directly, use drm_atomic_set_crtc_for_plane() */ 729 struct drm_crtc *crtc; /* do not write directly, use drm_atomic_set_crtc_for_plane() */
721 struct drm_framebuffer *fb; /* do not write directly, use drm_atomic_set_fb_for_plane() */ 730 struct drm_framebuffer *fb; /* do not write directly, use drm_atomic_set_fb_for_plane() */
722 struct fence *fence; 731 struct fence *fence;