Skip to contentSkip to conversation

drm/i915: make sure south port interrupts are enabled properly

PATCH In review Jesse Barnes 2 participants 8 messages Jan 10, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 drm/i915: make sure south port interrupts are enabled properly

We were apparently relying on the defaults on BDW, which resulted in no hotplug or AUX interrupts.

References: https://bugs.freedesktop.org/show_bug.cgi?id=72834
References: https://bugs.freedesktop.org/show_bug.cgi?id=72833

---
 drivers/gpu/drm/i915/i915_irq.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_irq.c +3 -1
index 261254a..f88e265 100644
@@ -2763,13 +2763,15 @@ static void ibx_irq_postinstall(struct drm_device *dev)
 		mask = SDE_GMBUS | SDE_AUX_MASK | SDE_TRANSB_FIFO_UNDER |
 		       SDE_TRANSA_FIFO_UNDER | SDE_POISON;
 	} else {
-		mask = SDE_GMBUS_CPT | SDE_AUX_MASK_CPT | SDE_ERROR_CPT;
+		mask = SDE_GMBUS_CPT | SDE_AUX_MASK_CPT | SDE_ERROR_CPT |
+			SDE_HOTPLUG_MASK_CPT;
 
 		I915_WRITE(SERR_INT, I915_READ(SERR_INT));
 	}
 
 	I915_WRITE(SDEIIR, I915_READ(SDEIIR));
 	I915_WRITE(SDEIMR, ~mask);
+	I915_WRITE(SDEIER, mask);
 }
 
 static void gen5_gt_irq_postinstall(struct drm_device *dev)
Signature · 1 line
1.8.3.2
#1 lore raw

PATCH 2/2 drm/i915: get proper hwrawclk freq on BDW

We need to read out the CDclk to calculate the DP aux divider correctly.

---
 drivers/gpu/drm/i915/intel_dp.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/i915/intel_dp.c +3 -0
index 7df5085..4ac1da5 100644
@@ -214,6 +214,9 @@ intel_hrawclk(struct drm_device *dev)
 	if (IS_VALLEYVIEW(dev))
 		return 200;
 
+	if (IS_BROADWELL(dev))
+		return intel_ddi_get_cdclk_freq(dev_priv) / 1000;
+
 	clkcfg = I915_READ(CLKCFG);
 	switch (clkcfg & CLKCFG_FSB_MASK) {
 	case CLKCFG_FSB_400:
Signature · 1 line
1.8.3.2
#2 lore raw
In reply to Jesse Barnes
Quoted 21 lines · On Fri, 10 Jan 2014 13:02:20 -0800 Jesse Barnes <[email protected]>…

We were apparently relying on the defaults on BDW, which resulted in no hotplug or AUX interrupts.

References: https://bugs.freedesktop.org/show_bug.cgi?id=72834
References: https://bugs.freedesktop.org/show_bug.cgi?id=72833

---
 drivers/gpu/drm/i915/i915_irq.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_irq.c +2 -1
index 261254a..f88e265 100644
@@ -2763,13 +2763,15 @@ static void ibx_irq_postinstall(struct drm_device *dev)
 		mask = SDE_GMBUS | SDE_AUX_MASK | SDE_TRANSB_FIFO_UNDER |
 		       SDE_TRANSA_FIFO_UNDER | SDE_POISON;
 	} else {
-		mask = SDE_GMBUS_CPT | SDE_AUX_MASK_CPT | SDE_ERROR_CPT;
+		mask = SDE_GMBUS_CPT | SDE_AUX_MASK_CPT | SDE_ERROR_CPT |
+			SDE_HOTPLUG_MASK_CPT;

drivers/gpu/drm/i915/i915_irq.c static void ibx_irq_postinstall(struct drm_device *dev) · line 2777

Quoted 10 lines
drivers/gpu/drm/i915/i915_irq.c +1 -0
 
 		I915_WRITE(SERR_INT, I915_READ(SERR_INT));
 	}
 
 	I915_WRITE(SDEIIR, I915_READ(SDEIIR));
 	I915_WRITE(SDEIMR, ~mask);
+	I915_WRITE(SDEIER, mask);
 }
 
 static void gen5_gt_irq_postinstall(struct drm_device *dev)

Note we still don't handle port A interrupts. Not sure if that's important since we don't really use them yet, but if we want to add that we'd probably need to add some new code to the hpd functions to deal with walking both CPU and PCH masks.

Signature · 1 line
Jesse Barnes, Intel Open Source Technology Center
#3 lore raw

2014/1/10 Jesse Barnes <[email protected]>:

Quoted 33 lines
Quoted 30 lines · On Fri, 10 Jan 2014 13:02:20 -0800 Jesse Barnes <[email protected]>…

We were apparently relying on the defaults on BDW, which resulted in no hotplug or AUX interrupts.

References: https://bugs.freedesktop.org/show_bug.cgi?id=72834
References: https://bugs.freedesktop.org/show_bug.cgi?id=72833

---
 drivers/gpu/drm/i915/i915_irq.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_irq.c +3 -1
index 261254a..f88e265 100644
@@ -2763,13 +2763,15 @@ static void ibx_irq_postinstall(struct drm_device *dev)
              mask = SDE_GMBUS | SDE_AUX_MASK | SDE_TRANSB_FIFO_UNDER |
                     SDE_TRANSA_FIFO_UNDER | SDE_POISON;
      } else {
-             mask = SDE_GMBUS_CPT | SDE_AUX_MASK_CPT | SDE_ERROR_CPT;
+             mask = SDE_GMBUS_CPT | SDE_AUX_MASK_CPT | SDE_ERROR_CPT |
+                     SDE_HOTPLUG_MASK_CPT;
 
              I915_WRITE(SERR_INT, I915_READ(SERR_INT));
      }
 
      I915_WRITE(SDEIIR, I915_READ(SDEIIR));
      I915_WRITE(SDEIMR, ~mask);
+     I915_WRITE(SDEIER, mask);
 }
 
Quoted 6 lines

drivers/gpu/drm/i915/i915_irq.c static void ibx_irq_postinstall(struct drm_device *dev) · line 2777

Quoted 1 line
drivers/gpu/drm/i915/i915_irq.c +0 -0
 static void gen5_gt_irq_postinstall(struct drm_device *dev)

Note we still don't handle port A interrupts. Not sure if that's important since we don't really use them yet, but if we want to add that we'd probably need to add some new code to the hpd functions to deal with walking both CPU and PCH masks.

All the previous gens also lack this and things kinda work so far... The BIOS sets some state, and we lose it after suspend. Of course, I'm not suggesting we should keep it like this :)

Quoted 7 lines

--
Jesse Barnes, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

Signature · 1 line
Paulo Zanoni
#4 lore raw
In reply to Jesse Barnes

2014/1/10 Jesse Barnes <[email protected]>:

Quoted 18 lines

We were apparently relying on the defaults on BDW, which resulted in no hotplug or AUX interrupts.

References: https://bugs.freedesktop.org/show_bug.cgi?id=72834
References: https://bugs.freedesktop.org/show_bug.cgi?id=72833

---
 drivers/gpu/drm/i915/i915_irq.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_irq.c +0 -0
index 261254a..f88e265 100644
@@ -2763,13 +2763,15 @@ static void ibx_irq_postinstall(struct drm_device *dev)
                mask = SDE_GMBUS | SDE_AUX_MASK | SDE_TRANSB_FIFO_UNDER |
                       SDE_TRANSA_FIFO_UNDER | SDE_POISON;
        } else {

drivers/gpu/drm/i915/i915_irq.c static void ibx_irq_postinstall(struct drm_device *dev) · line 2774

Quoted 10 lines
drivers/gpu/drm/i915/i915_irq.c +3 -1
-               mask = SDE_GMBUS_CPT | SDE_AUX_MASK_CPT | SDE_ERROR_CPT;
+               mask = SDE_GMBUS_CPT | SDE_AUX_MASK_CPT | SDE_ERROR_CPT |
+                       SDE_HOTPLUG_MASK_CPT;
 
                I915_WRITE(SERR_INT, I915_READ(SERR_INT));
        }
 
        I915_WRITE(SDEIIR, I915_READ(SDEIIR));
        I915_WRITE(SDEIMR, ~mask);
+       I915_WRITE(SDEIER, mask);

ibx_irq_preinstall contains a nice comment explaining why SDEIER needs to be 0xffffffff.

I think the proper solution to your bug is probably to call ibx_irq_preinstall from gen8_irq_preinstall.

Quoted 10 lines
drivers/gpu/drm/i915/i915_irq.c +0 -1
 }
 
 static void gen5_gt_irq_postinstall(struct drm_device *dev)
--

1.8.3.2

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

Signature · 1 line
Paulo Zanoni
#5 lore raw

PATCH 1/1 drm/i915/bdw: make sure south port interrupts are enabled properly v2

In reply to Jesse Barnes

We were apparently relying on the defaults on BDW, which resulted in no hotplug or AUX interrupts. So be sure to call the ibx_irq_preinstall to enable all interrupts.

v2: use preinstall instead of redundant SDIER write

References: https://bugs.freedesktop.org/show_bug.cgi?id=72834
References: https://bugs.freedesktop.org/show_bug.cgi?id=72833

---
 drivers/gpu/drm/i915/i915_irq.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/i915/i915_irq.c +2 -0
index 261254a..69b0b71 100644
@@ -2714,6 +2714,8 @@ static void gen8_irq_preinstall(struct drm_device *dev)
 #undef GEN8_IRQ_INIT_NDX
 
 	POSTING_READ(GEN8_PCU_IIR);
+
+	ibx_irq_preinstall(dev);
 }
 
 static void ibx_hpd_irq_setup(struct drm_device *dev)
Signature · 1 line
1.8.3.2
Reviewed-by on v1 1/1
#6 lore raw

Re: [PATCH] drm/i915/bdw: make sure south port interrupts are enabled properly v2

2014/1/10 Jesse Barnes <[email protected]>:

Quoted 9 lines

We were apparently relying on the defaults on BDW, which resulted in no hotplug or AUX interrupts. So be sure to call the ibx_irq_preinstall to enable all interrupts.

v2: use preinstall instead of redundant SDIER write

References: https://bugs.freedesktop.org/show_bug.cgi?id=72834
References: https://bugs.freedesktop.org/show_bug.cgi?id=72833

And this should probably go to Kernel 3.13 too, right?

Quoted 24 lines
---
 drivers/gpu/drm/i915/i915_irq.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/i915/i915_irq.c +2 -1
index 261254a..69b0b71 100644
@@ -2714,6 +2714,8 @@ static void gen8_irq_preinstall(struct drm_device *dev)
 #undef GEN8_IRQ_INIT_NDX
 
        POSTING_READ(GEN8_PCU_IIR);
+
+       ibx_irq_preinstall(dev);
 }
 
 static void ibx_hpd_irq_setup(struct drm_device *dev)
--

1.8.3.2

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

Signature · 1 line
Paulo Zanoni
#7 lore raw

Re: [PATCH] drm/i915/bdw: make sure south port interrupts are enabled properly v2

Quoted 7 lines · On Fri, 10 Jan 2014 19:17:02 -0200 Paulo Zanoni <[email protected]> wrote:

2014/1/10 Jesse Barnes <[email protected]>:

Quoted 6 lines

We were apparently relying on the defaults on BDW, which resulted in no hotplug or AUX interrupts. So be sure to call the ibx_irq_preinstall to enable all interrupts.

v2: use preinstall instead of redundant SDIER write

Quoted 7 lines
Quoted 3 lines

References: https://bugs.freedesktop.org/show_bug.cgi?id=72834
References: https://bugs.freedesktop.org/show_bug.cgi?id=72833

And this should probably go to Kernel 3.13 too, right?

Yeah probably.

Daniel, please cc:stable

Thanks,

Signature · 1 line
Jesse Barnes, Intel Open Source Technology Center