Re: [Intel-gfx] [PATCH 5/7] drm/i915/fbc: use drm_atomic_get_existing_crtc_state when appropriate

2016-11-11 Thread Chris Wilson
On Fri, Nov 11, 2016 at 02:57:39PM -0200, Paulo Zanoni wrote:
> 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 
Reviewed-by: Chris Wilson 
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH 5/7] drm/i915/fbc: use drm_atomic_get_existing_crtc_state when appropriate

2016-11-11 Thread Paulo Zanoni
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 
---
 drivers/gpu/drm/i915/intel_fbc.c | 15 ---
 1 file changed, 4 insertions(+), 11 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_fbc.c b/drivers/gpu/drm/i915/intel_fbc.c
index 89d5612..b095175 100644
--- a/drivers/gpu/drm/i915/intel_fbc.c
+++ b/drivers/gpu/drm/i915/intel_fbc.c
@@ -1055,23 +1055,16 @@ void intel_fbc_choose_crtc(struct drm_i915_private 
*dev_priv,
   struct drm_atomic_state *state)
 {
struct intel_fbc *fbc = _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(>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, >crtc->base))
goto out;
 
if (!intel_fbc_can_enable(dev_priv))
-- 
2.7.4

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx