summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/gpu/nvgpu/vgpu/gp10b/vgpu_gr_gp10b.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_gr_gp10b.c b/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_gr_gp10b.c
index d3ad6280..8a5130f6 100644
--- a/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_gr_gp10b.c
+++ b/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_gr_gp10b.c
@@ -86,10 +86,11 @@ int vgpu_gr_gp10b_alloc_gr_ctx(struct gk20a *g,
86 86
87 if (priv->constants.force_preempt_mode && !graphics_preempt_mode && 87 if (priv->constants.force_preempt_mode && !graphics_preempt_mode &&
88 !compute_preempt_mode) { 88 !compute_preempt_mode) {
89 graphics_preempt_mode = PASCAL_A == class ? 89 graphics_preempt_mode = g->ops.gr.is_valid_gfx_class(g, class) ?
90 NVGPU_PREEMPTION_MODE_GRAPHICS_GFXP : 0; 90 NVGPU_PREEMPTION_MODE_GRAPHICS_GFXP : 0;
91 compute_preempt_mode = PASCAL_COMPUTE_A == class ? 91 compute_preempt_mode =
92 NVGPU_PREEMPTION_MODE_COMPUTE_CTA : 0; 92 g->ops.gr.is_valid_compute_class(g, class) ?
93 NVGPU_PREEMPTION_MODE_COMPUTE_CTA : 0;
93 } 94 }
94 95
95 if (graphics_preempt_mode || compute_preempt_mode) { 96 if (graphics_preempt_mode || compute_preempt_mode) {
@@ -126,10 +127,11 @@ int vgpu_gr_gp10b_set_ctxsw_preemption_mode(struct gk20a *g,
126 &msg.params.gr_bind_ctxsw_buffers; 127 &msg.params.gr_bind_ctxsw_buffers;
127 int err = 0; 128 int err = 0;
128 129
129 if (class == PASCAL_A && g->gr.t18x.ctx_vars.force_preemption_gfxp) 130 if (g->ops.gr.is_valid_gfx_class(g, class) &&
131 g->gr.t18x.ctx_vars.force_preemption_gfxp)
130 graphics_preempt_mode = NVGPU_PREEMPTION_MODE_GRAPHICS_GFXP; 132 graphics_preempt_mode = NVGPU_PREEMPTION_MODE_GRAPHICS_GFXP;
131 133
132 if (class == PASCAL_COMPUTE_A && 134 if (g->ops.gr.is_valid_compute_class(g, class) &&
133 g->gr.t18x.ctx_vars.force_preemption_cilp) 135 g->gr.t18x.ctx_vars.force_preemption_cilp)
134 compute_preempt_mode = NVGPU_PREEMPTION_MODE_COMPUTE_CILP; 136 compute_preempt_mode = NVGPU_PREEMPTION_MODE_COMPUTE_CILP;
135 137
@@ -225,7 +227,7 @@ int vgpu_gr_gp10b_set_ctxsw_preemption_mode(struct gk20a *g,
225 break; 227 break;
226 } 228 }
227 229
228 if (class == PASCAL_COMPUTE_A) { 230 if (g->ops.gr.is_valid_compute_class(g, class)) {
229 switch (compute_preempt_mode) { 231 switch (compute_preempt_mode) {
230 case NVGPU_PREEMPTION_MODE_COMPUTE_WFI: 232 case NVGPU_PREEMPTION_MODE_COMPUTE_WFI:
231 gr_ctx->compute_preempt_mode = 233 gr_ctx->compute_preempt_mode =