53 lines · c
1/* SPDX-License-Identifier: MIT */2/*3 * Copyright © 2020 Intel Corporation4 */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_display_mode;14struct drm_i915_private;15struct intel_atomic_state;16struct intel_crtc;17struct intel_crtc_state;18 19/*20 * FIXME: We should instead only take spinlocks once for the entire update21 * instead of once per mmio.22 */23#if IS_ENABLED(CONFIG_PROVE_LOCKING)24#define VBLANK_EVASION_TIME_US 25025#else26#define VBLANK_EVASION_TIME_US 10027#endif28 29int intel_usecs_to_scanlines(const struct drm_display_mode *adjusted_mode,30 int usecs);31void intel_crtc_arm_vblank_event(struct intel_crtc_state *crtc_state);32u32 intel_crtc_max_vblank_count(const struct intel_crtc_state *crtc_state);33int intel_crtc_init(struct drm_i915_private *dev_priv, enum pipe pipe);34struct intel_crtc_state *intel_crtc_state_alloc(struct intel_crtc *crtc);35void intel_crtc_state_reset(struct intel_crtc_state *crtc_state,36 struct intel_crtc *crtc);37u32 intel_crtc_get_vblank_counter(struct intel_crtc *crtc);38void intel_crtc_vblank_on(const struct intel_crtc_state *crtc_state);39void intel_crtc_vblank_off(const struct intel_crtc_state *crtc_state);40void intel_pipe_update_start(struct intel_atomic_state *state,41 struct intel_crtc *crtc);42void intel_pipe_update_end(struct intel_atomic_state *state,43 struct intel_crtc *crtc);44void intel_wait_for_vblank_workers(struct intel_atomic_state *state);45struct intel_crtc *intel_first_crtc(struct drm_i915_private *i915);46struct intel_crtc *intel_crtc_for_pipe(struct drm_i915_private *i915,47 enum pipe pipe);48void intel_wait_for_vblank_if_active(struct drm_i915_private *i915,49 enum pipe pipe);50void intel_crtc_wait_for_next_vblank(struct intel_crtc *crtc);51 52#endif53