0903551
From 00edb23bcefa3ad6931f2a2855fe0801a55523f7 Mon Sep 17 00:00:00 2001
0903551
From: Fedora Kernel Team <kernel-team@fedoraproject.org>
0903551
Date: Mon, 20 Jun 2016 12:39:40 +0200
0903551
Subject: [PATCH 06/17] drm/i915: Track whether an atomic transaction changes
0903551
 the active CRTC's
0903551
0903551
Upstream: since drm-intel-next-2016-05-22
0903551
commit 8b4a7d0597cd9910d7127ffae6ae91d21853a8a2
0903551
0903551
Author:     Matt Roper <matthew.d.roper@intel.com>
0903551
AuthorDate: Thu May 12 07:06:00 2016 -0700
0903551
Commit:     Matt Roper <matthew.d.roper@intel.com>
0903551
CommitDate: Fri May 13 07:33:10 2016 -0700
0903551
0903551
    drm/i915: Track whether an atomic transaction changes the active CRTC's
0903551
0903551
    For the purposes of DDB re-allocation we need to know whether a
0903551
    transaction changes the list of CRTC's that are active.  While
0903551
    state->modeset could be used for this purpose, that would be slightly
0903551
    too aggressive since it would lead us to re-allocate the DDB when a
0903551
    CRTC's mode changes, but not its final active state.
0903551
0903551
    Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
0903551
    Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
0903551
    Link: http://patchwork.freedesktop.org/patch/msgid/1463061971-19638-7-git-send-email-matthew.d.roper@intel.com
0903551
---
0903551
 drivers/gpu/drm/i915/intel_display.c |  3 +++
0903551
 drivers/gpu/drm/i915/intel_drv.h     | 10 ++++++++++
0903551
 2 files changed, 13 insertions(+)
0903551
0903551
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
0903551
index 7d855ba..f53df81 100644
0903551
--- a/drivers/gpu/drm/i915/intel_display.c
0903551
+++ b/drivers/gpu/drm/i915/intel_display.c
0903551
@@ -13183,6 +13183,9 @@ static int intel_modeset_checks(struct drm_atomic_state *state)
0903551
 			intel_state->active_crtcs |= 1 << i;
0903551
 		else
0903551
 			intel_state->active_crtcs &= ~(1 << i);
0903551
+
0903551
+		if (crtc_state->active != crtc->state->active)
0903551
+			intel_state->active_pipe_changes |= drm_crtc_mask(crtc);
0903551
 	}
0903551
 
0903551
 	/*
0903551
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
0903551
index d246308..672ca56 100644
0903551
--- a/drivers/gpu/drm/i915/intel_drv.h
0903551
+++ b/drivers/gpu/drm/i915/intel_drv.h
0903551
@@ -256,6 +256,16 @@ struct intel_atomic_state {
0903551
 
0903551
 	bool dpll_set, modeset;
0903551
 
0903551
+	/*
0903551
+	 * Does this transaction change the pipes that are active?  This mask
0903551
+	 * tracks which CRTC's have changed their active state at the end of
0903551
+	 * the transaction (not counting the temporary disable during modesets).
0903551
+	 * This mask should only be non-zero when intel_state->modeset is true,
0903551
+	 * but the converse is not necessarily true; simply changing a mode may
0903551
+	 * not flip the final active status of any CRTC's
0903551
+	 */
0903551
+	unsigned int active_pipe_changes;
0903551
+
0903551
 	unsigned int active_crtcs;
0903551
 	unsigned int min_pixclk[I915_MAX_PIPES];
0903551
 
0903551
-- 
0903551
2.7.4
0903551