2 * Copyright 2015 Advanced Micro Devices, Inc.
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:
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
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.
26 #ifndef __DC_HW_SEQUENCER_H__
27 #define __DC_HW_SEQUENCER_H__
29 #include "clock_source.h"
30 #include "inc/hw/timing_generator.h"
31 #include "inc/hw/link_encoder.h"
32 #include "core_status.h"
34 enum pipe_gating_control {
35 PIPE_GATING_CONTROL_DISABLE = 0,
36 PIPE_GATING_CONTROL_ENABLE,
37 PIPE_GATING_CONTROL_INIT
41 bool blnd_crtc_trigger;
45 struct dc_context *ctx;
46 const struct dce_hwseq_registers *regs;
47 const struct dce_hwseq_shift *shifts;
48 const struct dce_hwseq_mask *masks;
49 struct dce_hwseq_wa wa;
54 struct dchub_init_data;
55 struct dc_static_screen_events;
57 struct resource_context;
59 struct hw_sequencer_funcs {
61 void (*init_hw)(struct dc *dc);
63 enum dc_status (*apply_ctx_to_hw)(
64 struct dc *dc, struct dc_state *context);
66 void (*reset_hw_ctx_wrap)(
67 struct dc *dc, struct dc_state *context);
69 void (*apply_ctx_for_surface)(
71 const struct dc_stream_state *stream,
73 struct dc_state *context);
75 void (*set_plane_config)(
77 struct pipe_ctx *pipe_ctx,
78 struct resource_context *res_ctx);
80 void (*program_gamut_remap)(
81 struct pipe_ctx *pipe_ctx);
83 void (*program_csc_matrix)(
84 struct pipe_ctx *pipe_ctx,
85 enum dc_color_space colorspace,
88 void (*update_plane_addr)(
90 struct pipe_ctx *pipe_ctx);
93 struct dce_hwseq *hws,
94 struct dchub_init_data *dh_data);
96 void (*update_pending_status)(
97 struct pipe_ctx *pipe_ctx);
99 bool (*set_input_transfer_func)(
100 struct pipe_ctx *pipe_ctx,
101 const struct dc_plane_state *plane_state);
103 bool (*set_output_transfer_func)(
104 struct pipe_ctx *pipe_ctx,
105 const struct dc_stream_state *stream);
107 void (*power_down)(struct dc *dc);
109 void (*enable_accelerated_mode)(struct dc *dc);
111 void (*enable_timing_synchronization)(
115 struct pipe_ctx *grouped_pipes[]);
117 void (*enable_display_pipe_clock_gating)(
118 struct dc_context *ctx,
121 bool (*enable_display_power_gating)(
123 uint8_t controller_id,
125 enum pipe_gating_control power_gating);
127 void (*power_down_front_end)(struct dc *dc, int fe_idx);
129 void (*power_on_front_end)(struct dc *dc,
130 struct pipe_ctx *pipe,
131 struct dc_state *context);
133 void (*update_info_frame)(struct pipe_ctx *pipe_ctx);
135 void (*enable_stream)(struct pipe_ctx *pipe_ctx);
137 void (*disable_stream)(struct pipe_ctx *pipe_ctx,
140 void (*unblank_stream)(struct pipe_ctx *pipe_ctx,
141 struct dc_link_settings *link_settings);
143 void (*pipe_control_lock)(
145 struct pipe_ctx *pipe,
148 void (*set_bandwidth)(
150 struct dc_state *context,
151 bool decrease_allowed);
153 void (*set_drr)(struct pipe_ctx **pipe_ctx, int num_pipes,
156 void (*get_position)(struct pipe_ctx **pipe_ctx, int num_pipes,
157 struct crtc_position *position);
159 void (*set_static_screen_control)(struct pipe_ctx **pipe_ctx,
160 int num_pipes, const struct dc_static_screen_events *events);
162 enum dc_status (*prog_pixclk_crtc_otg)(
163 struct pipe_ctx *pipe_ctx,
164 struct dc_state *context,
167 void (*setup_stereo)(
168 struct pipe_ctx *pipe_ctx,
171 void (*set_avmute)(struct pipe_ctx *pipe_ctx, bool enable);
173 void (*log_hw_state)(struct dc *dc);
175 void (*wait_for_mpcc_disconnect)(struct dc *dc,
176 struct resource_pool *res_pool,
177 struct pipe_ctx *pipe_ctx);
179 void (*ready_shared_resources)(struct dc *dc, struct dc_state *context);
180 void (*optimize_shared_resources)(struct dc *dc);
181 void (*edp_power_control)(
182 struct link_encoder *enc,
184 void (*edp_backlight_control)(
185 struct dc_link *link,
189 void color_space_to_black_color(
191 enum dc_color_space colorspace,
192 struct tg_color *black_color);
194 bool hwss_wait_for_blank_complete(
195 struct timing_generator *tg);
197 #endif /* __DC_HW_SEQUENCER_H__ */