mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-23 09:57:08 +03:00
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>
This commit is contained in:
@@ -877,6 +877,15 @@ static int gr_gp10b_set_ctxsw_preemption_mode(struct gk20a *g,
|
|||||||
(compute_preempt_mode == NVGPU_COMPUTE_PREEMPTION_MODE_CILP))
|
(compute_preempt_mode == NVGPU_COMPUTE_PREEMPTION_MODE_CILP))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
|
/* Do not allow lower preemption modes than current ones */
|
||||||
|
if (graphics_preempt_mode &&
|
||||||
|
(graphics_preempt_mode < gr_ctx->graphics_preempt_mode))
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
|
if (compute_preempt_mode &&
|
||||||
|
(compute_preempt_mode < gr_ctx->compute_preempt_mode))
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
/* set preemption modes */
|
/* set preemption modes */
|
||||||
switch (graphics_preempt_mode) {
|
switch (graphics_preempt_mode) {
|
||||||
case NVGPU_GRAPHICS_PREEMPTION_MODE_GFXP:
|
case NVGPU_GRAPHICS_PREEMPTION_MODE_GFXP:
|
||||||
@@ -2064,10 +2073,6 @@ static int gr_gp10b_set_preemption_mode(struct channel_gk20a *ch,
|
|||||||
if (!class)
|
if (!class)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
/* preemption already set ? */
|
|
||||||
if (gr_ctx->graphics_preempt_mode || gr_ctx->compute_preempt_mode)
|
|
||||||
return -EINVAL;
|
|
||||||
|
|
||||||
if (gk20a_is_channel_marked_as_tsg(ch)) {
|
if (gk20a_is_channel_marked_as_tsg(ch)) {
|
||||||
tsg = &g->fifo.tsg[ch->tsgid];
|
tsg = &g->fifo.tsg[ch->tsgid];
|
||||||
vm = tsg->vm;
|
vm = tsg->vm;
|
||||||
|
|||||||
Reference in New Issue
Block a user