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 v2 10/11] drm/i915/display: Check if pipe fastset is allowed by external dependencies
Date: Tue, 10 Dec 2019 18:08:57 -0800	[thread overview]
Message-ID: <20191211020858.423049-10-jose.souza@intel.com> (raw)
In-Reply-To: <20191211020858.423049-1-jose.souza@intel.com>

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.
But it will probably be need for port sync as well.

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

diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
index 4dc48e79d14b..9729f0b299b3 100644
--- a/drivers/gpu/drm/i915/display/intel_display.c
+++ b/drivers/gpu/drm/i915/display/intel_display.c
@@ -13930,11 +13930,52 @@ static int calc_watermark_data(struct intel_atomic_state *state)
 	return 0;
 }
 
+/**
+ * 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.
+ */
+static bool
+intel_crtc_check_external_dependencies_fastset(const struct intel_crtc_state *old_crtc_state,
+					       struct intel_crtc_state *new_crtc_state)
+{
+	struct intel_atomic_state *state = to_intel_atomic_state(new_crtc_state->uapi.state);
+	struct drm_i915_private *dev_priv = to_i915(new_crtc_state->uapi.crtc->dev);
+	struct intel_crtc_state *new_crtc_state_iter;
+	struct intel_crtc *crtc_iter;
+	int i;
+
+	if (INTEL_GEN(dev_priv) < 12)
+		return true;
+
+	if (!intel_crtc_has_type(old_crtc_state, INTEL_OUTPUT_DP_MST) ||
+	    intel_dp_mst_is_master_trans(new_crtc_state))
+		return true;
+
+	for_each_new_intel_crtc_in_state(state, crtc_iter, new_crtc_state_iter, i) {
+		if (new_crtc_state_iter->cpu_transcoder !=
+		    new_crtc_state->mst_master_transcoder)
+			continue;
+
+		return !needs_modeset(new_crtc_state_iter);
+	}
+
+	DRM_ERROR("Master MST transcoder of pipe not found\n");
+	return false;
+}
+
 static void intel_crtc_check_fastset(const struct intel_crtc_state *old_crtc_state,
 				     struct intel_crtc_state *new_crtc_state)
 {
 	if (!intel_pipe_config_compare(old_crtc_state, new_crtc_state, true))
 		return;
+	if (!intel_crtc_check_external_dependencies_fastset(old_crtc_state,
+							    new_crtc_state))
+		return;
+
 
 	new_crtc_state->uapi.mode_changed = false;
 	new_crtc_state->update_pipe = true;
-- 
2.24.0

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

  parent reply	other threads:[~2019-12-11  2:09 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-11  2:08 [Intel-gfx] [PATCH v2 01/11] drm: Add __drm_atomic_helper_crtc_state_reset() & co José Roberto de Souza
2019-12-11  2:08 ` [Intel-gfx] [PATCH v2 02/11] drm/i915: s/intel_crtc/crtc/ in intel_crtc_init() José Roberto de Souza
2019-12-11  2:08 ` [Intel-gfx] [PATCH v2 03/11] drm/i915: Introduce intel_crtc_{alloc, free}() José Roberto de Souza
2019-12-11  2:08 ` [Intel-gfx] [PATCH v2 04/11] drm/i915: Introduce intel_crtc_state_reset() José Roberto de Souza
2019-12-11  2:08 ` [Intel-gfx] [PATCH v2 05/11] drm/i915: Introduce intel_plane_state_reset() José Roberto de Souza
2019-12-11  2:08 ` [Intel-gfx] [PATCH v2 06/11] drm/i915/display: Share intel_connector_needs_modeset() José Roberto de Souza
2019-12-11  2:08 ` [Intel-gfx] [PATCH v2 07/11] drm/i915/tgl: Select master transcoder for MST stream José Roberto de Souza
2019-12-11  2:08 ` [Intel-gfx] [PATCH v2 08/11] drm/i915/display: Always enables MST master pipe first José Roberto de Souza
2019-12-11  2:08 ` [Intel-gfx] [PATCH v2 09/11] drm/i915/dp: Fix MST disable sequences José Roberto de Souza
2019-12-11  2:08 ` José Roberto de Souza [this message]
2019-12-11  2:08 ` [Intel-gfx] [PATCH v2 11/11] drm/i915/display: Add comment to a function that probably can be removed José Roberto de Souza
2019-12-11  7:34 ` [Intel-gfx] ✗ Fi.CI.BUILD: failure for series starting with [v2,01/11] drm: Add __drm_atomic_helper_crtc_state_reset() & co Patchwork
2019-12-16 22:38 ` [Intel-gfx] [PATCH v2 01/11] " kbuild test robot
2019-12-16 22:38   ` kbuild test robot

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=20191211020858.423049-10-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.