From: Mika Kahola <mika.kahola@intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [Intel-gfx] [PATCH 1/3] drm/i915/display: Move C20 HW readout
Date: Mon, 4 Dec 2023 13:58:54 +0200 [thread overview]
Message-ID: <20231204115856.176240-2-mika.kahola@intel.com> (raw)
In-Reply-To: <20231204115856.176240-1-mika.kahola@intel.com>
Moving intel_c20pll_readout_hw_state() for better place
to better suit for upcoming changes.
Signed-off-by: Mika Kahola <mika.kahola@intel.com>
---
drivers/gpu/drm/i915/display/intel_cx0_phy.c | 116 +++++++++----------
1 file changed, 58 insertions(+), 58 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_cx0_phy.c b/drivers/gpu/drm/i915/display/intel_cx0_phy.c
index 5fbec5784b83..2e6412fc2258 100644
--- a/drivers/gpu/drm/i915/display/intel_cx0_phy.c
+++ b/drivers/gpu/drm/i915/display/intel_cx0_phy.c
@@ -2123,64 +2123,6 @@ static bool intel_c20_use_mplla(u32 clock)
return false;
}
-static void intel_c20pll_readout_hw_state(struct intel_encoder *encoder,
- struct intel_c20pll_state *pll_state)
-{
- struct drm_i915_private *i915 = to_i915(encoder->base.dev);
- bool cntx;
- intel_wakeref_t wakeref;
- int i;
-
- wakeref = intel_cx0_phy_transaction_begin(encoder);
-
- /* 1. Read current context selection */
- cntx = intel_cx0_read(i915, encoder->port, INTEL_CX0_LANE0, PHY_C20_VDR_CUSTOM_SERDES_RATE) & PHY_C20_CONTEXT_TOGGLE;
-
- /* Read Tx configuration */
- for (i = 0; i < ARRAY_SIZE(pll_state->tx); i++) {
- if (cntx)
- pll_state->tx[i] = intel_c20_sram_read(i915, encoder->port, INTEL_CX0_LANE0,
- PHY_C20_B_TX_CNTX_CFG(i));
- else
- pll_state->tx[i] = intel_c20_sram_read(i915, encoder->port, INTEL_CX0_LANE0,
- PHY_C20_A_TX_CNTX_CFG(i));
- }
-
- /* Read common configuration */
- for (i = 0; i < ARRAY_SIZE(pll_state->cmn); i++) {
- if (cntx)
- pll_state->cmn[i] = intel_c20_sram_read(i915, encoder->port, INTEL_CX0_LANE0,
- PHY_C20_B_CMN_CNTX_CFG(i));
- else
- pll_state->cmn[i] = intel_c20_sram_read(i915, encoder->port, INTEL_CX0_LANE0,
- PHY_C20_A_CMN_CNTX_CFG(i));
- }
-
- if (pll_state->tx[0] & C20_PHY_USE_MPLLB) {
- /* MPLLB configuration */
- for (i = 0; i < ARRAY_SIZE(pll_state->mpllb); i++) {
- if (cntx)
- pll_state->mpllb[i] = intel_c20_sram_read(i915, encoder->port, INTEL_CX0_LANE0,
- PHY_C20_B_MPLLB_CNTX_CFG(i));
- else
- pll_state->mpllb[i] = intel_c20_sram_read(i915, encoder->port, INTEL_CX0_LANE0,
- PHY_C20_A_MPLLB_CNTX_CFG(i));
- }
- } else {
- /* MPLLA configuration */
- for (i = 0; i < ARRAY_SIZE(pll_state->mplla); i++) {
- if (cntx)
- pll_state->mplla[i] = intel_c20_sram_read(i915, encoder->port, INTEL_CX0_LANE0,
- PHY_C20_B_MPLLA_CNTX_CFG(i));
- else
- pll_state->mplla[i] = intel_c20_sram_read(i915, encoder->port, INTEL_CX0_LANE0,
- PHY_C20_A_MPLLA_CNTX_CFG(i));
- }
- }
-
- intel_cx0_phy_transaction_end(encoder, wakeref);
-}
-
void intel_c20pll_dump_hw_state(struct drm_i915_private *i915,
const struct intel_c20pll_state *hw_state)
{
@@ -2503,6 +2445,64 @@ static void intel_program_port_clock_ctl(struct intel_encoder *encoder,
XELPDP_SSC_ENABLE_PLLB, val);
}
+static void intel_c20pll_readout_hw_state(struct intel_encoder *encoder,
+ struct intel_c20pll_state *pll_state)
+{
+ struct drm_i915_private *i915 = to_i915(encoder->base.dev);
+ bool cntx;
+ intel_wakeref_t wakeref;
+ int i;
+
+ wakeref = intel_cx0_phy_transaction_begin(encoder);
+
+ /* 1. Read current context selection */
+ cntx = intel_cx0_read(i915, encoder->port, INTEL_CX0_LANE0, PHY_C20_VDR_CUSTOM_SERDES_RATE) & PHY_C20_CONTEXT_TOGGLE;
+
+ /* Read Tx configuration */
+ for (i = 0; i < ARRAY_SIZE(pll_state->tx); i++) {
+ if (cntx)
+ pll_state->tx[i] = intel_c20_sram_read(i915, encoder->port, INTEL_CX0_LANE0,
+ PHY_C20_B_TX_CNTX_CFG(i));
+ else
+ pll_state->tx[i] = intel_c20_sram_read(i915, encoder->port, INTEL_CX0_LANE0,
+ PHY_C20_A_TX_CNTX_CFG(i));
+ }
+
+ /* Read common configuration */
+ for (i = 0; i < ARRAY_SIZE(pll_state->cmn); i++) {
+ if (cntx)
+ pll_state->cmn[i] = intel_c20_sram_read(i915, encoder->port, INTEL_CX0_LANE0,
+ PHY_C20_B_CMN_CNTX_CFG(i));
+ else
+ pll_state->cmn[i] = intel_c20_sram_read(i915, encoder->port, INTEL_CX0_LANE0,
+ PHY_C20_A_CMN_CNTX_CFG(i));
+ }
+
+ if (pll_state->tx[0] & C20_PHY_USE_MPLLB) {
+ /* MPLLB configuration */
+ for (i = 0; i < ARRAY_SIZE(pll_state->mpllb); i++) {
+ if (cntx)
+ pll_state->mpllb[i] = intel_c20_sram_read(i915, encoder->port, INTEL_CX0_LANE0,
+ PHY_C20_B_MPLLB_CNTX_CFG(i));
+ else
+ pll_state->mpllb[i] = intel_c20_sram_read(i915, encoder->port, INTEL_CX0_LANE0,
+ PHY_C20_A_MPLLB_CNTX_CFG(i));
+ }
+ } else {
+ /* MPLLA configuration */
+ for (i = 0; i < ARRAY_SIZE(pll_state->mplla); i++) {
+ if (cntx)
+ pll_state->mplla[i] = intel_c20_sram_read(i915, encoder->port, INTEL_CX0_LANE0,
+ PHY_C20_B_MPLLA_CNTX_CFG(i));
+ else
+ pll_state->mplla[i] = intel_c20_sram_read(i915, encoder->port, INTEL_CX0_LANE0,
+ PHY_C20_A_MPLLA_CNTX_CFG(i));
+ }
+ }
+
+ intel_cx0_phy_transaction_end(encoder, wakeref);
+}
+
static u32 intel_cx0_get_powerdown_update(u8 lane_mask)
{
u32 val = 0;
--
2.34.1
next prev parent reply other threads:[~2023-12-04 12:05 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-04 11:58 [Intel-gfx] [PATCH 0/3] drm/i915/display: Convert link bitrate to clock Mika Kahola
2023-12-04 11:58 ` Mika Kahola [this message]
2023-12-04 11:58 ` [Intel-gfx] [PATCH 2/3] drm/i915/display: Convert link bitrate to corresponding PLL clock Mika Kahola
2023-12-05 1:36 ` Sripada, Radhakrishna
2023-12-05 8:28 ` Kahola, Mika
2023-12-05 18:09 ` Sripada, Radhakrishna
2023-12-07 13:29 ` Kahola, Mika
2023-12-04 11:58 ` [Intel-gfx] [PATCH 3/3] drm/i915/display: Print out debug messages for clock rates Mika Kahola
2023-12-04 19:10 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915/display: Convert link bitrate to clock Patchwork
2023-12-04 19:11 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2023-12-04 19:11 ` [Intel-gfx] ✗ Fi.CI.DOCS: " Patchwork
2023-12-04 19:23 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2023-12-05 0:21 ` [Intel-gfx] ✗ Fi.CI.IGT: 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=20231204115856.176240-2-mika.kahola@intel.com \
--to=mika.kahola@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
/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;
as well as URLs for NNTP newsgroup(s).