All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: Stanislav.Lisovskiy@intel.com, jani.saarinen@intel.com,
	ville.syrjala@linux.intel.com, vidya.srinivas@intel.com
Subject: [PATCH 1/6] Add a small helper to compute the set of pipes that the current crtc is using.
Date: Fri,  8 Mar 2024 15:11:41 +0200	[thread overview]
Message-ID: <20240308131146.32714-2-stanislav.lisovskiy@intel.com> (raw)
In-Reply-To: <20240308131146.32714-1-stanislav.lisovskiy@intel.com>

And we have at least one trivial place in
intel_ddi_update_active_dpll() where we can use it
immediately, so let's do that.

v2: - Fixed conflicts, part of patch didn't apply, because of master_crtc
      rename(Stan)

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
Credits-to: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/display/intel_ddi.c     | 9 ++++-----
 drivers/gpu/drm/i915/display/intel_display.c | 7 +++++++
 drivers/gpu/drm/i915/display/intel_display.h | 1 +
 3 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c
index c587a8efeafcf..bbce74f011d40 100644
--- a/drivers/gpu/drm/i915/display/intel_ddi.c
+++ b/drivers/gpu/drm/i915/display/intel_ddi.c
@@ -3472,17 +3472,16 @@ void intel_ddi_update_active_dpll(struct intel_atomic_state *state,
 	struct drm_i915_private *i915 = to_i915(encoder->base.dev);
 	struct intel_crtc_state *crtc_state =
 		intel_atomic_get_new_crtc_state(state, crtc);
-	struct intel_crtc *slave_crtc;
+	struct intel_crtc *pipe_mask_crtc;
+	u8 pipe_mask = intel_crtc_joined_pipe_mask(crtc_state);
 	enum phy phy = intel_port_to_phy(i915, encoder->port);
 
 	/* FIXME: Add MTL pll_mgr */
 	if (DISPLAY_VER(i915) >= 14 || !intel_phy_is_tc(i915, phy))
 		return;
 
-	intel_update_active_dpll(state, crtc, encoder);
-	for_each_intel_crtc_in_pipe_mask(&i915->drm, slave_crtc,
-					 intel_crtc_bigjoiner_slave_pipes(crtc_state))
-		intel_update_active_dpll(state, slave_crtc, encoder);
+	for_each_intel_crtc_in_pipe_mask(&i915->drm, pipe_mask_crtc, pipe_mask)
+		intel_update_active_dpll(state, pipe_mask_crtc, encoder);
 }
 
 static void
diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
index b88f214e111ae..021db26a630af 100644
--- a/drivers/gpu/drm/i915/display/intel_display.c
+++ b/drivers/gpu/drm/i915/display/intel_display.c
@@ -275,6 +275,13 @@ static int intel_bigjoiner_num_pipes(const struct intel_crtc_state *crtc_state)
 	return hweight8(crtc_state->bigjoiner_pipes);
 }
 
+u8 intel_crtc_joined_pipe_mask(const struct intel_crtc_state *crtc_state)
+{
+	struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
+
+	return BIT(crtc->pipe) | crtc_state->bigjoiner_pipes;
+}
+
 struct intel_crtc *intel_master_crtc(const struct intel_crtc_state *crtc_state)
 {
 	struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->dev);
diff --git a/drivers/gpu/drm/i915/display/intel_display.h b/drivers/gpu/drm/i915/display/intel_display.h
index f4a0773f0fca8..631218c954a47 100644
--- a/drivers/gpu/drm/i915/display/intel_display.h
+++ b/drivers/gpu/drm/i915/display/intel_display.h
@@ -410,6 +410,7 @@ bool is_trans_port_sync_mode(const struct intel_crtc_state *state);
 bool is_trans_port_sync_master(const struct intel_crtc_state *state);
 bool intel_crtc_is_bigjoiner_slave(const struct intel_crtc_state *crtc_state);
 bool intel_crtc_is_bigjoiner_master(const struct intel_crtc_state *crtc_state);
+u8 intel_crtc_joined_pipe_mask(const struct intel_crtc_state *crtc_state);
 u8 intel_crtc_bigjoiner_slave_pipes(const struct intel_crtc_state *crtc_state);
 struct intel_crtc *intel_master_crtc(const struct intel_crtc_state *crtc_state);
 bool intel_crtc_get_pipe_config(struct intel_crtc_state *crtc_state);
-- 
2.37.3


  reply	other threads:[~2024-03-08 13:11 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-08 13:11 [PATCH 0/6] Bigjoiner refactoring Stanislav Lisovskiy
2024-03-08 13:11 ` Stanislav Lisovskiy [this message]
2024-03-26 19:38   ` [PATCH 1/6] Add a small helper to compute the set of pipes that the current crtc is using Manasi Navare
2024-03-08 13:11 ` [PATCH 2/6] drm/i915: Extract intel_ddi_post_disable_hdmi_or_sst() Stanislav Lisovskiy
2024-03-13  4:36   ` Manasi Navare
2024-03-13  8:42     ` Lisovskiy, Stanislav
2024-03-08 13:11 ` [PATCH 3/6] drm/i915: Utilize intel_crtc_joined_pipe_mask() more Stanislav Lisovskiy
2024-03-13  4:45   ` Manasi Navare
2024-03-08 13:11 ` [PATCH 4/6] drm/i915: Handle joined pipes inside hsw_crtc_disable() Stanislav Lisovskiy
2024-03-08 13:11 ` [PATCH 5/6] drm/i915: Handle joined pipes inside hsw_crtc_enable() Stanislav Lisovskiy
2024-03-08 13:11 ` [PATCH 6/6] drm/i915: Allow bigjoiner for MST Stanislav Lisovskiy
2024-03-13  4:48   ` Manasi Navare
2024-03-13 10:02     ` Lisovskiy, Stanislav
2024-03-08 15:21 ` ✗ Fi.CI.CHECKPATCH: warning for Bigjoiner refactoring (rev9) Patchwork
2024-03-08 15:21 ` ✗ Fi.CI.SPARSE: " Patchwork
2024-03-08 15:40 ` ✗ Fi.CI.BAT: failure " Patchwork

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=20240308131146.32714-2-stanislav.lisovskiy@intel.com \
    --to=stanislav.lisovskiy@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.saarinen@intel.com \
    --cc=vidya.srinivas@intel.com \
    --cc=ville.syrjala@linux.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.