aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_runtime_pm.c
diff options
context:
space:
mode:
authorImre Deak <imre.deak@intel.com>2018-11-01 10:04:26 -0400
committerImre Deak <imre.deak@intel.com>2018-11-01 19:24:03 -0400
commitc7375d9542f121049ff90562c5828e5843747c9a (patch)
treed6f7fbf2c5ec18a820b120ec7f72c64b2f078ff6 /drivers/gpu/drm/i915/intel_runtime_pm.c
parent8e4a3ad9b81b7b595676c5fa88cd44a1b788be2e (diff)
drm/i915: Configure AUX_CH_CTL when enabling the AUX power domain
Most of the AUX_CH_CTL flags are concerned with DP AUX transfer parameters. As opposed to this the flag specifying the thunderbolt vs. non-thunderbolt mode of the port is not related to AUX transfers at all (rather it's repurposed to enable either TBT or non-TBT PHY HW blocks). The programming has to be done before enabling the corresponding AUX power well, so make it part of the power well code. v3: - Use existing enable/disable helpers instead of opencoding. (Jose) - Fix type of is_tc_tbt to remain a bitfield. (Lucas) - Add comment describing the is_tc_tbt power well flag. (Lucas) Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108548 Cc: Paulo Zanoni <paulo.r.zanoni@intel.com> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com> Cc: José Roberto de Souza <jose.souza@intel.com> Cc: Lucas De Marchi <lucas.demarchi@intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Signed-off-by: Imre Deak <imre.deak@intel.com> Reviewed-by: José Roberto de Souza <jose.souza@intel.com> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20181101140427.31026-8-imre.deak@intel.com
Diffstat (limited to 'drivers/gpu/drm/i915/intel_runtime_pm.c')
-rw-r--r--drivers/gpu/drm/i915/intel_runtime_pm.c50
1 files changed, 42 insertions, 8 deletions
diff --git a/drivers/gpu/drm/i915/intel_runtime_pm.c b/drivers/gpu/drm/i915/intel_runtime_pm.c
index b1901a6c17be..6c453366cd24 100644
--- a/drivers/gpu/drm/i915/intel_runtime_pm.c
+++ b/drivers/gpu/drm/i915/intel_runtime_pm.c
@@ -465,6 +465,25 @@ icl_combo_phy_aux_power_well_disable(struct drm_i915_private *dev_priv,
465 hsw_wait_for_power_well_disable(dev_priv, power_well); 465 hsw_wait_for_power_well_disable(dev_priv, power_well);
466} 466}
467 467
468#define ICL_AUX_PW_TO_CH(pw_idx) \
469 ((pw_idx) - ICL_PW_CTL_IDX_AUX_A + AUX_CH_A)
470
471static void
472icl_tc_phy_aux_power_well_enable(struct drm_i915_private *dev_priv,
473 struct i915_power_well *power_well)
474{
475 enum aux_ch aux_ch = ICL_AUX_PW_TO_CH(power_well->desc->hsw.idx);
476 u32 val;
477
478 val = I915_READ(DP_AUX_CH_CTL(aux_ch));
479 val &= ~DP_AUX_CH_CTL_TBT_IO;
480 if (power_well->desc->hsw.is_tc_tbt)
481 val |= DP_AUX_CH_CTL_TBT_IO;
482 I915_WRITE(DP_AUX_CH_CTL(aux_ch), val);
483
484 hsw_power_well_enable(dev_priv, power_well);
485}
486
468/* 487/*
469 * We should only use the power well if we explicitly asked the hardware to 488 * We should only use the power well if we explicitly asked the hardware to
470 * enable it, so check if it's enabled and also check if we've requested it to 489 * enable it, so check if it's enabled and also check if we've requested it to
@@ -2732,6 +2751,13 @@ static const struct i915_power_well_ops icl_combo_phy_aux_power_well_ops = {
2732 .is_enabled = hsw_power_well_enabled, 2751 .is_enabled = hsw_power_well_enabled,
2733}; 2752};
2734 2753
2754static const struct i915_power_well_ops icl_tc_phy_aux_power_well_ops = {
2755 .sync_hw = hsw_power_well_sync_hw,
2756 .enable = icl_tc_phy_aux_power_well_enable,
2757 .disable = hsw_power_well_disable,
2758 .is_enabled = hsw_power_well_enabled,
2759};
2760
2735static const struct i915_power_well_regs icl_aux_power_well_regs = { 2761static const struct i915_power_well_regs icl_aux_power_well_regs = {
2736 .bios = ICL_PWR_WELL_CTL_AUX1, 2762 .bios = ICL_PWR_WELL_CTL_AUX1,
2737 .driver = ICL_PWR_WELL_CTL_AUX2, 2763 .driver = ICL_PWR_WELL_CTL_AUX2,
@@ -2877,81 +2903,89 @@ static const struct i915_power_well_desc icl_power_wells[] = {
2877 { 2903 {
2878 .name = "AUX C", 2904 .name = "AUX C",
2879 .domains = ICL_AUX_C_IO_POWER_DOMAINS, 2905 .domains = ICL_AUX_C_IO_POWER_DOMAINS,
2880 .ops = &hsw_power_well_ops, 2906 .ops = &icl_tc_phy_aux_power_well_ops,
2881 .id = DISP_PW_ID_NONE, 2907 .id = DISP_PW_ID_NONE,
2882 { 2908 {
2883 .hsw.regs = &icl_aux_power_well_regs, 2909 .hsw.regs = &icl_aux_power_well_regs,
2884 .hsw.idx = ICL_PW_CTL_IDX_AUX_C, 2910 .hsw.idx = ICL_PW_CTL_IDX_AUX_C,
2911 .hsw.is_tc_tbt = false,
2885 }, 2912 },
2886 }, 2913 },
2887 { 2914 {
2888 .name = "AUX D", 2915 .name = "AUX D",
2889 .domains = ICL_AUX_D_IO_POWER_DOMAINS, 2916 .domains = ICL_AUX_D_IO_POWER_DOMAINS,
2890 .ops = &hsw_power_well_ops, 2917 .ops = &icl_tc_phy_aux_power_well_ops,
2891 .id = DISP_PW_ID_NONE, 2918 .id = DISP_PW_ID_NONE,
2892 { 2919 {
2893 .hsw.regs = &icl_aux_power_well_regs, 2920 .hsw.regs = &icl_aux_power_well_regs,
2894 .hsw.idx = ICL_PW_CTL_IDX_AUX_D, 2921 .hsw.idx = ICL_PW_CTL_IDX_AUX_D,
2922 .hsw.is_tc_tbt = false,
2895 }, 2923 },
2896 }, 2924 },
2897 { 2925 {
2898 .name = "AUX E", 2926 .name = "AUX E",
2899 .domains = ICL_AUX_E_IO_POWER_DOMAINS, 2927 .domains = ICL_AUX_E_IO_POWER_DOMAINS,
2900 .ops = &hsw_power_well_ops, 2928 .ops = &icl_tc_phy_aux_power_well_ops,
2901 .id = DISP_PW_ID_NONE, 2929 .id = DISP_PW_ID_NONE,
2902 { 2930 {
2903 .hsw.regs = &icl_aux_power_well_regs, 2931 .hsw.regs = &icl_aux_power_well_regs,
2904 .hsw.idx = ICL_PW_CTL_IDX_AUX_E, 2932 .hsw.idx = ICL_PW_CTL_IDX_AUX_E,
2933 .hsw.is_tc_tbt = false,
2905 }, 2934 },
2906 }, 2935 },
2907 { 2936 {
2908 .name = "AUX F", 2937 .name = "AUX F",
2909 .domains = ICL_AUX_F_IO_POWER_DOMAINS, 2938 .domains = ICL_AUX_F_IO_POWER_DOMAINS,
2910 .ops = &hsw_power_well_ops, 2939 .ops = &icl_tc_phy_aux_power_well_ops,
2911 .id = DISP_PW_ID_NONE, 2940 .id = DISP_PW_ID_NONE,
2912 { 2941 {
2913 .hsw.regs = &icl_aux_power_well_regs, 2942 .hsw.regs = &icl_aux_power_well_regs,
2914 .hsw.idx = ICL_PW_CTL_IDX_AUX_F, 2943 .hsw.idx = ICL_PW_CTL_IDX_AUX_F,
2944 .hsw.is_tc_tbt = false,
2915 }, 2945 },
2916 }, 2946 },
2917 { 2947 {
2918 .name = "AUX TBT1", 2948 .name = "AUX TBT1",
2919 .domains = ICL_AUX_TBT1_IO_POWER_DOMAINS, 2949 .domains = ICL_AUX_TBT1_IO_POWER_DOMAINS,
2920 .ops = &hsw_power_well_ops, 2950 .ops = &icl_tc_phy_aux_power_well_ops,
2921 .id = DISP_PW_ID_NONE, 2951 .id = DISP_PW_ID_NONE,
2922 { 2952 {
2923 .hsw.regs = &icl_aux_power_well_regs, 2953 .hsw.regs = &icl_aux_power_well_regs,
2924 .hsw.idx = ICL_PW_CTL_IDX_AUX_TBT1, 2954 .hsw.idx = ICL_PW_CTL_IDX_AUX_TBT1,
2955 .hsw.is_tc_tbt = true,
2925 }, 2956 },
2926 }, 2957 },
2927 { 2958 {
2928 .name = "AUX TBT2", 2959 .name = "AUX TBT2",
2929 .domains = ICL_AUX_TBT2_IO_POWER_DOMAINS, 2960 .domains = ICL_AUX_TBT2_IO_POWER_DOMAINS,
2930 .ops = &hsw_power_well_ops, 2961 .ops = &icl_tc_phy_aux_power_well_ops,
2931 .id = DISP_PW_ID_NONE, 2962 .id = DISP_PW_ID_NONE,
2932 { 2963 {
2933 .hsw.regs = &icl_aux_power_well_regs, 2964 .hsw.regs = &icl_aux_power_well_regs,
2934 .hsw.idx = ICL_PW_CTL_IDX_AUX_TBT2, 2965 .hsw.idx = ICL_PW_CTL_IDX_AUX_TBT2,
2966 .hsw.is_tc_tbt = true,
2935 }, 2967 },
2936 }, 2968 },
2937 { 2969 {
2938 .name = "AUX TBT3", 2970 .name = "AUX TBT3",
2939 .domains = ICL_AUX_TBT3_IO_POWER_DOMAINS, 2971 .domains = ICL_AUX_TBT3_IO_POWER_DOMAINS,
2940 .ops = &hsw_power_well_ops, 2972 .ops = &icl_tc_phy_aux_power_well_ops,
2941 .id = DISP_PW_ID_NONE, 2973 .id = DISP_PW_ID_NONE,
2942 { 2974 {
2943 .hsw.regs = &icl_aux_power_well_regs, 2975 .hsw.regs = &icl_aux_power_well_regs,
2944 .hsw.idx = ICL_PW_CTL_IDX_AUX_TBT3, 2976 .hsw.idx = ICL_PW_CTL_IDX_AUX_TBT3,
2977 .hsw.is_tc_tbt = true,
2945 }, 2978 },
2946 }, 2979 },
2947 { 2980 {
2948 .name = "AUX TBT4", 2981 .name = "AUX TBT4",
2949 .domains = ICL_AUX_TBT4_IO_POWER_DOMAINS, 2982 .domains = ICL_AUX_TBT4_IO_POWER_DOMAINS,
2950 .ops = &hsw_power_well_ops, 2983 .ops = &icl_tc_phy_aux_power_well_ops,
2951 .id = DISP_PW_ID_NONE, 2984 .id = DISP_PW_ID_NONE,
2952 { 2985 {
2953 .hsw.regs = &icl_aux_power_well_regs, 2986 .hsw.regs = &icl_aux_power_well_regs,
2954 .hsw.idx = ICL_PW_CTL_IDX_AUX_TBT4, 2987 .hsw.idx = ICL_PW_CTL_IDX_AUX_TBT4,
2988 .hsw.is_tc_tbt = true,
2955 }, 2989 },
2956 }, 2990 },
2957 { 2991 {