aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/gpu/drm/drm_irq.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c
index 91e8b4c55ea0..55239d285f25 100644
--- a/drivers/gpu/drm/drm_irq.c
+++ b/drivers/gpu/drm/drm_irq.c
@@ -453,12 +453,6 @@ void drm_calc_timestamping_constants(struct drm_crtc *crtc,
453 int linedur_ns = 0, pixeldur_ns = 0, framedur_ns = 0; 453 int linedur_ns = 0, pixeldur_ns = 0, framedur_ns = 0;
454 int dotclock = mode->crtc_clock; 454 int dotclock = mode->crtc_clock;
455 455
456 /* Fields of interlaced scanout modes are only half a frame duration.
457 * Double the dotclock to get half the frame-/line-/pixelduration.
458 */
459 if (mode->flags & DRM_MODE_FLAG_INTERLACE)
460 dotclock *= 2;
461
462 /* Valid dotclock? */ 456 /* Valid dotclock? */
463 if (dotclock > 0) { 457 if (dotclock > 0) {
464 int frame_size = mode->crtc_htotal * mode->crtc_vtotal; 458 int frame_size = mode->crtc_htotal * mode->crtc_vtotal;
@@ -471,6 +465,12 @@ void drm_calc_timestamping_constants(struct drm_crtc *crtc,
471 pixeldur_ns = 1000000 / dotclock; 465 pixeldur_ns = 1000000 / dotclock;
472 linedur_ns = div_u64((u64) mode->crtc_htotal * 1000000, dotclock); 466 linedur_ns = div_u64((u64) mode->crtc_htotal * 1000000, dotclock);
473 framedur_ns = div_u64((u64) frame_size * 1000000, dotclock); 467 framedur_ns = div_u64((u64) frame_size * 1000000, dotclock);
468
469 /*
470 * Fields of interlaced scanout modes are only half a frame duration.
471 */
472 if (mode->flags & DRM_MODE_FLAG_INTERLACE)
473 framedur_ns /= 2;
474 } else 474 } else
475 DRM_ERROR("crtc %d: Can't calculate constants, dotclock = 0!\n", 475 DRM_ERROR("crtc %d: Can't calculate constants, dotclock = 0!\n",
476 crtc->base.id); 476 crtc->base.id);