Commit 65edccce authored by Ville Syrjälä's avatar Ville Syrjälä

drm/i915: Pass dev_priv to skl_init_scalers()

Unify our approach to things by passing around dev_priv instead of dev.
While at it let's do some house cleaning: s/intel_foo/foo/ and move
things into tighter scope.
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1477946245-14134-3-git-send-email-ville.syrjala@linux.intel.comReviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
parent 580503c7
...@@ -115,8 +115,9 @@ static void chv_prepare_pll(struct intel_crtc *crtc, ...@@ -115,8 +115,9 @@ static void chv_prepare_pll(struct intel_crtc *crtc,
const struct intel_crtc_state *pipe_config); const struct intel_crtc_state *pipe_config);
static void intel_begin_crtc_commit(struct drm_crtc *, struct drm_crtc_state *); static void intel_begin_crtc_commit(struct drm_crtc *, struct drm_crtc_state *);
static void intel_finish_crtc_commit(struct drm_crtc *, struct drm_crtc_state *); static void intel_finish_crtc_commit(struct drm_crtc *, struct drm_crtc_state *);
static void skl_init_scalers(struct drm_device *dev, struct intel_crtc *intel_crtc, static void skl_init_scalers(struct drm_i915_private *dev_priv,
struct intel_crtc_state *crtc_state); struct intel_crtc *crtc,
struct intel_crtc_state *crtc_state);
static void skylake_pfit_enable(struct intel_crtc *crtc); static void skylake_pfit_enable(struct intel_crtc *crtc);
static void ironlake_pfit_disable(struct intel_crtc *crtc, bool force); static void ironlake_pfit_disable(struct intel_crtc *crtc, bool force);
static void ironlake_pfit_enable(struct intel_crtc *crtc); static void ironlake_pfit_enable(struct intel_crtc *crtc);
...@@ -10735,10 +10736,8 @@ static bool haswell_get_pipe_config(struct intel_crtc *crtc, ...@@ -10735,10 +10736,8 @@ static bool haswell_get_pipe_config(struct intel_crtc *crtc,
I915_READ(GAMMA_MODE(crtc->pipe)) & GAMMA_MODE_MODE_MASK; I915_READ(GAMMA_MODE(crtc->pipe)) & GAMMA_MODE_MODE_MASK;
if (INTEL_INFO(dev)->gen >= 9) { if (INTEL_INFO(dev)->gen >= 9) {
skl_init_scalers(dev, crtc, pipe_config); skl_init_scalers(dev_priv, crtc, pipe_config);
}
if (INTEL_INFO(dev)->gen >= 9) {
pipe_config->scaler_state.scaler_id = -1; pipe_config->scaler_state.scaler_id = -1;
pipe_config->scaler_state.scaler_users &= ~(1 << SKL_CRTC_INDEX); pipe_config->scaler_state.scaler_users &= ~(1 << SKL_CRTC_INDEX);
} }
...@@ -15222,17 +15221,19 @@ intel_cursor_plane_create(struct drm_i915_private *dev_priv, enum pipe pipe) ...@@ -15222,17 +15221,19 @@ intel_cursor_plane_create(struct drm_i915_private *dev_priv, enum pipe pipe)
return ERR_PTR(ret); return ERR_PTR(ret);
} }
static void skl_init_scalers(struct drm_device *dev, struct intel_crtc *intel_crtc, static void skl_init_scalers(struct drm_i915_private *dev_priv,
struct intel_crtc_state *crtc_state) struct intel_crtc *crtc,
struct intel_crtc_state *crtc_state)
{ {
struct intel_crtc_scaler_state *scaler_state =
&crtc_state->scaler_state;
int i; int i;
struct intel_scaler *intel_scaler;
struct intel_crtc_scaler_state *scaler_state = &crtc_state->scaler_state;
for (i = 0; i < intel_crtc->num_scalers; i++) { for (i = 0; i < crtc->num_scalers; i++) {
intel_scaler = &scaler_state->scalers[i]; struct intel_scaler *scaler = &scaler_state->scalers[i];
intel_scaler->in_use = 0;
intel_scaler->mode = PS_SCALER_MODE_DYN; scaler->in_use = 0;
scaler->mode = PS_SCALER_MODE_DYN;
} }
scaler_state->scaler_id = -1; scaler_state->scaler_id = -1;
...@@ -15267,7 +15268,7 @@ static int intel_crtc_init(struct drm_device *dev, enum pipe pipe) ...@@ -15267,7 +15268,7 @@ static int intel_crtc_init(struct drm_device *dev, enum pipe pipe)
else else
intel_crtc->num_scalers = SKL_NUM_SCALERS; intel_crtc->num_scalers = SKL_NUM_SCALERS;
skl_init_scalers(dev, intel_crtc, crtc_state); skl_init_scalers(dev_priv, intel_crtc, crtc_state);
} }
primary = intel_primary_plane_create(dev_priv, pipe); primary = intel_primary_plane_create(dev_priv, pipe);
......
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