Loading...
1/* SPDX-License-Identifier: MIT */
2/*
3 * Copyright © 2020 Intel Corporation
4 */
5
6#ifndef _INTEL_CRTC_H_
7#define _INTEL_CRTC_H_
8
9#include <linux/types.h>
10
11enum pipe;
12struct drm_i915_private;
13struct intel_crtc;
14struct intel_crtc_state;
15
16u32 intel_crtc_max_vblank_count(const struct intel_crtc_state *crtc_state);
17int intel_crtc_init(struct drm_i915_private *dev_priv, enum pipe pipe);
18struct intel_crtc_state *intel_crtc_state_alloc(struct intel_crtc *crtc);
19void intel_crtc_state_reset(struct intel_crtc_state *crtc_state,
20 struct intel_crtc *crtc);
21u32 intel_crtc_get_vblank_counter(struct intel_crtc *crtc);
22void intel_crtc_vblank_on(const struct intel_crtc_state *crtc_state);
23void intel_crtc_vblank_off(const struct intel_crtc_state *crtc_state);
24
25#endif
1/* SPDX-License-Identifier: MIT */
2/*
3 * Copyright © 2020 Intel Corporation
4 */
5
6#ifndef _INTEL_CRTC_H_
7#define _INTEL_CRTC_H_
8
9#include <linux/types.h>
10
11enum i9xx_plane_id;
12enum pipe;
13struct drm_device;
14struct drm_display_mode;
15struct drm_file;
16struct drm_i915_private;
17struct drm_pending_vblank_event;
18struct intel_atomic_state;
19struct intel_crtc;
20struct intel_crtc_state;
21struct intel_display;
22
23/*
24 * FIXME: We should instead only take spinlocks once for the entire update
25 * instead of once per mmio.
26 */
27#if IS_ENABLED(CONFIG_PROVE_LOCKING)
28#define VBLANK_EVASION_TIME_US 250
29#else
30#define VBLANK_EVASION_TIME_US 100
31#endif
32
33int intel_usecs_to_scanlines(const struct drm_display_mode *adjusted_mode,
34 int usecs);
35int intel_scanlines_to_usecs(const struct drm_display_mode *adjusted_mode,
36 int scanlines);
37void intel_crtc_arm_vblank_event(struct intel_crtc_state *crtc_state);
38void intel_crtc_prepare_vblank_event(struct intel_crtc_state *crtc_state,
39 struct drm_pending_vblank_event **event);
40u32 intel_crtc_max_vblank_count(const struct intel_crtc_state *crtc_state);
41int intel_crtc_init(struct drm_i915_private *dev_priv, enum pipe pipe);
42int intel_crtc_get_pipe_from_crtc_id_ioctl(struct drm_device *dev, void *data,
43 struct drm_file *file_priv);
44struct intel_crtc_state *intel_crtc_state_alloc(struct intel_crtc *crtc);
45void intel_crtc_state_reset(struct intel_crtc_state *crtc_state,
46 struct intel_crtc *crtc);
47u32 intel_crtc_get_vblank_counter(struct intel_crtc *crtc);
48void intel_crtc_vblank_on(const struct intel_crtc_state *crtc_state);
49void intel_crtc_vblank_off(const struct intel_crtc_state *crtc_state);
50void intel_pipe_update_start(struct intel_atomic_state *state,
51 struct intel_crtc *crtc);
52void intel_pipe_update_end(struct intel_atomic_state *state,
53 struct intel_crtc *crtc);
54void intel_wait_for_vblank_workers(struct intel_atomic_state *state);
55struct intel_crtc *intel_first_crtc(struct drm_i915_private *i915);
56struct intel_crtc *intel_crtc_for_pipe(struct intel_display *display,
57 enum pipe pipe);
58void intel_wait_for_vblank_if_active(struct drm_i915_private *i915,
59 enum pipe pipe);
60void intel_crtc_wait_for_next_vblank(struct intel_crtc *crtc);
61
62#endif