mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/
synced 2026-04-18 14:43:42 -04:00
drm/amd/display: Refactor reg_set and reg_update.
[Why] Current reg update and reg set use same functions and only delta is update reads reg value and call update function. [How] Refactor reg update and reg set functions. 1.Implement different functions for reg update and reg set. 2.Wrap same process to a help function, both reg update and reg set will call it. Signed-off-by: Yongqiang Sun <yongqiang.sun@amd.com> Reviewed-by: Tony Cheng <Tony.Cheng@amd.com> Acked-by: Leo Li <sunpeng.li@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
committed by
Alex Deucher
parent
929c3aaa26
commit
148cccf267
@@ -144,10 +144,14 @@ static inline uint32_t set_reg_field_value_ex(
|
||||
reg_name ## __ ## reg_field ## _MASK,\
|
||||
reg_name ## __ ## reg_field ## __SHIFT)
|
||||
|
||||
uint32_t generic_reg_update_ex(const struct dc_context *ctx,
|
||||
uint32_t generic_reg_set_ex(const struct dc_context *ctx,
|
||||
uint32_t addr, uint32_t reg_val, int n,
|
||||
uint8_t shift1, uint32_t mask1, uint32_t field_value1, ...);
|
||||
|
||||
uint32_t generic_reg_update_ex(const struct dc_context *ctx,
|
||||
uint32_t addr, int n,
|
||||
uint8_t shift1, uint32_t mask1, uint32_t field_value1, ...);
|
||||
|
||||
#define FD(reg_field) reg_field ## __SHIFT, \
|
||||
reg_field ## _MASK
|
||||
|
||||
@@ -172,11 +176,10 @@ unsigned int generic_reg_wait(const struct dc_context *ctx,
|
||||
|
||||
#define generic_reg_update_soc15(ctx, inst_offset, reg_name, n, ...)\
|
||||
generic_reg_update_ex(ctx, DCE_BASE.instance[0].segment[mm##reg_name##_BASE_IDX] + mm##reg_name + inst_offset, \
|
||||
dm_read_reg_func(ctx, mm##reg_name + DCE_BASE.instance[0].segment[mm##reg_name##_BASE_IDX] + inst_offset, __func__), \
|
||||
n, __VA_ARGS__)
|
||||
|
||||
#define generic_reg_set_soc15(ctx, inst_offset, reg_name, n, ...)\
|
||||
generic_reg_update_ex(ctx, DCE_BASE.instance[0].segment[mm##reg_name##_BASE_IDX] + mm##reg_name + inst_offset, 0, \
|
||||
generic_reg_set_ex(ctx, DCE_BASE.instance[0].segment[mm##reg_name##_BASE_IDX] + mm##reg_name + inst_offset, 0, \
|
||||
n, __VA_ARGS__)
|
||||
|
||||
#define get_reg_field_value_soc15(reg_value, block, reg_num, reg_name, reg_field)\
|
||||
|
||||
Reference in New Issue
Block a user