aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2013-10-26 10:57:31 -0400
committerVille Syrjälä <ville.syrjala@linux.intel.com>2014-01-20 04:05:08 -0500
commit7da903ef04851aba81e4ddabf65c15fb71b7ce47 (patch)
tree391586f05bee51b1874ebadcbdcb465646d6e03d
parent545cdd5510205f01cd9604e23385bac468d45c63 (diff)
drm: Pass the display mode to drm_calc_vbltimestamp_from_scanoutpos()
Rather than using crtc->hwmode, just pass the relevant mode to drm_calc_vbltimestamp_from_scanoutpos(). This removes the last hwmode usage from core drm. Reviewed-by: mario.kleiner.de@gmail.com Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
-rw-r--r--drivers/gpu/drm/drm_irq.c6
-rw-r--r--drivers/gpu/drm/i915/i915_irq.c3
-rw-r--r--drivers/gpu/drm/radeon/radeon_kms.c2
-rw-r--r--include/drm/drmP.h3
4 files changed, 8 insertions, 6 deletions
diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c
index 3837132086f0..db93b07723dd 100644
--- a/drivers/gpu/drm/drm_irq.c
+++ b/drivers/gpu/drm/drm_irq.c
@@ -522,6 +522,7 @@ EXPORT_SYMBOL(drm_calc_timestamping_constants);
522 * 0 = Default. 522 * 0 = Default.
523 * DRM_CALLED_FROM_VBLIRQ = If function is called from vbl irq handler. 523 * DRM_CALLED_FROM_VBLIRQ = If function is called from vbl irq handler.
524 * @refcrtc: drm_crtc* of crtc which defines scanout timing. 524 * @refcrtc: drm_crtc* of crtc which defines scanout timing.
525 * @mode: mode which defines the scanout timings
525 * 526 *
526 * Returns negative value on error, failure or if not supported in current 527 * Returns negative value on error, failure or if not supported in current
527 * video mode: 528 * video mode:
@@ -541,11 +542,11 @@ int drm_calc_vbltimestamp_from_scanoutpos(struct drm_device *dev, int crtc,
541 int *max_error, 542 int *max_error,
542 struct timeval *vblank_time, 543 struct timeval *vblank_time,
543 unsigned flags, 544 unsigned flags,
544 struct drm_crtc *refcrtc) 545 const struct drm_crtc *refcrtc,
546 const struct drm_display_mode *mode)
545{ 547{
546 ktime_t stime, etime, mono_time_offset; 548 ktime_t stime, etime, mono_time_offset;
547 struct timeval tv_etime; 549 struct timeval tv_etime;
548 struct drm_display_mode *mode;
549 int vbl_status, vtotal, vdisplay; 550 int vbl_status, vtotal, vdisplay;
550 int vpos, hpos, i; 551 int vpos, hpos, i;
551 s64 framedur_ns, linedur_ns, pixeldur_ns, delta_ns, duration_ns; 552 s64 framedur_ns, linedur_ns, pixeldur_ns, delta_ns, duration_ns;
@@ -562,7 +563,6 @@ int drm_calc_vbltimestamp_from_scanoutpos(struct drm_device *dev, int crtc,
562 return -EIO; 563 return -EIO;
563 } 564 }
564 565
565 mode = &refcrtc->hwmode;
566 vtotal = mode->crtc_vtotal; 566 vtotal = mode->crtc_vtotal;
567 vdisplay = mode->crtc_vdisplay; 567 vdisplay = mode->crtc_vdisplay;
568 568
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index 6d11e253218a..b6e4a762806b 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -809,7 +809,8 @@ static int i915_get_vblank_timestamp(struct drm_device *dev, int pipe,
809 /* Helper routine in DRM core does all the work: */ 809 /* Helper routine in DRM core does all the work: */
810 return drm_calc_vbltimestamp_from_scanoutpos(dev, pipe, max_error, 810 return drm_calc_vbltimestamp_from_scanoutpos(dev, pipe, max_error,
811 vblank_time, flags, 811 vblank_time, flags,
812 crtc); 812 crtc,
813 &to_intel_crtc(crtc)->config.adjusted_mode);
813} 814}
814 815
815static bool intel_hpd_irq_event(struct drm_device *dev, 816static bool intel_hpd_irq_event(struct drm_device *dev,
diff --git a/drivers/gpu/drm/radeon/radeon_kms.c b/drivers/gpu/drm/radeon/radeon_kms.c
index 5bf50cec017e..5444948cf01d 100644
--- a/drivers/gpu/drm/radeon/radeon_kms.c
+++ b/drivers/gpu/drm/radeon/radeon_kms.c
@@ -712,7 +712,7 @@ int radeon_get_vblank_timestamp_kms(struct drm_device *dev, int crtc,
712 /* Helper routine in DRM core does all the work: */ 712 /* Helper routine in DRM core does all the work: */
713 return drm_calc_vbltimestamp_from_scanoutpos(dev, crtc, max_error, 713 return drm_calc_vbltimestamp_from_scanoutpos(dev, crtc, max_error,
714 vblank_time, flags, 714 vblank_time, flags,
715 drmcrtc); 715 drmcrtc, &drmcrtc->hwmode);
716} 716}
717 717
718#define KMS_INVALID_IOCTL(name) \ 718#define KMS_INVALID_IOCTL(name) \
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index 46bf8ae7e302..3f57c77acef8 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -1401,7 +1401,8 @@ extern int drm_calc_vbltimestamp_from_scanoutpos(struct drm_device *dev,
1401 int crtc, int *max_error, 1401 int crtc, int *max_error,
1402 struct timeval *vblank_time, 1402 struct timeval *vblank_time,
1403 unsigned flags, 1403 unsigned flags,
1404 struct drm_crtc *refcrtc); 1404 const struct drm_crtc *refcrtc,
1405 const struct drm_display_mode *mode);
1405extern void drm_calc_timestamping_constants(struct drm_crtc *crtc, 1406extern void drm_calc_timestamping_constants(struct drm_crtc *crtc,
1406 const struct drm_display_mode *mode); 1407 const struct drm_display_mode *mode);
1407 1408