Skip to contentSkip to conversation

drm/i915: Force vblanks around evasion when i915.watermark_test is set.

PATCH In review Maarten Lankhorst 2 participants 4 messages Jun 9, 2016 – Jun 14, 2016

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

PATCH 1/1 drm/i915: Force vblanks around evasion when i915.watermark_test is set.

This will make it more likely that intermediary watermarks cause fifo underruns, which is useful when writing watermark specific tests, to make it more likely to trigger FIFO underruns in intermediary watermarks.

---
 drivers/gpu/drm/i915/i915_params.c   | 1 +
 drivers/gpu/drm/i915/i915_params.h   | 1 +
 drivers/gpu/drm/i915/intel_display.c | 6 ++++++
 3 files changed, 8 insertions(+)
drivers/gpu/drm/i915/i915_params.c +1 -0
index 5e18cf9f754d..297d1cd53b15 100644
@@ -45,6 +45,7 @@ struct i915_params i915 __read_mostly = {
 	.fastboot = 0,
 	.prefault_disable = 0,
 	.load_detect_test = 0,
+	.watermark_test = 0,
 	.reset = true,
 	.invert_brightness = 0,
 	.disable_display = 0,
drivers/gpu/drm/i915/i915_params.h +1 -0
index 1323261a0cdd..91f976c6bac6 100644
@@ -57,6 +57,7 @@ struct i915_params {
 	bool fastboot;
 	bool prefault_disable;
 	bool load_detect_test;
+	bool watermark_test;
 	bool reset;
 	bool disable_display;
 	bool verbose_state_checks;
drivers/gpu/drm/i915/intel_display.c +6 -0
index 8bb8d36f5cb9..9dcf304c7b1f 100644
@@ -14184,6 +14184,9 @@ static void intel_begin_crtc_commit(struct drm_crtc *crtc,
 		to_intel_crtc_state(old_crtc_state);
 	bool modeset = needs_modeset(crtc->state);
 
+	if (i915.watermark_test)
+		intel_wait_for_vblank(dev, intel_crtc->pipe);
+
 	/* Perform vblank evasion around commit operation */
 	intel_pipe_update_start(intel_crtc);
 
@@ -14207,6 +14210,9 @@ static void intel_finish_crtc_commit(struct drm_crtc *crtc,
 	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
 
 	intel_pipe_update_end(intel_crtc, NULL);
+
+	if (i915.watermark_test)
+		intel_wait_for_vblank(crtc->dev, intel_crtc->pipe);
 }
 
 /**
Signature · 7 lines
2.5.5


_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw
Quoted 3 lines · Maarten Lankhorst

This will make it more likely that intermediary watermarks cause fifo underruns, which is useful when writing watermark specific tests, to make it more likely to trigger FIFO underruns in intermediary watermarks.

That's surprising ... with the vblank_wait added you're pretty much guaranteed to never hit the evasion case. Note that the vblank evasion code also just does a vblank wait if it detects a possible collision.

Given that I'd have assumed that this simply slows down atomic flips, which is probably not what we want for testing all. Does this really help? Any ideas why?
-Daniel

Quoted 64 lines
---
 drivers/gpu/drm/i915/i915_params.c   | 1 +
 drivers/gpu/drm/i915/i915_params.h   | 1 +
 drivers/gpu/drm/i915/intel_display.c | 6 ++++++
 3 files changed, 8 insertions(+)
drivers/gpu/drm/i915/i915_params.c +1 -0
index 5e18cf9f754d..297d1cd53b15 100644
@@ -45,6 +45,7 @@ struct i915_params i915 __read_mostly = {
 	.fastboot = 0,
 	.prefault_disable = 0,
 	.load_detect_test = 0,
+	.watermark_test = 0,
 	.reset = true,
 	.invert_brightness = 0,
 	.disable_display = 0,
drivers/gpu/drm/i915/i915_params.h +1 -0
index 1323261a0cdd..91f976c6bac6 100644
@@ -57,6 +57,7 @@ struct i915_params {
 	bool fastboot;
 	bool prefault_disable;
 	bool load_detect_test;
+	bool watermark_test;
 	bool reset;
 	bool disable_display;
 	bool verbose_state_checks;
drivers/gpu/drm/i915/intel_display.c +6 -0
index 8bb8d36f5cb9..9dcf304c7b1f 100644
@@ -14184,6 +14184,9 @@ static void intel_begin_crtc_commit(struct drm_crtc *crtc,
 		to_intel_crtc_state(old_crtc_state);
 	bool modeset = needs_modeset(crtc->state);
 
+	if (i915.watermark_test)
+		intel_wait_for_vblank(dev, intel_crtc->pipe);
+
 	/* Perform vblank evasion around commit operation */
 	intel_pipe_update_start(intel_crtc);
 
@@ -14207,6 +14210,9 @@ static void intel_finish_crtc_commit(struct drm_crtc *crtc,
 	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
 
 	intel_pipe_update_end(intel_crtc, NULL);
+
+	if (i915.watermark_test)
+		intel_wait_for_vblank(crtc->dev, intel_crtc->pipe);
 }
 
 /**
Signature · 7 lines
2.5.5


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

Op 13-06-16 om 16:45 schreef Daniel Vetter:

Quoted 11 lines · Maarten Lankhorst
Quoted 3 lines

This will make it more likely that intermediary watermarks cause fifo underruns, which is useful when writing watermark specific tests, to make it more likely to trigger FIFO underruns in intermediary watermarks.

That's surprising ... with the vblank_wait added you're pretty much guaranteed to never hit the evasion case. Note that the vblank evasion code also just does a vblank wait if it detects a possible collision.

Given that I'd have assumed that this simply slows down atomic flips, which is probably not what we want for testing all. Does this really help? Any ideas why?

This is a sanity check on the intermediate watermarks. The vblank test will ensure that the old plane configuration doesn't cause underruns with watermarks, and that the intermediate watermarks will work correctly with the new plane configuration too.

I think the latter vblank_wait may be killed, but the former could be really useful, for example to find correct watervblank values in CHV.

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

#3 lore raw
Quoted 12 lines · Maarten Lankhorst

Op 13-06-16 om 16:45 schreef Daniel Vetter:

Quoted 11 lines · Maarten Lankhorst
Quoted 3 lines

This will make it more likely that intermediary watermarks cause fifo underruns, which is useful when writing watermark specific tests, to make it more likely to trigger FIFO underruns in intermediary watermarks.

That's surprising ... with the vblank_wait added you're pretty much guaranteed to never hit the evasion case. Note that the vblank evasion code also just does a vblank wait if it detects a possible collision.

Given that I'd have assumed that this simply slows down atomic flips, which is probably not what we want for testing all. Does this really help? Any ideas why?

Quoted 6 lines

This is a sanity check on the intermediate watermarks. The vblank test will ensure that the old plane configuration doesn't cause underruns with watermarks, and that the intermediate watermarks will work correctly with the new plane configuration too.

I think the latter vblank_wait may be killed, but the former could be really useful, for example to find correct watervblank values in CHV.

Why can't we do the vblank wait in userspace? If we wait 1 vblank (or just for the drm event of the previous commit), and then immediately issue the next one, we will also run with intermediate watermarks for a full frame. At least I still don't see a super-short race window for which we need to have code in the kernel to properly provoke it ...
-Daniel

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