Linux Audio

Check our new training course

Open-source upstreaming

Need help get the support for your hardware in upstream Linux?
Loading...
Note: File does not exist in v5.14.15.
 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 drm_display_mode;
14struct intel_crtc;
15struct intel_crtc_state;
16
17struct intel_vblank_evade_ctx {
18	struct intel_crtc *crtc;
19	int min, max, vblank_start;
20	bool need_vlv_dsi_wa;
21};
22
23int intel_mode_vdisplay(const struct drm_display_mode *mode);
24int intel_mode_vblank_start(const struct drm_display_mode *mode);
25int intel_mode_vblank_end(const struct drm_display_mode *mode);
26int intel_mode_vtotal(const struct drm_display_mode *mode);
27
28void intel_vblank_evade_init(const struct intel_crtc_state *old_crtc_state,
29			     const struct intel_crtc_state *new_crtc_state,
30			     struct intel_vblank_evade_ctx *evade);
31/* must be called with vblank interrupt already enabled! */
32int intel_vblank_evade(struct intel_vblank_evade_ctx *evade);
33
34u32 i915_get_vblank_counter(struct drm_crtc *crtc);
35u32 g4x_get_vblank_counter(struct drm_crtc *crtc);
36bool intel_crtc_get_vblank_timestamp(struct drm_crtc *crtc, int *max_error,
37				     ktime_t *vblank_time, bool in_vblank_irq);
38int intel_get_crtc_scanline(struct intel_crtc *crtc);
39void intel_wait_for_pipe_scanline_stopped(struct intel_crtc *crtc);
40void intel_wait_for_pipe_scanline_moving(struct intel_crtc *crtc);
41void intel_crtc_update_active_timings(const struct intel_crtc_state *crtc_state,
42				      bool vrr_enable);
43int intel_crtc_scanline_offset(const struct intel_crtc_state *crtc_state);
44
45#endif /* __INTEL_VBLANK_H__ */