summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/vgpu/gr_vgpu.c
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2017-10-26 18:44:43 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-10-29 14:02:32 -0400
commit721315298b0d02cedfd186ce3b61da1acd4020b8 (patch)
tree225df4a90d73c379a1ddfa60683edb3521f63739 /drivers/gpu/nvgpu/vgpu/gr_vgpu.c
parent4d2d890c01b94d10ad55643a4c2c159a98419efe (diff)
gpu: nvgpu: Make alloc_obj_ctx args Linux specific
Use nvgpu_alloc_obj_ctx_args structure specific to Linux code only. Pass the fields of the structure as separate arguments to all common functions. gr_ops_gp10b.h referred to the struct, but it's not used anywhere, so delete the file. JIRA NVGPU-259 Change-Id: Idba78d48de1c30f205a42da2fe47a9f8c03735f1 Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1586563 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/vgpu/gr_vgpu.c')
-rw-r--r--drivers/gpu/nvgpu/vgpu/gr_vgpu.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/drivers/gpu/nvgpu/vgpu/gr_vgpu.c b/drivers/gpu/nvgpu/vgpu/gr_vgpu.c
index d400f08e..fca02831 100644
--- a/drivers/gpu/nvgpu/vgpu/gr_vgpu.c
+++ b/drivers/gpu/nvgpu/vgpu/gr_vgpu.c
@@ -485,8 +485,7 @@ static int vgpu_gr_tsg_bind_gr_ctx(struct tsg_gk20a *tsg)
485 return err; 485 return err;
486} 486}
487 487
488int vgpu_gr_alloc_obj_ctx(struct channel_gk20a *c, 488int vgpu_gr_alloc_obj_ctx(struct channel_gk20a *c, u32 class_num, u32 flags)
489 struct nvgpu_alloc_obj_ctx_args *args)
490{ 489{
491 struct gk20a *g = c->g; 490 struct gk20a *g = c->g;
492 struct fifo_gk20a *f = &g->fifo; 491 struct fifo_gk20a *f = &g->fifo;
@@ -503,12 +502,12 @@ int vgpu_gr_alloc_obj_ctx(struct channel_gk20a *c,
503 return -EINVAL; 502 return -EINVAL;
504 } 503 }
505 504
506 if (!g->ops.gr.is_valid_class(g, args->class_num)) { 505 if (!g->ops.gr.is_valid_class(g, class_num)) {
507 nvgpu_err(g, "invalid obj class 0x%x", args->class_num); 506 nvgpu_err(g, "invalid obj class 0x%x", class_num);
508 err = -EINVAL; 507 err = -EINVAL;
509 goto out; 508 goto out;
510 } 509 }
511 c->obj_class = args->class_num; 510 c->obj_class = class_num;
512 511
513 if (gk20a_is_channel_marked_as_tsg(c)) 512 if (gk20a_is_channel_marked_as_tsg(c))
514 tsg = &f->tsg[c->tsgid]; 513 tsg = &f->tsg[c->tsgid];
@@ -518,8 +517,8 @@ int vgpu_gr_alloc_obj_ctx(struct channel_gk20a *c,
518 if (!ch_ctx->gr_ctx) { 517 if (!ch_ctx->gr_ctx) {
519 err = g->ops.gr.alloc_gr_ctx(g, &c->ch_ctx.gr_ctx, 518 err = g->ops.gr.alloc_gr_ctx(g, &c->ch_ctx.gr_ctx,
520 c->vm, 519 c->vm,
521 args->class_num, 520 class_num,
522 args->flags); 521 flags);
523 if (!err) 522 if (!err)
524 err = vgpu_gr_ch_bind_gr_ctx(c); 523 err = vgpu_gr_ch_bind_gr_ctx(c);
525 if (err) { 524 if (err) {
@@ -541,8 +540,8 @@ int vgpu_gr_alloc_obj_ctx(struct channel_gk20a *c,
541 nvgpu_vm_get(tsg->vm); 540 nvgpu_vm_get(tsg->vm);
542 err = g->ops.gr.alloc_gr_ctx(g, &tsg->tsg_gr_ctx, 541 err = g->ops.gr.alloc_gr_ctx(g, &tsg->tsg_gr_ctx,
543 c->vm, 542 c->vm,
544 args->class_num, 543 class_num,
545 args->flags); 544 flags);
546 if (!err) 545 if (!err)
547 err = vgpu_gr_tsg_bind_gr_ctx(tsg); 546 err = vgpu_gr_tsg_bind_gr_ctx(tsg);
548 if (err) { 547 if (err) {