From 064ba6a7ef236a7bb1085715c6ab37810f230bbf Mon Sep 17 00:00:00 2001 From: Vaibhav Kachore Date: Mon, 20 Aug 2018 15:25:06 +0530 Subject: gpu: nvgpu: convert linux nvgpu ctxsw tags Convert linux nvgpu ctxsw tags type of the form of NVGPU_CTXSW_TAG_* into common nvgpu ctxsw tags type of the form of NVGPU_GPU_CTXSW_TAG_* EVLR-3078 Change-Id: I337487722c103c05003457f74ad6e05bf3bd38fc Signed-off-by: Vaibhav Kachore Reviewed-on: https://git-master.nvidia.com/r/1803209 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/os/linux/ctxsw_trace.c | 38 ++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'drivers/gpu/nvgpu/os') diff --git a/drivers/gpu/nvgpu/os/linux/ctxsw_trace.c b/drivers/gpu/nvgpu/os/linux/ctxsw_trace.c index a8f5f815..4983061b 100644 --- a/drivers/gpu/nvgpu/os/linux/ctxsw_trace.c +++ b/drivers/gpu/nvgpu/os/linux/ctxsw_trace.c @@ -743,3 +743,41 @@ void gk20a_ctxsw_trace_tsg_reset(struct gk20a *g, struct tsg_gk20a *tsg) #endif trace_gk20a_channel_reset(~0, tsg->tsgid); } + +/* + * Convert linux nvgpu ctxsw tags type of the form of NVGPU_CTXSW_TAG_* + * into common nvgpu ctxsw tags type of the form of NVGPU_GPU_CTXSW_TAG_* + */ + +u8 nvgpu_gpu_ctxsw_tags_to_common_tags(u8 tags) +{ + switch (tags){ + case NVGPU_CTXSW_TAG_SOF: + return NVGPU_GPU_CTXSW_TAG_SOF; + case NVGPU_CTXSW_TAG_CTXSW_REQ_BY_HOST: + return NVGPU_GPU_CTXSW_TAG_CTXSW_REQ_BY_HOST; + case NVGPU_CTXSW_TAG_FE_ACK: + return NVGPU_GPU_CTXSW_TAG_FE_ACK; + case NVGPU_CTXSW_TAG_FE_ACK_WFI: + return NVGPU_GPU_CTXSW_TAG_FE_ACK_WFI; + case NVGPU_CTXSW_TAG_FE_ACK_GFXP: + return NVGPU_GPU_CTXSW_TAG_FE_ACK_GFXP; + case NVGPU_CTXSW_TAG_FE_ACK_CTAP: + return NVGPU_GPU_CTXSW_TAG_FE_ACK_CTAP; + case NVGPU_CTXSW_TAG_FE_ACK_CILP: + return NVGPU_GPU_CTXSW_TAG_FE_ACK_CILP; + case NVGPU_CTXSW_TAG_SAVE_END: + return NVGPU_GPU_CTXSW_TAG_SAVE_END; + case NVGPU_CTXSW_TAG_RESTORE_START: + return NVGPU_GPU_CTXSW_TAG_RESTORE_START; + case NVGPU_CTXSW_TAG_CONTEXT_START: + return NVGPU_GPU_CTXSW_TAG_CONTEXT_START; + case NVGPU_CTXSW_TAG_ENGINE_RESET: + return NVGPU_GPU_CTXSW_TAG_ENGINE_RESET; + case NVGPU_CTXSW_TAG_INVALID_TIMESTAMP: + return NVGPU_GPU_CTXSW_TAG_INVALID_TIMESTAMP; + } + + WARN_ON(1); + return tags; +} -- cgit v1.2.2