* [Intel-gfx] [PATCH] drm/i915/ehl: Donot reuse icl get and put dplls
@ 2020-02-19 23:31 Radhakrishna Sripada
2020-02-20 0:15 ` [Intel-gfx] ✗ Fi.CI.BUILD: failure for " Patchwork
0 siblings, 1 reply; 2+ messages in thread
From: Radhakrishna Sripada @ 2020-02-19 23:31 UTC (permalink / raw)
To: intel-gfx; +Cc: Lucas De Marchi
Elkhartlake does not have as many PLL combinations as Icelake.
Use a simpler get pll function and reuse intel_put_pll for ehl.
Suggested-by: Matt Roper <matthew.d.roper@intel.com>
Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Signed-off-by: Radhakrishna Sripada <radhakrishna.sripada@intel.com>
---
drivers/gpu/drm/i915/display/intel_display.c | 11 +++-
drivers/gpu/drm/i915/display/intel_dpll_mgr.c | 56 +++++++++++++++----
2 files changed, 53 insertions(+), 14 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
index ee7d54ccd3e6..9bb6ccb5b3ea 100644
--- a/drivers/gpu/drm/i915/display/intel_display.c
+++ b/drivers/gpu/drm/i915/display/intel_display.c
@@ -10763,10 +10763,15 @@ static void icl_get_ddi_pll(struct drm_i915_private *dev_priv, enum port port,
return;
}
- pipe_config->icl_port_dplls[port_dpll_id].pll =
- intel_get_shared_dpll_by_id(dev_priv, id);
+ if (!IS_ELKHARTLAKE(dev_priv)) {
+ pipe_config->icl_port_dplls[port_dpll_id].pll =
+ intel_get_shared_dpll_by_id(dev_priv, id);
- icl_set_active_port_dpll(pipe_config, port_dpll_id);
+ icl_set_active_port_dpll(pipe_config, port_dpll_id);
+ } else {
+ pipe_config->shared_dpll =
+ intel_get_shared_dpll_by_id(dev_priv, id);
+ }
}
static void bxt_get_ddi_pll(struct drm_i915_private *dev_priv,
diff --git a/drivers/gpu/drm/i915/display/intel_dpll_mgr.c b/drivers/gpu/drm/i915/display/intel_dpll_mgr.c
index e5bfe5245276..6d79547433f5 100644
--- a/drivers/gpu/drm/i915/display/intel_dpll_mgr.c
+++ b/drivers/gpu/drm/i915/display/intel_dpll_mgr.c
@@ -3016,8 +3016,6 @@ static bool icl_get_combo_phy_dpll(struct intel_atomic_state *state,
intel_atomic_get_new_crtc_state(state, crtc);
struct icl_port_dpll *port_dpll =
&crtc_state->icl_port_dplls[ICL_PORT_DPLL_DEFAULT];
- struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
- enum port port = encoder->port;
unsigned long dpll_mask;
if (!icl_calc_dpll_state(crtc_state, encoder, &port_dpll->hw_state)) {
@@ -3027,13 +3025,7 @@ static bool icl_get_combo_phy_dpll(struct intel_atomic_state *state,
return false;
}
- if (IS_ELKHARTLAKE(dev_priv) && port != PORT_A)
- dpll_mask =
- BIT(DPLL_ID_EHL_DPLL4) |
- BIT(DPLL_ID_ICL_DPLL1) |
- BIT(DPLL_ID_ICL_DPLL0);
- else
- dpll_mask = BIT(DPLL_ID_ICL_DPLL1) | BIT(DPLL_ID_ICL_DPLL0);
+ dpll_mask = BIT(DPLL_ID_ICL_DPLL1) | BIT(DPLL_ID_ICL_DPLL0);
port_dpll->pll = intel_find_shared_dpll(state, crtc,
&port_dpll->hw_state,
@@ -3154,6 +3146,48 @@ static void icl_put_dplls(struct intel_atomic_state *state,
}
}
+static bool ehl_get_dpll(struct intel_atomic_state *state,
+ struct intel_crtc *crtc,
+ struct intel_encoder *encoder)
+{
+ struct intel_crtc_state *crtc_state =
+ intel_atomic_get_new_crtc_state(state, crtc);
+ struct intel_shared_dpll *pll;
+ struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
+ enum port port = encoder->port;
+ unsigned long dpll_mask;
+
+
+ if (!icl_calc_dpll_state(crtc_state, encoder, &crtc_state->dpll_hw_state)) {
+ DRM_DEBUG_KMS("Could not calculate combo PHY PLL state.\n");
+
+ return false;
+ }
+
+ if (IS_ELKHARTLAKE(dev_priv) && port != PORT_A)
+ dpll_mask =
+ BIT(DPLL_ID_EHL_DPLL4) |
+ BIT(DPLL_ID_ICL_DPLL1) |
+ BIT(DPLL_ID_ICL_DPLL0);
+ else
+ dpll_mask = BIT(DPLL_ID_ICL_DPLL1) | BIT(DPLL_ID_ICL_DPLL0);
+
+ pll = intel_find_shared_dpll(state, crtc,
+ &crtc_state->dpll_hw_state,
+ dpll_mask);
+ if (!pll) {
+ DRM_DEBUG_KMS("No PLL selected\n");
+ return false;
+ }
+
+ intel_reference_shared_dpll(state, crtc,
+ pll, &crtc_state->dpll_hw_state);
+
+ crtc_state->shared_dpll = pll;
+
+ return true;
+}
+
static bool mg_pll_get_hw_state(struct drm_i915_private *dev_priv,
struct intel_shared_dpll *pll,
struct intel_dpll_hw_state *hw_state)
@@ -3751,8 +3785,8 @@ static const struct dpll_info ehl_plls[] = {
static const struct intel_dpll_mgr ehl_pll_mgr = {
.dpll_info = ehl_plls,
- .get_dplls = icl_get_dplls,
- .put_dplls = icl_put_dplls,
+ .get_dplls = ehl_get_dpll,
+ .put_dplls = intel_put_dpll,
.dump_hw_state = icl_dump_hw_state,
};
--
2.20.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [Intel-gfx] ✗ Fi.CI.BUILD: failure for drm/i915/ehl: Donot reuse icl get and put dplls
2020-02-19 23:31 [Intel-gfx] [PATCH] drm/i915/ehl: Donot reuse icl get and put dplls Radhakrishna Sripada
@ 2020-02-20 0:15 ` Patchwork
0 siblings, 0 replies; 2+ messages in thread
From: Patchwork @ 2020-02-20 0:15 UTC (permalink / raw)
To: Radhakrishna Sripada; +Cc: intel-gfx
== Series Details ==
Series: drm/i915/ehl: Donot reuse icl get and put dplls
URL : https://patchwork.freedesktop.org/series/73681/
State : failure
== Summary ==
CALL scripts/checksyscalls.sh
CALL scripts/atomic/check-atomics.sh
DESCEND objtool
CHK include/generated/compile.h
CC [M] drivers/gpu/drm/i915/display/intel_dpll_mgr.o
In file included from ./include/drm/drm_mm.h:49:0,
from ./include/drm/drm_vma_manager.h:26,
from ./include/drm/drm_gem.h:40,
from ./drivers/gpu/drm/i915/i915_drv.h:53,
from drivers/gpu/drm/i915/display/intel_display_types.h:46,
from drivers/gpu/drm/i915/display/intel_dpll_mgr.c:24:
drivers/gpu/drm/i915/display/intel_dpll_mgr.c: In function ‘icl_get_combo_phy_dpll’:
drivers/gpu/drm/i915/display/intel_dpll_mgr.c:3022:16: error: ‘dev_priv’ undeclared (first use in this function); did you mean ‘dev_crit’?
drm_dbg_kms(&dev_priv->drm,
^
./include/drm/drm_print.h:432:15: note: in definition of macro ‘drm_dbg_kms’
drm_dev_dbg((drm)->dev, DRM_UT_KMS, fmt, ##__VA_ARGS__)
^~~
drivers/gpu/drm/i915/display/intel_dpll_mgr.c:3022:16: note: each undeclared identifier is reported only once for each function it appears in
drm_dbg_kms(&dev_priv->drm,
^
./include/drm/drm_print.h:432:15: note: in definition of macro ‘drm_dbg_kms’
drm_dev_dbg((drm)->dev, DRM_UT_KMS, fmt, ##__VA_ARGS__)
^~~
scripts/Makefile.build:267: recipe for target 'drivers/gpu/drm/i915/display/intel_dpll_mgr.o' failed
make[4]: *** [drivers/gpu/drm/i915/display/intel_dpll_mgr.o] Error 1
scripts/Makefile.build:505: recipe for target 'drivers/gpu/drm/i915' failed
make[3]: *** [drivers/gpu/drm/i915] Error 2
scripts/Makefile.build:505: recipe for target 'drivers/gpu/drm' failed
make[2]: *** [drivers/gpu/drm] Error 2
scripts/Makefile.build:505: recipe for target 'drivers/gpu' failed
make[1]: *** [drivers/gpu] Error 2
Makefile:1681: recipe for target 'drivers' failed
make: *** [drivers] Error 2
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-02-20 0:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-19 23:31 [Intel-gfx] [PATCH] drm/i915/ehl: Donot reuse icl get and put dplls Radhakrishna Sripada
2020-02-20 0:15 ` [Intel-gfx] ✗ Fi.CI.BUILD: failure for " Patchwork
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).