mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-21 04:53:46 -04:00
drm/amd/display: Indirect reg read macro with shift and mask
[Why] Recent double buffering changes for dcn2 use IX_REG_READ. However, this macro returns the full register value, with the need to manually shift and mask it to retrieve field data. [How] Create new IX_REG_GET macro that handles shift and mask. Use this for double buffering reads instead of IX_REG_READ. Signed-off-by: Noah Abradjian <noah.abradjian@amd.com> Reviewed-by: Tony Cheng <Tony.Cheng@amd.com> Acked-by: Harry Wentland <harry.wentland@amd.com> Acked-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
committed by
Alex Deucher
parent
ec256f449c
commit
c1e3417558
@@ -458,7 +458,14 @@ uint32_t generic_reg_get8(const struct dc_context *ctx, uint32_t addr,
|
||||
#define IX_REG_READ(index_reg_name, data_reg_name, index) \
|
||||
generic_read_indirect_reg(CTX, REG(index_reg_name), REG(data_reg_name), IND_REG(index))
|
||||
|
||||
#define IX_REG_GET_N(index_reg_name, data_reg_name, index, n, ...) \
|
||||
generic_indirect_reg_get(CTX, REG(index_reg_name), REG(data_reg_name), \
|
||||
IND_REG(index), \
|
||||
n, __VA_ARGS__)
|
||||
|
||||
#define IX_REG_GET(index_reg_name, data_reg_name, index, field, val) \
|
||||
IX_REG_GET_N(index_reg_name, data_reg_name, index, 1, \
|
||||
FN(data_reg_name, field), val)
|
||||
|
||||
#define IX_REG_UPDATE_N(index_reg_name, data_reg_name, index, n, ...) \
|
||||
generic_indirect_reg_update_ex(CTX, \
|
||||
@@ -479,6 +486,12 @@ uint32_t generic_read_indirect_reg(const struct dc_context *ctx,
|
||||
uint32_t addr_index, uint32_t addr_data,
|
||||
uint32_t index);
|
||||
|
||||
uint32_t generic_indirect_reg_get(const struct dc_context *ctx,
|
||||
uint32_t addr_index, uint32_t addr_data,
|
||||
uint32_t index, int n,
|
||||
uint8_t shift1, uint32_t mask1, uint32_t *field_value1,
|
||||
...);
|
||||
|
||||
uint32_t generic_indirect_reg_update_ex(const struct dc_context *ctx,
|
||||
uint32_t addr_index, uint32_t addr_data,
|
||||
uint32_t index, uint32_t reg_val, int n,
|
||||
|
||||
Reference in New Issue
Block a user