]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
drm/i915/fbc: use drm_atomic_get_existing_crtc_state when appropriate
authorPaulo Zanoni <paulo.r.zanoni@intel.com>
Fri, 11 Nov 2016 16:57:39 +0000 (14:57 -0200)
committerPaulo Zanoni <paulo.r.zanoni@intel.com>
Mon, 14 Nov 2016 16:00:29 +0000 (14:00 -0200)
Use drm_atomic_get_existing_crtc_state() instead of looping through
the CRTC states and checking if the FBC CRTC is there.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: http://patchwork.freedesktop.org/patch/msgid/1478883461-20201-6-git-send-email-paulo.r.zanoni@intel.com
drivers/gpu/drm/i915/intel_fbc.c

index 89d5612f7b0e8e790558a79c68f0055dfe50b490..b0951753c2f88e7bf8078a24a757abb628995aa6 100644 (file)
@@ -1055,23 +1055,16 @@ void intel_fbc_choose_crtc(struct drm_i915_private *dev_priv,
                           struct drm_atomic_state *state)
 {
        struct intel_fbc *fbc = &dev_priv->fbc;
-       struct drm_crtc *crtc;
-       struct drm_crtc_state *crtc_state;
        struct drm_plane *plane;
        struct drm_plane_state *plane_state;
-       bool fbc_crtc_present = false, crtc_chosen = false;
+       bool crtc_chosen = false;
        int i;
 
        mutex_lock(&fbc->lock);
 
-       for_each_crtc_in_state(state, crtc, crtc_state, i) {
-               if (fbc->crtc == to_intel_crtc(crtc)) {
-                       fbc_crtc_present = true;
-                       break;
-               }
-       }
-       /* This atomic commit doesn't involve the CRTC currently tied to FBC. */
-       if (!fbc_crtc_present && fbc->crtc != NULL)
+       /* Does this atomic commit involve the CRTC currently tied to FBC? */
+       if (fbc->crtc &&
+           !drm_atomic_get_existing_crtc_state(state, &fbc->crtc->base))
                goto out;
 
        if (!intel_fbc_can_enable(dev_priv))