diff options
Diffstat (limited to 'drivers/gpu/drm/i915/i915_irq.c')
-rw-r--r-- | drivers/gpu/drm/i915/i915_irq.c | 69 |
1 files changed, 50 insertions, 19 deletions
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c index ee313247673b..53bb7de6020d 100644 --- a/drivers/gpu/drm/i915/i915_irq.c +++ b/drivers/gpu/drm/i915/i915_irq.c | |||
@@ -3123,19 +3123,16 @@ static void ibx_hpd_irq_setup(struct drm_i915_private *dev_priv) | |||
3123 | I915_WRITE(PCH_PORT_HOTPLUG, hotplug); | 3123 | I915_WRITE(PCH_PORT_HOTPLUG, hotplug); |
3124 | } | 3124 | } |
3125 | 3125 | ||
3126 | static void spt_hpd_irq_setup(struct drm_i915_private *dev_priv) | 3126 | static void spt_hpd_detection_setup(struct drm_i915_private *dev_priv) |
3127 | { | 3127 | { |
3128 | u32 hotplug_irqs, hotplug, enabled_irqs; | 3128 | u32 hotplug; |
3129 | |||
3130 | hotplug_irqs = SDE_HOTPLUG_MASK_SPT; | ||
3131 | enabled_irqs = intel_hpd_enabled_irqs(dev_priv, hpd_spt); | ||
3132 | |||
3133 | ibx_display_interrupt_update(dev_priv, hotplug_irqs, enabled_irqs); | ||
3134 | 3129 | ||
3135 | /* Enable digital hotplug on the PCH */ | 3130 | /* Enable digital hotplug on the PCH */ |
3136 | hotplug = I915_READ(PCH_PORT_HOTPLUG); | 3131 | hotplug = I915_READ(PCH_PORT_HOTPLUG); |
3137 | hotplug |= PORTD_HOTPLUG_ENABLE | PORTC_HOTPLUG_ENABLE | | 3132 | hotplug |= PORTA_HOTPLUG_ENABLE | |
3138 | PORTB_HOTPLUG_ENABLE | PORTA_HOTPLUG_ENABLE; | 3133 | PORTB_HOTPLUG_ENABLE | |
3134 | PORTC_HOTPLUG_ENABLE | | ||
3135 | PORTD_HOTPLUG_ENABLE; | ||
3139 | I915_WRITE(PCH_PORT_HOTPLUG, hotplug); | 3136 | I915_WRITE(PCH_PORT_HOTPLUG, hotplug); |
3140 | 3137 | ||
3141 | hotplug = I915_READ(PCH_PORT_HOTPLUG2); | 3138 | hotplug = I915_READ(PCH_PORT_HOTPLUG2); |
@@ -3143,6 +3140,18 @@ static void spt_hpd_irq_setup(struct drm_i915_private *dev_priv) | |||
3143 | I915_WRITE(PCH_PORT_HOTPLUG2, hotplug); | 3140 | I915_WRITE(PCH_PORT_HOTPLUG2, hotplug); |
3144 | } | 3141 | } |
3145 | 3142 | ||
3143 | static void spt_hpd_irq_setup(struct drm_i915_private *dev_priv) | ||
3144 | { | ||
3145 | u32 hotplug_irqs, enabled_irqs; | ||
3146 | |||
3147 | hotplug_irqs = SDE_HOTPLUG_MASK_SPT; | ||
3148 | enabled_irqs = intel_hpd_enabled_irqs(dev_priv, hpd_spt); | ||
3149 | |||
3150 | ibx_display_interrupt_update(dev_priv, hotplug_irqs, enabled_irqs); | ||
3151 | |||
3152 | spt_hpd_detection_setup(dev_priv); | ||
3153 | } | ||
3154 | |||
3146 | static void ilk_hpd_irq_setup(struct drm_i915_private *dev_priv) | 3155 | static void ilk_hpd_irq_setup(struct drm_i915_private *dev_priv) |
3147 | { | 3156 | { |
3148 | u32 hotplug_irqs, hotplug, enabled_irqs; | 3157 | u32 hotplug_irqs, hotplug, enabled_irqs; |
@@ -3177,18 +3186,15 @@ static void ilk_hpd_irq_setup(struct drm_i915_private *dev_priv) | |||
3177 | ibx_hpd_irq_setup(dev_priv); | 3186 | ibx_hpd_irq_setup(dev_priv); |
3178 | } | 3187 | } |
3179 | 3188 | ||
3180 | static void bxt_hpd_irq_setup(struct drm_i915_private *dev_priv) | 3189 | static void __bxt_hpd_detection_setup(struct drm_i915_private *dev_priv, |
3190 | u32 enabled_irqs) | ||
3181 | { | 3191 | { |
3182 | u32 hotplug_irqs, hotplug, enabled_irqs; | 3192 | u32 hotplug; |
3183 | |||
3184 | enabled_irqs = intel_hpd_enabled_irqs(dev_priv, hpd_bxt); | ||
3185 | hotplug_irqs = BXT_DE_PORT_HOTPLUG_MASK; | ||
3186 | |||
3187 | bdw_update_port_irq(dev_priv, hotplug_irqs, enabled_irqs); | ||
3188 | 3193 | ||
3189 | hotplug = I915_READ(PCH_PORT_HOTPLUG); | 3194 | hotplug = I915_READ(PCH_PORT_HOTPLUG); |
3190 | hotplug |= PORTC_HOTPLUG_ENABLE | PORTB_HOTPLUG_ENABLE | | 3195 | hotplug |= PORTA_HOTPLUG_ENABLE | |
3191 | PORTA_HOTPLUG_ENABLE; | 3196 | PORTB_HOTPLUG_ENABLE | |
3197 | PORTC_HOTPLUG_ENABLE; | ||
3192 | 3198 | ||
3193 | DRM_DEBUG_KMS("Invert bit setting: hp_ctl:%x hp_port:%x\n", | 3199 | DRM_DEBUG_KMS("Invert bit setting: hp_ctl:%x hp_port:%x\n", |
3194 | hotplug, enabled_irqs); | 3200 | hotplug, enabled_irqs); |
@@ -3198,7 +3204,6 @@ static void bxt_hpd_irq_setup(struct drm_i915_private *dev_priv) | |||
3198 | * For BXT invert bit has to be set based on AOB design | 3204 | * For BXT invert bit has to be set based on AOB design |
3199 | * for HPD detection logic, update it based on VBT fields. | 3205 | * for HPD detection logic, update it based on VBT fields. |
3200 | */ | 3206 | */ |
3201 | |||
3202 | if ((enabled_irqs & BXT_DE_PORT_HP_DDIA) && | 3207 | if ((enabled_irqs & BXT_DE_PORT_HP_DDIA) && |
3203 | intel_bios_is_port_hpd_inverted(dev_priv, PORT_A)) | 3208 | intel_bios_is_port_hpd_inverted(dev_priv, PORT_A)) |
3204 | hotplug |= BXT_DDIA_HPD_INVERT; | 3209 | hotplug |= BXT_DDIA_HPD_INVERT; |
@@ -3212,6 +3217,23 @@ static void bxt_hpd_irq_setup(struct drm_i915_private *dev_priv) | |||
3212 | I915_WRITE(PCH_PORT_HOTPLUG, hotplug); | 3217 | I915_WRITE(PCH_PORT_HOTPLUG, hotplug); |
3213 | } | 3218 | } |
3214 | 3219 | ||
3220 | static void bxt_hpd_detection_setup(struct drm_i915_private *dev_priv) | ||
3221 | { | ||
3222 | __bxt_hpd_detection_setup(dev_priv, BXT_DE_PORT_HOTPLUG_MASK); | ||
3223 | } | ||
3224 | |||
3225 | static void bxt_hpd_irq_setup(struct drm_i915_private *dev_priv) | ||
3226 | { | ||
3227 | u32 hotplug_irqs, enabled_irqs; | ||
3228 | |||
3229 | enabled_irqs = intel_hpd_enabled_irqs(dev_priv, hpd_bxt); | ||
3230 | hotplug_irqs = BXT_DE_PORT_HOTPLUG_MASK; | ||
3231 | |||
3232 | bdw_update_port_irq(dev_priv, hotplug_irqs, enabled_irqs); | ||
3233 | |||
3234 | __bxt_hpd_detection_setup(dev_priv, enabled_irqs); | ||
3235 | } | ||
3236 | |||
3215 | static void ibx_irq_postinstall(struct drm_device *dev) | 3237 | static void ibx_irq_postinstall(struct drm_device *dev) |
3216 | { | 3238 | { |
3217 | struct drm_i915_private *dev_priv = to_i915(dev); | 3239 | struct drm_i915_private *dev_priv = to_i915(dev); |
@@ -3227,6 +3249,12 @@ static void ibx_irq_postinstall(struct drm_device *dev) | |||
3227 | 3249 | ||
3228 | gen5_assert_iir_is_zero(dev_priv, SDEIIR); | 3250 | gen5_assert_iir_is_zero(dev_priv, SDEIIR); |
3229 | I915_WRITE(SDEIMR, ~mask); | 3251 | I915_WRITE(SDEIMR, ~mask); |
3252 | |||
3253 | if (HAS_PCH_IBX(dev_priv) || HAS_PCH_CPT(dev_priv) || | ||
3254 | HAS_PCH_LPT(dev_priv)) | ||
3255 | ; /* TODO: Enable HPD detection on older PCH platforms too */ | ||
3256 | else | ||
3257 | spt_hpd_detection_setup(dev_priv); | ||
3230 | } | 3258 | } |
3231 | 3259 | ||
3232 | static void gen5_gt_irq_postinstall(struct drm_device *dev) | 3260 | static void gen5_gt_irq_postinstall(struct drm_device *dev) |
@@ -3438,6 +3466,9 @@ static void gen8_de_irq_postinstall(struct drm_i915_private *dev_priv) | |||
3438 | 3466 | ||
3439 | GEN5_IRQ_INIT(GEN8_DE_PORT_, ~de_port_masked, de_port_enables); | 3467 | GEN5_IRQ_INIT(GEN8_DE_PORT_, ~de_port_masked, de_port_enables); |
3440 | GEN5_IRQ_INIT(GEN8_DE_MISC_, ~de_misc_masked, de_misc_masked); | 3468 | GEN5_IRQ_INIT(GEN8_DE_MISC_, ~de_misc_masked, de_misc_masked); |
3469 | |||
3470 | if (IS_GEN9_LP(dev_priv)) | ||
3471 | bxt_hpd_detection_setup(dev_priv); | ||
3441 | } | 3472 | } |
3442 | 3473 | ||
3443 | static int gen8_irq_postinstall(struct drm_device *dev) | 3474 | static int gen8_irq_postinstall(struct drm_device *dev) |