Commit abca9e45 authored by Ville Syrjälä's avatar Ville Syrjälä

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: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
parent c0ae24c1
...@@ -586,7 +586,7 @@ int drm_calc_vbltimestamp_from_scanoutpos(struct drm_device *dev, int crtc, ...@@ -586,7 +586,7 @@ int drm_calc_vbltimestamp_from_scanoutpos(struct drm_device *dev, int crtc,
* Get vertical and horizontal scanout position vpos, hpos, * Get vertical and horizontal scanout position vpos, hpos,
* and bounding timestamps stime, etime, pre/post query. * and bounding timestamps stime, etime, pre/post query.
*/ */
vbl_status = dev->driver->get_scanout_position(dev, crtc, &vpos, vbl_status = dev->driver->get_scanout_position(dev, crtc, flags, &vpos,
&hpos, &stime, &etime); &hpos, &stime, &etime);
/* /*
......
...@@ -675,7 +675,8 @@ static bool intel_pipe_in_vblank_locked(struct drm_device *dev, enum pipe pipe) ...@@ -675,7 +675,8 @@ static bool intel_pipe_in_vblank_locked(struct drm_device *dev, enum pipe pipe)
} }
static int i915_get_crtc_scanoutpos(struct drm_device *dev, int pipe, static int i915_get_crtc_scanoutpos(struct drm_device *dev, int pipe,
int *vpos, int *hpos, ktime_t *stime, ktime_t *etime) unsigned int flags, int *vpos, int *hpos,
ktime_t *stime, ktime_t *etime)
{ {
struct drm_i915_private *dev_priv = dev->dev_private; struct drm_i915_private *dev_priv = dev->dev_private;
struct drm_crtc *crtc = dev_priv->pipe_to_crtc_mapping[pipe]; struct drm_crtc *crtc = dev_priv->pipe_to_crtc_mapping[pipe];
......
...@@ -306,7 +306,7 @@ void radeon_crtc_handle_flip(struct radeon_device *rdev, int crtc_id) ...@@ -306,7 +306,7 @@ void radeon_crtc_handle_flip(struct radeon_device *rdev, int crtc_id)
* to complete in this vblank? * to complete in this vblank?
*/ */
if (update_pending && if (update_pending &&
(DRM_SCANOUTPOS_VALID & radeon_get_crtc_scanoutpos(rdev->ddev, crtc_id, (DRM_SCANOUTPOS_VALID & radeon_get_crtc_scanoutpos(rdev->ddev, crtc_id, 0,
&vpos, &hpos, NULL, NULL)) && &vpos, &hpos, NULL, NULL)) &&
((vpos >= (99 * rdev->mode_info.crtcs[crtc_id]->base.hwmode.crtc_vdisplay)/100) || ((vpos >= (99 * rdev->mode_info.crtcs[crtc_id]->base.hwmode.crtc_vdisplay)/100) ||
(vpos < 0 && !ASIC_IS_AVIVO(rdev)))) { (vpos < 0 && !ASIC_IS_AVIVO(rdev)))) {
...@@ -1610,6 +1610,7 @@ bool radeon_crtc_scaling_mode_fixup(struct drm_crtc *crtc, ...@@ -1610,6 +1610,7 @@ bool radeon_crtc_scaling_mode_fixup(struct drm_crtc *crtc,
* *
* \param dev Device to query. * \param dev Device to query.
* \param crtc Crtc to query. * \param crtc Crtc to query.
* \param flags Flags from caller (DRM_CALLED_FROM_VBLIRQ or 0).
* \param *vpos Location where vertical scanout position should be stored. * \param *vpos Location where vertical scanout position should be stored.
* \param *hpos Location where horizontal scanout position should go. * \param *hpos Location where horizontal scanout position should go.
* \param *stime Target location for timestamp taken immediately before * \param *stime Target location for timestamp taken immediately before
...@@ -1631,8 +1632,8 @@ bool radeon_crtc_scaling_mode_fixup(struct drm_crtc *crtc, ...@@ -1631,8 +1632,8 @@ bool radeon_crtc_scaling_mode_fixup(struct drm_crtc *crtc,
* unknown small number of scanlines wrt. real scanout position. * unknown small number of scanlines wrt. real scanout position.
* *
*/ */
int radeon_get_crtc_scanoutpos(struct drm_device *dev, int crtc, int *vpos, int *hpos, int radeon_get_crtc_scanoutpos(struct drm_device *dev, int crtc, unsigned int flags,
ktime_t *stime, ktime_t *etime) int *vpos, int *hpos, ktime_t *stime, ktime_t *etime)
{ {
u32 stat_crtc = 0, vbl = 0, position = 0; u32 stat_crtc = 0, vbl = 0, position = 0;
int vbl_start, vbl_end, vtotal, ret = 0; int vbl_start, vbl_end, vtotal, ret = 0;
......
...@@ -109,6 +109,7 @@ int radeon_gem_object_open(struct drm_gem_object *obj, ...@@ -109,6 +109,7 @@ int radeon_gem_object_open(struct drm_gem_object *obj,
void radeon_gem_object_close(struct drm_gem_object *obj, void radeon_gem_object_close(struct drm_gem_object *obj,
struct drm_file *file_priv); struct drm_file *file_priv);
extern int radeon_get_crtc_scanoutpos(struct drm_device *dev, int crtc, extern int radeon_get_crtc_scanoutpos(struct drm_device *dev, int crtc,
unsigned int flags,
int *vpos, int *hpos, ktime_t *stime, int *vpos, int *hpos, ktime_t *stime,
ktime_t *etime); ktime_t *etime);
extern const struct drm_ioctl_desc radeon_ioctls_kms[]; extern const struct drm_ioctl_desc radeon_ioctls_kms[];
......
...@@ -800,6 +800,7 @@ extern int radeon_crtc_cursor_move(struct drm_crtc *crtc, ...@@ -800,6 +800,7 @@ extern int radeon_crtc_cursor_move(struct drm_crtc *crtc,
int x, int y); int x, int y);
extern int radeon_get_crtc_scanoutpos(struct drm_device *dev, int crtc, extern int radeon_get_crtc_scanoutpos(struct drm_device *dev, int crtc,
unsigned int flags,
int *vpos, int *hpos, ktime_t *stime, int *vpos, int *hpos, ktime_t *stime,
ktime_t *etime); ktime_t *etime);
......
...@@ -1482,7 +1482,7 @@ static bool radeon_pm_in_vbl(struct radeon_device *rdev) ...@@ -1482,7 +1482,7 @@ static bool radeon_pm_in_vbl(struct radeon_device *rdev)
*/ */
for (crtc = 0; (crtc < rdev->num_crtc) && in_vbl; crtc++) { for (crtc = 0; (crtc < rdev->num_crtc) && in_vbl; crtc++) {
if (rdev->pm.active_crtcs & (1 << crtc)) { if (rdev->pm.active_crtcs & (1 << crtc)) {
vbl_status = radeon_get_crtc_scanoutpos(rdev->ddev, crtc, &vpos, &hpos, NULL, NULL); vbl_status = radeon_get_crtc_scanoutpos(rdev->ddev, crtc, 0, &vpos, &hpos, NULL, NULL);
if ((vbl_status & DRM_SCANOUTPOS_VALID) && if ((vbl_status & DRM_SCANOUTPOS_VALID) &&
!(vbl_status & DRM_SCANOUTPOS_INVBL)) !(vbl_status & DRM_SCANOUTPOS_INVBL))
in_vbl = false; in_vbl = false;
......
...@@ -845,6 +845,7 @@ struct drm_driver { ...@@ -845,6 +845,7 @@ struct drm_driver {
* *
* \param dev DRM device. * \param dev DRM device.
* \param crtc Id of the crtc to query. * \param crtc Id of the crtc to query.
* \param flags Flags from the caller (DRM_CALLED_FROM_VBLIRQ or 0).
* \param *vpos Target location for current vertical scanout position. * \param *vpos Target location for current vertical scanout position.
* \param *hpos Target location for current horizontal scanout position. * \param *hpos Target location for current horizontal scanout position.
* \param *stime Target location for timestamp taken immediately before * \param *stime Target location for timestamp taken immediately before
...@@ -867,6 +868,7 @@ struct drm_driver { ...@@ -867,6 +868,7 @@ struct drm_driver {
* *
*/ */
int (*get_scanout_position) (struct drm_device *dev, int crtc, int (*get_scanout_position) (struct drm_device *dev, int crtc,
unsigned int flags,
int *vpos, int *hpos, ktime_t *stime, int *vpos, int *hpos, ktime_t *stime,
ktime_t *etime); ktime_t *etime);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment