#include "intel_display_types.h"
#include "intel_display_utils.h"
#include "intel_dp.h"
+#include "intel_dpll.h"
#include "intel_hdmi.h"
#include "intel_lt_phy.h"
#include "intel_panel.h"
int i;
for (i = 0; tables[i].name; i++) {
- if (port_clock == tables[i].clock_rate) {
+ int clock = intel_c10pll_calc_port_clock(tables[i].c10);
+
+ drm_WARN_ON(display->drm, !intel_dpll_clock_matches(clock, tables[i].clock_rate));
+ if (intel_dpll_clock_matches(port_clock, clock)) {
pll_state->c10 = *tables[i].c10;
intel_cx0pll_update_ssc(encoder, pll_state, is_dp);
intel_c10pll_update_pll(encoder, pll_state);
intel_c20_pll_find_table(const struct intel_crtc_state *crtc_state,
struct intel_encoder *encoder)
{
+ struct intel_display *display = to_intel_display(crtc_state);
const struct intel_cx0pll_params *tables;
int i;
if (!tables)
return NULL;
- for (i = 0; tables[i].name; i++)
- if (crtc_state->port_clock == tables[i].clock_rate)
+ for (i = 0; tables[i].name; i++) {
+ int clock = intel_c20pll_calc_port_clock(tables[i].c20);
+
+ drm_WARN_ON(display->drm, !intel_dpll_clock_matches(clock, tables[i].clock_rate));
+ if (intel_dpll_clock_matches(crtc_state->port_clock, clock))
return &tables[i];
+ }
return NULL;
}
static void intel_cx0pll_enable(struct intel_encoder *encoder,
const struct intel_cx0pll_state *pll_state)
{
- int port_clock = pll_state->use_c10 ? pll_state->c10.clock : pll_state->c20.clock;
struct intel_display *display = to_intel_display(encoder);
enum phy phy = intel_encoder_to_phy(encoder);
struct intel_digital_port *dig_port = enc_to_dig_port(encoder);
u8 maxpclk_lane = lane_reversal ? INTEL_CX0_LANE1 :
INTEL_CX0_LANE0;
struct ref_tracker *wakeref = intel_cx0_phy_transaction_begin(encoder);
+ int port_clock;
+
+ if (pll_state->use_c10)
+ port_clock = intel_c10pll_calc_port_clock(&pll_state->c10);
+ else
+ port_clock = intel_c20pll_calc_port_clock(&pll_state->c20);
/*
* Lane reversal is never used in DP-alt mode, in that case the
#include "intel_display.h"
#include "intel_display_types.h"
#include "intel_display_utils.h"
+#include "intel_dpll.h"
#include "intel_dpll_mgr.h"
#include "intel_hdmi.h"
#include "intel_lt_phy.h"
intel_lt_phy_pll_calc_state(struct intel_crtc_state *crtc_state,
struct intel_encoder *encoder)
{
+ struct intel_display *display = to_intel_display(crtc_state);
const struct intel_lt_phy_pll_params *tables;
int i;
return -EINVAL;
for (i = 0; tables[i].name; i++) {
- if (crtc_state->port_clock == tables[i].clock_rate) {
+ int clock = intel_lt_phy_calc_port_clock(display, tables[i].state);
+
+ drm_WARN_ON(display->drm, !intel_dpll_clock_matches(clock, tables[i].clock_rate));
+ if (intel_dpll_clock_matches(crtc_state->port_clock, clock)) {
crtc_state->dpll_hw_state.ltpll = *tables[i].state;
if (intel_crtc_has_dp_encoder(crtc_state)) {
if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_EDP))