Commit eb120ef6 authored by Jesse Barnes's avatar Jesse Barnes Committed by Jani Nikula

drm/i915: add more debug info for when atomic updates fail v3

I used these additional fields to track down the issue I saw on HSW.

v2: move debug fields into a substruct (Ville)
v3: clean up debug code more (Ville)

References: https://bugs.freedesktop.org/show_bug.cgi?id=91579Signed-off-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
parent d9072a3e
...@@ -565,8 +565,12 @@ struct intel_crtc { ...@@ -565,8 +565,12 @@ struct intel_crtc {
int scanline_offset; int scanline_offset;
unsigned start_vbl_count; struct {
ktime_t start_vbl_time; unsigned start_vbl_count;
ktime_t start_vbl_time;
int min_vbl, max_vbl;
int scanline_start;
} debug;
struct intel_crtc_atomic_commit atomic; struct intel_crtc_atomic_commit atomic;
......
...@@ -95,7 +95,6 @@ void intel_pipe_update_start(struct intel_crtc *crtc) ...@@ -95,7 +95,6 @@ void intel_pipe_update_start(struct intel_crtc *crtc)
max = vblank_start - 1; max = vblank_start - 1;
local_irq_disable(); local_irq_disable();
crtc->start_vbl_count = 0;
if (min <= 0 || max <= 0) if (min <= 0 || max <= 0)
return; return;
...@@ -134,11 +133,15 @@ void intel_pipe_update_start(struct intel_crtc *crtc) ...@@ -134,11 +133,15 @@ void intel_pipe_update_start(struct intel_crtc *crtc)
drm_crtc_vblank_put(&crtc->base); drm_crtc_vblank_put(&crtc->base);
crtc->start_vbl_time = ktime_get(); crtc->debug.min_vbl = min;
crtc->start_vbl_count = dev->driver->get_vblank_counter(dev, pipe); crtc->debug.max_vbl = max;
crtc->debug.scanline_start = scanline;
crtc->debug.start_vbl_time = ktime_get();
crtc->debug.start_vbl_count =
dev->driver->get_vblank_counter(dev, pipe);
trace_i915_pipe_update_vblank_evaded(crtc, min, max, trace_i915_pipe_update_vblank_evaded(crtc, min, max,
crtc->start_vbl_count); crtc->debug.start_vbl_count);
} }
/** /**
...@@ -154,6 +157,7 @@ void intel_pipe_update_end(struct intel_crtc *crtc) ...@@ -154,6 +157,7 @@ void intel_pipe_update_end(struct intel_crtc *crtc)
{ {
struct drm_device *dev = crtc->base.dev; struct drm_device *dev = crtc->base.dev;
enum pipe pipe = crtc->pipe; enum pipe pipe = crtc->pipe;
int scanline_end = intel_get_crtc_scanline(crtc);
u32 end_vbl_count = dev->driver->get_vblank_counter(dev, pipe); u32 end_vbl_count = dev->driver->get_vblank_counter(dev, pipe);
ktime_t end_vbl_time = ktime_get(); ktime_t end_vbl_time = ktime_get();
...@@ -161,10 +165,15 @@ void intel_pipe_update_end(struct intel_crtc *crtc) ...@@ -161,10 +165,15 @@ void intel_pipe_update_end(struct intel_crtc *crtc)
local_irq_enable(); local_irq_enable();
if (crtc->start_vbl_count && crtc->start_vbl_count != end_vbl_count) if (crtc->debug.start_vbl_count &&
DRM_ERROR("Atomic update failure on pipe %c (start=%u end=%u) time %lld us\n", crtc->debug.start_vbl_count != end_vbl_count) {
pipe_name(pipe), crtc->start_vbl_count, end_vbl_count, DRM_ERROR("Atomic update failure on pipe %c (start=%u end=%u) time %lld us, min %d, max %d, scanline start %d, end %d\n",
ktime_us_delta(end_vbl_time, crtc->start_vbl_time)); pipe_name(pipe), crtc->debug.start_vbl_count,
end_vbl_count,
ktime_us_delta(end_vbl_time, crtc->debug.start_vbl_time),
crtc->debug.min_vbl, crtc->debug.max_vbl,
crtc->debug.scanline_start, scanline_end);
}
} }
static void static void
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment