Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+12 -6
+1 -1
drivers/gpu/drm/drm_irq.c
··· 586 586 * Get vertical and horizontal scanout position vpos, hpos, 587 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 590 &hpos, &stime, &etime); 591 591 592 592 /*
+2 -1
drivers/gpu/drm/i915/i915_irq.c
··· 675 675 } 676 676 677 677 static 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 681 struct drm_i915_private *dev_priv = dev->dev_private; 681 682 struct drm_crtc *crtc = dev_priv->pipe_to_crtc_mapping[pipe];
+4 -3
drivers/gpu/drm/radeon/radeon_display.c
··· 306 306 * to complete in this vblank? 307 307 */ 308 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 310 &vpos, &hpos, NULL, NULL)) && 311 311 ((vpos >= (99 * rdev->mode_info.crtcs[crtc_id]->base.hwmode.crtc_vdisplay)/100) || 312 312 (vpos < 0 && !ASIC_IS_AVIVO(rdev)))) { ··· 1610 1610 * 1611 1611 * \param dev Device to query. 1612 1612 * \param crtc Crtc to query. 1613 + * \param flags Flags from caller (DRM_CALLED_FROM_VBLIRQ or 0). 1613 1614 * \param *vpos Location where vertical scanout position should be stored. 1614 1615 * \param *hpos Location where horizontal scanout position should go. 1615 1616 * \param *stime Target location for timestamp taken immediately before ··· 1632 1631 * unknown small number of scanlines wrt. real scanout position. 1633 1632 * 1634 1633 */ 1635 - int radeon_get_crtc_scanoutpos(struct drm_device *dev, int crtc, int *vpos, int *hpos, 1636 - ktime_t *stime, ktime_t *etime) 1634 + int radeon_get_crtc_scanoutpos(struct drm_device *dev, int crtc, unsigned int flags, 1635 + int *vpos, int *hpos, ktime_t *stime, ktime_t *etime) 1637 1636 { 1638 1637 u32 stat_crtc = 0, vbl = 0, position = 0; 1639 1638 int vbl_start, vbl_end, vtotal, ret = 0;
+1
drivers/gpu/drm/radeon/radeon_drv.c
··· 109 109 void radeon_gem_object_close(struct drm_gem_object *obj, 110 110 struct drm_file *file_priv); 111 111 extern int radeon_get_crtc_scanoutpos(struct drm_device *dev, int crtc, 112 + unsigned int flags, 112 113 int *vpos, int *hpos, ktime_t *stime, 113 114 ktime_t *etime); 114 115 extern const struct drm_ioctl_desc radeon_ioctls_kms[];
+1
drivers/gpu/drm/radeon/radeon_mode.h
··· 800 800 int x, int y); 801 801 802 802 extern int radeon_get_crtc_scanoutpos(struct drm_device *dev, int crtc, 803 + unsigned int flags, 803 804 int *vpos, int *hpos, ktime_t *stime, 804 805 ktime_t *etime); 805 806
+1 -1
drivers/gpu/drm/radeon/radeon_pm.c
··· 1482 1482 */ 1483 1483 for (crtc = 0; (crtc < rdev->num_crtc) && in_vbl; crtc++) { 1484 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 1486 if ((vbl_status & DRM_SCANOUTPOS_VALID) && 1487 1487 !(vbl_status & DRM_SCANOUTPOS_INVBL)) 1488 1488 in_vbl = false;
+2
include/drm/drmP.h
··· 845 845 * 846 846 * \param dev DRM device. 847 847 * \param crtc Id of the crtc to query. 848 + * \param flags Flags from the caller (DRM_CALLED_FROM_VBLIRQ or 0). 848 849 * \param *vpos Target location for current vertical scanout position. 849 850 * \param *hpos Target location for current horizontal scanout position. 850 851 * \param *stime Target location for timestamp taken immediately before ··· 868 867 * 869 868 */ 870 869 int (*get_scanout_position) (struct drm_device *dev, int crtc, 870 + unsigned int flags, 871 871 int *vpos, int *hpos, ktime_t *stime, 872 872 ktime_t *etime); 873 873