drm/i915: Make vblank evade warnings optional

Add a new Kconfig option to enable/disable the extra warnings
from the vblank evade code. For now we'll keep the warning
about an actually missed vblank always enabled as that can have
an actual user visible impact. But if we miss the deadline
othrwise there's no real need to bother the user with that.
We'll want these warnings enabled during development however
so that we can catch regressions.

Based on the reports it looks like this is still very easy
to hit on SKL, so we have more work ahead of us to optimize
the crtiical section further.

Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Dave Airlie <airlied@redhat.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reported-by: Jens Axboe <axboe@kernel.dk>
Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
Fixes: e1edbd44e23b ("drm/i915: Complain if we take too long under vblank evasion.")
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@redhat.com>

authored by Ville Syrjälä and committed by Dave Airlie 7b8cd336 bb57d041

+18 -2
+13
drivers/gpu/drm/i915/Kconfig.debug
··· 87 and also analyze the request dependency resolving timeline. 88 89 If in doubt, say "N".
··· 87 and also analyze the request dependency resolving timeline. 88 89 If in doubt, say "N". 90 + 91 + config DRM_I915_DEBUG_VBLANK_EVADE 92 + bool "Enable extra debug warnings for vblank evasion" 93 + depends on DRM_I915 94 + default n 95 + help 96 + Choose this option to turn on extra debug warnings for the 97 + vblank evade mechanism. This gives a warning every time the 98 + the deadline allotted for the vblank evade critical section 99 + is exceeded, even if there isn't an actual risk of missing 100 + the vblank. 101 + 102 + If in doubt, say "N".
+5 -2
drivers/gpu/drm/i915/intel_sprite.c
··· 198 ktime_us_delta(end_vbl_time, crtc->debug.start_vbl_time), 199 crtc->debug.min_vbl, crtc->debug.max_vbl, 200 crtc->debug.scanline_start, scanline_end); 201 - } else if (ktime_us_delta(end_vbl_time, crtc->debug.start_vbl_time) > 202 - VBLANK_EVASION_TIME_US) 203 DRM_WARN("Atomic update on pipe (%c) took %lld us, max time under evasion is %u us\n", 204 pipe_name(pipe), 205 ktime_us_delta(end_vbl_time, crtc->debug.start_vbl_time), 206 VBLANK_EVASION_TIME_US); 207 } 208 209 static void
··· 198 ktime_us_delta(end_vbl_time, crtc->debug.start_vbl_time), 199 crtc->debug.min_vbl, crtc->debug.max_vbl, 200 crtc->debug.scanline_start, scanline_end); 201 + } 202 + #ifdef CONFIG_DRM_I915_DEBUG_VBLANK_EVADE 203 + else if (ktime_us_delta(end_vbl_time, crtc->debug.start_vbl_time) > 204 + VBLANK_EVASION_TIME_US) 205 DRM_WARN("Atomic update on pipe (%c) took %lld us, max time under evasion is %u us\n", 206 pipe_name(pipe), 207 ktime_us_delta(end_vbl_time, crtc->debug.start_vbl_time), 208 VBLANK_EVASION_TIME_US); 209 + #endif 210 } 211 212 static void