1/*
2 * Copyright 2022 Advanced Micro Devices, Inc.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20 * OTHER DEALINGS IN THE SOFTWARE.
21 *
22 * Authors: AMD
23 *
24 */
25
26#ifndef __DC_LINK_EDP_PANEL_CONTROL_H__
27#define __DC_LINK_EDP_PANEL_CONTROL_H__
28#include "link.h"
29
30enum dp_panel_mode dp_get_panel_mode(struct dc_link *link);
31void dp_set_panel_mode(struct dc_link *link, enum dp_panel_mode panel_mode);
32bool set_default_brightness_aux(struct dc_link *link);
33void edp_panel_backlight_power_on(struct dc_link *link, bool wait_for_hpd);
34int edp_get_backlight_level(const struct dc_link *link);
35bool edp_get_backlight_level_nits(struct dc_link *link,
36 uint32_t *backlight_millinits_avg,
37 uint32_t *backlight_millinits_peak);
38bool edp_set_backlight_level(const struct dc_link *link,
39 uint32_t backlight_pwm_u16_16,
40 uint32_t frame_ramp);
41bool edp_set_backlight_level_nits(struct dc_link *link,
42 bool isHDR,
43 uint32_t backlight_millinits,
44 uint32_t transition_time_in_ms);
45int edp_get_target_backlight_pwm(const struct dc_link *link);
46bool edp_get_psr_state(const struct dc_link *link, enum dc_psr_state *state);
47bool edp_set_psr_allow_active(struct dc_link *link, const bool *allow_active,
48 bool wait, bool force_static, const unsigned int *power_opts);
49bool edp_setup_psr(struct dc_link *link,
50 const struct dc_stream_state *stream, struct psr_config *psr_config,
51 struct psr_context *psr_context);
52bool edp_set_sink_vtotal_in_psr_active(const struct dc_link *link,
53 uint16_t psr_vtotal_idle, uint16_t psr_vtotal_su);
54void edp_get_psr_residency(const struct dc_link *link, uint32_t *residency);
55bool edp_set_replay_allow_active(struct dc_link *dc_link, const bool *enable,
56 bool wait, bool force_static, const unsigned int *power_opts);
57bool edp_setup_replay(struct dc_link *link,
58 const struct dc_stream_state *stream);
59bool edp_send_replay_cmd(struct dc_link *link,
60 enum replay_FW_Message_type msg,
61 union dmub_replay_cmd_set *cmd_data);
62bool edp_set_coasting_vtotal(struct dc_link *link, uint32_t coasting_vtotal);
63bool edp_replay_residency(const struct dc_link *link,
64 unsigned int *residency, const bool is_start, const bool is_alpm);
65bool edp_get_replay_state(const struct dc_link *link, uint64_t *state);
66bool edp_set_replay_power_opt_and_coasting_vtotal(struct dc_link *link,
67 const unsigned int *power_opts, uint32_t coasting_vtotal);
68bool edp_wait_for_t12(struct dc_link *link);
69bool edp_is_ilr_optimization_required(struct dc_link *link,
70 struct dc_crtc_timing *crtc_timing);
71bool edp_is_ilr_optimization_enabled(struct dc_link *link);
72enum dc_link_rate get_max_link_rate_from_ilr_table(struct dc_link *link);
73bool edp_backlight_enable_aux(struct dc_link *link, bool enable);
74void edp_add_delay_for_T9(struct dc_link *link);
75bool edp_receiver_ready_T9(struct dc_link *link);
76bool edp_receiver_ready_T7(struct dc_link *link);
77bool edp_power_alpm_dpcd_enable(struct dc_link *link, bool enable);
78void edp_set_panel_power(struct dc_link *link, bool powerOn);
79#endif /* __DC_LINK_EDP_POWER_CONTROL_H__ */
80

source code of linux/drivers/gpu/drm/amd/display/dc/link/protocols/link_edp_panel_control.h