From cae514120b2c6420127ac6102a2d3fd5023218d0 Mon Sep 17 00:00:00 2001 From: Konsta Holtta Date: Tue, 22 May 2018 12:59:02 +0300 Subject: gpu: nvgpu: abstract submit profiling Add gk20a_fifo_profile_snapshot() to store the submit time in a profiling entry that was acquired from gk20a_fifo_profile_acquire(). Also get rid of ifdef CONFIG_DEBUG_FS by stubbing the acquire and free functions when debugfs is not enabled. This reduces some cyclomatic complexity in the submit path. Jira NVGPU-708 Change-Id: I39829a6475cfe3aa582620219e420bde62228e52 Signed-off-by: Konsta Holtta Reviewed-on: https://git-master.nvidia.com/r/1729545 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/fifo_gk20a.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'drivers/gpu/nvgpu/gk20a/fifo_gk20a.h') diff --git a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.h b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.h index cf3ac167..bccd15f6 100644 --- a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.h @@ -349,6 +349,21 @@ bool gk20a_is_fault_engine_subid_gpc(struct gk20a *g, u32 engine_subid); struct fifo_profile_gk20a *gk20a_fifo_profile_acquire(struct gk20a *g); void gk20a_fifo_profile_release(struct gk20a *g, struct fifo_profile_gk20a *profile); +void gk20a_fifo_profile_snapshot(struct fifo_profile_gk20a *profile, int idx); +#else +static inline struct fifo_profile_gk20a * +gk20a_fifo_profile_acquire(struct gk20a *g) +{ + return NULL; +} +static inline void gk20a_fifo_profile_release(struct gk20a *g, + struct fifo_profile_gk20a *profile) +{ +} +static inline void gk20a_fifo_profile_snapshot( + struct fifo_profile_gk20a *profile, int idx) +{ +} #endif void gk20a_dump_channel_status_ramfc(struct gk20a *g, -- cgit v1.2.2