diff options
author | Yongqiang Sun <yongqiang.sun@amd.com> | 2019-02-28 23:14:39 +0300 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2019-03-21 07:39:48 +0300 |
commit | 901f4f97be669a316f32116d9ff842f1b29cdff6 (patch) | |
tree | 1268340466b5cbfba3c52f2f81cfc0128e1052ee /drivers/gpu/drm/amd/display/dc/dc_helper.c | |
parent | 7ddaef96cd30c340839926e8ad4f755a1864e338 (diff) | |
download | linux-901f4f97be669a316f32116d9ff842f1b29cdff6.tar.xz |
drm/amd/display: Move dm_read_reg_func to dc_helper.
Move out of header to dc_helper.c, in preparation for future
implementations.
Signed-off-by: Yongqiang Sun <yongqiang.sun@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/display/dc/dc_helper.c')
-rw-r--r-- | drivers/gpu/drm/amd/display/dc/dc_helper.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/dc_helper.c b/drivers/gpu/drm/amd/display/dc/dc_helper.c index 0872514480f4..5e6c5eff49cf 100644 --- a/drivers/gpu/drm/amd/display/dc/dc_helper.c +++ b/drivers/gpu/drm/amd/display/dc/dc_helper.c @@ -119,6 +119,24 @@ uint32_t generic_reg_set_ex(const struct dc_context *ctx, return reg_val; } +uint32_t dm_read_reg_func( + const struct dc_context *ctx, + uint32_t address, + const char *func_name) +{ + uint32_t value; +#ifdef DM_CHECK_ADDR_0 + if (address == 0) { + DC_ERR("invalid register read; address = 0\n"); + return 0; + } +#endif + value = cgs_read_register(ctx->cgs_device, address); + trace_amdgpu_dc_rreg(&ctx->perf_trace->read_count, address, value); + + return value; +} + uint32_t generic_reg_get(const struct dc_context *ctx, uint32_t addr, uint8_t shift, uint32_t mask, uint32_t *field_value) { |