diff options
author | Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com> | 2016-12-29 10:22:12 -0500 |
---|---|---|
committer | Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com> | 2016-12-30 02:32:34 -0500 |
commit | f50b79f096a7533e9b13638c06dfa759de070f56 (patch) | |
tree | 11a1c2b4eee497b59f9e6900cf8a4c0740ad95c9 | |
parent | 294591cfbd2b185ac51fa2b1768a333fa6782011 (diff) |
drm/i915: Add dpll entrypoint for dumping hw state
Remove the IS_PLATFORM() macros from intel_dump_pipe_config() and split
that logic in platform specific implementations inside the dpll code,
accessed through a platform independent interface.
v2: Rebase.
Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> (v1)
Link: http://patchwork.freedesktop.org/patch/msgid/1483024933-3726-7-git-send-email-ander.conselvan.de.oliveira@intel.com
-rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 34 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_dpll_mgr.c | 79 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_dpll_mgr.h | 3 |
3 files changed, 83 insertions, 33 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index c056631228c0..fba9734d14aa 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -12824,39 +12824,7 @@ static void intel_dump_pipe_config(struct intel_crtc *crtc, | |||
12824 | DRM_DEBUG_KMS("ips: %i, double wide: %i\n", | 12824 | DRM_DEBUG_KMS("ips: %i, double wide: %i\n", |
12825 | pipe_config->ips_enabled, pipe_config->double_wide); | 12825 | pipe_config->ips_enabled, pipe_config->double_wide); |
12826 | 12826 | ||
12827 | if (IS_GEN9_LP(dev_priv)) { | 12827 | intel_dpll_dump_hw_state(dev_priv, &pipe_config->dpll_hw_state); |
12828 | DRM_DEBUG_KMS("dpll_hw_state: ebb0: 0x%x, ebb4: 0x%x," | ||
12829 | "pll0: 0x%x, pll1: 0x%x, pll2: 0x%x, pll3: 0x%x, " | ||
12830 | "pll6: 0x%x, pll8: 0x%x, pll9: 0x%x, pll10: 0x%x, pcsdw12: 0x%x\n", | ||
12831 | pipe_config->dpll_hw_state.ebb0, | ||
12832 | pipe_config->dpll_hw_state.ebb4, | ||
12833 | pipe_config->dpll_hw_state.pll0, | ||
12834 | pipe_config->dpll_hw_state.pll1, | ||
12835 | pipe_config->dpll_hw_state.pll2, | ||
12836 | pipe_config->dpll_hw_state.pll3, | ||
12837 | pipe_config->dpll_hw_state.pll6, | ||
12838 | pipe_config->dpll_hw_state.pll8, | ||
12839 | pipe_config->dpll_hw_state.pll9, | ||
12840 | pipe_config->dpll_hw_state.pll10, | ||
12841 | pipe_config->dpll_hw_state.pcsdw12); | ||
12842 | } else if (IS_SKYLAKE(dev_priv) || IS_KABYLAKE(dev_priv)) { | ||
12843 | DRM_DEBUG_KMS("dpll_hw_state: " | ||
12844 | "ctrl1: 0x%x, cfgcr1: 0x%x, cfgcr2: 0x%x\n", | ||
12845 | pipe_config->dpll_hw_state.ctrl1, | ||
12846 | pipe_config->dpll_hw_state.cfgcr1, | ||
12847 | pipe_config->dpll_hw_state.cfgcr2); | ||
12848 | } else if (HAS_DDI(dev_priv)) { | ||
12849 | DRM_DEBUG_KMS("dpll_hw_state: wrpll: 0x%x spll: 0x%x\n", | ||
12850 | pipe_config->dpll_hw_state.wrpll, | ||
12851 | pipe_config->dpll_hw_state.spll); | ||
12852 | } else { | ||
12853 | DRM_DEBUG_KMS("dpll_hw_state: dpll: 0x%x, dpll_md: 0x%x, " | ||
12854 | "fp0: 0x%x, fp1: 0x%x\n", | ||
12855 | pipe_config->dpll_hw_state.dpll, | ||
12856 | pipe_config->dpll_hw_state.dpll_md, | ||
12857 | pipe_config->dpll_hw_state.fp0, | ||
12858 | pipe_config->dpll_hw_state.fp1); | ||
12859 | } | ||
12860 | 12828 | ||
12861 | DRM_DEBUG_KMS("planes on this crtc\n"); | 12829 | DRM_DEBUG_KMS("planes on this crtc\n"); |
12862 | list_for_each_entry(plane, &dev->mode_config.plane_list, head) { | 12830 | list_for_each_entry(plane, &dev->mode_config.plane_list, head) { |
diff --git a/drivers/gpu/drm/i915/intel_dpll_mgr.c b/drivers/gpu/drm/i915/intel_dpll_mgr.c index 44c3c7056f3f..57d4271cba2c 100644 --- a/drivers/gpu/drm/i915/intel_dpll_mgr.c +++ b/drivers/gpu/drm/i915/intel_dpll_mgr.c | |||
@@ -452,6 +452,17 @@ ibx_get_dpll(struct intel_crtc *crtc, struct intel_crtc_state *crtc_state, | |||
452 | return pll; | 452 | return pll; |
453 | } | 453 | } |
454 | 454 | ||
455 | static void ibx_dump_hw_state(struct drm_i915_private *dev_priv, | ||
456 | struct intel_dpll_hw_state *hw_state) | ||
457 | { | ||
458 | DRM_DEBUG_KMS("dpll_hw_state: dpll: 0x%x, dpll_md: 0x%x, " | ||
459 | "fp0: 0x%x, fp1: 0x%x\n", | ||
460 | hw_state->dpll, | ||
461 | hw_state->dpll_md, | ||
462 | hw_state->fp0, | ||
463 | hw_state->fp1); | ||
464 | } | ||
465 | |||
455 | static const struct intel_shared_dpll_funcs ibx_pch_dpll_funcs = { | 466 | static const struct intel_shared_dpll_funcs ibx_pch_dpll_funcs = { |
456 | .prepare = ibx_pch_dpll_prepare, | 467 | .prepare = ibx_pch_dpll_prepare, |
457 | .enable = ibx_pch_dpll_enable, | 468 | .enable = ibx_pch_dpll_enable, |
@@ -838,6 +849,13 @@ hsw_get_dpll(struct intel_crtc *crtc, struct intel_crtc_state *crtc_state, | |||
838 | return pll; | 849 | return pll; |
839 | } | 850 | } |
840 | 851 | ||
852 | static void hsw_dump_hw_state(struct drm_i915_private *dev_priv, | ||
853 | struct intel_dpll_hw_state *hw_state) | ||
854 | { | ||
855 | DRM_DEBUG_KMS("dpll_hw_state: wrpll: 0x%x spll: 0x%x\n", | ||
856 | hw_state->wrpll, hw_state->spll); | ||
857 | } | ||
858 | |||
841 | static const struct intel_shared_dpll_funcs hsw_ddi_wrpll_funcs = { | 859 | static const struct intel_shared_dpll_funcs hsw_ddi_wrpll_funcs = { |
842 | .enable = hsw_ddi_wrpll_enable, | 860 | .enable = hsw_ddi_wrpll_enable, |
843 | .disable = hsw_ddi_wrpll_disable, | 861 | .disable = hsw_ddi_wrpll_disable, |
@@ -1393,6 +1411,16 @@ skl_get_dpll(struct intel_crtc *crtc, struct intel_crtc_state *crtc_state, | |||
1393 | return pll; | 1411 | return pll; |
1394 | } | 1412 | } |
1395 | 1413 | ||
1414 | static void skl_dump_hw_state(struct drm_i915_private *dev_priv, | ||
1415 | struct intel_dpll_hw_state *hw_state) | ||
1416 | { | ||
1417 | DRM_DEBUG_KMS("dpll_hw_state: " | ||
1418 | "ctrl1: 0x%x, cfgcr1: 0x%x, cfgcr2: 0x%x\n", | ||
1419 | hw_state->ctrl1, | ||
1420 | hw_state->cfgcr1, | ||
1421 | hw_state->cfgcr2); | ||
1422 | } | ||
1423 | |||
1396 | static const struct intel_shared_dpll_funcs skl_ddi_pll_funcs = { | 1424 | static const struct intel_shared_dpll_funcs skl_ddi_pll_funcs = { |
1397 | .enable = skl_ddi_pll_enable, | 1425 | .enable = skl_ddi_pll_enable, |
1398 | .disable = skl_ddi_pll_disable, | 1426 | .disable = skl_ddi_pll_disable, |
@@ -1824,6 +1852,25 @@ bxt_get_dpll(struct intel_crtc *crtc, | |||
1824 | return pll; | 1852 | return pll; |
1825 | } | 1853 | } |
1826 | 1854 | ||
1855 | static void bxt_dump_hw_state(struct drm_i915_private *dev_priv, | ||
1856 | struct intel_dpll_hw_state *hw_state) | ||
1857 | { | ||
1858 | DRM_DEBUG_KMS("dpll_hw_state: ebb0: 0x%x, ebb4: 0x%x," | ||
1859 | "pll0: 0x%x, pll1: 0x%x, pll2: 0x%x, pll3: 0x%x, " | ||
1860 | "pll6: 0x%x, pll8: 0x%x, pll9: 0x%x, pll10: 0x%x, pcsdw12: 0x%x\n", | ||
1861 | hw_state->ebb0, | ||
1862 | hw_state->ebb4, | ||
1863 | hw_state->pll0, | ||
1864 | hw_state->pll1, | ||
1865 | hw_state->pll2, | ||
1866 | hw_state->pll3, | ||
1867 | hw_state->pll6, | ||
1868 | hw_state->pll8, | ||
1869 | hw_state->pll9, | ||
1870 | hw_state->pll10, | ||
1871 | hw_state->pcsdw12); | ||
1872 | } | ||
1873 | |||
1827 | static const struct intel_shared_dpll_funcs bxt_ddi_pll_funcs = { | 1874 | static const struct intel_shared_dpll_funcs bxt_ddi_pll_funcs = { |
1828 | .enable = bxt_ddi_pll_enable, | 1875 | .enable = bxt_ddi_pll_enable, |
1829 | .disable = bxt_ddi_pll_disable, | 1876 | .disable = bxt_ddi_pll_disable, |
@@ -1864,6 +1911,9 @@ struct intel_dpll_mgr { | |||
1864 | struct intel_shared_dpll *(*get_dpll)(struct intel_crtc *crtc, | 1911 | struct intel_shared_dpll *(*get_dpll)(struct intel_crtc *crtc, |
1865 | struct intel_crtc_state *crtc_state, | 1912 | struct intel_crtc_state *crtc_state, |
1866 | struct intel_encoder *encoder); | 1913 | struct intel_encoder *encoder); |
1914 | |||
1915 | void (*dump_hw_state)(struct drm_i915_private *dev_priv, | ||
1916 | struct intel_dpll_hw_state *hw_state); | ||
1867 | }; | 1917 | }; |
1868 | 1918 | ||
1869 | static const struct dpll_info pch_plls[] = { | 1919 | static const struct dpll_info pch_plls[] = { |
@@ -1875,6 +1925,7 @@ static const struct dpll_info pch_plls[] = { | |||
1875 | static const struct intel_dpll_mgr pch_pll_mgr = { | 1925 | static const struct intel_dpll_mgr pch_pll_mgr = { |
1876 | .dpll_info = pch_plls, | 1926 | .dpll_info = pch_plls, |
1877 | .get_dpll = ibx_get_dpll, | 1927 | .get_dpll = ibx_get_dpll, |
1928 | .dump_hw_state = ibx_dump_hw_state, | ||
1878 | }; | 1929 | }; |
1879 | 1930 | ||
1880 | static const struct dpll_info hsw_plls[] = { | 1931 | static const struct dpll_info hsw_plls[] = { |
@@ -1890,6 +1941,7 @@ static const struct dpll_info hsw_plls[] = { | |||
1890 | static const struct intel_dpll_mgr hsw_pll_mgr = { | 1941 | static const struct intel_dpll_mgr hsw_pll_mgr = { |
1891 | .dpll_info = hsw_plls, | 1942 | .dpll_info = hsw_plls, |
1892 | .get_dpll = hsw_get_dpll, | 1943 | .get_dpll = hsw_get_dpll, |
1944 | .dump_hw_state = hsw_dump_hw_state, | ||
1893 | }; | 1945 | }; |
1894 | 1946 | ||
1895 | static const struct dpll_info skl_plls[] = { | 1947 | static const struct dpll_info skl_plls[] = { |
@@ -1903,6 +1955,7 @@ static const struct dpll_info skl_plls[] = { | |||
1903 | static const struct intel_dpll_mgr skl_pll_mgr = { | 1955 | static const struct intel_dpll_mgr skl_pll_mgr = { |
1904 | .dpll_info = skl_plls, | 1956 | .dpll_info = skl_plls, |
1905 | .get_dpll = skl_get_dpll, | 1957 | .get_dpll = skl_get_dpll, |
1958 | .dump_hw_state = skl_dump_hw_state, | ||
1906 | }; | 1959 | }; |
1907 | 1960 | ||
1908 | static const struct dpll_info bxt_plls[] = { | 1961 | static const struct dpll_info bxt_plls[] = { |
@@ -1915,6 +1968,7 @@ static const struct dpll_info bxt_plls[] = { | |||
1915 | static const struct intel_dpll_mgr bxt_pll_mgr = { | 1968 | static const struct intel_dpll_mgr bxt_pll_mgr = { |
1916 | .dpll_info = bxt_plls, | 1969 | .dpll_info = bxt_plls, |
1917 | .get_dpll = bxt_get_dpll, | 1970 | .get_dpll = bxt_get_dpll, |
1971 | .dump_hw_state = bxt_dump_hw_state, | ||
1918 | }; | 1972 | }; |
1919 | 1973 | ||
1920 | /** | 1974 | /** |
@@ -2014,3 +2068,28 @@ void intel_release_shared_dpll(struct intel_shared_dpll *dpll, | |||
2014 | shared_dpll_state = intel_atomic_get_shared_dpll_state(state); | 2068 | shared_dpll_state = intel_atomic_get_shared_dpll_state(state); |
2015 | shared_dpll_state[dpll->id].crtc_mask &= ~(1 << crtc->pipe); | 2069 | shared_dpll_state[dpll->id].crtc_mask &= ~(1 << crtc->pipe); |
2016 | } | 2070 | } |
2071 | |||
2072 | /** | ||
2073 | * intel_shared_dpll_dump_hw_state - write hw_state to dmesg | ||
2074 | * @dev_priv: i915 drm device | ||
2075 | * @hw_state: hw state to be written to the log | ||
2076 | * | ||
2077 | * Write the relevant values in @hw_state to dmesg using DRM_DEBUG_KMS. | ||
2078 | */ | ||
2079 | void intel_dpll_dump_hw_state(struct drm_i915_private *dev_priv, | ||
2080 | struct intel_dpll_hw_state *hw_state) | ||
2081 | { | ||
2082 | if (dev_priv->dpll_mgr) { | ||
2083 | dev_priv->dpll_mgr->dump_hw_state(dev_priv, hw_state); | ||
2084 | } else { | ||
2085 | /* fallback for platforms that don't use the shared dpll | ||
2086 | * infrastructure | ||
2087 | */ | ||
2088 | DRM_DEBUG_KMS("dpll_hw_state: dpll: 0x%x, dpll_md: 0x%x, " | ||
2089 | "fp0: 0x%x, fp1: 0x%x\n", | ||
2090 | hw_state->dpll, | ||
2091 | hw_state->dpll_md, | ||
2092 | hw_state->fp0, | ||
2093 | hw_state->fp1); | ||
2094 | } | ||
2095 | } | ||
diff --git a/drivers/gpu/drm/i915/intel_dpll_mgr.h b/drivers/gpu/drm/i915/intel_dpll_mgr.h index db96eea00298..af1497eb4f9c 100644 --- a/drivers/gpu/drm/i915/intel_dpll_mgr.h +++ b/drivers/gpu/drm/i915/intel_dpll_mgr.h | |||
@@ -279,6 +279,9 @@ void intel_disable_shared_dpll(struct intel_crtc *crtc); | |||
279 | void intel_shared_dpll_swap_state(struct drm_atomic_state *state); | 279 | void intel_shared_dpll_swap_state(struct drm_atomic_state *state); |
280 | void intel_shared_dpll_init(struct drm_device *dev); | 280 | void intel_shared_dpll_init(struct drm_device *dev); |
281 | 281 | ||
282 | void intel_dpll_dump_hw_state(struct drm_i915_private *dev_priv, | ||
283 | struct intel_dpll_hw_state *hw_state); | ||
284 | |||
282 | /* BXT dpll related functions */ | 285 | /* BXT dpll related functions */ |
283 | bool bxt_ddi_dp_set_dpll_hw_state(int clock, | 286 | bool bxt_ddi_dp_set_dpll_hw_state(int clock, |
284 | struct intel_dpll_hw_state *dpll_hw_state); | 287 | struct intel_dpll_hw_state *dpll_hw_state); |