Commit 8cf41f31 authored by Dave Airlie's avatar Dave Airlie Committed by Jani Nikula

drm/i915: refactor pll code out into intel_dpll.c

This pulls a large chunk of the pll calculation code out of
intel_display.c to a new file.

One function makes 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: default avatarDave Airlie <airlied@redhat.com>
[Jani: cleaned up intel_dpll.h a bit, de-duped intel_panel_use_ssc().]
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/74b58e0572858b5d1734818ca594a23040d7d44f.1610622609.git.jani.nikula@intel.com
parent fbf756c3
...@@ -202,6 +202,7 @@ i915-y += \ ...@@ -202,6 +202,7 @@ i915-y += \
display/intel_display.o \ display/intel_display.o \
display/intel_display_power.o \ display/intel_display_power.o \
display/intel_dpio_phy.o \ display/intel_dpio_phy.o \
display/intel_dpll.o \
display/intel_dpll_mgr.o \ display/intel_dpll_mgr.o \
display/intel_dsb.o \ display/intel_dsb.o \
display/intel_fbc.o \ display/intel_fbc.o \
......
...@@ -651,6 +651,9 @@ u32 intel_plane_compute_aligned_offset(int *x, int *y, ...@@ -651,6 +651,9 @@ u32 intel_plane_compute_aligned_offset(int *x, int *y,
int color_plane); int color_plane);
int intel_plane_pin_fb(struct intel_plane_state *plane_state); int intel_plane_pin_fb(struct intel_plane_state *plane_state);
void intel_plane_unpin_fb(struct intel_plane_state *old_plane_state); void intel_plane_unpin_fb(struct intel_plane_state *old_plane_state);
struct intel_encoder *
intel_get_crtc_new_encoder(const struct intel_atomic_state *state,
const struct intel_crtc_state *crtc_state);
/* modesetting */ /* modesetting */
void intel_modeset_init_hw(struct drm_i915_private *i915); void intel_modeset_init_hw(struct drm_i915_private *i915);
......
...@@ -1839,4 +1839,17 @@ to_intel_frontbuffer(struct drm_framebuffer *fb) ...@@ -1839,4 +1839,17 @@ to_intel_frontbuffer(struct drm_framebuffer *fb)
return fb ? to_intel_framebuffer(fb)->frontbuffer : NULL; return fb ? to_intel_framebuffer(fb)->frontbuffer : NULL;
} }
static inline bool intel_panel_use_ssc(struct drm_i915_private *dev_priv)
{
if (dev_priv->params.panel_use_ssc >= 0)
return dev_priv->params.panel_use_ssc != 0;
return dev_priv->vbt.lvds_use_ssc
&& !(dev_priv->quirks & QUIRK_LVDS_SSC_DISABLE);
}
static inline u32 i9xx_dpll_compute_fp(struct dpll *dpll)
{
return dpll->n << 16 | dpll->m1 << 8 | dpll->m2;
}
#endif /* __INTEL_DISPLAY_TYPES_H__ */ #endif /* __INTEL_DISPLAY_TYPES_H__ */
This diff is collapsed.
/* SPDX-License-Identifier: MIT */
/*
* Copyright © 2020 Intel Corporation
*/
#ifndef _INTEL_DPLL_H_
#define _INTEL_DPLL_H_
struct dpll;
struct drm_i915_private;
struct intel_crtc;
struct intel_crtc_state;
void intel_dpll_init_clock_hook(struct drm_i915_private *dev_priv);
int vlv_calc_dpll_params(int refclk, struct dpll *clock);
int pnv_calc_dpll_params(int refclk, struct dpll *clock);
int i9xx_calc_dpll_params(int refclk, struct dpll *clock);
void vlv_compute_dpll(struct intel_crtc *crtc,
struct intel_crtc_state *pipe_config);
void chv_compute_dpll(struct intel_crtc *crtc,
struct intel_crtc_state *pipe_config);
#endif
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