1/* SPDX-License-Identifier: MIT */
2/*
3 * Copyright © 2022-2023 Intel Corporation
4 */
5
6#ifndef __INTEL_VBLANK_H__
7#define __INTEL_VBLANK_H__
8
9#include <linux/ktime.h>
10#include <linux/types.h>
11
12struct drm_crtc;
13struct intel_crtc;
14struct intel_crtc_state;
15
16struct intel_vblank_evade_ctx {
17 struct intel_crtc *crtc;
18 int min, max, vblank_start;
19 bool need_vlv_dsi_wa;
20};
21
22void intel_vblank_evade_init(const struct intel_crtc_state *old_crtc_state,
23 const struct intel_crtc_state *new_crtc_state,
24 struct intel_vblank_evade_ctx *evade);
25/* must be called with vblank interrupt already enabled! */
26int intel_vblank_evade(struct intel_vblank_evade_ctx *evade);
27
28u32 i915_get_vblank_counter(struct drm_crtc *crtc);
29u32 g4x_get_vblank_counter(struct drm_crtc *crtc);
30bool intel_crtc_get_vblank_timestamp(struct drm_crtc *crtc, int *max_error,
31 ktime_t *vblank_time, bool in_vblank_irq);
32int intel_get_crtc_scanline(struct intel_crtc *crtc);
33void intel_wait_for_pipe_scanline_stopped(struct intel_crtc *crtc);
34void intel_wait_for_pipe_scanline_moving(struct intel_crtc *crtc);
35void intel_crtc_update_active_timings(const struct intel_crtc_state *crtc_state,
36 bool vrr_enable);
37int intel_crtc_scanline_to_hw(struct intel_crtc *crtc, int scanline);
38
39#endif /* __INTEL_VBLANK_H__ */
40

source code of linux/drivers/gpu/drm/i915/display/intel_vblank.h