xref: /dflybsd-src/sys/dev/drm/amd/display/dc/dce80/dce80_hw_sequencer.c (revision 789731325bde747251c28a37e0a00ed4efb88c46)
1b843c749SSergey Zigachev /*
2b843c749SSergey Zigachev  * Copyright 2015 Advanced Micro Devices, Inc.
3b843c749SSergey Zigachev  *
4b843c749SSergey Zigachev  * Permission is hereby granted, free of charge, to any person obtaining a
5b843c749SSergey Zigachev  * copy of this software and associated documentation files (the "Software"),
6b843c749SSergey Zigachev  * to deal in the Software without restriction, including without limitation
7b843c749SSergey Zigachev  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8b843c749SSergey Zigachev  * and/or sell copies of the Software, and to permit persons to whom the
9b843c749SSergey Zigachev  * Software is furnished to do so, subject to the following conditions:
10b843c749SSergey Zigachev  *
11b843c749SSergey Zigachev  * The above copyright notice and this permission notice shall be included in
12b843c749SSergey Zigachev  * all copies or substantial portions of the Software.
13b843c749SSergey Zigachev  *
14b843c749SSergey Zigachev  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15b843c749SSergey Zigachev  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16b843c749SSergey Zigachev  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
17b843c749SSergey Zigachev  * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18b843c749SSergey Zigachev  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19b843c749SSergey Zigachev  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20b843c749SSergey Zigachev  * OTHER DEALINGS IN THE SOFTWARE.
21b843c749SSergey Zigachev  *
22b843c749SSergey Zigachev  * Authors: AMD
23b843c749SSergey Zigachev  *
24b843c749SSergey Zigachev  */
25b843c749SSergey Zigachev 
26b843c749SSergey Zigachev #include "dm_services.h"
27b843c749SSergey Zigachev #include "dc.h"
28b843c749SSergey Zigachev #include "core_types.h"
29b843c749SSergey Zigachev #include "dce80_hw_sequencer.h"
30b843c749SSergey Zigachev 
31b843c749SSergey Zigachev #include "dce/dce_hwseq.h"
32b843c749SSergey Zigachev #include "dce110/dce110_hw_sequencer.h"
33b843c749SSergey Zigachev #include "dce100/dce100_hw_sequencer.h"
34b843c749SSergey Zigachev 
35b843c749SSergey Zigachev /* include DCE8 register header files */
36b843c749SSergey Zigachev #include "dce/dce_8_0_d.h"
37b843c749SSergey Zigachev #include "dce/dce_8_0_sh_mask.h"
38b843c749SSergey Zigachev 
39b843c749SSergey Zigachev struct dce80_hw_seq_reg_offsets {
40b843c749SSergey Zigachev 	uint32_t crtc;
41b843c749SSergey Zigachev };
42b843c749SSergey Zigachev 
43*78973132SSergey Zigachev #if 0
44b843c749SSergey Zigachev static const struct dce80_hw_seq_reg_offsets reg_offsets[] = {
45b843c749SSergey Zigachev {
46b843c749SSergey Zigachev 	.crtc = (mmCRTC0_CRTC_GSL_CONTROL - mmCRTC_GSL_CONTROL),
47b843c749SSergey Zigachev },
48b843c749SSergey Zigachev {
49b843c749SSergey Zigachev 	.crtc = (mmCRTC1_CRTC_GSL_CONTROL - mmCRTC_GSL_CONTROL),
50b843c749SSergey Zigachev },
51b843c749SSergey Zigachev {
52b843c749SSergey Zigachev 	.crtc = (mmCRTC2_CRTC_GSL_CONTROL - mmCRTC_GSL_CONTROL),
53b843c749SSergey Zigachev },
54b843c749SSergey Zigachev {
55b843c749SSergey Zigachev 	.crtc = (mmCRTC3_CRTC_GSL_CONTROL - mmCRTC_GSL_CONTROL),
56b843c749SSergey Zigachev },
57b843c749SSergey Zigachev {
58b843c749SSergey Zigachev 	.crtc = (mmCRTC4_CRTC_GSL_CONTROL - mmCRTC_GSL_CONTROL),
59b843c749SSergey Zigachev },
60b843c749SSergey Zigachev {
61b843c749SSergey Zigachev 	.crtc = (mmCRTC5_CRTC_GSL_CONTROL - mmCRTC_GSL_CONTROL),
62b843c749SSergey Zigachev }
63b843c749SSergey Zigachev };
64*78973132SSergey Zigachev #endif
65b843c749SSergey Zigachev 
66b843c749SSergey Zigachev #define HW_REG_CRTC(reg, id)\
67b843c749SSergey Zigachev 	(reg + reg_offsets[id].crtc)
68b843c749SSergey Zigachev 
69b843c749SSergey Zigachev /*******************************************************************************
70b843c749SSergey Zigachev  * Private definitions
71b843c749SSergey Zigachev  ******************************************************************************/
72b843c749SSergey Zigachev 
73b843c749SSergey Zigachev /***************************PIPE_CONTROL***********************************/
74b843c749SSergey Zigachev 
dce80_hw_sequencer_construct(struct dc * dc)75b843c749SSergey Zigachev void dce80_hw_sequencer_construct(struct dc *dc)
76b843c749SSergey Zigachev {
77b843c749SSergey Zigachev 	dce110_hw_sequencer_construct(dc);
78b843c749SSergey Zigachev 
79b843c749SSergey Zigachev 	dc->hwss.enable_display_power_gating = dce100_enable_display_power_gating;
80b843c749SSergey Zigachev 	dc->hwss.pipe_control_lock = dce_pipe_control_lock;
81b843c749SSergey Zigachev 	dc->hwss.set_bandwidth = dce100_set_bandwidth;
82b843c749SSergey Zigachev }
83b843c749SSergey Zigachev 
84