13f68c01bSZhan Liu /*
23f68c01bSZhan Liu  * Copyright 2016 Advanced Micro Devices, Inc.
33f68c01bSZhan Liu  *
43f68c01bSZhan Liu  * Permission is hereby granted, free of charge, to any person obtaining a
53f68c01bSZhan Liu  * copy of this software and associated documentation files (the "Software"),
63f68c01bSZhan Liu  * to deal in the Software without restriction, including without limitation
73f68c01bSZhan Liu  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
83f68c01bSZhan Liu  * and/or sell copies of the Software, and to permit persons to whom the
93f68c01bSZhan Liu  * Software is furnished to do so, subject to the following conditions:
103f68c01bSZhan Liu  *
113f68c01bSZhan Liu  * The above copyright notice and this permission notice shall be included in
123f68c01bSZhan Liu  * all copies or substantial portions of the Software.
133f68c01bSZhan Liu  *
143f68c01bSZhan Liu  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
153f68c01bSZhan Liu  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
163f68c01bSZhan Liu  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
173f68c01bSZhan Liu  * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
183f68c01bSZhan Liu  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
193f68c01bSZhan Liu  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
203f68c01bSZhan Liu  * OTHER DEALINGS IN THE SOFTWARE.
213f68c01bSZhan Liu  *
223f68c01bSZhan Liu  * Authors: AMD
233f68c01bSZhan Liu  *
243f68c01bSZhan Liu  */
253f68c01bSZhan Liu 
263f68c01bSZhan Liu #include "dce110/dce110_hw_sequencer.h"
273f68c01bSZhan Liu #include "dcn10/dcn10_hw_sequencer.h"
283f68c01bSZhan Liu #include "dcn20/dcn20_hwseq.h"
293f68c01bSZhan Liu #include "dcn201_hwseq.h"
302bdcb12fSMaíra Canal #include "dcn201_init.h"
313f68c01bSZhan Liu 
323f68c01bSZhan Liu static const struct hw_sequencer_funcs dcn201_funcs = {
333f68c01bSZhan Liu 	.program_gamut_remap = dcn10_program_gamut_remap,
343f68c01bSZhan Liu 	.init_hw = dcn201_init_hw,
353f68c01bSZhan Liu 	.power_down_on_boot = NULL,
363f68c01bSZhan Liu 	.apply_ctx_to_hw = dce110_apply_ctx_to_hw,
373f68c01bSZhan Liu 	.apply_ctx_for_surface = NULL,
383f68c01bSZhan Liu 	.program_front_end_for_ctx = dcn20_program_front_end_for_ctx,
393f68c01bSZhan Liu 	.wait_for_pending_cleared = dcn10_wait_for_pending_cleared,
403f68c01bSZhan Liu 	.post_unlock_program_front_end = dcn10_post_unlock_program_front_end,
413f68c01bSZhan Liu 	.update_plane_addr = dcn201_update_plane_addr,
423f68c01bSZhan Liu 	.update_dchub = dcn10_update_dchub,
433f68c01bSZhan Liu 	.update_pending_status = dcn10_update_pending_status,
443f68c01bSZhan Liu 	.program_output_csc = dcn20_program_output_csc,
453f68c01bSZhan Liu 	.enable_accelerated_mode = dce110_enable_accelerated_mode,
463f68c01bSZhan Liu 	.enable_timing_synchronization = dcn10_enable_timing_synchronization,
473f68c01bSZhan Liu 	.enable_per_frame_crtc_position_reset = dcn10_enable_per_frame_crtc_position_reset,
483f68c01bSZhan Liu 	.update_info_frame = dce110_update_info_frame,
493f68c01bSZhan Liu 	.send_immediate_sdp_message = dcn10_send_immediate_sdp_message,
503f68c01bSZhan Liu 	.enable_stream = dce110_enable_stream,
513f68c01bSZhan Liu 	.disable_stream = dce110_disable_stream,
523f68c01bSZhan Liu 	.unblank_stream = dcn201_unblank_stream,
533f68c01bSZhan Liu 	.blank_stream = dce110_blank_stream,
543f68c01bSZhan Liu 	.enable_audio_stream = dce110_enable_audio_stream,
553f68c01bSZhan Liu 	.disable_audio_stream = dce110_disable_audio_stream,
563f68c01bSZhan Liu 	.disable_plane = dcn10_disable_plane,
573f68c01bSZhan Liu 	.pipe_control_lock = dcn201_pipe_control_lock,
583f68c01bSZhan Liu 	.interdependent_update_lock = dcn10_lock_all_pipes,
593f68c01bSZhan Liu 	.cursor_lock = dcn10_cursor_lock,
603f68c01bSZhan Liu 	.prepare_bandwidth = dcn20_prepare_bandwidth,
613f68c01bSZhan Liu 	.optimize_bandwidth = dcn20_optimize_bandwidth,
623f68c01bSZhan Liu 	.update_bandwidth = dcn20_update_bandwidth,
633f68c01bSZhan Liu 	.set_drr = dcn10_set_drr,
643f68c01bSZhan Liu 	.get_position = dcn10_get_position,
653f68c01bSZhan Liu 	.set_static_screen_control = dcn10_set_static_screen_control,
663f68c01bSZhan Liu 	.setup_stereo = dcn10_setup_stereo,
673f68c01bSZhan Liu 	.set_avmute = dce110_set_avmute,
683f68c01bSZhan Liu 	.log_hw_state = dcn10_log_hw_state,
693f68c01bSZhan Liu 	.get_hw_state = dcn10_get_hw_state,
703f68c01bSZhan Liu 	.clear_status_bits = dcn10_clear_status_bits,
713f68c01bSZhan Liu 	.wait_for_mpcc_disconnect = dcn10_wait_for_mpcc_disconnect,
723f68c01bSZhan Liu 	.edp_backlight_control = dce110_edp_backlight_control,
733f68c01bSZhan Liu 	.edp_power_control = dce110_edp_power_control,
743f68c01bSZhan Liu 	.edp_wait_for_hpd_ready = dce110_edp_wait_for_hpd_ready,
753f68c01bSZhan Liu 	.setup_periodic_interrupt = dcn10_setup_periodic_interrupt,
763f68c01bSZhan Liu 	.set_clock = dcn10_set_clock,
773f68c01bSZhan Liu 	.get_clock = dcn10_get_clock,
783f68c01bSZhan Liu 	.program_triplebuffer = dcn20_program_triple_buffer,
793f68c01bSZhan Liu 	.dmdata_status_done = dcn20_dmdata_status_done,
803f68c01bSZhan Liu 	.set_dmdata_attributes = dcn201_set_dmdata_attributes,
813f68c01bSZhan Liu 	.get_vupdate_offset_from_vsync = dcn10_get_vupdate_offset_from_vsync,
823f68c01bSZhan Liu 	.calc_vupdate_position = dcn10_calc_vupdate_position,
833f68c01bSZhan Liu 	.set_cursor_position = dcn10_set_cursor_position,
843f68c01bSZhan Liu 	.set_cursor_attribute = dcn201_set_cursor_attribute,
853f68c01bSZhan Liu 	.set_cursor_sdr_white_level = dcn10_set_cursor_sdr_white_level,
863f68c01bSZhan Liu 	.set_backlight_level = dce110_set_backlight_level,
873f68c01bSZhan Liu 	.set_abm_immediate_disable = dce110_set_abm_immediate_disable,
883f68c01bSZhan Liu 	.set_pipe = dce110_set_pipe,
899c75891fSWenjing Liu 	.enable_lvds_link_output = dce110_enable_lvds_link_output,
909c75891fSWenjing Liu 	.enable_tmds_link_output = dce110_enable_tmds_link_output,
919c75891fSWenjing Liu 	.enable_dp_link_output = dce110_enable_dp_link_output,
929c75891fSWenjing Liu 	.disable_link_output = dce110_disable_link_output,
933f68c01bSZhan Liu 	.set_disp_pattern_generator = dcn20_set_disp_pattern_generator,
94*d205a800SLeo (Hanghong) Ma 	.update_visual_confirm_color = dcn10_update_visual_confirm_color,
953f68c01bSZhan Liu };
963f68c01bSZhan Liu 
973f68c01bSZhan Liu static const struct hwseq_private_funcs dcn201_private_funcs = {
983f68c01bSZhan Liu 	.init_pipes = NULL,
993f68c01bSZhan Liu 	.update_plane_addr = dcn201_update_plane_addr,
1003f68c01bSZhan Liu 	.plane_atomic_disconnect = dcn201_plane_atomic_disconnect,
1013f68c01bSZhan Liu 	.program_pipe = dcn10_program_pipe,
1023f68c01bSZhan Liu 	.update_mpcc = dcn201_update_mpcc,
1033f68c01bSZhan Liu 	.set_input_transfer_func = dcn20_set_input_transfer_func,
1043f68c01bSZhan Liu 	.set_output_transfer_func = dcn20_set_output_transfer_func,
1053f68c01bSZhan Liu 	.power_down = dce110_power_down,
1063f68c01bSZhan Liu 	.enable_display_power_gating = dcn10_dummy_display_power_gating,
1073f68c01bSZhan Liu 	.blank_pixel_data = dcn20_blank_pixel_data,
1083f68c01bSZhan Liu 	.reset_hw_ctx_wrap = dcn10_reset_hw_ctx_wrap,
1093f68c01bSZhan Liu 	.enable_stream_timing = dcn20_enable_stream_timing,
1103f68c01bSZhan Liu 	.edp_backlight_control = dce110_edp_backlight_control,
1113f68c01bSZhan Liu 	.disable_stream_gating = NULL,
1123f68c01bSZhan Liu 	.enable_stream_gating = NULL,
1133f68c01bSZhan Liu 	.setup_vupdate_interrupt = dcn20_setup_vupdate_interrupt,
1143f68c01bSZhan Liu 	.did_underflow_occur = dcn10_did_underflow_occur,
1153f68c01bSZhan Liu 	.init_blank = dcn201_init_blank,
1163f68c01bSZhan Liu 	.disable_vga = dcn10_disable_vga,
1173f68c01bSZhan Liu 	.bios_golden_init = dcn10_bios_golden_init,
1183f68c01bSZhan Liu 	.plane_atomic_disable = dcn10_plane_atomic_disable,
1193f68c01bSZhan Liu 	.plane_atomic_power_down = dcn10_plane_atomic_power_down,
1203f68c01bSZhan Liu 	.enable_power_gating_plane = dcn10_enable_power_gating_plane,
1213f68c01bSZhan Liu 	.dpp_pg_control = dcn10_dpp_pg_control,
1223f68c01bSZhan Liu 	.hubp_pg_control = dcn10_hubp_pg_control,
1233f68c01bSZhan Liu 	.dsc_pg_control = NULL,
1243f68c01bSZhan Liu 	.set_hdr_multiplier = dcn10_set_hdr_multiplier,
1253f68c01bSZhan Liu 	.verify_allow_pstate_change_high = dcn10_verify_allow_pstate_change_high,
1263f68c01bSZhan Liu 	.wait_for_blank_complete = dcn20_wait_for_blank_complete,
1273f68c01bSZhan Liu 	.dccg_init = dcn20_dccg_init,
1283f68c01bSZhan Liu 	.set_blend_lut = dcn20_set_blend_lut,
1293f68c01bSZhan Liu 	.set_shaper_3dlut = dcn20_set_shaper_3dlut,
1303f68c01bSZhan Liu };
1313f68c01bSZhan Liu 
dcn201_hw_sequencer_construct(struct dc * dc)1323f68c01bSZhan Liu void dcn201_hw_sequencer_construct(struct dc *dc)
1333f68c01bSZhan Liu {
1343f68c01bSZhan Liu 	dc->hwss = dcn201_funcs;
1353f68c01bSZhan Liu 	dc->hwseq->funcs = dcn201_private_funcs;
1363f68c01bSZhan Liu }
137