Skip to content

Commit 9dcf183

Browse files
committed
drm/i915/ltphy: Define LT PHY PLL state verify function
Define function to verify the LT PHY PLL state function and call it in intel_modeset_verify_crtc. Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com> Reviewed-by: Arun R Murthy <arun.r.murthy@intel.com> Link: https://patch.msgid.link/20251101032513.4171255-24-suraj.kandpal@intel.com
1 parent 89e0a91 commit 9dcf183

4 files changed

Lines changed: 63 additions & 1 deletion

File tree

drivers/gpu/drm/i915/display/intel_cx0_phy.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3575,7 +3575,7 @@ void intel_cx0pll_state_verify(struct intel_atomic_state *state,
35753575
struct intel_encoder *encoder;
35763576
struct intel_cx0pll_state mpll_hw_state = {};
35773577

3578-
if (DISPLAY_VER(display) < 14)
3578+
if (!IS_DISPLAY_VER(display, 14, 30))
35793579
return;
35803580

35813581
if (!new_crtc_state->hw.active)

drivers/gpu/drm/i915/display/intel_lt_phy.c

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1919,6 +1919,61 @@ void intel_lt_phy_pll_readout_hw_state(struct intel_encoder *encoder,
19191919
intel_lt_phy_transaction_end(encoder, wakeref);
19201920
}
19211921

1922+
void intel_lt_phy_pll_state_verify(struct intel_atomic_state *state,
1923+
struct intel_crtc *crtc)
1924+
{
1925+
struct intel_display *display = to_intel_display(state);
1926+
struct intel_digital_port *dig_port;
1927+
const struct intel_crtc_state *new_crtc_state =
1928+
intel_atomic_get_new_crtc_state(state, crtc);
1929+
struct intel_encoder *encoder;
1930+
struct intel_lt_phy_pll_state pll_hw_state = {};
1931+
const struct intel_lt_phy_pll_state *pll_sw_state = &new_crtc_state->dpll_hw_state.ltpll;
1932+
int clock;
1933+
int i, j;
1934+
1935+
if (DISPLAY_VER(display) < 35)
1936+
return;
1937+
1938+
if (!new_crtc_state->hw.active)
1939+
return;
1940+
1941+
/* intel_get_crtc_new_encoder() only works for modeset/fastset commits */
1942+
if (!intel_crtc_needs_modeset(new_crtc_state) &&
1943+
!intel_crtc_needs_fastset(new_crtc_state))
1944+
return;
1945+
1946+
encoder = intel_get_crtc_new_encoder(state, new_crtc_state);
1947+
intel_lt_phy_pll_readout_hw_state(encoder, new_crtc_state, &pll_hw_state);
1948+
clock = intel_lt_phy_calc_port_clock(encoder, new_crtc_state);
1949+
1950+
dig_port = enc_to_dig_port(encoder);
1951+
if (intel_tc_port_in_tbt_alt_mode(dig_port))
1952+
return;
1953+
1954+
INTEL_DISPLAY_STATE_WARN(display, pll_hw_state.clock != clock,
1955+
"[CRTC:%d:%s] mismatch in LT PHY: Register CLOCK (expected %d, found %d)",
1956+
crtc->base.base.id, crtc->base.name,
1957+
pll_sw_state->clock, pll_hw_state.clock);
1958+
1959+
for (i = 0; i < 3; i++) {
1960+
INTEL_DISPLAY_STATE_WARN(display, pll_hw_state.config[i] != pll_sw_state->config[i],
1961+
"[CRTC:%d:%s] mismatch in LT PHY PLL CONFIG%d: (expected 0x%04x, found 0x%04x)",
1962+
crtc->base.base.id, crtc->base.name, i,
1963+
pll_sw_state->config[i], pll_hw_state.config[i]);
1964+
}
1965+
1966+
for (i = 0; i <= 12; i++) {
1967+
for (j = 3; j >= 0; j--)
1968+
INTEL_DISPLAY_STATE_WARN(display,
1969+
pll_hw_state.data[i][j] !=
1970+
pll_sw_state->data[i][j],
1971+
"[CRTC:%d:%s] mismatch in LT PHY PLL DATA[%d][%d]: (expected 0x%04x, found 0x%04x)",
1972+
crtc->base.base.id, crtc->base.name, i, j,
1973+
pll_sw_state->data[i][j], pll_hw_state.data[i][j]);
1974+
}
1975+
}
1976+
19221977
void intel_xe3plpd_pll_enable(struct intel_encoder *encoder,
19231978
const struct intel_crtc_state *crtc_state)
19241979
{
@@ -1938,4 +1993,5 @@ void intel_xe3plpd_pll_disable(struct intel_encoder *encoder)
19381993
intel_mtl_tbt_pll_disable(encoder);
19391994
else
19401995
intel_lt_phy_pll_disable(encoder);
1996+
19411997
}

drivers/gpu/drm/i915/display/intel_lt_phy.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@
88

99
#include <linux/types.h>
1010

11+
struct intel_atomic_state;
1112
struct intel_display;
1213
struct intel_encoder;
1314
struct intel_crtc_state;
15+
struct intel_crtc;
1416
struct intel_lt_phy_pll_state;
1517

1618
void intel_lt_phy_pll_enable(struct intel_encoder *encoder,
@@ -31,6 +33,8 @@ intel_lt_phy_pll_compare_hw_state(const struct intel_lt_phy_pll_state *a,
3133
void intel_lt_phy_pll_readout_hw_state(struct intel_encoder *encoder,
3234
const struct intel_crtc_state *crtc_state,
3335
struct intel_lt_phy_pll_state *pll_state);
36+
void intel_lt_phy_pll_state_verify(struct intel_atomic_state *state,
37+
struct intel_crtc *crtc);
3438
void intel_xe3plpd_pll_enable(struct intel_encoder *encoder,
3539
const struct intel_crtc_state *crtc_state);
3640
void intel_xe3plpd_pll_disable(struct intel_encoder *encoder);

drivers/gpu/drm/i915/display/intel_modeset_verify.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include "intel_display_core.h"
1717
#include "intel_display_types.h"
1818
#include "intel_fdi.h"
19+
#include "intel_lt_phy.h"
1920
#include "intel_modeset_verify.h"
2021
#include "intel_snps_phy.h"
2122
#include "skl_watermark.h"
@@ -246,6 +247,7 @@ void intel_modeset_verify_crtc(struct intel_atomic_state *state,
246247
intel_dpll_state_verify(state, crtc);
247248
intel_mpllb_state_verify(state, crtc);
248249
intel_cx0pll_state_verify(state, crtc);
250+
intel_lt_phy_pll_state_verify(state, crtc);
249251
}
250252

251253
void intel_modeset_verify_disabled(struct intel_atomic_state *state)

0 commit comments

Comments
 (0)