#include <linux/kernel.h>
#include <linux/string_helpers.h>
#include "i915_reg.h"
#include "intel_atomic.h"
#include "intel_crtc.h"
#include "intel_cx0_phy.h"
#include "intel_de.h"
#include "intel_display.h"
#include "intel_display_types.h"
#include "intel_dpio_phy.h"
#include "intel_dpll.h"
#include "intel_lvds.h"
#include "intel_lvds_regs.h"
#include "intel_panel.h"
#include "intel_pps.h"
#include "intel_snps_phy.h"
#include "vlv_dpio_phy_regs.h"
#include "vlv_sideband.h"
struct intel_dpll_funcs { … };
struct intel_limit { … };
static const struct intel_limit intel_limits_i8xx_dac = …;
static const struct intel_limit intel_limits_i8xx_dvo = …;
static const struct intel_limit intel_limits_i8xx_lvds = …;
static const struct intel_limit intel_limits_i9xx_sdvo = …;
static const struct intel_limit intel_limits_i9xx_lvds = …;
static const struct intel_limit intel_limits_g4x_sdvo = …;
static const struct intel_limit intel_limits_g4x_hdmi = …;
static const struct intel_limit intel_limits_g4x_single_channel_lvds = …;
static const struct intel_limit intel_limits_g4x_dual_channel_lvds = …;
static const struct intel_limit pnv_limits_sdvo = …;
static const struct intel_limit pnv_limits_lvds = …;
static const struct intel_limit ilk_limits_dac = …;
static const struct intel_limit ilk_limits_single_lvds = …;
static const struct intel_limit ilk_limits_dual_lvds = …;
static const struct intel_limit ilk_limits_single_lvds_100m = …;
static const struct intel_limit ilk_limits_dual_lvds_100m = …;
static const struct intel_limit intel_limits_vlv = …;
static const struct intel_limit intel_limits_chv = …;
static const struct intel_limit intel_limits_bxt = …;
static int pnv_calc_dpll_params(int refclk, struct dpll *clock)
{ … }
static u32 i9xx_dpll_compute_m(const struct dpll *dpll)
{ … }
int i9xx_calc_dpll_params(int refclk, struct dpll *clock)
{ … }
static int vlv_calc_dpll_params(int refclk, struct dpll *clock)
{ … }
int chv_calc_dpll_params(int refclk, struct dpll *clock)
{ … }
static int i9xx_pll_refclk(const struct intel_crtc_state *crtc_state)
{ … }
void i9xx_dpll_get_hw_state(struct intel_crtc *crtc,
struct intel_dpll_hw_state *dpll_hw_state)
{ … }
void i9xx_crtc_clock_get(struct intel_crtc_state *crtc_state)
{ … }
void vlv_crtc_clock_get(struct intel_crtc_state *crtc_state)
{ … }
void chv_crtc_clock_get(struct intel_crtc_state *crtc_state)
{ … }
static bool intel_pll_is_valid(struct drm_i915_private *dev_priv,
const struct intel_limit *limit,
const struct dpll *clock)
{ … }
static int
i9xx_select_p2_div(const struct intel_limit *limit,
const struct intel_crtc_state *crtc_state,
int target)
{ … }
static bool
i9xx_find_best_dpll(const struct intel_limit *limit,
struct intel_crtc_state *crtc_state,
int target, int refclk,
const struct dpll *match_clock,
struct dpll *best_clock)
{ … }
static bool
pnv_find_best_dpll(const struct intel_limit *limit,
struct intel_crtc_state *crtc_state,
int target, int refclk,
const struct dpll *match_clock,
struct dpll *best_clock)
{ … }
static bool
g4x_find_best_dpll(const struct intel_limit *limit,
struct intel_crtc_state *crtc_state,
int target, int refclk,
const struct dpll *match_clock,
struct dpll *best_clock)
{ … }
static bool vlv_PLL_is_optimal(struct drm_device *dev, int target_freq,
const struct dpll *calculated_clock,
const struct dpll *best_clock,
unsigned int best_error_ppm,
unsigned int *error_ppm)
{ … }
static bool
vlv_find_best_dpll(const struct intel_limit *limit,
struct intel_crtc_state *crtc_state,
int target, int refclk,
const struct dpll *match_clock,
struct dpll *best_clock)
{ … }
static bool
chv_find_best_dpll(const struct intel_limit *limit,
struct intel_crtc_state *crtc_state,
int target, int refclk,
const struct dpll *match_clock,
struct dpll *best_clock)
{ … }
bool bxt_find_best_dpll(struct intel_crtc_state *crtc_state,
struct dpll *best_clock)
{ … }
u32 i9xx_dpll_compute_fp(const struct dpll *dpll)
{ … }
static u32 pnv_dpll_compute_fp(const struct dpll *dpll)
{ … }
static u32 i965_dpll_md(const struct intel_crtc_state *crtc_state)
{ … }
static u32 i9xx_dpll(const struct intel_crtc_state *crtc_state,
const struct dpll *clock,
const struct dpll *reduced_clock)
{ … }
static void i9xx_compute_dpll(struct intel_crtc_state *crtc_state,
const struct dpll *clock,
const struct dpll *reduced_clock)
{ … }
static u32 i8xx_dpll(const struct intel_crtc_state *crtc_state,
const struct dpll *clock,
const struct dpll *reduced_clock)
{ … }
static void i8xx_compute_dpll(struct intel_crtc_state *crtc_state,
const struct dpll *clock,
const struct dpll *reduced_clock)
{ … }
static int hsw_crtc_compute_clock(struct intel_atomic_state *state,
struct intel_crtc *crtc)
{ … }
static int hsw_crtc_get_shared_dpll(struct intel_atomic_state *state,
struct intel_crtc *crtc)
{ … }
static int dg2_crtc_compute_clock(struct intel_atomic_state *state,
struct intel_crtc *crtc)
{ … }
static int mtl_crtc_compute_clock(struct intel_atomic_state *state,
struct intel_crtc *crtc)
{ … }
static int ilk_fb_cb_factor(const struct intel_crtc_state *crtc_state)
{ … }
static bool ilk_needs_fb_cb_tune(const struct dpll *dpll, int factor)
{ … }
static u32 ilk_dpll_compute_fp(const struct dpll *clock, int factor)
{ … }
static u32 ilk_dpll(const struct intel_crtc_state *crtc_state,
const struct dpll *clock,
const struct dpll *reduced_clock)
{ … }
static void ilk_compute_dpll(struct intel_crtc_state *crtc_state,
const struct dpll *clock,
const struct dpll *reduced_clock)
{ … }
static int ilk_crtc_compute_clock(struct intel_atomic_state *state,
struct intel_crtc *crtc)
{ … }
static int ilk_crtc_get_shared_dpll(struct intel_atomic_state *state,
struct intel_crtc *crtc)
{ … }
static u32 vlv_dpll(const struct intel_crtc_state *crtc_state)
{ … }
void vlv_compute_dpll(struct intel_crtc_state *crtc_state)
{ … }
static u32 chv_dpll(const struct intel_crtc_state *crtc_state)
{ … }
void chv_compute_dpll(struct intel_crtc_state *crtc_state)
{ … }
static int chv_crtc_compute_clock(struct intel_atomic_state *state,
struct intel_crtc *crtc)
{ … }
static int vlv_crtc_compute_clock(struct intel_atomic_state *state,
struct intel_crtc *crtc)
{ … }
static int g4x_crtc_compute_clock(struct intel_atomic_state *state,
struct intel_crtc *crtc)
{ … }
static int pnv_crtc_compute_clock(struct intel_atomic_state *state,
struct intel_crtc *crtc)
{ … }
static int i9xx_crtc_compute_clock(struct intel_atomic_state *state,
struct intel_crtc *crtc)
{ … }
static int i8xx_crtc_compute_clock(struct intel_atomic_state *state,
struct intel_crtc *crtc)
{ … }
static const struct intel_dpll_funcs mtl_dpll_funcs = …;
static const struct intel_dpll_funcs dg2_dpll_funcs = …;
static const struct intel_dpll_funcs hsw_dpll_funcs = …;
static const struct intel_dpll_funcs ilk_dpll_funcs = …;
static const struct intel_dpll_funcs chv_dpll_funcs = …;
static const struct intel_dpll_funcs vlv_dpll_funcs = …;
static const struct intel_dpll_funcs g4x_dpll_funcs = …;
static const struct intel_dpll_funcs pnv_dpll_funcs = …;
static const struct intel_dpll_funcs i9xx_dpll_funcs = …;
static const struct intel_dpll_funcs i8xx_dpll_funcs = …;
int intel_dpll_crtc_compute_clock(struct intel_atomic_state *state,
struct intel_crtc *crtc)
{ … }
int intel_dpll_crtc_get_shared_dpll(struct intel_atomic_state *state,
struct intel_crtc *crtc)
{ … }
void
intel_dpll_init_clock_hook(struct drm_i915_private *dev_priv)
{ … }
static bool i9xx_has_pps(struct drm_i915_private *dev_priv)
{ … }
void i9xx_enable_pll(const struct intel_crtc_state *crtc_state)
{ … }
static void vlv_pllb_recal_opamp(struct drm_i915_private *dev_priv,
enum dpio_phy phy, enum dpio_channel ch)
{ … }
static void vlv_prepare_pll(const struct intel_crtc_state *crtc_state)
{ … }
static void _vlv_enable_pll(const struct intel_crtc_state *crtc_state)
{ … }
void vlv_enable_pll(const struct intel_crtc_state *crtc_state)
{ … }
static void chv_prepare_pll(const struct intel_crtc_state *crtc_state)
{ … }
static void _chv_enable_pll(const struct intel_crtc_state *crtc_state)
{ … }
void chv_enable_pll(const struct intel_crtc_state *crtc_state)
{ … }
int vlv_force_pll_on(struct drm_i915_private *dev_priv, enum pipe pipe,
const struct dpll *dpll)
{ … }
void vlv_disable_pll(struct drm_i915_private *dev_priv, enum pipe pipe)
{ … }
void chv_disable_pll(struct drm_i915_private *dev_priv, enum pipe pipe)
{ … }
void i9xx_disable_pll(const struct intel_crtc_state *crtc_state)
{ … }
void vlv_force_pll_off(struct drm_i915_private *dev_priv, enum pipe pipe)
{ … }
static void assert_pll(struct drm_i915_private *dev_priv,
enum pipe pipe, bool state)
{ … }
void assert_pll_enabled(struct drm_i915_private *i915, enum pipe pipe)
{ … }
void assert_pll_disabled(struct drm_i915_private *i915, enum pipe pipe)
{ … }