2021-01-14 13:13:45 +02:00
|
|
|
/* SPDX-License-Identifier: MIT */
|
|
|
|
/*
|
|
|
|
* Copyright © 2020 Intel Corporation
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _INTEL_CRTC_H_
|
|
|
|
#define _INTEL_CRTC_H_
|
|
|
|
|
|
|
|
#include <linux/types.h>
|
|
|
|
|
2021-12-01 15:57:07 +02:00
|
|
|
enum i9xx_plane_id;
|
2021-01-14 13:13:45 +02:00
|
|
|
enum pipe;
|
2024-09-13 16:54:38 +03:00
|
|
|
struct drm_device;
|
2021-10-21 01:33:36 +03:00
|
|
|
struct drm_display_mode;
|
2024-09-13 16:54:38 +03:00
|
|
|
struct drm_file;
|
2024-09-30 20:04:12 +03:00
|
|
|
struct drm_pending_vblank_event;
|
2021-10-21 01:33:38 +03:00
|
|
|
struct intel_atomic_state;
|
2021-01-14 13:13:45 +02:00
|
|
|
struct intel_crtc;
|
|
|
|
struct intel_crtc_state;
|
2024-09-04 16:06:32 +03:00
|
|
|
struct intel_display;
|
2021-01-14 13:13:45 +02:00
|
|
|
|
2023-04-18 20:55:15 +03: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-21 01:33:36 +03:00
|
|
|
int intel_usecs_to_scanlines(const struct drm_display_mode *adjusted_mode,
|
|
|
|
int usecs);
|
2024-09-30 20:04:10 +03:00
|
|
|
int intel_scanlines_to_usecs(const struct drm_display_mode *adjusted_mode,
|
|
|
|
int scanlines);
|
2024-06-11 16:33:34 +03:00
|
|
|
void intel_crtc_arm_vblank_event(struct intel_crtc_state *crtc_state);
|
2024-09-30 20:04:12 +03:00
|
|
|
void intel_crtc_prepare_vblank_event(struct intel_crtc_state *crtc_state,
|
|
|
|
struct drm_pending_vblank_event **event);
|
2021-01-14 13:13:45 +02:00
|
|
|
u32 intel_crtc_max_vblank_count(const struct intel_crtc_state *crtc_state);
|
2025-02-06 20:55:25 +02:00
|
|
|
int intel_crtc_init(struct intel_display *display, enum pipe pipe);
|
2024-09-13 16:54:38 +03:00
|
|
|
int intel_crtc_get_pipe_from_crtc_id_ioctl(struct drm_device *dev, void *data,
|
|
|
|
struct drm_file *file_priv);
|
2021-01-14 13:13:45 +02:00
|
|
|
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 15:03:15 +03: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 16:04:30 +03: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-21 01:33:38 +03:00
|
|
|
void intel_wait_for_vblank_workers(struct intel_atomic_state *state);
|
2025-02-06 20:55:25 +02:00
|
|
|
struct intel_crtc *intel_first_crtc(struct intel_display *display);
|
2024-09-04 16:06:32 +03:00
|
|
|
struct intel_crtc *intel_crtc_for_pipe(struct intel_display *display,
|
2021-12-01 15:57:07 +02:00
|
|
|
enum pipe pipe);
|
2025-02-06 20:55:25 +02:00
|
|
|
void intel_wait_for_vblank_if_active(struct intel_display *display,
|
2021-12-01 15:57:07 +02:00
|
|
|
enum pipe pipe);
|
|
|
|
void intel_crtc_wait_for_next_vblank(struct intel_crtc *crtc);
|
2021-01-14 13:13:45 +02:00
|
|
|
|
|
|
|
#endif
|