diff options
author | Richard Zhao <rizhao@nvidia.com> | 2017-11-13 18:40:05 -0500 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-11-16 15:38:58 -0500 |
commit | 1fc7ded060c7e4b359db43be763f7dc0af7276cb (patch) | |
tree | d5e62c1fea7d63ed4573ba9286242a5e31691d66 | |
parent | 42bc87167ad6eac96ff362bea82bcfdc9730e2ec (diff) |
gpu: nvgpu: vgpu: move to use is_valid_gfx/compute_class ops
It'll make the code be able to apply to gv11b too.
Jira EVLR-1671
Change-Id: I9a960fd1aaa9adc6bb39aa2c730049e75006fea7
Signed-off-by: Richard Zhao <rizhao@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1597379
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
-rw-r--r-- | drivers/gpu/nvgpu/vgpu/gp10b/vgpu_gr_gp10b.c | 14 |
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 = |