summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2017-10-11 14:51:47 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-10-23 22:36:10 -0400
commit748331cbab1c7af26ab1fbae5ead2cdaff22806a (patch)
tree5aebf76223f051b75f7d09918721ba96ef8a78f7
parent12e23c6aad0bbb54911f0573a2ae4d3a078b862a (diff)
gpu: nvgpu: Move preempt query functions
Move functions to query preemption type names to the user of the function: ioctl_channel.c. This removes a dependency to <uapi/linux/nvgpu.h> from gr_gk20a.h. JIRA NVGPU-259 Change-Id: I6cafda986eb4659fcfc1b19eac77e43aaaeaec76 Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1577248
-rw-r--r--drivers/gpu/nvgpu/common/linux/ioctl_channel.c22
-rw-r--r--drivers/gpu/nvgpu/gk20a/gr_gk20a.h22
2 files changed, 22 insertions, 22 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/ioctl_channel.c b/drivers/gpu/nvgpu/common/linux/ioctl_channel.c
index 78352d6b..ed00ad31 100644
--- a/drivers/gpu/nvgpu/common/linux/ioctl_channel.c
+++ b/drivers/gpu/nvgpu/common/linux/ioctl_channel.c
@@ -37,6 +37,28 @@
37#include "ioctl_channel.h" 37#include "ioctl_channel.h"
38#include "os_linux.h" 38#include "os_linux.h"
39 39
40static const char *gr_gk20a_graphics_preempt_mode_name(u32 graphics_preempt_mode)
41{
42 switch (graphics_preempt_mode) {
43 case NVGPU_GRAPHICS_PREEMPTION_MODE_WFI:
44 return "WFI";
45 default:
46 return "?";
47 }
48}
49
50static const char *gr_gk20a_compute_preempt_mode_name(u32 compute_preempt_mode)
51{
52 switch (compute_preempt_mode) {
53 case NVGPU_COMPUTE_PREEMPTION_MODE_WFI:
54 return "WFI";
55 case NVGPU_COMPUTE_PREEMPTION_MODE_CTA:
56 return "CTA";
57 default:
58 return "?";
59 }
60}
61
40static void gk20a_channel_trace_sched_param( 62static void gk20a_channel_trace_sched_param(
41 void (*trace)(int chid, int tsgid, pid_t pid, u32 timeslice, 63 void (*trace)(int chid, int tsgid, pid_t pid, u32 timeslice,
42 u32 timeout, const char *interleave, 64 u32 timeout, const char *interleave,
diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.h b/drivers/gpu/nvgpu/gk20a/gr_gk20a.h
index 52b39c4f..6b422138 100644
--- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.h
@@ -748,26 +748,4 @@ void gk20a_gr_get_ovr_perf_regs(struct gk20a *g, u32 *num_ovr_perf_regs,
748void gk20a_gr_init_ctxsw_hdr_data(struct gk20a *g, 748void gk20a_gr_init_ctxsw_hdr_data(struct gk20a *g,
749 struct nvgpu_mem *mem); 749 struct nvgpu_mem *mem);
750 750
751static inline const char *gr_gk20a_graphics_preempt_mode_name(u32 graphics_preempt_mode)
752{
753 switch (graphics_preempt_mode) {
754 case NVGPU_GRAPHICS_PREEMPTION_MODE_WFI:
755 return "WFI";
756 default:
757 return "?";
758 }
759}
760
761static inline const char *gr_gk20a_compute_preempt_mode_name(u32 compute_preempt_mode)
762{
763 switch (compute_preempt_mode) {
764 case NVGPU_COMPUTE_PREEMPTION_MODE_WFI:
765 return "WFI";
766 case NVGPU_COMPUTE_PREEMPTION_MODE_CTA:
767 return "CTA";
768 default:
769 return "?";
770 }
771}
772
773#endif /*__GR_GK20A_H__*/ 751#endif /*__GR_GK20A_H__*/