]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm: Add for_each_oldnew_intel_crtc_in_state_reverse()
authorJosé Roberto de Souza <jose.souza@intel.com>
Fri, 23 Aug 2019 08:20:43 +0000 (01:20 -0700)
committerLucas De Marchi <lucas.demarchi@intel.com>
Tue, 27 Aug 2019 15:27:49 +0000 (08:27 -0700)
Same as for_each_oldnew_intel_crtc_in_state() but iterates in reverse
order.

v2: Fix additional blank line
v3: Rebase

Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Reviewed-by: Mika Kahola <mika.kahola@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190823082055.5992-12-lucas.demarchi@intel.com
drivers/gpu/drm/i915/display/intel_display.h

index e57e6969051d063681b35490ea8d281dfdb85868..03321fb4a7038edf1335a2131013657f61ff32ab 100644 (file)
@@ -411,6 +411,15 @@ enum phy_fia {
             (__i)++) \
                for_each_if(crtc)
 
+#define for_each_oldnew_intel_crtc_in_state_reverse(__state, crtc, old_crtc_state, new_crtc_state, __i) \
+       for ((__i) = (__state)->base.dev->mode_config.num_crtc - 1; \
+            (__i) >= 0  && \
+            ((crtc) = to_intel_crtc((__state)->base.crtcs[__i].ptr), \
+             (old_crtc_state) = to_intel_crtc_state((__state)->base.crtcs[__i].old_state), \
+             (new_crtc_state) = to_intel_crtc_state((__state)->base.crtcs[__i].new_state), 1); \
+            (__i)--) \
+               for_each_if(crtc)
+
 void intel_link_compute_m_n(u16 bpp, int nlanes,
                            int pixel_clock, int link_clock,
                            struct intel_link_m_n *m_n,