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
This commit is contained in:
Terje Bergstrom
2017-10-11 11:51:47 -07:00
committed by mobile promotions
parent 12e23c6aad
commit 748331cbab
2 changed files with 22 additions and 22 deletions

View File

@@ -37,6 +37,28 @@
#include "ioctl_channel.h"
#include "os_linux.h"
static const char *gr_gk20a_graphics_preempt_mode_name(u32 graphics_preempt_mode)
{
switch (graphics_preempt_mode) {
case NVGPU_GRAPHICS_PREEMPTION_MODE_WFI:
return "WFI";
default:
return "?";
}
}
static const char *gr_gk20a_compute_preempt_mode_name(u32 compute_preempt_mode)
{
switch (compute_preempt_mode) {
case NVGPU_COMPUTE_PREEMPTION_MODE_WFI:
return "WFI";
case NVGPU_COMPUTE_PREEMPTION_MODE_CTA:
return "CTA";
default:
return "?";
}
}
static void gk20a_channel_trace_sched_param(
void (*trace)(int chid, int tsgid, pid_t pid, u32 timeslice,
u32 timeout, const char *interleave,

View File

@@ -748,26 +748,4 @@ void gk20a_gr_get_ovr_perf_regs(struct gk20a *g, u32 *num_ovr_perf_regs,
void gk20a_gr_init_ctxsw_hdr_data(struct gk20a *g,
struct nvgpu_mem *mem);
static inline const char *gr_gk20a_graphics_preempt_mode_name(u32 graphics_preempt_mode)
{
switch (graphics_preempt_mode) {
case NVGPU_GRAPHICS_PREEMPTION_MODE_WFI:
return "WFI";
default:
return "?";
}
}
static inline const char *gr_gk20a_compute_preempt_mode_name(u32 compute_preempt_mode)
{
switch (compute_preempt_mode) {
case NVGPU_COMPUTE_PREEMPTION_MODE_WFI:
return "WFI";
case NVGPU_COMPUTE_PREEMPTION_MODE_CTA:
return "CTA";
default:
return "?";
}
}
#endif /*__GR_GK20A_H__*/