Commit ee1398ba authored by Lucas De Marchi's avatar Lucas De Marchi Committed by Rodrigo Vivi

drm/i915: use funcs from intel_shared_dpll.info

Replace all users of pll->funcs.* to use
pll->info->funcs->*. The extra indirection here is not on any critical
path and we can leave all const data together.
Signed-off-by: default avatarLucas De Marchi <lucas.demarchi@intel.com>
Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180320220637.21480-4-lucas.demarchi@intel.com
parent e3037963
...@@ -8763,8 +8763,8 @@ static bool ironlake_get_pipe_config(struct intel_crtc *crtc, ...@@ -8763,8 +8763,8 @@ static bool ironlake_get_pipe_config(struct intel_crtc *crtc,
intel_get_shared_dpll_by_id(dev_priv, pll_id); intel_get_shared_dpll_by_id(dev_priv, pll_id);
pll = pipe_config->shared_dpll; pll = pipe_config->shared_dpll;
WARN_ON(!pll->funcs.get_hw_state(dev_priv, pll, WARN_ON(!pll->info->funcs->get_hw_state(dev_priv, pll,
&pipe_config->dpll_hw_state)); &pipe_config->dpll_hw_state));
tmp = pipe_config->dpll_hw_state.dpll; tmp = pipe_config->dpll_hw_state.dpll;
pipe_config->pixel_multiplier = pipe_config->pixel_multiplier =
...@@ -9240,8 +9240,8 @@ static void haswell_get_ddi_port_state(struct intel_crtc *crtc, ...@@ -9240,8 +9240,8 @@ static void haswell_get_ddi_port_state(struct intel_crtc *crtc,
pll = pipe_config->shared_dpll; pll = pipe_config->shared_dpll;
if (pll) { if (pll) {
WARN_ON(!pll->funcs.get_hw_state(dev_priv, pll, WARN_ON(!pll->info->funcs->get_hw_state(dev_priv, pll,
&pipe_config->dpll_hw_state)); &pipe_config->dpll_hw_state));
} }
/* /*
...@@ -11655,7 +11655,7 @@ verify_single_dpll_state(struct drm_i915_private *dev_priv, ...@@ -11655,7 +11655,7 @@ verify_single_dpll_state(struct drm_i915_private *dev_priv,
DRM_DEBUG_KMS("%s\n", pll->name); DRM_DEBUG_KMS("%s\n", pll->name);
active = pll->funcs.get_hw_state(dev_priv, pll, &dpll_hw_state); active = pll->info->funcs->get_hw_state(dev_priv, pll, &dpll_hw_state);
if (!(pll->flags & INTEL_DPLL_ALWAYS_ON)) { if (!(pll->flags & INTEL_DPLL_ALWAYS_ON)) {
I915_STATE_WARN(!pll->on && pll->active_mask, I915_STATE_WARN(!pll->on && pll->active_mask,
...@@ -15128,8 +15128,8 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev) ...@@ -15128,8 +15128,8 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev)
for (i = 0; i < dev_priv->num_shared_dpll; i++) { for (i = 0; i < dev_priv->num_shared_dpll; i++) {
struct intel_shared_dpll *pll = &dev_priv->shared_dplls[i]; struct intel_shared_dpll *pll = &dev_priv->shared_dplls[i];
pll->on = pll->funcs.get_hw_state(dev_priv, pll, pll->on = pll->info->funcs->get_hw_state(dev_priv, pll,
&pll->state.hw_state); &pll->state.hw_state);
pll->state.crtc_mask = 0; pll->state.crtc_mask = 0;
for_each_intel_crtc(dev, crtc) { for_each_intel_crtc(dev, crtc) {
struct intel_crtc_state *crtc_state = struct intel_crtc_state *crtc_state =
...@@ -15318,7 +15318,7 @@ intel_modeset_setup_hw_state(struct drm_device *dev, ...@@ -15318,7 +15318,7 @@ intel_modeset_setup_hw_state(struct drm_device *dev,
DRM_DEBUG_KMS("%s enabled but not in use, disabling\n", pll->name); DRM_DEBUG_KMS("%s enabled but not in use, disabling\n", pll->name);
pll->funcs.disable(dev_priv, pll); pll->info->funcs->disable(dev_priv, pll);
pll->on = false; pll->on = false;
} }
......
...@@ -118,7 +118,7 @@ void assert_shared_dpll(struct drm_i915_private *dev_priv, ...@@ -118,7 +118,7 @@ void assert_shared_dpll(struct drm_i915_private *dev_priv,
if (WARN(!pll, "asserting DPLL %s with no DPLL\n", onoff(state))) if (WARN(!pll, "asserting DPLL %s with no DPLL\n", onoff(state)))
return; return;
cur_state = pll->funcs.get_hw_state(dev_priv, pll, &hw_state); cur_state = pll->info->funcs->get_hw_state(dev_priv, pll, &hw_state);
I915_STATE_WARN(cur_state != state, I915_STATE_WARN(cur_state != state,
"%s assertion failure (expected %s, current %s)\n", "%s assertion failure (expected %s, current %s)\n",
pll->name, onoff(state), onoff(cur_state)); pll->name, onoff(state), onoff(cur_state));
...@@ -147,7 +147,7 @@ void intel_prepare_shared_dpll(struct intel_crtc *crtc) ...@@ -147,7 +147,7 @@ void intel_prepare_shared_dpll(struct intel_crtc *crtc)
WARN_ON(pll->on); WARN_ON(pll->on);
assert_shared_dpll_disabled(dev_priv, pll); assert_shared_dpll_disabled(dev_priv, pll);
pll->funcs.prepare(dev_priv, pll); pll->info->funcs->prepare(dev_priv, pll);
} }
mutex_unlock(&dev_priv->dpll_lock); mutex_unlock(&dev_priv->dpll_lock);
} }
...@@ -190,7 +190,7 @@ void intel_enable_shared_dpll(struct intel_crtc *crtc) ...@@ -190,7 +190,7 @@ void intel_enable_shared_dpll(struct intel_crtc *crtc)
WARN_ON(pll->on); WARN_ON(pll->on);
DRM_DEBUG_KMS("enabling %s\n", pll->name); DRM_DEBUG_KMS("enabling %s\n", pll->name);
pll->funcs.enable(dev_priv, pll); pll->info->funcs->enable(dev_priv, pll);
pll->on = true; pll->on = true;
out: out:
...@@ -232,7 +232,7 @@ void intel_disable_shared_dpll(struct intel_crtc *crtc) ...@@ -232,7 +232,7 @@ void intel_disable_shared_dpll(struct intel_crtc *crtc)
goto out; goto out;
DRM_DEBUG_KMS("disabling %s\n", pll->name); DRM_DEBUG_KMS("disabling %s\n", pll->name);
pll->funcs.disable(dev_priv, pll); pll->info->funcs->disable(dev_priv, pll);
pll->on = false; pll->on = false;
out: out:
...@@ -2414,7 +2414,6 @@ void intel_shared_dpll_init(struct drm_device *dev) ...@@ -2414,7 +2414,6 @@ void intel_shared_dpll_init(struct drm_device *dev)
dev_priv->shared_dplls[i].id = dpll_info[i].id; dev_priv->shared_dplls[i].id = dpll_info[i].id;
dev_priv->shared_dplls[i].name = dpll_info[i].name; dev_priv->shared_dplls[i].name = dpll_info[i].name;
dev_priv->shared_dplls[i].funcs = *dpll_info[i].funcs;
dev_priv->shared_dplls[i].flags = dpll_info[i].flags; dev_priv->shared_dplls[i].flags = dpll_info[i].flags;
} }
......
...@@ -211,6 +211,9 @@ struct intel_shared_dpll_funcs { ...@@ -211,6 +211,9 @@ struct intel_shared_dpll_funcs {
struct dpll_info { struct dpll_info {
const char *name; const char *name;
const int id; const int id;
/**
* @funcs: platform specific hooks
*/
const struct intel_shared_dpll_funcs *funcs; const struct intel_shared_dpll_funcs *funcs;
uint32_t flags; uint32_t flags;
}; };
...@@ -248,11 +251,6 @@ struct intel_shared_dpll { ...@@ -248,11 +251,6 @@ struct intel_shared_dpll {
*/ */
enum intel_dpll_id id; enum intel_dpll_id id;
/**
* @funcs: platform specific hooks
*/
struct intel_shared_dpll_funcs funcs;
/** /**
* @info: platform specific info * @info: platform specific info
*/ */
......
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