| 1 | /* SPDX-License-Identifier: MIT */ |
| 2 | /* |
| 3 | * Copyright © 2019 Intel Corporation |
| 4 | */ |
| 5 | |
| 6 | #ifndef __INTEL_PSR_H__ |
| 7 | #define __INTEL_PSR_H__ |
| 8 | |
| 9 | #include <linux/types.h> |
| 10 | |
| 11 | enum fb_op_origin; |
| 12 | struct drm_connector; |
| 13 | struct drm_connector_state; |
| 14 | struct intel_atomic_state; |
| 15 | struct intel_connector; |
| 16 | struct intel_crtc; |
| 17 | struct intel_crtc_state; |
| 18 | struct intel_display; |
| 19 | struct intel_dp; |
| 20 | struct intel_dsb; |
| 21 | struct intel_encoder; |
| 22 | struct intel_plane; |
| 23 | struct intel_plane_state; |
| 24 | |
| 25 | #define CAN_PANEL_REPLAY(intel_dp) ((intel_dp)->psr.sink_panel_replay_support && \ |
| 26 | (intel_dp)->psr.source_panel_replay_support) |
| 27 | |
| 28 | bool intel_encoder_can_psr(struct intel_encoder *encoder); |
| 29 | bool intel_psr_needs_aux_io_power(struct intel_encoder *encoder, |
| 30 | const struct intel_crtc_state *crtc_state); |
| 31 | void intel_psr_init_dpcd(struct intel_dp *intel_dp); |
| 32 | void intel_psr_panel_replay_enable_sink(struct intel_dp *intel_dp); |
| 33 | void intel_psr_pre_plane_update(struct intel_atomic_state *state, |
| 34 | struct intel_crtc *crtc); |
| 35 | void intel_psr_post_plane_update(struct intel_atomic_state *state, |
| 36 | struct intel_crtc *crtc); |
| 37 | void intel_psr_disable(struct intel_dp *intel_dp, |
| 38 | const struct intel_crtc_state *old_crtc_state); |
| 39 | int intel_psr_debug_set(struct intel_dp *intel_dp, u64 value); |
| 40 | void intel_psr_invalidate(struct intel_display *display, |
| 41 | unsigned frontbuffer_bits, |
| 42 | enum fb_op_origin origin); |
| 43 | void intel_psr_flush(struct intel_display *display, |
| 44 | unsigned frontbuffer_bits, |
| 45 | enum fb_op_origin origin); |
| 46 | void intel_psr_init(struct intel_dp *intel_dp); |
| 47 | void intel_psr_compute_config(struct intel_dp *intel_dp, |
| 48 | struct intel_crtc_state *crtc_state, |
| 49 | struct drm_connector_state *conn_state); |
| 50 | void intel_psr_get_config(struct intel_encoder *encoder, |
| 51 | struct intel_crtc_state *pipe_config); |
| 52 | void intel_psr_irq_handler(struct intel_dp *intel_dp, u32 psr_iir); |
| 53 | void intel_psr_short_pulse(struct intel_dp *intel_dp); |
| 54 | void intel_psr_wait_for_idle_locked(const struct intel_crtc_state *new_crtc_state); |
| 55 | void intel_psr_wait_for_idle_dsb(struct intel_dsb *dsb, |
| 56 | const struct intel_crtc_state *new_crtc_state); |
| 57 | bool intel_psr_enabled(struct intel_dp *intel_dp); |
| 58 | int intel_psr2_sel_fetch_update(struct intel_atomic_state *state, |
| 59 | struct intel_crtc *crtc); |
| 60 | void intel_psr2_program_trans_man_trk_ctl(struct intel_dsb *dsb, |
| 61 | const struct intel_crtc_state *crtc_state); |
| 62 | void intel_psr2_panic_force_full_update(struct intel_display *display, |
| 63 | struct intel_crtc_state *crtc_state); |
| 64 | void intel_psr_pause(struct intel_dp *intel_dp); |
| 65 | void intel_psr_resume(struct intel_dp *intel_dp); |
| 66 | bool intel_psr_needs_vblank_notification(const struct intel_crtc_state *crtc_state); |
| 67 | void intel_psr_notify_pipe_change(struct intel_atomic_state *state, |
| 68 | struct intel_crtc *crtc, bool enable); |
| 69 | void intel_psr_notify_dc5_dc6(struct intel_display *display); |
| 70 | void intel_psr_dc5_dc6_wa_init(struct intel_display *display); |
| 71 | void intel_psr_notify_vblank_enable_disable(struct intel_display *display, |
| 72 | bool enable); |
| 73 | bool intel_psr_link_ok(struct intel_dp *intel_dp); |
| 74 | |
| 75 | void intel_psr_lock(const struct intel_crtc_state *crtc_state); |
| 76 | void intel_psr_unlock(const struct intel_crtc_state *crtc_state); |
| 77 | void intel_psr_trigger_frame_change_event(struct intel_dsb *dsb, |
| 78 | struct intel_atomic_state *state, |
| 79 | struct intel_crtc *crtc); |
| 80 | int intel_psr_min_set_context_latency(const struct intel_crtc_state *crtc_state); |
| 81 | void intel_psr_connector_debugfs_add(struct intel_connector *connector); |
| 82 | void intel_psr_debugfs_register(struct intel_display *display); |
| 83 | bool intel_psr_needs_alpm(struct intel_dp *intel_dp, const struct intel_crtc_state *crtc_state); |
| 84 | bool intel_psr_needs_alpm_aux_less(struct intel_dp *intel_dp, |
| 85 | const struct intel_crtc_state *crtc_state); |
| 86 | void intel_psr_compute_config_late(struct intel_dp *intel_dp, |
| 87 | struct intel_crtc_state *crtc_state); |
| 88 | int intel_psr_min_guardband(struct intel_crtc_state *crtc_state); |
| 89 | |
| 90 | #endif /* __INTEL_PSR_H__ */ |
| 91 | |