diff options
Diffstat (limited to 'drivers/gpu/drm/drm_irq.c')
-rw-r--r-- | drivers/gpu/drm/drm_irq.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c index 52a234c4160e..91e8b4c55ea0 100644 --- a/drivers/gpu/drm/drm_irq.c +++ b/drivers/gpu/drm/drm_irq.c | |||
@@ -450,7 +450,7 @@ int drm_control(struct drm_device *dev, void *data, | |||
450 | void drm_calc_timestamping_constants(struct drm_crtc *crtc, | 450 | void drm_calc_timestamping_constants(struct drm_crtc *crtc, |
451 | const struct drm_display_mode *mode) | 451 | const struct drm_display_mode *mode) |
452 | { | 452 | { |
453 | s64 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. | 456 | /* Fields of interlaced scanout modes are only half a frame duration. |
@@ -483,8 +483,8 @@ void drm_calc_timestamping_constants(struct drm_crtc *crtc, | |||
483 | crtc->base.id, mode->crtc_htotal, | 483 | crtc->base.id, mode->crtc_htotal, |
484 | mode->crtc_vtotal, mode->crtc_vdisplay); | 484 | mode->crtc_vtotal, mode->crtc_vdisplay); |
485 | DRM_DEBUG("crtc %d: clock %d kHz framedur %d linedur %d, pixeldur %d\n", | 485 | DRM_DEBUG("crtc %d: clock %d kHz framedur %d linedur %d, pixeldur %d\n", |
486 | crtc->base.id, dotclock, (int) framedur_ns, | 486 | crtc->base.id, dotclock, framedur_ns, |
487 | (int) linedur_ns, (int) pixeldur_ns); | 487 | linedur_ns, pixeldur_ns); |
488 | } | 488 | } |
489 | EXPORT_SYMBOL(drm_calc_timestamping_constants); | 489 | EXPORT_SYMBOL(drm_calc_timestamping_constants); |
490 | 490 | ||
@@ -544,7 +544,7 @@ int drm_calc_vbltimestamp_from_scanoutpos(struct drm_device *dev, int crtc, | |||
544 | struct timeval tv_etime; | 544 | struct timeval tv_etime; |
545 | int vbl_status, vtotal, vdisplay; | 545 | int vbl_status, vtotal, vdisplay; |
546 | int vpos, hpos, i; | 546 | int vpos, hpos, i; |
547 | s64 framedur_ns, linedur_ns, pixeldur_ns, delta_ns, duration_ns; | 547 | int framedur_ns, linedur_ns, pixeldur_ns, delta_ns, duration_ns; |
548 | bool invbl; | 548 | bool invbl; |
549 | 549 | ||
550 | if (crtc < 0 || crtc >= dev->num_crtcs) { | 550 | if (crtc < 0 || crtc >= dev->num_crtcs) { |
@@ -607,18 +607,18 @@ int drm_calc_vbltimestamp_from_scanoutpos(struct drm_device *dev, int crtc, | |||
607 | duration_ns = ktime_to_ns(etime) - ktime_to_ns(stime); | 607 | duration_ns = ktime_to_ns(etime) - ktime_to_ns(stime); |
608 | 608 | ||
609 | /* Accept result with < max_error nsecs timing uncertainty. */ | 609 | /* Accept result with < max_error nsecs timing uncertainty. */ |
610 | if (duration_ns <= (s64) *max_error) | 610 | if (duration_ns <= *max_error) |
611 | break; | 611 | break; |
612 | } | 612 | } |
613 | 613 | ||
614 | /* Noisy system timing? */ | 614 | /* Noisy system timing? */ |
615 | if (i == DRM_TIMESTAMP_MAXRETRIES) { | 615 | if (i == DRM_TIMESTAMP_MAXRETRIES) { |
616 | DRM_DEBUG("crtc %d: Noisy timestamp %d us > %d us [%d reps].\n", | 616 | DRM_DEBUG("crtc %d: Noisy timestamp %d us > %d us [%d reps].\n", |
617 | crtc, (int) duration_ns/1000, *max_error/1000, i); | 617 | crtc, duration_ns/1000, *max_error/1000, i); |
618 | } | 618 | } |
619 | 619 | ||
620 | /* Return upper bound of timestamp precision error. */ | 620 | /* Return upper bound of timestamp precision error. */ |
621 | *max_error = (int) duration_ns; | 621 | *max_error = duration_ns; |
622 | 622 | ||
623 | /* Check if in vblank area: | 623 | /* Check if in vblank area: |
624 | * vpos is >=0 in video scanout area, but negative | 624 | * vpos is >=0 in video scanout area, but negative |
@@ -631,7 +631,7 @@ int drm_calc_vbltimestamp_from_scanoutpos(struct drm_device *dev, int crtc, | |||
631 | * since start of scanout at first display scanline. delta_ns | 631 | * since start of scanout at first display scanline. delta_ns |
632 | * can be negative if start of scanout hasn't happened yet. | 632 | * can be negative if start of scanout hasn't happened yet. |
633 | */ | 633 | */ |
634 | delta_ns = (s64) vpos * linedur_ns + (s64) hpos * pixeldur_ns; | 634 | delta_ns = vpos * linedur_ns + hpos * pixeldur_ns; |
635 | 635 | ||
636 | /* Is vpos outside nominal vblank area, but less than | 636 | /* Is vpos outside nominal vblank area, but less than |
637 | * 1/100 of a frame height away from start of vblank? | 637 | * 1/100 of a frame height away from start of vblank? |
@@ -669,7 +669,7 @@ int drm_calc_vbltimestamp_from_scanoutpos(struct drm_device *dev, int crtc, | |||
669 | crtc, (int)vbl_status, hpos, vpos, | 669 | crtc, (int)vbl_status, hpos, vpos, |
670 | (long)tv_etime.tv_sec, (long)tv_etime.tv_usec, | 670 | (long)tv_etime.tv_sec, (long)tv_etime.tv_usec, |
671 | (long)vblank_time->tv_sec, (long)vblank_time->tv_usec, | 671 | (long)vblank_time->tv_sec, (long)vblank_time->tv_usec, |
672 | (int)duration_ns/1000, i); | 672 | duration_ns/1000, i); |
673 | 673 | ||
674 | vbl_status = DRM_VBLANKTIME_SCANOUTPOS_METHOD; | 674 | vbl_status = DRM_VBLANKTIME_SCANOUTPOS_METHOD; |
675 | if (invbl) | 675 | if (invbl) |