Skip to content

Commit e1edbd4

Browse files
committed
drm/i915: Complain if we take too long under vblank evasion.
Instead of only complaining when we actually miss a vblank, always complain if we take longer than 100 us. This will make it easier to find cases where we potentially miss vblanks. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/1488292128-14540-2-git-send-email-maarten.lankhorst@linux.intel.com Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> [mlankhorst: Add commit message.]
1 parent 567f079 commit e1edbd4

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

drivers/gpu/drm/i915/intel_sprite.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ int intel_usecs_to_scanlines(const struct drm_display_mode *adjusted_mode,
6565
1000 * adjusted_mode->crtc_htotal);
6666
}
6767

68+
#define VBLANK_EVASION_TIME_US 100
69+
6870
/**
6971
* intel_pipe_update_start() - start update of a set of display registers
7072
* @crtc: the crtc of which the registers are going to be updated
@@ -92,7 +94,8 @@ void intel_pipe_update_start(struct intel_crtc *crtc)
9294
vblank_start = DIV_ROUND_UP(vblank_start, 2);
9395

9496
/* FIXME needs to be calibrated sensibly */
95-
min = vblank_start - intel_usecs_to_scanlines(adjusted_mode, 100);
97+
min = vblank_start - intel_usecs_to_scanlines(adjusted_mode,
98+
VBLANK_EVASION_TIME_US);
9699
max = vblank_start - 1;
97100

98101
local_irq_disable();
@@ -191,7 +194,12 @@ void intel_pipe_update_end(struct intel_crtc *crtc, struct intel_flip_work *work
191194
ktime_us_delta(end_vbl_time, crtc->debug.start_vbl_time),
192195
crtc->debug.min_vbl, crtc->debug.max_vbl,
193196
crtc->debug.scanline_start, scanline_end);
194-
}
197+
} else if (ktime_us_delta(end_vbl_time, crtc->debug.start_vbl_time) >
198+
VBLANK_EVASION_TIME_US)
199+
DRM_WARN("Atomic update on pipe (%c) took %lld us, max time under evasion is %u us\n",
200+
pipe_name(pipe),
201+
ktime_us_delta(end_vbl_time, crtc->debug.start_vbl_time),
202+
VBLANK_EVASION_TIME_US);
195203
}
196204

197205
static void

0 commit comments

Comments
 (0)