Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/i915/ltphy: Define the LT Phy state compare function

Define function to compare the state and if mismatch is detected
dump both the states.

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-22-suraj.kandpal@intel.com

+68 -1
+32 -1
drivers/gpu/drm/i915/display/intel_display.c
··· 100 100 #include "intel_hdmi.h" 101 101 #include "intel_hotplug.h" 102 102 #include "intel_link_bw.h" 103 + #include "intel_lt_phy.h" 103 104 #include "intel_lvds.h" 104 105 #include "intel_lvds_regs.h" 105 106 #include "intel_modeset_setup.h" ··· 5001 5000 !intel_crtc_has_type(old_crtc_state, INTEL_OUTPUT_DSI); 5002 5001 } 5003 5002 5003 + static void 5004 + pipe_config_lt_phy_pll_mismatch(struct drm_printer *p, bool fastset, 5005 + const struct intel_crtc *crtc, 5006 + const char *name, 5007 + const struct intel_lt_phy_pll_state *a, 5008 + const struct intel_lt_phy_pll_state *b) 5009 + { 5010 + struct intel_display *display = to_intel_display(crtc); 5011 + char *chipname = "LTPHY"; 5012 + 5013 + pipe_config_mismatch(p, fastset, crtc, name, chipname); 5014 + 5015 + drm_printf(p, "expected:\n"); 5016 + intel_lt_phy_dump_hw_state(display, a); 5017 + drm_printf(p, "found:\n"); 5018 + intel_lt_phy_dump_hw_state(display, b); 5019 + } 5020 + 5004 5021 bool 5005 5022 intel_pipe_config_compare(const struct intel_crtc_state *current_config, 5006 5023 const struct intel_crtc_state *pipe_config, ··· 5139 5120 pipe_config_cx0pll_mismatch(&p, fastset, crtc, __stringify(name), \ 5140 5121 &current_config->name, \ 5141 5122 &pipe_config->name); \ 5123 + ret = false; \ 5124 + } \ 5125 + } while (0) 5126 + 5127 + #define PIPE_CONF_CHECK_PLL_LT(name) do { \ 5128 + if (!intel_lt_phy_pll_compare_hw_state(&current_config->name, \ 5129 + &pipe_config->name)) { \ 5130 + pipe_config_lt_phy_pll_mismatch(&p, fastset, crtc, __stringify(name), \ 5131 + &current_config->name, \ 5132 + &pipe_config->name); \ 5142 5133 ret = false; \ 5143 5134 } \ 5144 5135 } while (0) ··· 5380 5351 PIPE_CONF_CHECK_PLL(dpll_hw_state); 5381 5352 5382 5353 /* FIXME convert MTL+ platforms over to dpll_mgr */ 5383 - if (DISPLAY_VER(display) >= 14) 5354 + if (HAS_LT_PHY(display)) 5355 + PIPE_CONF_CHECK_PLL_LT(dpll_hw_state.ltpll); 5356 + else if (DISPLAY_VER(display) >= 14) 5384 5357 PIPE_CONF_CHECK_PLL_CX0(dpll_hw_state.cx0pll); 5385 5358 5386 5359 PIPE_CONF_CHECK_X(dsi_pll.ctrl);
+30
drivers/gpu/drm/i915/display/intel_lt_phy.c
··· 1856 1856 intel_lt_phy_transaction_end(encoder, wakeref); 1857 1857 } 1858 1858 1859 + void intel_lt_phy_dump_hw_state(struct intel_display *display, 1860 + const struct intel_lt_phy_pll_state *hw_state) 1861 + { 1862 + int i, j; 1863 + 1864 + drm_dbg_kms(display->drm, "lt_phy_pll_hw_state:\n"); 1865 + for (i = 0; i < 3; i++) { 1866 + drm_dbg_kms(display->drm, "config[%d] = 0x%.4x,\n", 1867 + i, hw_state->config[i]); 1868 + } 1869 + 1870 + for (i = 0; i <= 12; i++) 1871 + for (j = 3; j >= 0; j--) 1872 + drm_dbg_kms(display->drm, "vdr_data[%d][%d] = 0x%.4x,\n", 1873 + i, j, hw_state->data[i][j]); 1874 + } 1875 + 1876 + bool 1877 + intel_lt_phy_pll_compare_hw_state(const struct intel_lt_phy_pll_state *a, 1878 + const struct intel_lt_phy_pll_state *b) 1879 + { 1880 + if (memcmp(&a->config, &b->config, sizeof(a->config)) != 0) 1881 + return false; 1882 + 1883 + if (memcmp(&a->data, &b->data, sizeof(a->data)) != 0) 1884 + return false; 1885 + 1886 + return true; 1887 + } 1888 + 1859 1889 void intel_xe3plpd_pll_enable(struct intel_encoder *encoder, 1860 1890 const struct intel_crtc_state *crtc_state) 1861 1891 {
+6
drivers/gpu/drm/i915/display/intel_lt_phy.h
··· 8 8 9 9 #include <linux/types.h> 10 10 11 + struct intel_display; 11 12 struct intel_encoder; 12 13 struct intel_crtc_state; 13 14 struct intel_lt_phy_pll_state; ··· 23 22 const struct intel_crtc_state *crtc_state); 24 23 void intel_lt_phy_set_signal_levels(struct intel_encoder *encoder, 25 24 const struct intel_crtc_state *crtc_state); 25 + void intel_lt_phy_dump_hw_state(struct intel_display *display, 26 + const struct intel_lt_phy_pll_state *hw_state); 27 + bool 28 + intel_lt_phy_pll_compare_hw_state(const struct intel_lt_phy_pll_state *a, 29 + const struct intel_lt_phy_pll_state *b); 26 30 void intel_xe3plpd_pll_enable(struct intel_encoder *encoder, 27 31 const struct intel_crtc_state *crtc_state); 28 32 void intel_xe3plpd_pll_disable(struct intel_encoder *encoder);