diff options
author | Rodrigo Siqueira <Rodrigo.Siqueira@amd.com> | 2020-09-15 19:33:43 +0300 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2020-10-26 20:33:59 +0300 |
commit | 9d83722d06feae80209483351db1e985f60a1c5a (patch) | |
tree | 5da18604fc3cf4282ada179aac9ad6ea6e4c8f8e /drivers/gpu/drm/amd/display/dc/dm_services.h | |
parent | b51366f77b9e07572d424381931c0dedb5526a5b (diff) | |
download | linux-9d83722d06feae80209483351db1e985f60a1c5a.tar.xz |
drm/amd/display: Decouple amdgpu_dm_trace from service
Our DC currently uses some of the tracepoint function inside a DC
header, which means that many other files implicitly include part of the
trace function. This situation limits how we can expand this feature for
other parts of the driver by generating multiple compilation errors when
we try to reuse some of the existing structures. This commit decouples
part of the amdgpu_dm_trace from DC core to simplify the trace
enlargement in future changes.
Signed-off-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Acked-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/display/dc/dm_services.h')
-rw-r--r-- | drivers/gpu/drm/amd/display/dc/dm_services.h | 42 |
1 files changed, 10 insertions, 32 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/dm_services.h b/drivers/gpu/drm/amd/display/dc/dm_services.h index fdd1943c828d..9a3f2a44f882 100644 --- a/drivers/gpu/drm/amd/display/dc/dm_services.h +++ b/drivers/gpu/drm/amd/display/dc/dm_services.h @@ -31,8 +31,6 @@ #define __DM_SERVICES_H__ -#include "amdgpu_dm_trace.h" - /* TODO: remove when DC is complete. */ #include "dm_services_types.h" #include "logger_interface.h" @@ -49,43 +47,26 @@ irq_handler_idx dm_register_interrupt( interrupt_handler ih, void *handler_args); - /* * * GPU registers access * */ -uint32_t dm_read_reg_func( - const struct dc_context *ctx, - uint32_t address, - const char *func_name); +uint32_t dm_read_reg_func(const struct dc_context *ctx, uint32_t address, + const char *func_name); + /* enable for debugging new code, this adds 50k to the driver size. */ /* #define DM_CHECK_ADDR_0 */ -#define dm_read_reg(ctx, address) \ - dm_read_reg_func(ctx, address, __func__) - +void dm_write_reg_func(const struct dc_context *ctx, uint32_t address, + uint32_t value, const char *func_name); +#define dm_read_reg(ctx, address) \ + dm_read_reg_func(ctx, address, __func__) #define dm_write_reg(ctx, address, value) \ dm_write_reg_func(ctx, address, value, __func__) -static inline void dm_write_reg_func( - const struct dc_context *ctx, - uint32_t address, - uint32_t value, - const char *func_name) -{ -#ifdef DM_CHECK_ADDR_0 - if (address == 0) { - DC_ERR("invalid register write. address = 0"); - return; - } -#endif - cgs_write_register(ctx->cgs_device, address, value); - trace_amdgpu_dc_wreg(&ctx->perf_trace->write_count, address, value); -} - static inline uint32_t dm_read_index_reg( const struct dc_context *ctx, enum cgs_ind_reg addr_space, @@ -287,13 +268,10 @@ unsigned long long dm_get_elapse_time_in_ns(struct dc_context *ctx, /* * performance tracing */ -#define PERF_TRACE() trace_amdgpu_dc_performance(CTX->perf_trace->read_count,\ - CTX->perf_trace->write_count, &CTX->perf_trace->last_entry_read,\ - &CTX->perf_trace->last_entry_write, __func__, __LINE__) -#define PERF_TRACE_CTX(__CTX) trace_amdgpu_dc_performance(__CTX->perf_trace->read_count,\ - __CTX->perf_trace->write_count, &__CTX->perf_trace->last_entry_read,\ - &__CTX->perf_trace->last_entry_write, __func__, __LINE__) +void dm_perf_trace_timestamp(const char *func_name, unsigned int line, struct dc_context *ctx); +#define PERF_TRACE() dm_perf_trace_timestamp(__func__, __LINE__, CTX) +#define PERF_TRACE_CTX(__CTX) dm_perf_trace_timestamp(__func__, __LINE__, __CTX) /* * Debug and verification hooks |