1 /* SPDX-License-Identifier: MIT */
2 /*
3  * Copyright 2023 Advanced Micro Devices, Inc.
4  *
5  * Permission is hereby granted, free of charge, to any person obtaining a
6  * copy of this software and associated documentation files (the "Software"),
7  * to deal in the Software without restriction, including without limitation
8  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9  * and/or sell copies of the Software, and to permit persons to whom the
10  * Software is furnished to do so, subject to the following conditions:
11  *
12  * The above copyright notice and this permission notice shall be included in
13  * all copies or substantial portions of the Software.
14  *
15  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
18  * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
19  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
20  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
21  * OTHER DEALINGS IN THE SOFTWARE.
22  *
23  * Authors: AMD
24  *
25  */
26 
27 #ifndef __DC_HUBP_DCN35_H__
28 #define __DC_HUBP_DCN35_H__
29 
30 #include "dcn31/dcn31_hubp.h"
31 #include "dcn32/dcn32_hubp.h"
32 #define HUBP_MASK_SH_LIST_DCN35(mask_sh)\
33 	HUBP_MASK_SH_LIST_DCN32(mask_sh),\
34 	HUBP_SF(HUBP0_HUBP_CLK_CNTL, HUBP_FGCG_REP_DIS, mask_sh)
35 
36 #define DCN35_HUBP_REG_FIELD_VARIABLE_LIST(type)          \
37 	struct {                                          \
38 		DCN32_HUBP_REG_FIELD_VARIABLE_LIST(type); \
39 		type HUBP_FGCG_REP_DIS;                   \
40 	}
41 
42 struct dcn35_hubp2_shift {
43 	DCN35_HUBP_REG_FIELD_VARIABLE_LIST(uint8_t);
44 };
45 
46 struct dcn35_hubp2_mask {
47 	DCN35_HUBP_REG_FIELD_VARIABLE_LIST(uint32_t);
48 };
49 
50 
51 bool hubp35_construct(
52 	struct dcn20_hubp *hubp2,
53 	struct dc_context *ctx,
54 	uint32_t inst,
55 	const struct dcn_hubp2_registers *hubp_regs,
56 	const struct dcn35_hubp2_shift *hubp_shift,
57 	const struct dcn35_hubp2_mask *hubp_mask);
58 
59 void hubp35_set_fgcg(struct hubp *hubp, bool enable);
60 
61 void hubp35_program_pixel_format(
62 	struct hubp *hubp,
63 	enum surface_pixel_format format);
64 
65 void hubp35_program_surface_config(
66 	struct hubp *hubp,
67 	enum surface_pixel_format format,
68 	union dc_tiling_info *tiling_info,
69 	struct plane_size *plane_size,
70 	enum dc_rotation_angle rotation,
71 	struct dc_plane_dcc_param *dcc,
72 	bool horizontal_mirror,
73 	unsigned int compat_level);
74 
75 #endif /* __DC_HUBP_DCN35_H__ */
76