diff options
author | Deepak Nibade <dnibade@nvidia.com> | 2016-04-19 07:27:49 -0400 |
---|---|---|
committer | Terje Bergstrom <tbergstrom@nvidia.com> | 2016-05-09 16:16:29 -0400 |
commit | d868b654419cfa096f563c9281a2a5cc067c23db (patch) | |
tree | a11fc30ab435c6e2a4c54b97455d3f5c177ad507 /drivers/gpu/nvgpu/gk20a/gr_gk20a.h | |
parent | f14152c081d94710dbde843b8dcd9b3981afb831 (diff) |
gpu: nvgpu: separate IOCTL to set preemption mode
Add separate IOCTL NVGPU_IOCTL_CHANNEL_SET_PREEMPTION_MODE
to allow setting preemption modes from UMD
Define preemption modes in nvgpu.h and use them everywhere
Remove mode definitions from mm_gk20a.h
Also, we support setting only one preemption mode in a channel
But it is possible to have multiple preemption modes (one from
graphics and one from compute) set simultaneously
Hence, update struct gr_ctx_desc to include two separate
preemption modes (graphics_preempt_mode and compute_preempt_mode)
API NVGPU_IOCTL_CHANNEL_SET_PREEMPTION_MODE also supports
setting two separate preemption modes i.e. one for graphics
and one for compute
Make necessary changes in code to support two preemption
modes
Bug 1646259
Change-Id: Ia1dea19e609ba8cc0de2f39ab6c0c4cd6b0a752c
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/1131805
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/gr_gk20a.h')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gr_gk20a.h | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.h b/drivers/gpu/nvgpu/gk20a/gr_gk20a.h index 24123eea..10997c17 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.h | |||
@@ -628,18 +628,23 @@ int gr_gk20a_resume_contexts(struct gk20a *g, | |||
628 | struct dbg_session_gk20a *dbg_s, | 628 | struct dbg_session_gk20a *dbg_s, |
629 | int *ctx_resident_ch_fd); | 629 | int *ctx_resident_ch_fd); |
630 | 630 | ||
631 | #define NVGPU_GR_PREEMPTION_MODE_WFI 0 | 631 | static inline const char *gr_gk20a_graphics_preempt_mode_name(u32 graphics_preempt_mode) |
632 | #define NVGPU_GR_PREEMPTION_MODE_CTA 2 | ||
633 | |||
634 | static inline const char *gr_gk20a_preempt_mode_name(u32 preempt_mode) | ||
635 | { | 632 | { |
636 | switch (preempt_mode) { | 633 | switch (graphics_preempt_mode) { |
637 | case NVGPU_GR_PREEMPTION_MODE_WFI: | 634 | case NVGPU_GRAPHICS_PREEMPTION_MODE_WFI: |
638 | return "WFI"; | 635 | return "WFI"; |
636 | default: | ||
637 | return "?"; | ||
638 | } | ||
639 | } | ||
639 | 640 | ||
640 | case NVGPU_GR_PREEMPTION_MODE_CTA: | 641 | static inline const char *gr_gk20a_compute_preempt_mode_name(u32 compute_preempt_mode) |
642 | { | ||
643 | switch (compute_preempt_mode) { | ||
644 | case NVGPU_COMPUTE_PREEMPTION_MODE_WFI: | ||
645 | return "WFI"; | ||
646 | case NVGPU_COMPUTE_PREEMPTION_MODE_CTA: | ||
641 | return "CTA"; | 647 | return "CTA"; |
642 | |||
643 | default: | 648 | default: |
644 | return "?"; | 649 | return "?"; |
645 | } | 650 | } |