Skip to contentSkip to conversation

drm/i915: Don't forget to mark crtc as inactive after disable

PATCH Applied Patrik Jakobsson 5 participants 8 messages Jul 8, 2015 – Jul 13, 2015

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

PATCH v2 1/1 drm/i915: Don't forget to mark crtc as inactive after disable

Watermark calculations depend on the intel_crtc->active flag to be set properly. Suspend/resume is broken on SKL and we also get DDB mismatches without this patch.

The regression was introduced in:

commit eddfcbcdc27fbecb33bff098967bbdd7ca75bfa6

Author: Maarten Lankhorst <[email protected]>
Date:   Mon Jun 15 12:33:53 2015 +0200

drm/i915: Update less state during modeset.

No need to repeatedly call update_watermarks, or update_fbc. Down to a single call to update_watermarks in .crtc_enable

Tested-by(IVB): Matt Roper <[email protected]>

v2: Don't touch disable_shared_dpll()

---
 drivers/gpu/drm/i915/intel_display.c | 9 +++++++++
 1 file changed, 9 insertions(+)
drivers/gpu/drm/i915/intel_display.c +9 -0
index 3c2425f..b4f7a4f 100644
@@ -5046,6 +5046,9 @@ static void ironlake_crtc_disable(struct drm_crtc *crtc)
 
 		ironlake_fdi_pll_disable(intel_crtc);
 	}
+
+	intel_crtc->active = false;
+	intel_update_watermarks(crtc);
 }
 
 static void haswell_crtc_disable(struct drm_crtc *crtc)
@@ -5091,6 +5094,9 @@ static void haswell_crtc_disable(struct drm_crtc *crtc)
 	for_each_encoder_on_crtc(dev, crtc, encoder)
 		if (encoder->post_disable)
 			encoder->post_disable(encoder);
+
+	intel_crtc->active = false;
+	intel_update_watermarks(crtc);
 }
 
 static void i9xx_pfit_enable(struct intel_crtc *crtc)
@@ -6155,6 +6161,9 @@ static void i9xx_crtc_disable(struct drm_crtc *crtc)
 
 	if (!IS_GEN2(dev))
 		intel_set_cpu_fifo_underrun_reporting(dev_priv, pipe, false);
+
+	intel_crtc->active = false;
+	intel_update_watermarks(crtc);
 }
 
 static void intel_crtc_disable_noatomic(struct drm_crtc *crtc)
Signature · 6 lines
2.1.4

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Tested-by on v2 1/1
#1 lore raw

Task id: 6751 -------------------------------------Summary-------------------------------------
Platform Delta drm-intel-nightly Series Applied

ILK                                  302/302              302/302
SNB                                  312/316              312/316
IVB                                  343/343              343/343

BYT -1 287/287 286/287
HSW 380/380 380/380
-------------------------------------Detailed-------------------------------------
Platform Test drm-intel-nightly Series Applied
*BYT igt@gem_partial_pwrite_pread@reads-display PASS(1) FAIL(1)
Note: You need to pay more attention to line start with '*'
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

#2 lore raw
In reply to Patrik Jakobsson

Hi Patrik,

Please do Cc the patch author and reviewer when finding a regression, they are superb candidates for the review, especially when they are busy rewriting the display code.

Quoted 15 lines · Patrik Jakobsson

Watermark calculations depend on the intel_crtc->active flag to be set properly. Suspend/resume is broken on SKL and we also get DDB mismatches without this patch.

The regression was introduced in:

commit eddfcbcdc27fbecb33bff098967bbdd7ca75bfa6

Author: Maarten Lankhorst <[email protected]>
Date:   Mon Jun 15 12:33:53 2015 +0200

drm/i915: Update less state during modeset.

No need to repeatedly call update_watermarks, or update_fbc. Down to a single call to update_watermarks in .crtc_enable

Quoted 8 lines

Tested-by(IVB): Matt Roper <[email protected]>

v2: Don't touch disable_shared_dpll()

We do need to update the watermarks in disable() as well, to repartition the DDB and update the watermarks based on the new allocation.

Maarten, Matt, I've no clue where you want the crtc state update, where the atomic WM work is at, could you comment?

Thanks,

Signature · 1 line
Damien
Quoted 45 lines
---
 drivers/gpu/drm/i915/intel_display.c | 9 +++++++++
 1 file changed, 9 insertions(+)
drivers/gpu/drm/i915/intel_display.c +9 -0
index 3c2425f..b4f7a4f 100644
@@ -5046,6 +5046,9 @@ static void ironlake_crtc_disable(struct drm_crtc *crtc)
 
 		ironlake_fdi_pll_disable(intel_crtc);
 	}
+
+	intel_crtc->active = false;
+	intel_update_watermarks(crtc);
 }
 
 static void haswell_crtc_disable(struct drm_crtc *crtc)
@@ -5091,6 +5094,9 @@ static void haswell_crtc_disable(struct drm_crtc *crtc)
 	for_each_encoder_on_crtc(dev, crtc, encoder)
 		if (encoder->post_disable)
 			encoder->post_disable(encoder);
+
+	intel_crtc->active = false;
+	intel_update_watermarks(crtc);
 }
 
 static void i9xx_pfit_enable(struct intel_crtc *crtc)
@@ -6155,6 +6161,9 @@ static void i9xx_crtc_disable(struct drm_crtc *crtc)
 
 	if (!IS_GEN2(dev))
 		intel_set_cpu_fifo_underrun_reporting(dev_priv, pipe, false);
+
+	intel_crtc->active = false;
+	intel_update_watermarks(crtc);
 }
 
 static void intel_crtc_disable_noatomic(struct drm_crtc *crtc)
Signature · 6 lines
2.1.4

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

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

#3 lore raw
Quoted 5 lines · Damien Lespiau

Hi Patrik,

Please do Cc the patch author and reviewer when finding a regression, they are superb candidates for the review, especially when they are busy rewriting the display code.

Hmm, I figured they would be picked up from the commit msg by git-send-email but maybe that doesn't work on indented lines.

Anyways, CCing them now.

Thanks
Patrik

Quoted 26 lines · Patrik Jakobsson
Quoted 15 lines

Watermark calculations depend on the intel_crtc->active flag to be set properly. Suspend/resume is broken on SKL and we also get DDB mismatches without this patch.

The regression was introduced in:

commit eddfcbcdc27fbecb33bff098967bbdd7ca75bfa6

Author: Maarten Lankhorst <[email protected]>
Date:   Mon Jun 15 12:33:53 2015 +0200

drm/i915: Update less state during modeset.

No need to repeatedly call update_watermarks, or update_fbc. Down to a single call to update_watermarks in .crtc_enable

Quoted 8 lines

Tested-by(IVB): Matt Roper <[email protected]>

v2: Don't touch disable_shared_dpll()

Quoted 56 lines

We do need to update the watermarks in disable() as well, to repartition the DDB and update the watermarks based on the new allocation.

Maarten, Matt, I've no clue where you want the crtc state update, where the atomic WM work is at, could you comment?

Thanks,

Signature · 1 line
Damien
Quoted 45 lines
---
 drivers/gpu/drm/i915/intel_display.c | 9 +++++++++
 1 file changed, 9 insertions(+)
drivers/gpu/drm/i915/intel_display.c +9 -0
index 3c2425f..b4f7a4f 100644
@@ -5046,6 +5046,9 @@ static void ironlake_crtc_disable(struct drm_crtc *crtc)
 
 		ironlake_fdi_pll_disable(intel_crtc);
 	}
+
+	intel_crtc->active = false;
+	intel_update_watermarks(crtc);
 }
 
 static void haswell_crtc_disable(struct drm_crtc *crtc)
@@ -5091,6 +5094,9 @@ static void haswell_crtc_disable(struct drm_crtc *crtc)
 	for_each_encoder_on_crtc(dev, crtc, encoder)
 		if (encoder->post_disable)
 			encoder->post_disable(encoder);
+
+	intel_crtc->active = false;
+	intel_update_watermarks(crtc);
 }
 
 static void i9xx_pfit_enable(struct intel_crtc *crtc)
@@ -6155,6 +6161,9 @@ static void i9xx_crtc_disable(struct drm_crtc *crtc)
 
 	if (!IS_GEN2(dev))
 		intel_set_cpu_fifo_underrun_reporting(dev_priv, pipe, false);
+
+	intel_crtc->active = false;
+	intel_update_watermarks(crtc);
 }
 
 static void intel_crtc_disable_noatomic(struct drm_crtc *crtc)
Signature · 6 lines
2.1.4

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

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

Reviewed-by
#4 lore raw
In reply to Damien Lespiau

Op 10-07-15 om 13:22 schreef Damien Lespiau:

Quoted 27 lines

Hi Patrik,

Please do Cc the patch author and reviewer when finding a regression, they are superb candidates for the review, especially when they are busy rewriting the display code.

Quoted 20 lines · Patrik Jakobsson

Watermark calculations depend on the intel_crtc->active flag to be set properly. Suspend/resume is broken on SKL and we also get DDB mismatches without this patch.

The regression was introduced in:

commit eddfcbcdc27fbecb33bff098967bbdd7ca75bfa6

Author: Maarten Lankhorst <[email protected]>
Date:   Mon Jun 15 12:33:53 2015 +0200

drm/i915: Update less state during modeset.

No need to repeatedly call update_watermarks, or update_fbc. Down to a single call to update_watermarks in .crtc_enable

Tested-by(IVB): Matt Roper <[email protected]>

Quoted 9 lines
Quoted 3 lines

v2: Don't touch disable_shared_dpll()

We do need to update the watermarks in disable() as well, to repartition the DDB and update the watermarks based on the new allocation.

Maarten, Matt, I've no clue where you want the crtc state update, where the atomic WM work is at, could you comment?

I'd rather have we had a better way of updating watermarks, but keeping it in the .crtc_disable hook looks good to me right now. Some proper atomic solution will eventually have to be done. :)

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

#5 lore raw
Quoted 6 lines · Maarten Lankhorst

Op 10-07-15 om 13:22 schreef Damien Lespiau:

Quoted 5 lines

Hi Patrik,

Please do Cc the patch author and reviewer when finding a regression, they are superb candidates for the review, especially when they are busy rewriting the display code.

Yeah you need to list everyone you want to Cc: explicitly.

Quoted 27 lines
Quoted 27 lines · Patrik Jakobsson
Quoted 15 lines

Watermark calculations depend on the intel_crtc->active flag to be set properly. Suspend/resume is broken on SKL and we also get DDB mismatches without this patch.

The regression was introduced in:

commit eddfcbcdc27fbecb33bff098967bbdd7ca75bfa6

Author: Maarten Lankhorst <[email protected]>
Date:   Mon Jun 15 12:33:53 2015 +0200

drm/i915: Update less state during modeset.

No need to repeatedly call update_watermarks, or update_fbc. Down to a single call to update_watermarks in .crtc_enable

Quoted 8 lines

Tested-by(IVB): Matt Roper <[email protected]>

v2: Don't touch disable_shared_dpll()

We do need to update the watermarks in disable() as well, to repartition the DDB and update the watermarks based on the new allocation.

Quoted 8 lines
Quoted 3 lines

Maarten, Matt, I've no clue where you want the crtc state update, where the atomic WM work is at, could you comment?

I'd rather have we had a better way of updating watermarks, but keeping it in the .crtc_disable hook looks good to me right now. Some proper atomic solution will eventually have to be done. :)

Queued for -next, thanks for the patch.
-Daniel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#6 lore raw
Quoted 9 lines · Daniel Vetter
Quoted 6 lines · Maarten Lankhorst

Op 10-07-15 om 13:22 schreef Damien Lespiau:

Quoted 5 lines

Hi Patrik,

Please do Cc the patch author and reviewer when finding a regression, they are superb candidates for the review, especially when they are busy rewriting the display code.

Yeah you need to list everyone you want to Cc: explicitly.

Also need the Bugzilla reference when fixing a bug. In this case:

https://bugs.freedesktop.org/show_bug.cgi?id=91203

Signature · 5 lines
Damien
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#7 lore raw
Quoted 9 lines · Damien Lespiau
Quoted 8 lines · Daniel Vetter
Quoted 6 lines · Maarten Lankhorst

Op 10-07-15 om 13:22 schreef Damien Lespiau:

Quoted 5 lines

Hi Patrik,

Please do Cc the patch author and reviewer when finding a regression, they are superb candidates for the review, especially when they are busy rewriting the display code.

Quoted 5 lines
Quoted 1 line

Yeah you need to list everyone you want to Cc: explicitly.

Also need the Bugzilla reference when fixing a bug. In this case:

https://bugs.freedesktop.org/show_bug.cgi?id=91203

Added, thanks for supplying the link.
-Daniel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx