[Intel-gfx] [PATCH 6/9] drm/i915: refactor pll code out into intel_dpll_legacy.c

Ville Syrjälä ville.syrjala at linux.intel.com
Thu Dec 10 15:18:54 UTC 2020


On Thu, Dec 10, 2020 at 02:17:52PM +1000, Dave Airlie wrote:
> From: Dave Airlie <airlied at redhat.com>
> 
> This pulls a large chunk of the pll calculation code out of
> intel_display.c to a new file.
> 
> One function makse sense to be an inline, otherwise this
> is pretty much a straight copy cover. also all the
> remaining hooks for g45 and older end up the same now.
> 
> Signed-off-by: Dave Airlie <airlied at redhat.com>
> ---
>  drivers/gpu/drm/i915/Makefile                 |    1 +
>  drivers/gpu/drm/i915/display/intel_display.c  | 1393 +----------------
>  drivers/gpu/drm/i915/display/intel_display.h  |   13 +-
>  .../drm/i915/display/intel_display_types.h    |    5 +
>  .../gpu/drm/i915/display/intel_dpll_legacy.c  | 1370 ++++++++++++++++
>  5 files changed, 1398 insertions(+), 1384 deletions(-)
>  create mode 100644 drivers/gpu/drm/i915/display/intel_dpll_legacy.c
> 
<snip>
> +static int hsw_crtc_compute_clock(struct intel_crtc *crtc,
> +				  struct intel_crtc_state *crtc_state)
> +{
> +	struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
> +	struct intel_atomic_state *state =
> +		to_intel_atomic_state(crtc_state->uapi.state);
> +
> +	if (!intel_crtc_has_type(crtc_state, INTEL_OUTPUT_DSI) ||
> +	    INTEL_GEN(dev_priv) >= 11) {
> +		struct intel_encoder *encoder =
> +			intel_get_crtc_new_encoder(state, crtc_state);
> +
> +		if (!intel_reserve_shared_dplls(state, crtc, encoder)) {
> +			drm_dbg_kms(&dev_priv->drm,
> +				    "failed to find PLL for pipe %c\n",
> +				    pipe_name(crtc->pipe));
> +			return -EINVAL;
> +		}
> +	}
> +
> +	return 0;
> +}

If you're moving this then the "legacy" in the fine name is just
wrong. I guess just call it intel_dpll.c if we lack a better idea?

-- 
Ville Syrjälä
Intel


More information about the Intel-gfx mailing list