aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2013-10-28 14:50:48 -0400
committerVille Syrjälä <ville.syrjala@linux.intel.com>2014-01-20 05:21:35 -0500
commitabca9e45449876ca4e66f7e31c850753cde344a5 (patch)
tree50880095c7c4842aadcf1c0f5f011383bccfef30 /drivers/gpu
parentc0ae24c17ed0864b42d449733460140322f275e2 (diff)
drm: Pass 'flags' from the caller to .get_scanout_position()
Preparation for moving the early vblank IRQ logic into radeon_get_crtc_scanoutpos(). v2: Fix radeon_drv.c compile warning (Mario) Reviewed-by: mario.kleiner.de@gmail.com Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/drm_irq.c2
-rw-r--r--drivers/gpu/drm/i915/i915_irq.c3
-rw-r--r--drivers/gpu/drm/radeon/radeon_display.c7
-rw-r--r--drivers/gpu/drm/radeon/radeon_drv.c1
-rw-r--r--drivers/gpu/drm/radeon/radeon_mode.h1
-rw-r--r--drivers/gpu/drm/radeon/radeon_pm.c2
6 files changed, 10 insertions, 6 deletions
diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c
index 55239d285f25..e55619f49671 100644
--- a/drivers/gpu/drm/drm_irq.c
+++ b/drivers/gpu/drm/drm_irq.c
@@ -586,7 +586,7 @@ int drm_calc_vbltimestamp_from_scanoutpos(struct drm_device *dev, int crtc,
586 * Get vertical and horizontal scanout position vpos, hpos, 586 * Get vertical and horizontal scanout position vpos, hpos,
587 * and bounding timestamps stime, etime, pre/post query. 587 * and bounding timestamps stime, etime, pre/post query.
588 */ 588 */
589 vbl_status = dev->driver->get_scanout_position(dev, crtc, &vpos, 589 vbl_status = dev->driver->get_scanout_position(dev, crtc, flags, &vpos,
590 &hpos, &stime, &etime); 590 &hpos, &stime, &etime);
591 591
592 /* 592 /*
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index eacbb2f9e091..fb4801c7d9e4 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -675,7 +675,8 @@ static bool intel_pipe_in_vblank_locked(struct drm_device *dev, enum pipe pipe)
675} 675}
676 676
677static int i915_get_crtc_scanoutpos(struct drm_device *dev, int pipe, 677static int i915_get_crtc_scanoutpos(struct drm_device *dev, int pipe,
678 int *vpos, int *hpos, ktime_t *stime, ktime_t *etime) 678 unsigned int flags, int *vpos, int *hpos,
679 ktime_t *stime, ktime_t *etime)
679{ 680{
680 struct drm_i915_private *dev_priv = dev->dev_private; 681 struct drm_i915_private *dev_priv = dev->dev_private;
681 struct drm_crtc *crtc = dev_priv->pipe_to_crtc_mapping[pipe]; 682 struct drm_crtc *crtc = dev_priv->pipe_to_crtc_mapping[pipe];
diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/radeon/radeon_display.c
index 7ea647b84733..567215be4728 100644
--- a/drivers/gpu/drm/radeon/radeon_display.c
+++ b/drivers/gpu/drm/radeon/radeon_display.c
@@ -306,7 +306,7 @@ void radeon_crtc_handle_flip(struct radeon_device *rdev, int crtc_id)
306 * to complete in this vblank? 306 * to complete in this vblank?
307 */ 307 */
308 if (update_pending && 308 if (update_pending &&
309 (DRM_SCANOUTPOS_VALID & radeon_get_crtc_scanoutpos(rdev->ddev, crtc_id, 309 (DRM_SCANOUTPOS_VALID & radeon_get_crtc_scanoutpos(rdev->ddev, crtc_id, 0,
310 &vpos, &hpos, NULL, NULL)) && 310 &vpos, &hpos, NULL, NULL)) &&
311 ((vpos >= (99 * rdev->mode_info.crtcs[crtc_id]->base.hwmode.crtc_vdisplay)/100) || 311 ((vpos >= (99 * rdev->mode_info.crtcs[crtc_id]->base.hwmode.crtc_vdisplay)/100) ||
312 (vpos < 0 && !ASIC_IS_AVIVO(rdev)))) { 312 (vpos < 0 && !ASIC_IS_AVIVO(rdev)))) {
@@ -1610,6 +1610,7 @@ bool radeon_crtc_scaling_mode_fixup(struct drm_crtc *crtc,
1610 * 1610 *
1611 * \param dev Device to query. 1611 * \param dev Device to query.
1612 * \param crtc Crtc to query. 1612 * \param crtc Crtc to query.
1613 * \param flags Flags from caller (DRM_CALLED_FROM_VBLIRQ or 0).
1613 * \param *vpos Location where vertical scanout position should be stored. 1614 * \param *vpos Location where vertical scanout position should be stored.
1614 * \param *hpos Location where horizontal scanout position should go. 1615 * \param *hpos Location where horizontal scanout position should go.
1615 * \param *stime Target location for timestamp taken immediately before 1616 * \param *stime Target location for timestamp taken immediately before
@@ -1631,8 +1632,8 @@ bool radeon_crtc_scaling_mode_fixup(struct drm_crtc *crtc,
1631 * unknown small number of scanlines wrt. real scanout position. 1632 * unknown small number of scanlines wrt. real scanout position.
1632 * 1633 *
1633 */ 1634 */
1634int radeon_get_crtc_scanoutpos(struct drm_device *dev, int crtc, int *vpos, int *hpos, 1635int radeon_get_crtc_scanoutpos(struct drm_device *dev, int crtc, unsigned int flags,
1635 ktime_t *stime, ktime_t *etime) 1636 int *vpos, int *hpos, ktime_t *stime, ktime_t *etime)
1636{ 1637{
1637 u32 stat_crtc = 0, vbl = 0, position = 0; 1638 u32 stat_crtc = 0, vbl = 0, position = 0;
1638 int vbl_start, vbl_end, vtotal, ret = 0; 1639 int vbl_start, vbl_end, vtotal, ret = 0;
diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c
index 67fadcf4590f..1235a78fbba1 100644
--- a/drivers/gpu/drm/radeon/radeon_drv.c
+++ b/drivers/gpu/drm/radeon/radeon_drv.c
@@ -109,6 +109,7 @@ int radeon_gem_object_open(struct drm_gem_object *obj,
109void radeon_gem_object_close(struct drm_gem_object *obj, 109void radeon_gem_object_close(struct drm_gem_object *obj,
110 struct drm_file *file_priv); 110 struct drm_file *file_priv);
111extern int radeon_get_crtc_scanoutpos(struct drm_device *dev, int crtc, 111extern int radeon_get_crtc_scanoutpos(struct drm_device *dev, int crtc,
112 unsigned int flags,
112 int *vpos, int *hpos, ktime_t *stime, 113 int *vpos, int *hpos, ktime_t *stime,
113 ktime_t *etime); 114 ktime_t *etime);
114extern const struct drm_ioctl_desc radeon_ioctls_kms[]; 115extern const struct drm_ioctl_desc radeon_ioctls_kms[];
diff --git a/drivers/gpu/drm/radeon/radeon_mode.h b/drivers/gpu/drm/radeon/radeon_mode.h
index 28bba631b80c..b8e37a6d6f4e 100644
--- a/drivers/gpu/drm/radeon/radeon_mode.h
+++ b/drivers/gpu/drm/radeon/radeon_mode.h
@@ -800,6 +800,7 @@ extern int radeon_crtc_cursor_move(struct drm_crtc *crtc,
800 int x, int y); 800 int x, int y);
801 801
802extern int radeon_get_crtc_scanoutpos(struct drm_device *dev, int crtc, 802extern int radeon_get_crtc_scanoutpos(struct drm_device *dev, int crtc,
803 unsigned int flags,
803 int *vpos, int *hpos, ktime_t *stime, 804 int *vpos, int *hpos, ktime_t *stime,
804 ktime_t *etime); 805 ktime_t *etime);
805 806
diff --git a/drivers/gpu/drm/radeon/radeon_pm.c b/drivers/gpu/drm/radeon/radeon_pm.c
index 0b24c4c7dcf9..eee1b6831b06 100644
--- a/drivers/gpu/drm/radeon/radeon_pm.c
+++ b/drivers/gpu/drm/radeon/radeon_pm.c
@@ -1482,7 +1482,7 @@ static bool radeon_pm_in_vbl(struct radeon_device *rdev)
1482 */ 1482 */
1483 for (crtc = 0; (crtc < rdev->num_crtc) && in_vbl; crtc++) { 1483 for (crtc = 0; (crtc < rdev->num_crtc) && in_vbl; crtc++) {
1484 if (rdev->pm.active_crtcs & (1 << crtc)) { 1484 if (rdev->pm.active_crtcs & (1 << crtc)) {
1485 vbl_status = radeon_get_crtc_scanoutpos(rdev->ddev, crtc, &vpos, &hpos, NULL, NULL); 1485 vbl_status = radeon_get_crtc_scanoutpos(rdev->ddev, crtc, 0, &vpos, &hpos, NULL, NULL);
1486 if ((vbl_status & DRM_SCANOUTPOS_VALID) && 1486 if ((vbl_status & DRM_SCANOUTPOS_VALID) &&
1487 !(vbl_status & DRM_SCANOUTPOS_INVBL)) 1487 !(vbl_status & DRM_SCANOUTPOS_INVBL))
1488 in_vbl = false; 1488 in_vbl = false;