drm: Remove legacy version of get_scanout_position()

The legacy version of get_scanout_position() was only useful while
drivers still used drm_driver.get_scanout_position(). With no such
drivers left, the related typedef and code can be removed

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200123135943.24140-23-tzimmermann@suse.de
This commit is contained in:
Thomas Zimmermann 2020-01-23 14:59:43 +01:00
parent f397d66b31
commit 48e678076e
3 changed files with 9 additions and 32 deletions

View File

@ -604,9 +604,6 @@ EXPORT_SYMBOL(drm_calc_timestamping_constants);
* @get_scanout_position: * @get_scanout_position:
* Callback function to retrieve the scanout position. See * Callback function to retrieve the scanout position. See
* @struct drm_crtc_helper_funcs.get_scanout_position. * @struct drm_crtc_helper_funcs.get_scanout_position.
* @get_scanout_position_legacy:
* Callback function to retrieve the scanout position. See
* @struct drm_driver.get_scanout_position.
* *
* Implements calculation of exact vblank timestamps from given drm_display_mode * Implements calculation of exact vblank timestamps from given drm_display_mode
* timings and current video scanout position of a CRTC. * timings and current video scanout position of a CRTC.
@ -629,8 +626,7 @@ bool
drm_crtc_vblank_helper_get_vblank_timestamp_internal( drm_crtc_vblank_helper_get_vblank_timestamp_internal(
struct drm_crtc *crtc, int *max_error, ktime_t *vblank_time, struct drm_crtc *crtc, int *max_error, ktime_t *vblank_time,
bool in_vblank_irq, bool in_vblank_irq,
drm_vblank_get_scanout_position_func get_scanout_position, drm_vblank_get_scanout_position_func get_scanout_position)
drm_vblank_get_scanout_position_legacy_func get_scanout_position_legacy)
{ {
struct drm_device *dev = crtc->dev; struct drm_device *dev = crtc->dev;
unsigned int pipe = crtc->index; unsigned int pipe = crtc->index;
@ -648,7 +644,7 @@ drm_crtc_vblank_helper_get_vblank_timestamp_internal(
} }
/* Scanout position query not supported? Should not happen. */ /* Scanout position query not supported? Should not happen. */
if (!get_scanout_position && !get_scanout_position_legacy) { if (!get_scanout_position) {
DRM_ERROR("Called from CRTC w/o get_scanout_position()!?\n"); DRM_ERROR("Called from CRTC w/o get_scanout_position()!?\n");
return false; return false;
} }
@ -679,19 +675,10 @@ drm_crtc_vblank_helper_get_vblank_timestamp_internal(
* 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.
*/ */
if (get_scanout_position) { vbl_status = get_scanout_position(crtc, in_vblank_irq,
vbl_status = get_scanout_position(crtc, &vpos, &hpos,
in_vblank_irq, &stime, &etime,
&vpos, &hpos, mode);
&stime, &etime,
mode);
} else {
vbl_status = get_scanout_position_legacy(dev, pipe,
in_vblank_irq,
&vpos, &hpos,
&stime, &etime,
mode);
}
/* Return as no-op if scanout query unsupported or failed. */ /* Return as no-op if scanout query unsupported or failed. */
if (!vbl_status) { if (!vbl_status) {
@ -783,7 +770,7 @@ bool drm_crtc_vblank_helper_get_vblank_timestamp(struct drm_crtc *crtc,
{ {
return drm_crtc_vblank_helper_get_vblank_timestamp_internal( return drm_crtc_vblank_helper_get_vblank_timestamp_internal(
crtc, max_error, vblank_time, in_vblank_irq, crtc, max_error, vblank_time, in_vblank_irq,
crtc->helper_private->get_scanout_position, NULL); crtc->helper_private->get_scanout_position);
} }
EXPORT_SYMBOL(drm_crtc_vblank_helper_get_vblank_timestamp); EXPORT_SYMBOL(drm_crtc_vblank_helper_get_vblank_timestamp);

View File

@ -886,7 +886,7 @@ bool intel_crtc_get_vblank_timestamp(struct drm_crtc *crtc, int *max_error,
{ {
return drm_crtc_vblank_helper_get_vblank_timestamp_internal( return drm_crtc_vblank_helper_get_vblank_timestamp_internal(
crtc, max_error, vblank_time, in_vblank_irq, crtc, max_error, vblank_time, in_vblank_irq,
i915_get_crtc_scanoutpos, NULL); i915_get_crtc_scanoutpos);
} }
int intel_get_crtc_scanline(struct intel_crtc *crtc) int intel_get_crtc_scanline(struct intel_crtc *crtc)

View File

@ -247,22 +247,12 @@ typedef bool (*drm_vblank_get_scanout_position_func)(struct drm_crtc *crtc,
ktime_t *etime, ktime_t *etime,
const struct drm_display_mode *mode); const struct drm_display_mode *mode);
typedef bool (*drm_vblank_get_scanout_position_legacy_func)(struct drm_device *dev,
unsigned int pipe,
bool in_vblank_irq,
int *vpos,
int *hpos,
ktime_t *stime,
ktime_t *etime,
const struct drm_display_mode *mode);
bool bool
drm_crtc_vblank_helper_get_vblank_timestamp_internal(struct drm_crtc *crtc, drm_crtc_vblank_helper_get_vblank_timestamp_internal(struct drm_crtc *crtc,
int *max_error, int *max_error,
ktime_t *vblank_time, ktime_t *vblank_time,
bool in_vblank_irq, bool in_vblank_irq,
drm_vblank_get_scanout_position_func get_scanout_position, drm_vblank_get_scanout_position_func get_scanout_position);
drm_vblank_get_scanout_position_legacy_func get_scanout_position_legacy);
bool drm_crtc_vblank_helper_get_vblank_timestamp(struct drm_crtc *crtc, bool drm_crtc_vblank_helper_get_vblank_timestamp(struct drm_crtc *crtc,
int *max_error, int *max_error,
ktime_t *vblank_time, ktime_t *vblank_time,