Skip to content

Commit 77ac3b0

Browse files
committed
drm/atomic: Remove deprecated accessor macros
Now that the last users have been converted, we can finally get rid of for_each_obj_in_state, we have better macros to replace them with. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Cc: Daniel Vetter <daniel.vetter@intel.com> Cc: Jani Nikula <jani.nikula@linux.intel.com> Cc: Sean Paul <seanpaul@chromium.org> Cc: David Airlie <airlied@linux.ie> Link: https://patchwork.freedesktop.org/patch/msgid/20170719143920.25685-8-maarten.lankhorst@linux.intel.com Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
1 parent 669c921 commit 77ac3b0

4 files changed

Lines changed: 9 additions & 85 deletions

File tree

‎include/drm/drm_atomic.h‎

Lines changed: 0 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -569,31 +569,6 @@ int __must_check drm_atomic_nonblocking_commit(struct drm_atomic_state *state);
569569

570570
void drm_state_dump(struct drm_device *dev, struct drm_printer *p);
571571

572-
/**
573-
* for_each_connector_in_state - iterate over all connectors in an atomic update
574-
* @__state: &struct drm_atomic_state pointer
575-
* @connector: &struct drm_connector iteration cursor
576-
* @connector_state: &struct drm_connector_state iteration cursor
577-
* @__i: int iteration cursor, for macro-internal use
578-
*
579-
* This iterates over all connectors in an atomic update. Note that before the
580-
* software state is committed (by calling drm_atomic_helper_swap_state(), this
581-
* points to the new state, while afterwards it points to the old state. Due to
582-
* this tricky confusion this macro is deprecated.
583-
*
584-
* FIXME:
585-
*
586-
* Replace all usage of this with one of the explicit iterators below and then
587-
* remove this macro.
588-
*/
589-
#define for_each_connector_in_state(__state, connector, connector_state, __i) \
590-
for ((__i) = 0; \
591-
(__i) < (__state)->num_connector && \
592-
((connector) = (__state)->connectors[__i].ptr, \
593-
(connector_state) = (__state)->connectors[__i].state, 1); \
594-
(__i)++) \
595-
for_each_if (connector)
596-
597572
/**
598573
* for_each_oldnew_connector_in_state - iterate over all connectors in an atomic update
599574
* @__state: &struct drm_atomic_state pointer
@@ -657,31 +632,6 @@ void drm_state_dump(struct drm_device *dev, struct drm_printer *p);
657632
(__i)++) \
658633
for_each_if (connector)
659634

660-
/**
661-
* for_each_crtc_in_state - iterate over all CRTCs in an atomic update
662-
* @__state: &struct drm_atomic_state pointer
663-
* @crtc: &struct drm_crtc iteration cursor
664-
* @crtc_state: &struct drm_crtc_state iteration cursor
665-
* @__i: int iteration cursor, for macro-internal use
666-
*
667-
* This iterates over all CRTCs in an atomic update. Note that before the
668-
* software state is committed (by calling drm_atomic_helper_swap_state(), this
669-
* points to the new state, while afterwards it points to the old state. Due to
670-
* this tricky confusion this macro is deprecated.
671-
*
672-
* FIXME:
673-
*
674-
* Replace all usage of this with one of the explicit iterators below and then
675-
* remove this macro.
676-
*/
677-
#define for_each_crtc_in_state(__state, crtc, crtc_state, __i) \
678-
for ((__i) = 0; \
679-
(__i) < (__state)->dev->mode_config.num_crtc && \
680-
((crtc) = (__state)->crtcs[__i].ptr, \
681-
(crtc_state) = (__state)->crtcs[__i].state, 1); \
682-
(__i)++) \
683-
for_each_if (crtc_state)
684-
685635
/**
686636
* for_each_oldnew_crtc_in_state - iterate over all CRTCs in an atomic update
687637
* @__state: &struct drm_atomic_state pointer
@@ -741,31 +691,6 @@ void drm_state_dump(struct drm_device *dev, struct drm_printer *p);
741691
(__i)++) \
742692
for_each_if (crtc)
743693

744-
/**
745-
* for_each_plane_in_state - iterate over all planes in an atomic update
746-
* @__state: &struct drm_atomic_state pointer
747-
* @plane: &struct drm_plane iteration cursor
748-
* @plane_state: &struct drm_plane_state iteration cursor
749-
* @__i: int iteration cursor, for macro-internal use
750-
*
751-
* This iterates over all planes in an atomic update. Note that before the
752-
* software state is committed (by calling drm_atomic_helper_swap_state(), this
753-
* points to the new state, while afterwards it points to the old state. Due to
754-
* this tricky confusion this macro is deprecated.
755-
*
756-
* FIXME:
757-
*
758-
* Replace all usage of this with one of the explicit iterators below and then
759-
* remove this macro.
760-
*/
761-
#define for_each_plane_in_state(__state, plane, plane_state, __i) \
762-
for ((__i) = 0; \
763-
(__i) < (__state)->dev->mode_config.num_total_plane && \
764-
((plane) = (__state)->planes[__i].ptr, \
765-
(plane_state) = (__state)->planes[__i].state, 1); \
766-
(__i)++) \
767-
for_each_if (plane_state)
768-
769694
/**
770695
* for_each_oldnew_plane_in_state - iterate over all planes in an atomic update
771696
* @__state: &struct drm_atomic_state pointer

‎include/drm/drm_connector.h‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -895,8 +895,7 @@ struct drm_connector {
895895
* This is protected by @drm_mode_config.connection_mutex. Note that
896896
* nonblocking atomic commits access the current connector state without
897897
* taking locks. Either by going through the &struct drm_atomic_state
898-
* pointers, see for_each_connector_in_state(),
899-
* for_each_oldnew_connector_in_state(),
898+
* pointers, see for_each_oldnew_connector_in_state(),
900899
* for_each_old_connector_in_state() and
901900
* for_each_new_connector_in_state(). Or through careful ordering of
902901
* atomic commit operations as implemented in the atomic helpers, see

‎include/drm/drm_crtc.h‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -806,10 +806,10 @@ struct drm_crtc {
806806
* This is protected by @mutex. Note that nonblocking atomic commits
807807
* access the current CRTC state without taking locks. Either by going
808808
* through the &struct drm_atomic_state pointers, see
809-
* for_each_crtc_in_state(), for_each_oldnew_crtc_in_state(),
810-
* for_each_old_crtc_in_state() and for_each_new_crtc_in_state(). Or
811-
* through careful ordering of atomic commit operations as implemented
812-
* in the atomic helpers, see &struct drm_crtc_commit.
809+
* for_each_oldnew_crtc_in_state(), for_each_old_crtc_in_state() and
810+
* for_each_new_crtc_in_state(). Or through careful ordering of atomic
811+
* commit operations as implemented in the atomic helpers, see
812+
* &struct drm_crtc_commit.
813813
*/
814814
struct drm_crtc_state *state;
815815

‎include/drm/drm_plane.h‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -539,10 +539,10 @@ struct drm_plane {
539539
* This is protected by @mutex. Note that nonblocking atomic commits
540540
* access the current plane state without taking locks. Either by going
541541
* through the &struct drm_atomic_state pointers, see
542-
* for_each_plane_in_state(), for_each_oldnew_plane_in_state(),
543-
* for_each_old_plane_in_state() and for_each_new_plane_in_state(). Or
544-
* through careful ordering of atomic commit operations as implemented
545-
* in the atomic helpers, see &struct drm_crtc_commit.
542+
* for_each_oldnew_plane_in_state(), for_each_old_plane_in_state() and
543+
* for_each_new_plane_in_state(). Or through careful ordering of atomic
544+
* commit operations as implemented in the atomic helpers, see
545+
* &struct drm_crtc_commit.
546546
*/
547547
struct drm_plane_state *state;
548548

0 commit comments

Comments
 (0)