All of lore.kernel.org
 help / color / mirror / Atom feed
From: "José Roberto de Souza" <jose.souza@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Subject: [Intel-gfx] [PATCH v6 rebased 6/7] drm/i915/mst: Force modeset on MST slaves when master needs a modeset
Date: Sun, 22 Dec 2019 17:06:53 -0800	[thread overview]
Message-ID: <20191223010654.67037-6-jose.souza@intel.com> (raw)
In-Reply-To: <20191223010654.67037-1-jose.souza@intel.com>

MST master can not be disabled while it have attached MST slaves, so
it is necessary force a modeset in all of its slaves.

v3:
- moved handling to intel_atomic_check() this way is guarantee that
all pipes will have its state computed

v4:
- added a function to return if MST master neeeds modeset to simply
code in intel_atomic_check()

v5:
- fixed and moved code to check if MST master needs a modeset

v6:
- previons version of this patch was split into two patches

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
---
 drivers/gpu/drm/i915/display/intel_display.c | 36 ++++++++++++++++++++
 1 file changed, 36 insertions(+)

diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
index 3c5cf2623182..32e1fdfceac7 100644
--- a/drivers/gpu/drm/i915/display/intel_display.c
+++ b/drivers/gpu/drm/i915/display/intel_display.c
@@ -14036,6 +14036,20 @@ static int intel_atomic_check_crtcs(struct intel_atomic_state *state)
 	return 0;
 }
 
+static bool intel_cpu_transcoder_needs_modeset(struct intel_atomic_state *state,
+					       enum transcoder transcoder)
+{
+	struct intel_crtc_state *new_crtc_state;
+	struct intel_crtc *crtc;
+	int i;
+
+	for_each_new_intel_crtc_in_state(state, crtc, new_crtc_state, i)
+		if (new_crtc_state->cpu_transcoder == transcoder)
+			return needs_modeset(new_crtc_state);
+
+	return false;
+}
+
 /**
  * intel_atomic_check - validate state object
  * @dev: drm device
@@ -14088,6 +14102,28 @@ static int intel_atomic_check(struct drm_device *dev,
 		intel_crtc_check_fastset(old_crtc_state, new_crtc_state);
 	}
 
+	/**
+	 * Check if fastset is allowed by external dependencies like other
+	 * pipes and transcoders.
+	 *
+	 * Right now it only forces a fullmodeset when the MST master
+	 * transcoder did not changed but the pipe of the master transcoder
+	 * needs a fullmodeset so all slaves also needs to do a fullmodeset.
+	 */
+	for_each_new_intel_crtc_in_state(state, crtc, new_crtc_state, i) {
+		enum transcoder master = new_crtc_state->mst_master_transcoder;
+
+		if (!new_crtc_state->hw.enable ||
+		    needs_modeset(new_crtc_state) ||
+		    !intel_dp_mst_is_slave_trans(new_crtc_state))
+			continue;
+
+		if (intel_cpu_transcoder_needs_modeset(state, master)) {
+			new_crtc_state->uapi.mode_changed = true;
+			new_crtc_state->update_pipe = false;
+		}
+	}
+
 	for_each_oldnew_intel_crtc_in_state(state, crtc, old_crtc_state,
 					    new_crtc_state, i) {
 		if (needs_modeset(new_crtc_state)) {
-- 
2.24.1

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

  parent reply	other threads:[~2019-12-23  1:07 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-23  1:06 [Intel-gfx] [PATCH v6 rebased 1/7] drm/i915/display: Share intel_connector_needs_modeset() José Roberto de Souza
2019-12-23  1:06 ` [Intel-gfx] [PATCH v6 rebased 2/7] drm/i915/tgl: Select master transcoder for MST stream José Roberto de Souza
2019-12-23  1:06 ` [Intel-gfx] [PATCH v6 rebased 3/7] drm/i915/display: Always enables MST master pipe first José Roberto de Souza
2019-12-23  1:06 ` [Intel-gfx] [PATCH v6 rebased 4/7] drm/i915/dp: Fix MST disable sequence José Roberto de Souza
2019-12-23  1:06 ` [Intel-gfx] [PATCH v6 rebased 5/7] drm/i915/display: Prepare for fastset external dependencies check José Roberto de Souza
2019-12-23  1:06 ` José Roberto de Souza [this message]
2019-12-23  1:06 ` [Intel-gfx] [PATCH v6 rebased 7/7] drm/i915/display: Add comment to a function that probably can be removed José Roberto de Souza
2019-12-23  2:41 ` [Intel-gfx] ✓ Fi.CI.BAT: success for series starting with [v6,rebased,1/7] drm/i915/display: Share intel_connector_needs_modeset() Patchwork
2019-12-23 17:03 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
2019-12-23 17:55   ` Souza, Jose

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191223010654.67037-6-jose.souza@intel.com \
    --to=jose.souza@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=lucas.demarchi@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.