2021-01-14 11:13:45 +00:00
|
|
|
/* SPDX-License-Identifier: MIT */
|
|
|
|
/*
|
|
|
|
* Copyright © 2020 Intel Corporation
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _INTEL_CRTC_H_
|
|
|
|
#define _INTEL_CRTC_H_
|
|
|
|
|
|
|
|
#include <linux/types.h>
|
|
|
|
|
2021-12-01 13:57:07 +00:00
|
|
|
enum i9xx_plane_id;
|
2021-01-14 11:13:45 +00:00
|
|
|
enum pipe;
|
2021-10-20 22:33:36 +00:00
|
|
|
struct drm_display_mode;
|
2021-01-14 11:13:45 +00:00
|
|
|
struct drm_i915_private;
|
2021-10-20 22:33:38 +00:00
|
|
|
struct intel_atomic_state;
|
2021-01-14 11:13:45 +00:00
|
|
|
struct intel_crtc;
|
|
|
|
struct intel_crtc_state;
|
|
|
|
|
2023-04-18 17:55:15 +00:00
|
|
|
/*
|
|
|
|
* FIXME: We should instead only take spinlocks once for the entire update
|
|
|
|
* instead of once per mmio.
|
|
|
|
*/
|
|
|
|
#if IS_ENABLED(CONFIG_PROVE_LOCKING)
|
|
|
|
#define VBLANK_EVASION_TIME_US 250
|
|
|
|
#else
|
|
|
|
#define VBLANK_EVASION_TIME_US 100
|
|
|
|
#endif
|
|
|
|
|
2021-10-20 22:33:36 +00:00
|
|
|
int intel_usecs_to_scanlines(const struct drm_display_mode *adjusted_mode,
|
|
|
|
int usecs);
|
2021-01-14 11:13:45 +00:00
|
|
|
u32 intel_crtc_max_vblank_count(const struct intel_crtc_state *crtc_state);
|
|
|
|
int intel_crtc_init(struct drm_i915_private *dev_priv, enum pipe pipe);
|
|
|
|
struct intel_crtc_state *intel_crtc_state_alloc(struct intel_crtc *crtc);
|
|
|
|
void intel_crtc_state_reset(struct intel_crtc_state *crtc_state,
|
|
|
|
struct intel_crtc *crtc);
|
2021-04-27 12:03:15 +00:00
|
|
|
u32 intel_crtc_get_vblank_counter(struct intel_crtc *crtc);
|
|
|
|
void intel_crtc_vblank_on(const struct intel_crtc_state *crtc_state);
|
|
|
|
void intel_crtc_vblank_off(const struct intel_crtc_state *crtc_state);
|
2023-09-01 13:04:30 +00:00
|
|
|
void intel_pipe_update_start(struct intel_atomic_state *state,
|
|
|
|
struct intel_crtc *crtc);
|
|
|
|
void intel_pipe_update_end(struct intel_atomic_state *state,
|
|
|
|
struct intel_crtc *crtc);
|
2021-10-20 22:33:38 +00:00
|
|
|
void intel_wait_for_vblank_workers(struct intel_atomic_state *state);
|
2021-12-03 11:20:29 +00:00
|
|
|
struct intel_crtc *intel_first_crtc(struct drm_i915_private *i915);
|
2021-12-01 13:57:07 +00:00
|
|
|
struct intel_crtc *intel_crtc_for_pipe(struct drm_i915_private *i915,
|
|
|
|
enum pipe pipe);
|
|
|
|
void intel_wait_for_vblank_if_active(struct drm_i915_private *i915,
|
|
|
|
enum pipe pipe);
|
|
|
|
void intel_crtc_wait_for_next_vblank(struct intel_crtc *crtc);
|
2021-01-14 11:13:45 +00:00
|
|
|
|
|
|
|
#endif
|