diff options
author | Terje Bergstrom <tbergstrom@nvidia.com> | 2017-10-11 14:51:47 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-10-23 22:36:10 -0400 |
commit | 748331cbab1c7af26ab1fbae5ead2cdaff22806a (patch) | |
tree | 5aebf76223f051b75f7d09918721ba96ef8a78f7 /drivers/gpu/nvgpu/common | |
parent | 12e23c6aad0bbb54911f0573a2ae4d3a078b862a (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
Diffstat (limited to 'drivers/gpu/nvgpu/common')
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/ioctl_channel.c | 22 |
1 files changed, 22 insertions, 0 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 | ||
40 | static 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 | |||
50 | static 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 | |||
40 | static void gk20a_channel_trace_sched_param( | 62 | static 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, |