xref: /linux/drivers/gpu/drm/amd/display/dc/opp/dcn60/dcn60_opp.c (revision 67f8bc848ee31831336bd478e57d2f993551902e)
1 // SPDX-License-Identifier: MIT
2 /* Copyright 2025 Advanced Micro Devices, Inc. */
3 
4 #include "dcn60_opp.h"
5 #include "reg_helper.h"
6 
7 #define REG(reg) ((const struct dcn60_opp_registers *)(oppn20->regs))->reg
8 
9 #undef FN
10 #define FN(reg_name, field_name)                                           \
11 	((const struct dcn60_opp_shift *)(oppn20->opp_shift))->field_name, \
12 		((const struct dcn60_opp_mask *)(oppn20->opp_mask))->field_name
13 
14 #define CTX oppn20->base.ctx
15 
16 void dcn60_opp_construct(struct dcn20_opp *oppn20, struct dc_context *ctx,
17 		 uint32_t inst, const struct dcn60_opp_registers *regs,
18 		 const struct dcn60_opp_shift *opp_shift,
19 		 const struct dcn60_opp_mask *opp_mask)
20 {
21 	dcn20_opp_construct(oppn20, ctx, inst,
22 			    (const struct dcn20_opp_registers *)regs,
23 			    (const struct dcn20_opp_shift *)opp_shift,
24 			    (const struct dcn20_opp_mask *)opp_mask);
25 }
26