Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Suraj Kandpal <suraj.kandpal@intel.com>
To: intel-xe@lists.freedesktop.org, intel-gfx@lists.freedesktop.org
Cc: ankit.k.nautiyal@intel.com, uma.shankar@intel.com,
	mika.kahola@intel.com, Suraj Kandpal <suraj.kandpal@intel.com>
Subject: [PATCH 10/11] drm/i915/dpll: Add intel_encoder argument to get_hw_state hook
Date: Tue, 25 Feb 2025 13:39:26 +0530	[thread overview]
Message-ID: <20250225080927.157437-11-suraj.kandpal@intel.com> (raw)
In-Reply-To: <20250225080927.157437-1-suraj.kandpal@intel.com>

Add intel_encoder argument in the get_hw_state hook as encoders
and the data stored within them are essential to read the hw state
starting DISPLAY_VER() >= 14.

Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
---
 drivers/gpu/drm/i915/display/intel_dpll_mgr.c | 38 ++++++++++++-------
 1 file changed, 25 insertions(+), 13 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_dpll_mgr.c b/drivers/gpu/drm/i915/display/intel_dpll_mgr.c
index 1014ce4941e7..efb5472b69c5 100644
--- a/drivers/gpu/drm/i915/display/intel_dpll_mgr.c
+++ b/drivers/gpu/drm/i915/display/intel_dpll_mgr.c
@@ -90,7 +90,8 @@ struct intel_global_dpll_funcs {
 	 */
 	bool (*get_hw_state)(struct intel_display *display,
 			     struct intel_global_dpll *pll,
-			     struct intel_dpll_hw_state *dpll_hw_state);
+			     struct intel_dpll_hw_state *dpll_hw_state,
+			     struct intel_encoder *encoder);
 
 	/*
 	 * Hook for calculating the pll's output frequency based on its passed
@@ -531,7 +532,8 @@ void intel_dpll_swap_state(struct intel_atomic_state *state)
 
 static bool ibx_pch_dpll_get_hw_state(struct intel_display *display,
 				      struct intel_global_dpll *pll,
-				      struct intel_dpll_hw_state *dpll_hw_state)
+				      struct intel_dpll_hw_state *dpll_hw_state,
+				      struct intel_encoder *encoder)
 {
 	struct i9xx_dpll_hw_state *hw_state = &dpll_hw_state->i9xx;
 	const enum intel_dpll_id id = pll->info->id;
@@ -757,7 +759,8 @@ static void hsw_ddi_spll_disable(struct intel_display *display,
 
 static bool hsw_ddi_wrpll_get_hw_state(struct intel_display *display,
 				       struct intel_global_dpll *pll,
-				       struct intel_dpll_hw_state *dpll_hw_state)
+				       struct intel_dpll_hw_state *dpll_hw_state,
+				       struct intel_encoder *encoder)
 {
 	struct hsw_dpll_hw_state *hw_state = &dpll_hw_state->hsw;
 	const enum intel_dpll_id id = pll->info->id;
@@ -779,7 +782,8 @@ static bool hsw_ddi_wrpll_get_hw_state(struct intel_display *display,
 
 static bool hsw_ddi_spll_get_hw_state(struct intel_display *display,
 				      struct intel_global_dpll *pll,
-				      struct intel_dpll_hw_state *dpll_hw_state)
+				      struct intel_dpll_hw_state *dpll_hw_state,
+				      struct intel_encoder *encoder)
 {
 	struct hsw_dpll_hw_state *hw_state = &dpll_hw_state->hsw;
 	intel_wakeref_t wakeref;
@@ -1305,7 +1309,8 @@ static void hsw_ddi_lcpll_disable(struct intel_display *display,
 
 static bool hsw_ddi_lcpll_get_hw_state(struct intel_display *display,
 				       struct intel_global_dpll *pll,
-				       struct intel_dpll_hw_state *dpll_hw_state)
+				       struct intel_dpll_hw_state *dpll_hw_state,
+				       struct intel_encoder *encoder)
 {
 	return true;
 }
@@ -1436,7 +1441,8 @@ static void skl_ddi_dpll0_disable(struct intel_display *display,
 
 static bool skl_ddi_pll_get_hw_state(struct intel_display *display,
 				     struct intel_global_dpll *pll,
-				     struct intel_dpll_hw_state *dpll_hw_state)
+				     struct intel_dpll_hw_state *dpll_hw_state,
+				     struct intel_encoder *encoder)
 {
 	struct skl_dpll_hw_state *hw_state = &dpll_hw_state->skl;
 	const struct skl_dpll_regs *regs = skl_dpll_regs;
@@ -1474,7 +1480,8 @@ static bool skl_ddi_pll_get_hw_state(struct intel_display *display,
 
 static bool skl_ddi_dpll0_get_hw_state(struct intel_display *display,
 				       struct intel_global_dpll *pll,
-				       struct intel_dpll_hw_state *dpll_hw_state)
+				       struct intel_dpll_hw_state *dpll_hw_state,
+				       struct intel_encoder *encoder)
 {
 	struct skl_dpll_hw_state *hw_state = &dpll_hw_state->skl;
 	const struct skl_dpll_regs *regs = skl_dpll_regs;
@@ -2172,7 +2179,8 @@ static void bxt_ddi_pll_disable(struct intel_display *display,
 
 static bool bxt_ddi_pll_get_hw_state(struct intel_display *display,
 				     struct intel_global_dpll *pll,
-				     struct intel_dpll_hw_state *dpll_hw_state)
+				     struct intel_dpll_hw_state *dpll_hw_state,
+				     struct intel_encoder *encoder)
 {
 	struct bxt_dpll_hw_state *hw_state = &dpll_hw_state->bxt;
 	enum port port = (enum port)pll->info->id; /* 1:1 port->PLL mapping */
@@ -3553,7 +3561,8 @@ static void icl_put_dplls(struct intel_atomic_state *state,
 
 static bool mg_pll_get_hw_state(struct intel_display *display,
 				struct intel_global_dpll *pll,
-				struct intel_dpll_hw_state *dpll_hw_state)
+				struct intel_dpll_hw_state *dpll_hw_state,
+				struct intel_encoder *encoder)
 {
 	struct icl_dpll_hw_state *hw_state = &dpll_hw_state->icl;
 	const enum intel_dpll_id id = pll->info->id;
@@ -3620,7 +3629,8 @@ static bool mg_pll_get_hw_state(struct intel_display *display,
 
 static bool dkl_pll_get_hw_state(struct intel_display *display,
 				 struct intel_global_dpll *pll,
-				 struct intel_dpll_hw_state *dpll_hw_state)
+				 struct intel_dpll_hw_state *dpll_hw_state,
+				 struct intel_encoder *encoder)
 {
 	struct icl_dpll_hw_state *hw_state = &dpll_hw_state->icl;
 	const enum intel_dpll_id id = pll->info->id;
@@ -3753,7 +3763,8 @@ static bool icl_pll_get_hw_state(struct intel_display *display,
 
 static bool combo_pll_get_hw_state(struct intel_display *display,
 				   struct intel_global_dpll *pll,
-				   struct intel_dpll_hw_state *dpll_hw_state)
+				   struct intel_dpll_hw_state *dpll_hw_state,
+				   struct intel_encoder *encoder)
 {
 	i915_reg_t enable_reg = intel_combo_pll_enable_reg(display, pll);
 
@@ -3762,7 +3773,8 @@ static bool combo_pll_get_hw_state(struct intel_display *display,
 
 static bool tbt_pll_get_hw_state(struct intel_display *display,
 				 struct intel_global_dpll *pll,
-				 struct intel_dpll_hw_state *dpll_hw_state)
+				 struct intel_dpll_hw_state *dpll_hw_state,
+				 struct intel_encoder *encoder)
 {
 	return icl_pll_get_hw_state(display, pll, dpll_hw_state, TBT_PLL_ENABLE);
 }
@@ -4520,7 +4532,7 @@ bool intel_dpll_get_hw_state(struct intel_display *display,
 			     struct intel_global_dpll *pll,
 			     struct intel_dpll_hw_state *dpll_hw_state)
 {
-	return pll->info->funcs->get_hw_state(display, pll, dpll_hw_state);
+	return pll->info->funcs->get_hw_state(display, pll, dpll_hw_state, NULL);
 }
 
 static void readout_dpll_hw_state(struct intel_display *display,
-- 
2.34.1


  parent reply	other threads:[~2025-02-25  8:09 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-25  8:09 [PATCH 00/11] DPLL framework redesign Suraj Kandpal
2025-02-25  8:09 ` [PATCH 01/11] drm/i915/dpll: Rename intel_shared_dpll_state Suraj Kandpal
2025-02-25  8:09 ` [PATCH 02/11] drm/i915/dpll: Rename macro for_each_shared_dpll Suraj Kandpal
2025-02-25  8:09 ` [PATCH 03/11] drm/i915/dpll: Rename intel_shared_dpll_funcs Suraj Kandpal
2025-02-25  8:09 ` [PATCH 04/11] drm/i915/dpll: Rename intel_shared_dpll Suraj Kandpal
2025-02-25  8:09 ` [PATCH 05/11] drm/i915/dpll: Move away from using shared dpll Suraj Kandpal
2025-02-25  8:46   ` Jani Nikula
2025-02-25  8:54     ` Kandpal, Suraj
2025-02-25  9:47       ` Kandpal, Suraj
2025-02-25 15:30         ` Jani Nikula
2025-02-27 10:18           ` Kandpal, Suraj
2025-02-28 14:26             ` Ville Syrjälä
2025-02-28 15:31               ` Kandpal, Suraj
2025-03-03 12:51                 ` Ville Syrjälä
2025-03-07 12:02                   ` Kahola, Mika
2025-03-07 13:06                     ` Ville Syrjälä
2025-03-07 13:53                       ` Kahola, Mika
2025-03-11  8:12                         ` Kandpal, Suraj
2025-02-25  8:09 ` [PATCH 06/11] drm/i915/dpll: Rename crtc_get_shared_dpll Suraj Kandpal
2025-02-25  8:09 ` [PATCH 07/11] drm/i915/dpll: Change argument for enable hook in intel_global_dpll_funcs Suraj Kandpal
2025-03-07 14:06   ` Ville Syrjälä
2025-03-11  8:15     ` Kandpal, Suraj
2025-03-11  9:50       ` Kahola, Mika
2025-02-25  8:09 ` [PATCH 08/11] drm/i915/drm: Rename disable hook in intel_dpll_global_func Suraj Kandpal
2025-02-25  8:09 ` [PATCH 09/11] drm/i915/dpll: Introduce new hook in intel_global_dpll_func Suraj Kandpal
2025-02-25  8:09 ` Suraj Kandpal [this message]
2025-02-25  8:09 ` [PATCH 11/11] drm/i915/dpll: Change arguments for get_freq hook Suraj Kandpal
2025-02-25  8:43 ` ✓ CI.Patch_applied: success for DPLL framework redesign Patchwork
2025-02-25  8:43 ` ✗ CI.checkpatch: warning " Patchwork
2025-02-25  8:45 ` ✓ CI.KUnit: success " Patchwork
2025-02-25  9:02 ` ✓ CI.Build: " Patchwork
2025-02-25  9:04 ` ✓ CI.Hooks: " Patchwork
2025-02-25  9:06 ` ✓ CI.checksparse: " Patchwork
2025-02-25  9:26 ` ✓ Xe.CI.BAT: " Patchwork
2025-02-25 15:21 ` ✗ Xe.CI.Full: 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=20250225080927.157437-11-suraj.kandpal@intel.com \
    --to=suraj.kandpal@intel.com \
    --cc=ankit.k.nautiyal@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=mika.kahola@intel.com \
    --cc=uma.shankar@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox