Commit a919ff14 authored by Ander Conselvan de Oliveira's avatar Ander Conselvan de Oliveira Committed by Daniel Vetter

drm/i915: Make *_find_best_dpll() take an intel_crtc insted of drm_crtc

For consistency, since that's the rule followed for internal functions.
Signed-off-by: default avatarAnder Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent 6e2cc096
...@@ -460,7 +460,7 @@ struct drm_i915_display_funcs { ...@@ -460,7 +460,7 @@ struct drm_i915_display_funcs {
* Returns true on success, false on failure. * Returns true on success, false on failure.
*/ */
bool (*find_dpll)(const struct intel_limit *limit, bool (*find_dpll)(const struct intel_limit *limit,
struct drm_crtc *crtc, struct intel_crtc *crtc,
int target, int refclk, int target, int refclk,
struct dpll *match_clock, struct dpll *match_clock,
struct dpll *best_clock); struct dpll *best_clock);
......
...@@ -576,15 +576,15 @@ static bool intel_PLL_is_valid(struct drm_device *dev, ...@@ -576,15 +576,15 @@ static bool intel_PLL_is_valid(struct drm_device *dev,
} }
static bool static bool
i9xx_find_best_dpll(const intel_limit_t *limit, struct drm_crtc *crtc, i9xx_find_best_dpll(const intel_limit_t *limit, struct intel_crtc *crtc,
int target, int refclk, intel_clock_t *match_clock, int target, int refclk, intel_clock_t *match_clock,
intel_clock_t *best_clock) intel_clock_t *best_clock)
{ {
struct drm_device *dev = crtc->dev; struct drm_device *dev = crtc->base.dev;
intel_clock_t clock; intel_clock_t clock;
int err = target; int err = target;
if (intel_pipe_has_type(crtc, INTEL_OUTPUT_LVDS)) { if (intel_pipe_has_type(&crtc->base, INTEL_OUTPUT_LVDS)) {
/* /*
* For LVDS just rely on its current settings for dual-channel. * For LVDS just rely on its current settings for dual-channel.
* We haven't figured out how to reliably set up different * We haven't figured out how to reliably set up different
...@@ -637,15 +637,15 @@ i9xx_find_best_dpll(const intel_limit_t *limit, struct drm_crtc *crtc, ...@@ -637,15 +637,15 @@ i9xx_find_best_dpll(const intel_limit_t *limit, struct drm_crtc *crtc,
} }
static bool static bool
pnv_find_best_dpll(const intel_limit_t *limit, struct drm_crtc *crtc, pnv_find_best_dpll(const intel_limit_t *limit, struct intel_crtc *crtc,
int target, int refclk, intel_clock_t *match_clock, int target, int refclk, intel_clock_t *match_clock,
intel_clock_t *best_clock) intel_clock_t *best_clock)
{ {
struct drm_device *dev = crtc->dev; struct drm_device *dev = crtc->base.dev;
intel_clock_t clock; intel_clock_t clock;
int err = target; int err = target;
if (intel_pipe_has_type(crtc, INTEL_OUTPUT_LVDS)) { if (intel_pipe_has_type(&crtc->base, INTEL_OUTPUT_LVDS)) {
/* /*
* For LVDS just rely on its current settings for dual-channel. * For LVDS just rely on its current settings for dual-channel.
* We haven't figured out how to reliably set up different * We haven't figured out how to reliably set up different
...@@ -696,11 +696,11 @@ pnv_find_best_dpll(const intel_limit_t *limit, struct drm_crtc *crtc, ...@@ -696,11 +696,11 @@ pnv_find_best_dpll(const intel_limit_t *limit, struct drm_crtc *crtc,
} }
static bool static bool
g4x_find_best_dpll(const intel_limit_t *limit, struct drm_crtc *crtc, g4x_find_best_dpll(const intel_limit_t *limit, struct intel_crtc *crtc,
int target, int refclk, intel_clock_t *match_clock, int target, int refclk, intel_clock_t *match_clock,
intel_clock_t *best_clock) intel_clock_t *best_clock)
{ {
struct drm_device *dev = crtc->dev; struct drm_device *dev = crtc->base.dev;
intel_clock_t clock; intel_clock_t clock;
int max_n; int max_n;
bool found; bool found;
...@@ -708,7 +708,7 @@ g4x_find_best_dpll(const intel_limit_t *limit, struct drm_crtc *crtc, ...@@ -708,7 +708,7 @@ g4x_find_best_dpll(const intel_limit_t *limit, struct drm_crtc *crtc,
int err_most = (target >> 8) + (target >> 9); int err_most = (target >> 8) + (target >> 9);
found = false; found = false;
if (intel_pipe_has_type(crtc, INTEL_OUTPUT_LVDS)) { if (intel_pipe_has_type(&crtc->base, INTEL_OUTPUT_LVDS)) {
if (intel_is_dual_link_lvds(dev)) if (intel_is_dual_link_lvds(dev))
clock.p2 = limit->p2.p2_fast; clock.p2 = limit->p2.p2_fast;
else else
...@@ -753,11 +753,11 @@ g4x_find_best_dpll(const intel_limit_t *limit, struct drm_crtc *crtc, ...@@ -753,11 +753,11 @@ g4x_find_best_dpll(const intel_limit_t *limit, struct drm_crtc *crtc,
} }
static bool static bool
vlv_find_best_dpll(const intel_limit_t *limit, struct drm_crtc *crtc, vlv_find_best_dpll(const intel_limit_t *limit, struct intel_crtc *crtc,
int target, int refclk, intel_clock_t *match_clock, int target, int refclk, intel_clock_t *match_clock,
intel_clock_t *best_clock) intel_clock_t *best_clock)
{ {
struct drm_device *dev = crtc->dev; struct drm_device *dev = crtc->base.dev;
intel_clock_t clock; intel_clock_t clock;
unsigned int bestppm = 1000000; unsigned int bestppm = 1000000;
/* min update 19.2 MHz */ /* min update 19.2 MHz */
...@@ -810,11 +810,11 @@ vlv_find_best_dpll(const intel_limit_t *limit, struct drm_crtc *crtc, ...@@ -810,11 +810,11 @@ vlv_find_best_dpll(const intel_limit_t *limit, struct drm_crtc *crtc,
} }
static bool static bool
chv_find_best_dpll(const intel_limit_t *limit, struct drm_crtc *crtc, chv_find_best_dpll(const intel_limit_t *limit, struct intel_crtc *crtc,
int target, int refclk, intel_clock_t *match_clock, int target, int refclk, intel_clock_t *match_clock,
intel_clock_t *best_clock) intel_clock_t *best_clock)
{ {
struct drm_device *dev = crtc->dev; struct drm_device *dev = crtc->base.dev;
intel_clock_t clock; intel_clock_t clock;
uint64_t m2; uint64_t m2;
int found = false; int found = false;
...@@ -6284,7 +6284,7 @@ static int i9xx_crtc_mode_set(struct drm_crtc *crtc, ...@@ -6284,7 +6284,7 @@ static int i9xx_crtc_mode_set(struct drm_crtc *crtc,
* 2) / p1 / p2. * 2) / p1 / p2.
*/ */
limit = intel_limit(crtc, refclk); limit = intel_limit(crtc, refclk);
ok = dev_priv->display.find_dpll(limit, crtc, ok = dev_priv->display.find_dpll(limit, intel_crtc,
intel_crtc->config.port_clock, intel_crtc->config.port_clock,
refclk, NULL, &clock); refclk, NULL, &clock);
if (!ok) { if (!ok) {
...@@ -6300,7 +6300,7 @@ static int i9xx_crtc_mode_set(struct drm_crtc *crtc, ...@@ -6300,7 +6300,7 @@ static int i9xx_crtc_mode_set(struct drm_crtc *crtc,
* we will disable the LVDS downclock feature. * we will disable the LVDS downclock feature.
*/ */
has_reduced_clock = has_reduced_clock =
dev_priv->display.find_dpll(limit, crtc, dev_priv->display.find_dpll(limit, intel_crtc,
dev_priv->lvds_downclock, dev_priv->lvds_downclock,
refclk, &clock, refclk, &clock,
&reduced_clock); &reduced_clock);
...@@ -7110,6 +7110,7 @@ static bool ironlake_compute_clocks(struct drm_crtc *crtc, ...@@ -7110,6 +7110,7 @@ static bool ironlake_compute_clocks(struct drm_crtc *crtc,
{ {
struct drm_device *dev = crtc->dev; struct drm_device *dev = crtc->dev;
struct drm_i915_private *dev_priv = dev->dev_private; struct drm_i915_private *dev_priv = dev->dev_private;
struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
int refclk; int refclk;
const intel_limit_t *limit; const intel_limit_t *limit;
bool ret, is_lvds = false; bool ret, is_lvds = false;
...@@ -7124,8 +7125,8 @@ static bool ironlake_compute_clocks(struct drm_crtc *crtc, ...@@ -7124,8 +7125,8 @@ static bool ironlake_compute_clocks(struct drm_crtc *crtc,
* reflck * (5 * (m1 + 2) + (m2 + 2)) / (n + 2) / p1 / p2. * reflck * (5 * (m1 + 2) + (m2 + 2)) / (n + 2) / p1 / p2.
*/ */
limit = intel_limit(crtc, refclk); limit = intel_limit(crtc, refclk);
ret = dev_priv->display.find_dpll(limit, crtc, ret = dev_priv->display.find_dpll(limit, intel_crtc,
to_intel_crtc(crtc)->config.port_clock, intel_crtc->config.port_clock,
refclk, NULL, clock); refclk, NULL, clock);
if (!ret) if (!ret)
return false; return false;
...@@ -7138,7 +7139,7 @@ static bool ironlake_compute_clocks(struct drm_crtc *crtc, ...@@ -7138,7 +7139,7 @@ static bool ironlake_compute_clocks(struct drm_crtc *crtc,
* downclock feature. * downclock feature.
*/ */
*has_reduced_clock = *has_reduced_clock =
dev_priv->display.find_dpll(limit, crtc, dev_priv->display.find_dpll(limit, intel_crtc,
dev_priv->lvds_downclock, dev_priv->lvds_downclock,
refclk, clock, refclk, clock,
reduced_clock); reduced_clock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment