drm/i915/icl: keep track of unused pll while looping
Instead of looping again on the range of plls, just keep track of one unused one and use it later. Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com> Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20190125222444.19926-5-lucas.demarchi@intel.com
This commit is contained in:
parent
20fd2ab7be
commit
5b0bd14dcc
@ -247,7 +247,7 @@ intel_find_shared_dpll(struct intel_crtc *crtc,
|
|||||||
enum intel_dpll_id range_max)
|
enum intel_dpll_id range_max)
|
||||||
{
|
{
|
||||||
struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
|
struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
|
||||||
struct intel_shared_dpll *pll;
|
struct intel_shared_dpll *pll, *unused_pll = NULL;
|
||||||
struct intel_shared_dpll_state *shared_dpll;
|
struct intel_shared_dpll_state *shared_dpll;
|
||||||
enum intel_dpll_id i;
|
enum intel_dpll_id i;
|
||||||
|
|
||||||
@ -257,8 +257,10 @@ intel_find_shared_dpll(struct intel_crtc *crtc,
|
|||||||
pll = &dev_priv->shared_dplls[i];
|
pll = &dev_priv->shared_dplls[i];
|
||||||
|
|
||||||
/* Only want to check enabled timings first */
|
/* Only want to check enabled timings first */
|
||||||
if (shared_dpll[i].crtc_mask == 0)
|
if (shared_dpll[i].crtc_mask == 0) {
|
||||||
|
unused_pll = pll;
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (memcmp(&crtc_state->dpll_hw_state,
|
if (memcmp(&crtc_state->dpll_hw_state,
|
||||||
&shared_dpll[i].hw_state,
|
&shared_dpll[i].hw_state,
|
||||||
@ -273,14 +275,11 @@ intel_find_shared_dpll(struct intel_crtc *crtc,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Ok no matching timings, maybe there's a free one? */
|
/* Ok no matching timings, maybe there's a free one? */
|
||||||
for (i = range_min; i <= range_max; i++) {
|
if (unused_pll) {
|
||||||
pll = &dev_priv->shared_dplls[i];
|
DRM_DEBUG_KMS("[CRTC:%d:%s] allocated %s\n",
|
||||||
if (shared_dpll[i].crtc_mask == 0) {
|
crtc->base.base.id, crtc->base.name,
|
||||||
DRM_DEBUG_KMS("[CRTC:%d:%s] allocated %s\n",
|
unused_pll->info->name);
|
||||||
crtc->base.base.id, crtc->base.name,
|
return unused_pll;
|
||||||
pll->info->name);
|
|
||||||
return pll;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user