Skip to contentSkip to conversation

drm/i915/pll: Centralize PLL_ENABLE register lookup

PATCH In review Anusha Srivatsa 3 participants 8 messages Sep 1, 2020 – Sep 8, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/i915/pll: Centralize PLL_ENABLE register lookup

We currenty check for platform at multiple parts in the driver to grab the correct PLL. Let us begin to centralize it through a helper function.

v2: s/intel_get_pll_enable_reg()/intel_combo_pll_enable_reg() (Ville)

---
 drivers/gpu/drm/i915/display/intel_dpll_mgr.c | 25 +++++++++++--------
 1 file changed, 15 insertions(+), 10 deletions(-)
drivers/gpu/drm/i915/display/intel_dpll_mgr.c +15 -10
index c9013f8f766f..7440836c5e44 100644
@@ -147,6 +147,18 @@ void assert_shared_dpll(struct drm_i915_private *dev_priv,
 			pll->info->name, onoff(state), onoff(cur_state));
 }
 
+static
+i915_reg_t intel_combo_pll_enable_reg(struct drm_i915_private *dev_priv,
+				    struct intel_shared_dpll *pll)
+{
+
+	if (IS_ELKHARTLAKE(dev_priv) && (pll->info->id == DPLL_ID_EHL_DPLL4))
+			return MG_PLL_ENABLE(0);
+
+	return CNL_DPLL_ENABLE(pll->info->id);
+
+
+}
 /**
  * intel_prepare_shared_dpll - call a dpll's prepare hook
  * @crtc_state: CRTC, and its state, which has a shared dpll
@@ -3842,12 +3854,7 @@ static bool combo_pll_get_hw_state(struct drm_i915_private *dev_priv,
 				   struct intel_shared_dpll *pll,
 				   struct intel_dpll_hw_state *hw_state)
 {
-	i915_reg_t enable_reg = CNL_DPLL_ENABLE(pll->info->id);
-
-	if (IS_ELKHARTLAKE(dev_priv) &&
-	    pll->info->id == DPLL_ID_EHL_DPLL4) {
-		enable_reg = MG_PLL_ENABLE(0);
-	}
+	i915_reg_t enable_reg = intel_combo_pll_enable_reg(dev_priv, pll);
 
 	return icl_pll_get_hw_state(dev_priv, pll, hw_state, enable_reg);
 }
@@ -4045,11 +4052,10 @@ static void icl_pll_enable(struct drm_i915_private *dev_priv,
 static void combo_pll_enable(struct drm_i915_private *dev_priv,
 			     struct intel_shared_dpll *pll)
 {
-	i915_reg_t enable_reg = CNL_DPLL_ENABLE(pll->info->id);
+	i915_reg_t enable_reg = intel_combo_pll_enable_reg(dev_priv, pll);
 
 	if (IS_ELKHARTLAKE(dev_priv) &&
 	    pll->info->id == DPLL_ID_EHL_DPLL4) {
-		enable_reg = MG_PLL_ENABLE(0);
 
 		/*
 		 * We need to disable DC states when this DPLL is enabled.
@@ -4157,11 +4163,10 @@ static void icl_pll_disable(struct drm_i915_private *dev_priv,
 static void combo_pll_disable(struct drm_i915_private *dev_priv,
 			      struct intel_shared_dpll *pll)
 {
-	i915_reg_t enable_reg = CNL_DPLL_ENABLE(pll->info->id);
+	i915_reg_t enable_reg = intel_combo_pll_enable_reg(dev_priv, pll);
 
 	if (IS_ELKHARTLAKE(dev_priv) &&
 	    pll->info->id == DPLL_ID_EHL_DPLL4) {
-		enable_reg = MG_PLL_ENABLE(0);
 		icl_pll_disable(dev_priv, pll, enable_reg);
 
 		intel_display_power_put(dev_priv, POWER_DOMAIN_DPLL_DC_OFF,
Signature · 6 lines
2.25.0

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw

[Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915/pll: Centralize PLL_ENABLE register lookup (rev2)

== Series Details ==

== Series Details ==

Series: drm/i915/pll: Centralize PLL_ENABLE register lookup (rev2)
URL : https://patchwork.freedesktop.org/series/81150/
State : warning

== Summary ==

$ dim checkpatch origin/drm-tip
2b838e80247e drm/i915/pll: Centralize PLL_ENABLE register lookup
-:30: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis
#30: FILE: drivers/gpu/drm/i915/display/intel_dpll_mgr.c:152:
+i915_reg_t intel_combo_pll_enable_reg(struct drm_i915_private *dev_priv,
+				    struct intel_shared_dpll *pll)

-:32: CHECK:BRACES: Blank lines aren't necessary after an open brace '{' #32: FILE: drivers/gpu/drm/i915/display/intel_dpll_mgr.c:154:
+{
+

-:33: WARNING:SUSPECT_CODE_INDENT: suspect code indent for conditional statements (8, 24) #33: FILE: drivers/gpu/drm/i915/display/intel_dpll_mgr.c:155:
+ if (IS_ELKHARTLAKE(dev_priv) && (pll->info->id == DPLL_ID_EHL_DPLL4))
+ return MG_PLL_ENABLE(0);

-:33: CHECK:UNNECESSARY_PARENTHESES: Unnecessary parentheses around 'pll->info->id == DPLL_ID_EHL_DPLL4' #33: FILE: drivers/gpu/drm/i915/display/intel_dpll_mgr.c:155:
+ if (IS_ELKHARTLAKE(dev_priv) && (pll->info->id == DPLL_ID_EHL_DPLL4))

-:38: CHECK:LINE_SPACING: Please don't use multiple blank lines #38: FILE: drivers/gpu/drm/i915/display/intel_dpll_mgr.c:160:
+
+

-:39: CHECK:BRACES: Blank lines aren't necessary before a close brace '}' #39: FILE: drivers/gpu/drm/i915/display/intel_dpll_mgr.c:161:
+
+}

total: 0 errors, 1 warnings, 5 checks, 55 lines checked

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#2 lore raw

[Intel-gfx] ✗ Fi.CI.BAT: failure for drm/i915/pll: Centralize PLL_ENABLE register lookup (rev2)

In reply to Anusha Srivatsa
== Series Details ==

== Series Details ==

Series: drm/i915/pll: Centralize PLL_ENABLE register lookup (rev2)
URL : https://patchwork.freedesktop.org/series/81150/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_8951 -> Patchwork_18430
====================================================

Summary
-------

**FAILURE**

Serious unknown changes coming with Patchwork_18430 absolutely need to be verified manually.

If you think the reported changes have nothing to do with the changes introduced in Patchwork_18430, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.

External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18430/index.html

Possible new issues
-------------------

Here are the unknown changes that may have been introduced in Patchwork_18430:

### IGT changes ###

#### Possible regressions ####

* igt@i915_selftest@live@gem_contexts:
- fi-skl-guc: [PASS][1] -> [INCOMPLETE][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8951/fi-skl-guc/igt@i915_selftest@live@gem_contexts.html
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18430/fi-skl-guc/igt@i915_selftest@live@gem_contexts.html

Known issues
------------

Here are the changes found in Patchwork_18430 that come from known issues:

### IGT changes ###

#### Issues hit ####

* igt@i915_module_load@reload:
- fi-tgl-u2: [PASS][3] -> [DMESG-WARN][4] ([i915#1982])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8951/fi-tgl-u2/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18430/fi-tgl-u2/igt@[email protected]

#### Possible fixes ####

* igt@i915_selftest@live@gem_contexts:
- fi-cml-s: [INCOMPLETE][5] ([i915#2418]) -> [PASS][6]
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8951/fi-cml-s/igt@i915_selftest@live@gem_contexts.html
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18430/fi-cml-s/igt@i915_selftest@live@gem_contexts.html

{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).

[i915#1982]: https://gitlab.freedesktop.org/drm/intel/issues/1982
[i915#2418]: https://gitlab.freedesktop.org/drm/intel/issues/2418

Participating hosts (38 -> 32)
------------------------------

Missing (6): fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-icl-y fi-byt-clapper

Build changes
-------------

* Linux: CI_DRM_8951 -> Patchwork_18430

CI-20190529: 20190529
CI_DRM_8951: 5f8c53e35ef01a1d5e97db6005d3c308d3734bac @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5775: 58cb0aea18fa471af43c11ee9f587554721a7815 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_18430: 2b838e80247e21b2c7fb1bdfcae4454a3931d563 @ git://anongit.freedesktop.org/gfx-ci/linux

== Linux commits ==

2b838e80247e drm/i915/pll: Centralize PLL_ENABLE register lookup

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18430/index.html

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

maintainer
#3 lore raw
In reply to Anusha Srivatsa
Quoted 52 lines · Anusha Srivatsa

We currenty check for platform at multiple parts in the driver to grab the correct PLL. Let us begin to centralize it through a helper function.

v2: s/intel_get_pll_enable_reg()/intel_combo_pll_enable_reg() (Ville)

---
 drivers/gpu/drm/i915/display/intel_dpll_mgr.c | 25 +++++++++++--------
 1 file changed, 15 insertions(+), 10 deletions(-)
drivers/gpu/drm/i915/display/intel_dpll_mgr.c +13 -6
index c9013f8f766f..7440836c5e44 100644
@@ -147,6 +147,18 @@ void assert_shared_dpll(struct drm_i915_private *dev_priv,
 			pll->info->name, onoff(state), onoff(cur_state));
 }
 
+static
+i915_reg_t intel_combo_pll_enable_reg(struct drm_i915_private *dev_priv,
+				    struct intel_shared_dpll *pll)
+{
+
+	if (IS_ELKHARTLAKE(dev_priv) && (pll->info->id == DPLL_ID_EHL_DPLL4))
+			return MG_PLL_ENABLE(0);
+
+	return CNL_DPLL_ENABLE(pll->info->id);
+
+
+}
 /**
  * intel_prepare_shared_dpll - call a dpll's prepare hook
  * @crtc_state: CRTC, and its state, which has a shared dpll
@@ -3842,12 +3854,7 @@ static bool combo_pll_get_hw_state(struct drm_i915_private *dev_priv,
 				   struct intel_shared_dpll *pll,
 				   struct intel_dpll_hw_state *hw_state)
 {
-	i915_reg_t enable_reg = CNL_DPLL_ENABLE(pll->info->id);
-
-	if (IS_ELKHARTLAKE(dev_priv) &&
-	    pll->info->id == DPLL_ID_EHL_DPLL4) {
-		enable_reg = MG_PLL_ENABLE(0);
-	}
+	i915_reg_t enable_reg = intel_combo_pll_enable_reg(dev_priv, pll);
 
 	return icl_pll_get_hw_state(dev_priv, pll, hw_state, enable_reg);
 }

drivers/gpu/drm/i915/display/intel_dpll_mgr.c static void icl_pll_enable(struct drm_i915_private *dev_priv, · line 4058

Quoted 8 lines
drivers/gpu/drm/i915/display/intel_dpll_mgr.c +1 -1
@@ -4045,11 +4052,10 @@ static void icl_pll_enable(struct drm_i915_private *dev_priv,
 static void combo_pll_enable(struct drm_i915_private *dev_priv,
 			     struct intel_shared_dpll *pll)
 {
-	i915_reg_t enable_reg = CNL_DPLL_ENABLE(pll->info->id);
+	i915_reg_t enable_reg = intel_combo_pll_enable_reg(dev_priv, pll);
 
 	if (IS_ELKHARTLAKE(dev_priv) &&
 	    pll->info->id == DPLL_ID_EHL_DPLL4) {

there's probably something else that we can do now with the power_{put,get} to get rid of the, now, doubled if checks...

Quoted 5 lines
drivers/gpu/drm/i915/display/intel_dpll_mgr.c +0 -1
-		enable_reg = MG_PLL_ENABLE(0);
 
 		/*
 		 * We need to disable DC states when this DPLL is enabled.

drivers/gpu/drm/i915/display/intel_dpll_mgr.c static void icl_pll_disable(struct drm_i915_private *dev_priv, · line 4170

Quoted 10 lines
drivers/gpu/drm/i915/display/intel_dpll_mgr.c +1 -2
@@ -4157,11 +4163,10 @@ static void icl_pll_disable(struct drm_i915_private *dev_priv,
 static void combo_pll_disable(struct drm_i915_private *dev_priv,
 			      struct intel_shared_dpll *pll)
 {
-	i915_reg_t enable_reg = CNL_DPLL_ENABLE(pll->info->id);
+	i915_reg_t enable_reg = intel_combo_pll_enable_reg(dev_priv, pll);
 
 	if (IS_ELKHARTLAKE(dev_priv) &&
 	    pll->info->id == DPLL_ID_EHL_DPLL4) {
-		enable_reg = MG_PLL_ENABLE(0);
 		icl_pll_disable(dev_priv, pll, enable_reg);

but here, at least, let's clean this function now... move this call above and out of the if and delete the one below and keep just the power_put inside the if...

Quoted 9 lines
drivers/gpu/drm/i915/display/intel_dpll_mgr.c +0 -0
 		intel_display_power_put(dev_priv, POWER_DOMAIN_DPLL_DC_OFF,
Signature · 6 lines
2.25.0

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#4 lore raw
Quoted 71 lines

-----Original Message-----
From: Rodrigo Vivi <[email protected]>
Sent: Tuesday, September 1, 2020 12:30 PM
To: Srivatsa, Anusha <[email protected]>
Cc: [email protected]
Subject: Re: [Intel-gfx] [PATCH] drm/i915/pll: Centralize PLL_ENABLE register lookup

drivers/gpu/drm/i915/display/intel_dpll_mgr.c void assert_shared_dpll(struct drm_i915_private

Quoted 21 lines · Anusha Srivatsa

We currenty check for platform at multiple parts in the driver to grab the correct PLL. Let us begin to centralize it through a helper function.

v2: s/intel_get_pll_enable_reg()/intel_combo_pll_enable_reg() (Ville)

---
 drivers/gpu/drm/i915/display/intel_dpll_mgr.c | 25
+++++++++++--------
 1 file changed, 15 insertions(+), 10 deletions(-)
drivers/gpu/drm/i915/display/intel_dpll_mgr.c +0 -0
index c9013f8f766f..7440836c5e44 100644
@@ -147,6 +147,18 @@ void assert_shared_dpll(struct drm_i915_private

*dev_priv,

drivers/gpu/drm/i915/display/intel_dpll_mgr.c void assert_shared_dpll(struct drm_i915_private *dev_priv,

Quoted 4 lines
drivers/gpu/drm/i915/display/intel_dpll_mgr.c +2 -0
 			pll->info->name, onoff(state), onoff(cur_state));  }
 
+static
+i915_reg_t intel_combo_pll_enable_reg(struct drm_i915_private

*dev_priv,

drivers/gpu/drm/i915/display/intel_dpll_mgr.c void assert_shared_dpll(struct drm_i915_private · line 153

Quoted 3 lines
drivers/gpu/drm/i915/display/intel_dpll_mgr.c +3 -0
+				    struct intel_shared_dpll *pll) {
+
+	if (IS_ELKHARTLAKE(dev_priv) && (pll->info->id ==

DPLL_ID_EHL_DPLL4))

drivers/gpu/drm/i915/display/intel_dpll_mgr.c void assert_shared_dpll(struct drm_i915_private *dev_priv,

Quoted 10 lines
drivers/gpu/drm/i915/display/intel_dpll_mgr.c +6 -1
+			return MG_PLL_ENABLE(0);
+
+	return CNL_DPLL_ENABLE(pll->info->id);
+
+
+}
 /**
  * intel_prepare_shared_dpll - call a dpll's prepare hook
  * @crtc_state: CRTC, and its state, which has a shared dpll @@
-3842,12 +3854,7 @@ static bool combo_pll_get_hw_state(struct

drm_i915_private *dev_priv,

Quoted 12 lines
drivers/gpu/drm/i915/display/intel_dpll_mgr.c +1 -6
 				   struct intel_shared_dpll *pll,
 				   struct intel_dpll_hw_state *hw_state)  {
-	i915_reg_t enable_reg = CNL_DPLL_ENABLE(pll->info->id);
-
-	if (IS_ELKHARTLAKE(dev_priv) &&
-	    pll->info->id == DPLL_ID_EHL_DPLL4) {
-		enable_reg = MG_PLL_ENABLE(0);
-	}
+	i915_reg_t enable_reg = intel_combo_pll_enable_reg(dev_priv, pll);
 
 	return icl_pll_get_hw_state(dev_priv, pll, hw_state, enable_reg);  }
@@ -4045,11 +4052,10 @@ static void icl_pll_enable(struct
Quoted 1 line

drm_i915_private *dev_priv, static void combo_pll_enable(struct

drm_i915_private *dev_priv,

Quoted 4 lines
drivers/gpu/drm/i915/display/intel_dpll_mgr.c +1 -1
 			     struct intel_shared_dpll *pll)  {
-	i915_reg_t enable_reg = CNL_DPLL_ENABLE(pll->info->id);
+	i915_reg_t enable_reg = intel_combo_pll_enable_reg(dev_priv, pll);
Quoted 5 lines

drivers/gpu/drm/i915/display/intel_dpll_mgr.c

Quoted 2 lines
drivers/gpu/drm/i915/display/intel_dpll_mgr.c +0 -0
 	if (IS_ELKHARTLAKE(dev_priv) &&
 	    pll->info->id == DPLL_ID_EHL_DPLL4) {

there's probably something else that we can do now with the power_{put,get} to get rid of the, now, doubled if checks...

Don't follow you here Rodrigo. Are you suggesting using power_{put/get} to somehow get rid of doubled if?

Quoted 11 lines
Quoted 6 lines
drivers/gpu/drm/i915/display/intel_dpll_mgr.c +0 -1
-		enable_reg = MG_PLL_ENABLE(0);
 
 		/*
 		 * We need to disable DC states when this DPLL is enabled.
@@ -4157,11 +4163,10 @@ static void icl_pll_disable(struct

drm_i915_private *dev_priv, static void combo_pll_disable(struct

drm_i915_private *dev_priv,

Quoted 4 lines
drivers/gpu/drm/i915/display/intel_dpll_mgr.c +1 -1
 			      struct intel_shared_dpll *pll)  {
-	i915_reg_t enable_reg = CNL_DPLL_ENABLE(pll->info->id);
+	i915_reg_t enable_reg = intel_combo_pll_enable_reg(dev_priv, pll);
Quoted 8 lines

drivers/gpu/drm/i915/display/intel_dpll_mgr.c static void icl_pll_disable(struct drm_i915_private *dev_priv, · line 4170

Quoted 4 lines
drivers/gpu/drm/i915/display/intel_dpll_mgr.c +0 -1
 	if (IS_ELKHARTLAKE(dev_priv) &&
 	    pll->info->id == DPLL_ID_EHL_DPLL4) {
-		enable_reg = MG_PLL_ENABLE(0);
 		icl_pll_disable(dev_priv, pll, enable_reg);

but here, at least, let's clean this function now...
move this call above and out of the if and delete the one below and keep just the power_put inside the if...

Good change. Thanks!
Will change that.

Anusha

Quoted 10 lines
Quoted 2 lines

intel_display_power_put(dev_priv,

POWER_DOMAIN_DPLL_DC_OFF,

Quoted 7 lines

--
2.25.0

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

maintainer
#5 lore raw
Quoted 75 lines · Anusha
Quoted 72 lines

-----Original Message-----
From: Rodrigo Vivi <[email protected]>
Sent: Tuesday, September 1, 2020 12:30 PM
To: Srivatsa, Anusha <[email protected]>
Cc: [email protected]
Subject: Re: [Intel-gfx] [PATCH] drm/i915/pll: Centralize PLL_ENABLE register lookup

drivers/gpu/drm/i915/display/intel_dpll_mgr.c void assert_shared_dpll(struct drm_i915_private

Quoted 21 lines · Anusha Srivatsa

We currenty check for platform at multiple parts in the driver to grab the correct PLL. Let us begin to centralize it through a helper function.

v2: s/intel_get_pll_enable_reg()/intel_combo_pll_enable_reg() (Ville)

---
drivers/gpu/drm/i915/display/intel_dpll_mgr.c | 25
+++++++++++--------

1 file changed, 15 insertions(+), 10 deletions(-)
drivers/gpu/drm/i915/display/intel_dpll_mgr.c +0 -0
index c9013f8f766f..7440836c5e44 100644
@@ -147,6 +147,18 @@ void assert_shared_dpll(struct drm_i915_private

*dev_priv,

drivers/gpu/drm/i915/display/intel_dpll_mgr.c void assert_shared_dpll(struct drm_i915_private *dev_priv,

Quoted 4 lines
drivers/gpu/drm/i915/display/intel_dpll_mgr.c +2 -0
 			pll->info->name, onoff(state), onoff(cur_state));  }
 
+static
+i915_reg_t intel_combo_pll_enable_reg(struct drm_i915_private

*dev_priv,

drivers/gpu/drm/i915/display/intel_dpll_mgr.c void assert_shared_dpll(struct drm_i915_private · line 153

Quoted 3 lines
drivers/gpu/drm/i915/display/intel_dpll_mgr.c +3 -0
+				    struct intel_shared_dpll *pll) {
+
+	if (IS_ELKHARTLAKE(dev_priv) && (pll->info->id ==

DPLL_ID_EHL_DPLL4))

drivers/gpu/drm/i915/display/intel_dpll_mgr.c void assert_shared_dpll(struct drm_i915_private *dev_priv,

Quoted 10 lines
drivers/gpu/drm/i915/display/intel_dpll_mgr.c +6 -1
+			return MG_PLL_ENABLE(0);
+
+	return CNL_DPLL_ENABLE(pll->info->id);
+
+
+}
 /**
 * intel_prepare_shared_dpll - call a dpll's prepare hook
 * @crtc_state: CRTC, and its state, which has a shared dpll @@
-3842,12 +3854,7 @@ static bool combo_pll_get_hw_state(struct

drm_i915_private *dev_priv,

Quoted 12 lines
				   struct intel_shared_dpll *pll,
				   struct intel_dpll_hw_state *hw_state)  {
drivers/gpu/drm/i915/display/intel_dpll_mgr.c +1 -6
-	i915_reg_t enable_reg = CNL_DPLL_ENABLE(pll->info->id);
-
-	if (IS_ELKHARTLAKE(dev_priv) &&
-	    pll->info->id == DPLL_ID_EHL_DPLL4) {
-		enable_reg = MG_PLL_ENABLE(0);
-	}
+	i915_reg_t enable_reg = intel_combo_pll_enable_reg(dev_priv, pll);
	return icl_pll_get_hw_state(dev_priv, pll, hw_state, enable_reg);  }
drivers/gpu/drm/i915/display/intel_dpll_mgr.c +0 -0
@@ -4045,11 +4052,10 @@ static void icl_pll_enable(struct
Quoted 1 line

drm_i915_private *dev_priv, static void combo_pll_enable(struct

drm_i915_private *dev_priv,

Quoted 4 lines
			     struct intel_shared_dpll *pll)  {
drivers/gpu/drm/i915/display/intel_dpll_mgr.c +1 -1
-	i915_reg_t enable_reg = CNL_DPLL_ENABLE(pll->info->id);
+	i915_reg_t enable_reg = intel_combo_pll_enable_reg(dev_priv, pll);
Quoted 7 lines
Quoted 5 lines
Quoted 2 lines
	if (IS_ELKHARTLAKE(dev_priv) &&
	    pll->info->id == DPLL_ID_EHL_DPLL4) {

there's probably something else that we can do now with the power_{put,get} to get rid of the, now, doubled if checks...

Don't follow you here Rodrigo.

me neither ;)
I'm just brainstorming... thinking out lout.

Quoted 1 line

Are you suggesting using power_{put/get} to somehow get rid of doubled if?

after this patch, on this path we will do this if check twice. not a big deal, but we can probably do something better.

However I don't understand why we had this get/put here at first place. Only for this platform and only for this pll4. So, what I am wondering is that we have something better to do with the power_well infrastructure in general that would allow us to avoid the if (platform && pll4) in favor of something more generic.

but definitely not a blocker for this patch itself.

Quoted 21 lines
Quoted 12 lines
Quoted 7 lines
drivers/gpu/drm/i915/display/intel_dpll_mgr.c +0 -1
-		enable_reg = MG_PLL_ENABLE(0);
		/*
		 * We need to disable DC states when this DPLL is enabled.
drivers/gpu/drm/i915/display/intel_dpll_mgr.c +0 -0
@@ -4157,11 +4163,10 @@ static void icl_pll_disable(struct

drm_i915_private *dev_priv, static void combo_pll_disable(struct

drm_i915_private *dev_priv,

Quoted 4 lines
			      struct intel_shared_dpll *pll)  {
drivers/gpu/drm/i915/display/intel_dpll_mgr.c +1 -1
-	i915_reg_t enable_reg = CNL_DPLL_ENABLE(pll->info->id);
+	i915_reg_t enable_reg = intel_combo_pll_enable_reg(dev_priv, pll);
Quoted 8 lines
Quoted 4 lines
	if (IS_ELKHARTLAKE(dev_priv) &&
	    pll->info->id == DPLL_ID_EHL_DPLL4) {
drivers/gpu/drm/i915/display/intel_dpll_mgr.c +0 -1
-		enable_reg = MG_PLL_ENABLE(0);
		icl_pll_disable(dev_priv, pll, enable_reg);

but here, at least, let's clean this function now...
move this call above and out of the if and delete the one below and keep just the power_put inside the if...

Quoted 15 lines

Good change. Thanks!
Will change that.

Anusha

Quoted 10 lines
Quoted 2 lines

intel_display_power_put(dev_priv,

POWER_DOMAIN_DPLL_DC_OFF,

Quoted 7 lines

--
2.25.0

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#6 lore raw
Quoted 105 lines

-----Original Message-----
From: Vivi, Rodrigo <[email protected]>
Sent: Wednesday, September 2, 2020 2:32 PM
To: Srivatsa, Anusha <[email protected]>
Cc: [email protected]
Subject: Re: [Intel-gfx] [PATCH] drm/i915/pll: Centralize PLL_ENABLE register lookup

Quoted 1 line

On Sep 2, 2020, at 12:30 PM, Srivatsa, Anusha

Quoted 28 lines · <[email protected]> wrote:
Quoted 28 lines

-----Original Message-----
From: Rodrigo Vivi <[email protected]>
Sent: Tuesday, September 1, 2020 12:30 PM
To: Srivatsa, Anusha <[email protected]>
Cc: [email protected]
Subject: Re: [Intel-gfx] [PATCH] drm/i915/pll: Centralize PLL_ENABLE register lookup

Quoted 16 lines · Anusha Srivatsa

We currenty check for platform at multiple parts in the driver to grab the correct PLL. Let us begin to centralize it through a helper function.

v2: s/intel_get_pll_enable_reg()/intel_combo_pll_enable_reg() (Ville)

---
drivers/gpu/drm/i915/display/intel_dpll_mgr.c | 25
+++++++++++--------

1 file changed, 15 insertions(+), 10 deletions(-)
Quoted 6 lines
Quoted 6 lines

drivers/gpu/drm/i915/display/intel_dpll_mgr.c void assert_shared_dpll(struct

Quoted 6 lines
drivers/gpu/drm/i915/display/intel_dpll_mgr.c +0 -0
index c9013f8f766f..7440836c5e44 100644
@@ -147,6 +147,18 @@ void assert_shared_dpll(struct

drm_i915_private

Quoted 39 lines
Quoted 39 lines

*dev_priv,

drivers/gpu/drm/i915/display/intel_dpll_mgr.c void assert_shared_dpll(struct drm_i915_private *dev_priv,

Quoted 4 lines
drivers/gpu/drm/i915/display/intel_dpll_mgr.c +2 -0
 			pll->info->name, onoff(state), onoff(cur_state));  }
 
+static
+i915_reg_t intel_combo_pll_enable_reg(struct drm_i915_private

*dev_priv,

drivers/gpu/drm/i915/display/intel_dpll_mgr.c void assert_shared_dpll(struct · line 153

Quoted 3 lines
drivers/gpu/drm/i915/display/intel_dpll_mgr.c +3 -0
+				    struct intel_shared_dpll *pll) {
+
+	if (IS_ELKHARTLAKE(dev_priv) && (pll->info->id ==

DPLL_ID_EHL_DPLL4))

drivers/gpu/drm/i915/display/intel_dpll_mgr.c void assert_shared_dpll(struct drm_i915_private *dev_priv,

Quoted 10 lines
drivers/gpu/drm/i915/display/intel_dpll_mgr.c +6 -1
+			return MG_PLL_ENABLE(0);
+
+	return CNL_DPLL_ENABLE(pll->info->id);
+
+
+}
 /**
 * intel_prepare_shared_dpll - call a dpll's prepare hook
 * @crtc_state: CRTC, and its state, which has a shared dpll @@
-3842,12 +3854,7 @@ static bool combo_pll_get_hw_state(struct

drm_i915_private *dev_priv,

Quoted 10 lines
				   struct intel_shared_dpll *pll,
				   struct intel_dpll_hw_state *hw_state)  {
drivers/gpu/drm/i915/display/intel_dpll_mgr.c +1 -6
-	i915_reg_t enable_reg = CNL_DPLL_ENABLE(pll->info->id);
-
-	if (IS_ELKHARTLAKE(dev_priv) &&
-	    pll->info->id == DPLL_ID_EHL_DPLL4) {
-		enable_reg = MG_PLL_ENABLE(0);
-	}
+	i915_reg_t enable_reg = intel_combo_pll_enable_reg(dev_priv, pll);
Quoted 3 lines
	return icl_pll_get_hw_state(dev_priv, pll, hw_state, enable_reg);
} @@ -4045,11 +4052,10 @@ static void icl_pll_enable(struct

drm_i915_private *dev_priv, static void combo_pll_enable(struct

drm_i915_private *dev_priv,

Quoted 4 lines
			     struct intel_shared_dpll *pll)  {
drivers/gpu/drm/i915/display/intel_dpll_mgr.c +1 -1
-	i915_reg_t enable_reg = CNL_DPLL_ENABLE(pll->info->id);
+	i915_reg_t enable_reg = intel_combo_pll_enable_reg(dev_priv, pll);
Quoted 7 lines
Quoted 5 lines
Quoted 2 lines
	if (IS_ELKHARTLAKE(dev_priv) &&
	    pll->info->id == DPLL_ID_EHL_DPLL4) {

there's probably something else that we can do now with the power_{put,get} to get rid of the, now, doubled if checks...

Don't follow you here Rodrigo.

me neither ;)
I'm just brainstorming... thinking out lout.

Quoted 1 line

Are you suggesting using power_{put/get} to somehow get rid of doubled

if?

after this patch, on this path we will do this if check twice. not a big deal, but we can probably do something better.

Quoted 7 lines

However I don't understand why we had this get/put here at first place. Only for this platform and only for this pll4. So, what I am wondering is that we have something better to do with the power_well infrastructure in general that would allow us to avoid the if (platform && pll4) in favor of something more generic.

but definitely not a blocker for this patch itself.

Ok. So maybe the power well infrastructure change can be part a later patch?

Quoted 22 lines
Quoted 22 lines
Quoted 21 lines
Quoted 8 lines
drivers/gpu/drm/i915/display/intel_dpll_mgr.c +0 -1
-		enable_reg = MG_PLL_ENABLE(0);
		/*
		 * We need to disable DC states when this DPLL is enabled.
drivers/gpu/drm/i915/display/intel_dpll_mgr.c +0 -0
@@ -4157,11 +4163,10 @@ static void icl_pll_disable(struct

drm_i915_private *dev_priv, static void combo_pll_disable(struct

drm_i915_private *dev_priv,

Quoted 8 lines
			      struct intel_shared_dpll *pll)  {
drivers/gpu/drm/i915/display/intel_dpll_mgr.c +1 -1
-	i915_reg_t enable_reg = CNL_DPLL_ENABLE(pll->info->id);
+	i915_reg_t enable_reg = intel_combo_pll_enable_reg(dev_priv, pll);
	if (IS_ELKHARTLAKE(dev_priv) &&
	    pll->info->id == DPLL_ID_EHL_DPLL4) {
drivers/gpu/drm/i915/display/intel_dpll_mgr.c +0 -1
-		enable_reg = MG_PLL_ENABLE(0);
		icl_pll_disable(dev_priv, pll, enable_reg);

but here, at least, let's clean this function now... move this call above and out of the if and delete the one below and keep just the power_put inside the if...

Quoted 2 lines
Quoted 2 lines

Good change. Thanks!
Will change that.

With the above code movement, do I have your reviewed-by?

Anusha

Quoted 4 lines
Quoted 4 lines

Anusha

Quoted 2 lines
Quoted 2 lines

intel_display_power_put(dev_priv,

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

POWER_DOMAIN_DPLL_DC_OFF,

Quoted 7 lines

--
2.25.0

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

maintainer Reviewed-by
#7 lore raw
Quoted 109 lines · Anusha
Quoted 106 lines

-----Original Message-----
From: Vivi, Rodrigo <[email protected]>
Sent: Wednesday, September 2, 2020 2:32 PM
To: Srivatsa, Anusha <[email protected]>
Cc: [email protected]
Subject: Re: [Intel-gfx] [PATCH] drm/i915/pll: Centralize PLL_ENABLE register lookup

Quoted 1 line

On Sep 2, 2020, at 12:30 PM, Srivatsa, Anusha

Quoted 28 lines · <[email protected]> wrote:
Quoted 28 lines

-----Original Message-----
From: Rodrigo Vivi <[email protected]>
Sent: Tuesday, September 1, 2020 12:30 PM
To: Srivatsa, Anusha <[email protected]>
Cc: [email protected]
Subject: Re: [Intel-gfx] [PATCH] drm/i915/pll: Centralize PLL_ENABLE register lookup

Quoted 16 lines · Anusha Srivatsa

We currenty check for platform at multiple parts in the driver to grab the correct PLL. Let us begin to centralize it through a helper function.

v2: s/intel_get_pll_enable_reg()/intel_combo_pll_enable_reg() (Ville)

---
drivers/gpu/drm/i915/display/intel_dpll_mgr.c | 25
+++++++++++--------

1 file changed, 15 insertions(+), 10 deletions(-)
Quoted 6 lines
Quoted 6 lines

drivers/gpu/drm/i915/display/intel_dpll_mgr.c void assert_shared_dpll(struct

Quoted 6 lines
drivers/gpu/drm/i915/display/intel_dpll_mgr.c +0 -0
index c9013f8f766f..7440836c5e44 100644
@@ -147,6 +147,18 @@ void assert_shared_dpll(struct

drm_i915_private

Quoted 39 lines
Quoted 39 lines

*dev_priv,

drivers/gpu/drm/i915/display/intel_dpll_mgr.c void assert_shared_dpll(struct drm_i915_private *dev_priv,

Quoted 4 lines
drivers/gpu/drm/i915/display/intel_dpll_mgr.c +2 -0
 			pll->info->name, onoff(state), onoff(cur_state));  }
 
+static
+i915_reg_t intel_combo_pll_enable_reg(struct drm_i915_private

*dev_priv,

drivers/gpu/drm/i915/display/intel_dpll_mgr.c void assert_shared_dpll(struct · line 153

Quoted 3 lines
drivers/gpu/drm/i915/display/intel_dpll_mgr.c +3 -0
+				    struct intel_shared_dpll *pll) {
+
+	if (IS_ELKHARTLAKE(dev_priv) && (pll->info->id ==

DPLL_ID_EHL_DPLL4))

drivers/gpu/drm/i915/display/intel_dpll_mgr.c void assert_shared_dpll(struct drm_i915_private *dev_priv,

Quoted 10 lines
drivers/gpu/drm/i915/display/intel_dpll_mgr.c +6 -1
+			return MG_PLL_ENABLE(0);
+
+	return CNL_DPLL_ENABLE(pll->info->id);
+
+
+}
 /**
 * intel_prepare_shared_dpll - call a dpll's prepare hook
 * @crtc_state: CRTC, and its state, which has a shared dpll @@
-3842,12 +3854,7 @@ static bool combo_pll_get_hw_state(struct

drm_i915_private *dev_priv,

Quoted 10 lines
				   struct intel_shared_dpll *pll,
				   struct intel_dpll_hw_state *hw_state)  {
drivers/gpu/drm/i915/display/intel_dpll_mgr.c +1 -6
-	i915_reg_t enable_reg = CNL_DPLL_ENABLE(pll->info->id);
-
-	if (IS_ELKHARTLAKE(dev_priv) &&
-	    pll->info->id == DPLL_ID_EHL_DPLL4) {
-		enable_reg = MG_PLL_ENABLE(0);
-	}
+	i915_reg_t enable_reg = intel_combo_pll_enable_reg(dev_priv, pll);
Quoted 3 lines
	return icl_pll_get_hw_state(dev_priv, pll, hw_state, enable_reg);
} @@ -4045,11 +4052,10 @@ static void icl_pll_enable(struct

drm_i915_private *dev_priv, static void combo_pll_enable(struct

drm_i915_private *dev_priv,

Quoted 4 lines
			     struct intel_shared_dpll *pll)  {
drivers/gpu/drm/i915/display/intel_dpll_mgr.c +1 -1
-	i915_reg_t enable_reg = CNL_DPLL_ENABLE(pll->info->id);
+	i915_reg_t enable_reg = intel_combo_pll_enable_reg(dev_priv, pll);
Quoted 7 lines
Quoted 5 lines
Quoted 2 lines
	if (IS_ELKHARTLAKE(dev_priv) &&
	    pll->info->id == DPLL_ID_EHL_DPLL4) {

there's probably something else that we can do now with the power_{put,get} to get rid of the, now, doubled if checks...

Don't follow you here Rodrigo.

me neither ;)
I'm just brainstorming... thinking out lout.

Quoted 1 line

Are you suggesting using power_{put/get} to somehow get rid of doubled

if?

after this patch, on this path we will do this if check twice. not a big deal, but we can probably do something better.

Quoted 8 lines
Quoted 7 lines

However I don't understand why we had this get/put here at first place. Only for this platform and only for this pll4. So, what I am wondering is that we have something better to do with the power_well infrastructure in general that would allow us to avoid the if (platform && pll4) in favor of something more generic.

but definitely not a blocker for this patch itself.

Ok. So maybe the power well infrastructure change can be part a later patch?

sure

Quoted 23 lines
Quoted 23 lines
Quoted 23 lines
Quoted 22 lines
Quoted 9 lines
drivers/gpu/drm/i915/display/intel_dpll_mgr.c +0 -1
-		enable_reg = MG_PLL_ENABLE(0);
		/*
		 * We need to disable DC states when this DPLL is enabled.
drivers/gpu/drm/i915/display/intel_dpll_mgr.c +0 -0
@@ -4157,11 +4163,10 @@ static void icl_pll_disable(struct

drm_i915_private *dev_priv, static void combo_pll_disable(struct

drm_i915_private *dev_priv,

Quoted 8 lines
			      struct intel_shared_dpll *pll)  {
drivers/gpu/drm/i915/display/intel_dpll_mgr.c +1 -1
-	i915_reg_t enable_reg = CNL_DPLL_ENABLE(pll->info->id);
+	i915_reg_t enable_reg = intel_combo_pll_enable_reg(dev_priv, pll);
	if (IS_ELKHARTLAKE(dev_priv) &&
	    pll->info->id == DPLL_ID_EHL_DPLL4) {
drivers/gpu/drm/i915/display/intel_dpll_mgr.c +0 -1
-		enable_reg = MG_PLL_ENABLE(0);
		icl_pll_disable(dev_priv, pll, enable_reg);

but here, at least, let's clean this function now... move this call above and out of the if and delete the one below and keep just the power_put inside the if...

Quoted 3 lines
Quoted 2 lines
Quoted 2 lines

Good change. Thanks!
Will change that.

With the above code movement, do I have your reviewed-by?

yes

Quoted 14 lines

Anusha

Quoted 12 lines
Quoted 12 lines

Anusha

Quoted 10 lines
Quoted 2 lines

intel_display_power_put(dev_priv,

POWER_DOMAIN_DPLL_DC_OFF,

Quoted 7 lines

--
2.25.0

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx