summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/os
diff options
context:
space:
mode:
authorVaibhav Kachore <vkachore@nvidia.com>2018-08-20 05:55:06 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2018-08-31 15:16:10 -0400
commit064ba6a7ef236a7bb1085715c6ab37810f230bbf (patch)
tree007ab66696c49eda8dc02b1def57b69d3176dbc2 /drivers/gpu/nvgpu/os
parenteb97fc52a96887d9d85cbdc18eaa7d72eade43b2 (diff)
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 <vkachore@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1803209 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/os')
-rw-r--r--drivers/gpu/nvgpu/os/linux/ctxsw_trace.c38
1 files changed, 38 insertions, 0 deletions
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)
743#endif 743#endif
744 trace_gk20a_channel_reset(~0, tsg->tsgid); 744 trace_gk20a_channel_reset(~0, tsg->tsgid);
745} 745}
746
747/*
748 * Convert linux nvgpu ctxsw tags type of the form of NVGPU_CTXSW_TAG_*
749 * into common nvgpu ctxsw tags type of the form of NVGPU_GPU_CTXSW_TAG_*
750 */
751
752u8 nvgpu_gpu_ctxsw_tags_to_common_tags(u8 tags)
753{
754 switch (tags){
755 case NVGPU_CTXSW_TAG_SOF:
756 return NVGPU_GPU_CTXSW_TAG_SOF;
757 case NVGPU_CTXSW_TAG_CTXSW_REQ_BY_HOST:
758 return NVGPU_GPU_CTXSW_TAG_CTXSW_REQ_BY_HOST;
759 case NVGPU_CTXSW_TAG_FE_ACK:
760 return NVGPU_GPU_CTXSW_TAG_FE_ACK;
761 case NVGPU_CTXSW_TAG_FE_ACK_WFI:
762 return NVGPU_GPU_CTXSW_TAG_FE_ACK_WFI;
763 case NVGPU_CTXSW_TAG_FE_ACK_GFXP:
764 return NVGPU_GPU_CTXSW_TAG_FE_ACK_GFXP;
765 case NVGPU_CTXSW_TAG_FE_ACK_CTAP:
766 return NVGPU_GPU_CTXSW_TAG_FE_ACK_CTAP;
767 case NVGPU_CTXSW_TAG_FE_ACK_CILP:
768 return NVGPU_GPU_CTXSW_TAG_FE_ACK_CILP;
769 case NVGPU_CTXSW_TAG_SAVE_END:
770 return NVGPU_GPU_CTXSW_TAG_SAVE_END;
771 case NVGPU_CTXSW_TAG_RESTORE_START:
772 return NVGPU_GPU_CTXSW_TAG_RESTORE_START;
773 case NVGPU_CTXSW_TAG_CONTEXT_START:
774 return NVGPU_GPU_CTXSW_TAG_CONTEXT_START;
775 case NVGPU_CTXSW_TAG_ENGINE_RESET:
776 return NVGPU_GPU_CTXSW_TAG_ENGINE_RESET;
777 case NVGPU_CTXSW_TAG_INVALID_TIMESTAMP:
778 return NVGPU_GPU_CTXSW_TAG_INVALID_TIMESTAMP;
779 }
780
781 WARN_ON(1);
782 return tags;
783}