提交 d664c0ce 编写于 作者: D Damien Lespiau 提交者: Daniel Vetter

drm/i915: Make intel_ddi_calculate_wrpll() HSW/BDW specific

Signed-off-by: NDamien Lespiau <damien.lespiau@intel.com>
Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
上级 0220ab6e
...@@ -644,8 +644,8 @@ void intel_ddi_clock_get(struct intel_encoder *encoder, ...@@ -644,8 +644,8 @@ void intel_ddi_clock_get(struct intel_encoder *encoder,
} }
static void static void
intel_ddi_calculate_wrpll(int clock /* in Hz */, hsw_ddi_calculate_wrpll(int clock /* in Hz */,
unsigned *r2_out, unsigned *n2_out, unsigned *p_out) unsigned *r2_out, unsigned *n2_out, unsigned *p_out)
{ {
uint64_t freq2k; uint64_t freq2k;
unsigned p, n2, r2; unsigned p, n2, r2;
...@@ -709,14 +709,16 @@ intel_ddi_calculate_wrpll(int clock /* in Hz */, ...@@ -709,14 +709,16 @@ intel_ddi_calculate_wrpll(int clock /* in Hz */,
} }
static bool static bool
hsw_ddi_pll_select(struct intel_crtc *intel_crtc, int output, int clock) hsw_ddi_pll_select(struct intel_crtc *intel_crtc,
struct intel_encoder *intel_encoder,
int clock)
{ {
if (output == INTEL_OUTPUT_HDMI) { if (intel_encoder->type == INTEL_OUTPUT_HDMI) {
struct intel_shared_dpll *pll; struct intel_shared_dpll *pll;
uint32_t val; uint32_t val;
unsigned p, n2, r2; unsigned p, n2, r2;
intel_ddi_calculate_wrpll(clock * 1000, &r2, &n2, &p); hsw_ddi_calculate_wrpll(clock * 1000, &r2, &n2, &p);
val = WRPLL_PLL_ENABLE | WRPLL_PLL_LCPLL | val = WRPLL_PLL_ENABLE | WRPLL_PLL_LCPLL |
WRPLL_DIVIDER_REFERENCE(r2) | WRPLL_DIVIDER_FEEDBACK(n2) | WRPLL_DIVIDER_REFERENCE(r2) | WRPLL_DIVIDER_FEEDBACK(n2) |
...@@ -749,12 +751,11 @@ bool intel_ddi_pll_select(struct intel_crtc *intel_crtc) ...@@ -749,12 +751,11 @@ bool intel_ddi_pll_select(struct intel_crtc *intel_crtc)
{ {
struct drm_crtc *crtc = &intel_crtc->base; struct drm_crtc *crtc = &intel_crtc->base;
struct intel_encoder *intel_encoder = intel_ddi_get_crtc_encoder(crtc); struct intel_encoder *intel_encoder = intel_ddi_get_crtc_encoder(crtc);
int type = intel_encoder->type;
int clock = intel_crtc->config.port_clock; int clock = intel_crtc->config.port_clock;
intel_put_shared_dpll(intel_crtc); intel_put_shared_dpll(intel_crtc);
return hsw_ddi_pll_select(intel_crtc, type, clock); return hsw_ddi_pll_select(intel_crtc, intel_encoder, clock);
} }
void intel_ddi_set_pipe_settings(struct drm_crtc *crtc) void intel_ddi_set_pipe_settings(struct drm_crtc *crtc)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册