diff options
author | Deepak Nibade <dnibade@nvidia.com> | 2016-12-16 05:06:10 -0500 |
---|---|---|
committer | Deepak Nibade <dnibade@nvidia.com> | 2016-12-27 04:56:52 -0500 |
commit | 1710bdb0783a85ce183a77d182fb18d7f98af66e (patch) | |
tree | fede83c9b9d81fb17b05cef791ae7e5ae62ca965 | |
parent | be6e02a6d42b0a7092f92371474c42d41019c917 (diff) |
gpu: nvgpu: allow upgrading preemption modes
We currently do not allow resetting preemption
modes once set
Relax this check to allow upgrading preemption
modes. Downgrading of preemption modes is still
not allowed
Bug 200263471
Change-Id: Ie2dae910028929090899a661f4b8b9dd4d6d7ee7
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/1269472
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Aingara Paramakuru <aparamakuru@nvidia.com>
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
-rw-r--r-- | drivers/gpu/nvgpu/gp10b/gr_gp10b.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/gpu/nvgpu/gp10b/gr_gp10b.c b/drivers/gpu/nvgpu/gp10b/gr_gp10b.c index 051e16a3..aa2e3b65 100644 --- a/drivers/gpu/nvgpu/gp10b/gr_gp10b.c +++ b/drivers/gpu/nvgpu/gp10b/gr_gp10b.c | |||
@@ -877,6 +877,15 @@ static int gr_gp10b_set_ctxsw_preemption_mode(struct gk20a *g, | |||
877 | (compute_preempt_mode == NVGPU_COMPUTE_PREEMPTION_MODE_CILP)) | 877 | (compute_preempt_mode == NVGPU_COMPUTE_PREEMPTION_MODE_CILP)) |
878 | return -EINVAL; | 878 | return -EINVAL; |
879 | 879 | ||
880 | /* Do not allow lower preemption modes than current ones */ | ||
881 | if (graphics_preempt_mode && | ||
882 | (graphics_preempt_mode < gr_ctx->graphics_preempt_mode)) | ||
883 | return -EINVAL; | ||
884 | |||
885 | if (compute_preempt_mode && | ||
886 | (compute_preempt_mode < gr_ctx->compute_preempt_mode)) | ||
887 | return -EINVAL; | ||
888 | |||
880 | /* set preemption modes */ | 889 | /* set preemption modes */ |
881 | switch (graphics_preempt_mode) { | 890 | switch (graphics_preempt_mode) { |
882 | case NVGPU_GRAPHICS_PREEMPTION_MODE_GFXP: | 891 | case NVGPU_GRAPHICS_PREEMPTION_MODE_GFXP: |
@@ -2064,10 +2073,6 @@ static int gr_gp10b_set_preemption_mode(struct channel_gk20a *ch, | |||
2064 | if (!class) | 2073 | if (!class) |
2065 | return -EINVAL; | 2074 | return -EINVAL; |
2066 | 2075 | ||
2067 | /* preemption already set ? */ | ||
2068 | if (gr_ctx->graphics_preempt_mode || gr_ctx->compute_preempt_mode) | ||
2069 | return -EINVAL; | ||
2070 | |||
2071 | if (gk20a_is_channel_marked_as_tsg(ch)) { | 2076 | if (gk20a_is_channel_marked_as_tsg(ch)) { |
2072 | tsg = &g->fifo.tsg[ch->tsgid]; | 2077 | tsg = &g->fifo.tsg[ch->tsgid]; |
2073 | vm = tsg->vm; | 2078 | vm = tsg->vm; |