summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gm20b/gr_gm20b.c
diff options
context:
space:
mode:
authorDeepak Nibade <dnibade@nvidia.com>2016-04-19 07:27:49 -0400
committerTerje Bergstrom <tbergstrom@nvidia.com>2016-05-09 16:16:29 -0400
commitd868b654419cfa096f563c9281a2a5cc067c23db (patch)
treea11fc30ab435c6e2a4c54b97455d3f5c177ad507 /drivers/gpu/nvgpu/gm20b/gr_gm20b.c
parentf14152c081d94710dbde843b8dcd9b3981afb831 (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/gm20b/gr_gm20b.c')
-rw-r--r--drivers/gpu/nvgpu/gm20b/gr_gm20b.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/gm20b/gr_gm20b.c b/drivers/gpu/nvgpu/gm20b/gr_gm20b.c
index 35bbe70c..dbe30f00 100644
--- a/drivers/gpu/nvgpu/gm20b/gr_gm20b.c
+++ b/drivers/gpu/nvgpu/gm20b/gr_gm20b.c
@@ -824,7 +824,7 @@ static int gr_gm20b_alloc_gr_ctx(struct gk20a *g,
824 return err; 824 return err;
825 825
826 if (class == MAXWELL_COMPUTE_B) 826 if (class == MAXWELL_COMPUTE_B)
827 (*gr_ctx)->preempt_mode = NVGPU_GR_PREEMPTION_MODE_CTA; 827 (*gr_ctx)->compute_preempt_mode = NVGPU_COMPUTE_PREEMPTION_MODE_CTA;
828 828
829 gk20a_dbg_fn("done"); 829 gk20a_dbg_fn("done");
830 830
@@ -841,7 +841,7 @@ static void gr_gm20b_update_ctxsw_preemption_mode(struct gk20a *g,
841 841
842 gk20a_dbg_fn(""); 842 gk20a_dbg_fn("");
843 843
844 if (gr_ctx->preempt_mode == NVGPU_GR_PREEMPTION_MODE_CTA) { 844 if (gr_ctx->compute_preempt_mode == NVGPU_COMPUTE_PREEMPTION_MODE_CTA) {
845 gk20a_dbg_info("CTA: %x", cta_preempt_option); 845 gk20a_dbg_info("CTA: %x", cta_preempt_option);
846 gk20a_mem_wr32(ctx_ptr + ctxsw_prog_main_image_preemption_options_o(), 0, 846 gk20a_mem_wr32(ctx_ptr + ctxsw_prog_main_image_preemption_options_o(), 0,
847 cta_preempt_option); 847 cta_preempt_option);