drm/i915: Pass dev_priv to vlv force pll functions

Unify our approach to things by passing around dev_priv instead of dev.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1477946245-14134-9-git-send-email-ville.syrjala@linux.intel.com
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Ville Syrjälä 2016-10-31 22:37:07 +02:00
parent 0f0f74bc83
commit 30ad9814d5
3 changed files with 12 additions and 13 deletions

View File

@ -8103,10 +8103,10 @@ static void chv_prepare_pll(struct intel_crtc *crtc,
* in cases where we need the PLL enabled even when @pipe is not going to * in cases where we need the PLL enabled even when @pipe is not going to
* be enabled. * be enabled.
*/ */
int vlv_force_pll_on(struct drm_device *dev, enum pipe pipe, int vlv_force_pll_on(struct drm_i915_private *dev_priv, enum pipe pipe,
const struct dpll *dpll) const struct dpll *dpll)
{ {
struct intel_crtc *crtc = intel_get_crtc_for_pipe(dev, pipe); struct intel_crtc *crtc = intel_get_crtc_for_pipe(&dev_priv->drm, pipe);
struct intel_crtc_state *pipe_config; struct intel_crtc_state *pipe_config;
pipe_config = kzalloc(sizeof(*pipe_config), GFP_KERNEL); pipe_config = kzalloc(sizeof(*pipe_config), GFP_KERNEL);
@ -8117,7 +8117,7 @@ int vlv_force_pll_on(struct drm_device *dev, enum pipe pipe,
pipe_config->pixel_multiplier = 1; pipe_config->pixel_multiplier = 1;
pipe_config->dpll = *dpll; pipe_config->dpll = *dpll;
if (IS_CHERRYVIEW(to_i915(dev))) { if (IS_CHERRYVIEW(dev_priv)) {
chv_compute_dpll(crtc, pipe_config); chv_compute_dpll(crtc, pipe_config);
chv_prepare_pll(crtc, pipe_config); chv_prepare_pll(crtc, pipe_config);
chv_enable_pll(crtc, pipe_config); chv_enable_pll(crtc, pipe_config);
@ -8140,12 +8140,12 @@ int vlv_force_pll_on(struct drm_device *dev, enum pipe pipe,
* Disable the PLL for @pipe. To be used in cases where we need * Disable the PLL for @pipe. To be used in cases where we need
* the PLL enabled even when @pipe is not going to be enabled. * the PLL enabled even when @pipe is not going to be enabled.
*/ */
void vlv_force_pll_off(struct drm_device *dev, enum pipe pipe) void vlv_force_pll_off(struct drm_i915_private *dev_priv, enum pipe pipe)
{ {
if (IS_CHERRYVIEW(to_i915(dev))) if (IS_CHERRYVIEW(dev_priv))
chv_disable_pll(to_i915(dev), pipe); chv_disable_pll(dev_priv, pipe);
else else
vlv_disable_pll(to_i915(dev), pipe); vlv_disable_pll(dev_priv, pipe);
} }
static void i9xx_compute_dpll(struct intel_crtc *crtc, static void i9xx_compute_dpll(struct intel_crtc *crtc,

View File

@ -395,8 +395,7 @@ static void
vlv_power_sequencer_kick(struct intel_dp *intel_dp) vlv_power_sequencer_kick(struct intel_dp *intel_dp)
{ {
struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp); struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);
struct drm_device *dev = intel_dig_port->base.base.dev; struct drm_i915_private *dev_priv = to_i915(intel_dig_port->base.base.dev);
struct drm_i915_private *dev_priv = to_i915(dev);
enum pipe pipe = intel_dp->pps_pipe; enum pipe pipe = intel_dp->pps_pipe;
bool pll_enabled, release_cl_override = false; bool pll_enabled, release_cl_override = false;
enum dpio_phy phy = DPIO_PHY(pipe); enum dpio_phy phy = DPIO_PHY(pipe);
@ -434,7 +433,7 @@ vlv_power_sequencer_kick(struct intel_dp *intel_dp)
release_cl_override = IS_CHERRYVIEW(dev_priv) && release_cl_override = IS_CHERRYVIEW(dev_priv) &&
!chv_phy_powergate_ch(dev_priv, phy, ch, true); !chv_phy_powergate_ch(dev_priv, phy, ch, true);
if (vlv_force_pll_on(dev, pipe, IS_CHERRYVIEW(dev_priv) ? if (vlv_force_pll_on(dev_priv, pipe, IS_CHERRYVIEW(dev_priv) ?
&chv_dpll[0].dpll : &vlv_dpll[0].dpll)) { &chv_dpll[0].dpll : &vlv_dpll[0].dpll)) {
DRM_ERROR("Failed to force on pll for pipe %c!\n", DRM_ERROR("Failed to force on pll for pipe %c!\n",
pipe_name(pipe)); pipe_name(pipe));
@ -458,7 +457,7 @@ vlv_power_sequencer_kick(struct intel_dp *intel_dp)
POSTING_READ(intel_dp->output_reg); POSTING_READ(intel_dp->output_reg);
if (!pll_enabled) { if (!pll_enabled) {
vlv_force_pll_off(dev, pipe); vlv_force_pll_off(dev_priv, pipe);
if (release_cl_override) if (release_cl_override)
chv_phy_powergate_ch(dev_priv, phy, ch, false); chv_phy_powergate_ch(dev_priv, phy, ch, false);

View File

@ -1301,9 +1301,9 @@ unsigned int intel_tile_height(const struct drm_i915_private *dev_priv,
void assert_pch_transcoder_disabled(struct drm_i915_private *dev_priv, void assert_pch_transcoder_disabled(struct drm_i915_private *dev_priv,
enum pipe pipe); enum pipe pipe);
int vlv_force_pll_on(struct drm_device *dev, enum pipe pipe, int vlv_force_pll_on(struct drm_i915_private *dev_priv, enum pipe pipe,
const struct dpll *dpll); const struct dpll *dpll);
void vlv_force_pll_off(struct drm_device *dev, enum pipe pipe); void vlv_force_pll_off(struct drm_i915_private *dev_priv, enum pipe pipe);
int lpt_get_iclkip(struct drm_i915_private *dev_priv); int lpt_get_iclkip(struct drm_i915_private *dev_priv);
/* modesetting asserts */ /* modesetting asserts */