2019-04-05 14:00:09 +03:00
|
|
|
/* SPDX-License-Identifier: MIT */
|
|
|
|
/*
|
|
|
|
* Copyright © 2019 Intel Corporation
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __INTEL_PSR_H__
|
|
|
|
#define __INTEL_PSR_H__
|
|
|
|
|
2021-12-10 15:16:57 +02:00
|
|
|
#include <linux/types.h>
|
2019-04-05 14:00:09 +03:00
|
|
|
|
2021-12-10 15:16:57 +02:00
|
|
|
enum fb_op_origin;
|
2020-01-06 07:21:28 -08:00
|
|
|
struct drm_connector;
|
|
|
|
struct drm_connector_state;
|
2021-12-10 15:16:57 +02:00
|
|
|
struct intel_atomic_state;
|
2023-03-17 15:41:42 +02:00
|
|
|
struct intel_connector;
|
2021-12-10 15:16:57 +02:00
|
|
|
struct intel_crtc;
|
2019-04-05 14:00:09 +03:00
|
|
|
struct intel_crtc_state;
|
2024-08-30 13:15:46 +03:00
|
|
|
struct intel_display;
|
2019-04-05 14:00:09 +03:00
|
|
|
struct intel_dp;
|
2025-02-13 08:47:57 +02:00
|
|
|
struct intel_dsb;
|
2021-04-17 17:21:22 -07:00
|
|
|
struct intel_encoder;
|
2021-12-10 15:16:57 +02:00
|
|
|
struct intel_plane;
|
|
|
|
struct intel_plane_state;
|
2019-04-05 14:00:09 +03:00
|
|
|
|
2024-04-05 14:36:02 +03:00
|
|
|
#define CAN_PANEL_REPLAY(intel_dp) ((intel_dp)->psr.sink_panel_replay_support && \
|
|
|
|
(intel_dp)->psr.source_panel_replay_support)
|
|
|
|
|
2023-11-08 12:53:00 +05:30
|
|
|
bool intel_encoder_can_psr(struct intel_encoder *encoder);
|
2024-09-10 14:18:47 +03:00
|
|
|
bool intel_psr_needs_aux_io_power(struct intel_encoder *encoder,
|
|
|
|
const struct intel_crtc_state *crtc_state);
|
2019-04-05 14:00:09 +03:00
|
|
|
void intel_psr_init_dpcd(struct intel_dp *intel_dp);
|
2025-01-09 12:35:29 +02:00
|
|
|
void intel_psr_panel_replay_enable_sink(struct intel_dp *intel_dp);
|
2021-10-22 13:32:56 +03:00
|
|
|
void intel_psr_pre_plane_update(struct intel_atomic_state *state,
|
|
|
|
struct intel_crtc *crtc);
|
2023-10-04 18:55:56 +03:00
|
|
|
void intel_psr_post_plane_update(struct intel_atomic_state *state,
|
|
|
|
struct intel_crtc *crtc);
|
2019-04-05 14:00:09 +03:00
|
|
|
void intel_psr_disable(struct intel_dp *intel_dp,
|
|
|
|
const struct intel_crtc_state *old_crtc_state);
|
2021-02-04 15:40:14 +02:00
|
|
|
int intel_psr_debug_set(struct intel_dp *intel_dp, u64 value);
|
2024-08-30 13:15:46 +03:00
|
|
|
void intel_psr_invalidate(struct intel_display *display,
|
2019-04-05 14:00:09 +03:00
|
|
|
unsigned frontbuffer_bits,
|
|
|
|
enum fb_op_origin origin);
|
2024-08-30 13:15:46 +03:00
|
|
|
void intel_psr_flush(struct intel_display *display,
|
2019-04-05 14:00:09 +03:00
|
|
|
unsigned frontbuffer_bits,
|
|
|
|
enum fb_op_origin origin);
|
2021-02-04 15:40:14 +02:00
|
|
|
void intel_psr_init(struct intel_dp *intel_dp);
|
2019-04-05 14:00:09 +03:00
|
|
|
void intel_psr_compute_config(struct intel_dp *intel_dp,
|
2021-09-22 14:52:42 -07:00
|
|
|
struct intel_crtc_state *crtc_state,
|
|
|
|
struct drm_connector_state *conn_state);
|
2021-04-17 17:21:22 -07:00
|
|
|
void intel_psr_get_config(struct intel_encoder *encoder,
|
|
|
|
struct intel_crtc_state *pipe_config);
|
2021-02-04 15:40:14 +02:00
|
|
|
void intel_psr_irq_handler(struct intel_dp *intel_dp, u32 psr_iir);
|
2019-04-05 14:00:09 +03:00
|
|
|
void intel_psr_short_pulse(struct intel_dp *intel_dp);
|
2022-04-05 08:53:43 -07:00
|
|
|
void intel_psr_wait_for_idle_locked(const struct intel_crtc_state *new_crtc_state);
|
2019-04-05 14:00:09 +03:00
|
|
|
bool intel_psr_enabled(struct intel_dp *intel_dp);
|
2020-10-07 12:52:38 -07:00
|
|
|
int intel_psr2_sel_fetch_update(struct intel_atomic_state *state,
|
|
|
|
struct intel_crtc *crtc);
|
2025-02-13 08:47:57 +02:00
|
|
|
void intel_psr2_program_trans_man_trk_ctl(struct intel_dsb *dsb,
|
|
|
|
const struct intel_crtc_state *crtc_state);
|
2025-06-24 11:01:20 +02:00
|
|
|
void intel_psr2_panic_force_full_update(struct intel_display *display,
|
|
|
|
struct intel_crtc_state *crtc_state);
|
2021-06-08 11:54:14 +03:00
|
|
|
void intel_psr_pause(struct intel_dp *intel_dp);
|
|
|
|
void intel_psr_resume(struct intel_dp *intel_dp);
|
2025-04-14 13:05:07 +03:00
|
|
|
bool intel_psr_needs_vblank_notification(const struct intel_crtc_state *crtc_state);
|
2025-04-14 13:05:02 +03:00
|
|
|
void intel_psr_notify_pipe_change(struct intel_atomic_state *state,
|
|
|
|
struct intel_crtc *crtc, bool enable);
|
2025-04-14 13:05:03 +03:00
|
|
|
void intel_psr_notify_dc5_dc6(struct intel_display *display);
|
|
|
|
void intel_psr_dc5_dc6_wa_init(struct intel_display *display);
|
2025-04-14 13:05:04 +03:00
|
|
|
void intel_psr_notify_vblank_enable_disable(struct intel_display *display,
|
|
|
|
bool enable);
|
2024-10-29 14:24:15 +02:00
|
|
|
bool intel_psr_link_ok(struct intel_dp *intel_dp);
|
2019-04-05 14:00:09 +03:00
|
|
|
|
2022-04-05 08:53:43 -07:00
|
|
|
void intel_psr_lock(const struct intel_crtc_state *crtc_state);
|
|
|
|
void intel_psr_unlock(const struct intel_crtc_state *crtc_state);
|
2025-02-13 08:48:02 +02:00
|
|
|
void intel_psr_trigger_frame_change_event(struct intel_dsb *dsb,
|
|
|
|
struct intel_atomic_state *state,
|
|
|
|
struct intel_crtc *crtc);
|
2025-04-23 13:27:03 +03:00
|
|
|
int intel_psr_min_vblank_delay(const struct intel_crtc_state *crtc_state);
|
2023-03-17 15:41:42 +02:00
|
|
|
void intel_psr_connector_debugfs_add(struct intel_connector *connector);
|
2024-08-30 13:15:46 +03:00
|
|
|
void intel_psr_debugfs_register(struct intel_display *display);
|
2025-04-23 14:53:33 +05:30
|
|
|
bool intel_psr_needs_alpm(struct intel_dp *intel_dp, const struct intel_crtc_state *crtc_state);
|
2025-05-26 15:05:06 +03:00
|
|
|
bool intel_psr_needs_alpm_aux_less(struct intel_dp *intel_dp,
|
|
|
|
const struct intel_crtc_state *crtc_state);
|
2022-04-05 08:53:43 -07:00
|
|
|
|
2019-04-05 14:00:09 +03:00
|
|
|
#endif /* __INTEL_PSR_H__ */
|