summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/common
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/common
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/common')
-rw-r--r--drivers/gpu/nvgpu/common/linux/cde.c6
-rw-r--r--drivers/gpu/nvgpu/common/linux/ioctl_channel.c8
2 files changed, 7 insertions, 7 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/cde.c b/drivers/gpu/nvgpu/common/linux/cde.c
index 30edc1d5..65c50726 100644
--- a/drivers/gpu/nvgpu/common/linux/cde.c
+++ b/drivers/gpu/nvgpu/common/linux/cde.c
@@ -527,16 +527,12 @@ static int gk20a_init_cde_required_class(struct gk20a_cde_ctx *cde_ctx,
527{ 527{
528 struct nvgpu_os_linux *l = cde_ctx->l; 528 struct nvgpu_os_linux *l = cde_ctx->l;
529 struct gk20a *g = &l->g; 529 struct gk20a *g = &l->g;
530 struct nvgpu_alloc_obj_ctx_args alloc_obj_ctx;
531 int err; 530 int err;
532 531
533 alloc_obj_ctx.class_num = required_class;
534 alloc_obj_ctx.flags = 0;
535
536 /* CDE enabled */ 532 /* CDE enabled */
537 cde_ctx->ch->cde = true; 533 cde_ctx->ch->cde = true;
538 534
539 err = gk20a_alloc_obj_ctx(cde_ctx->ch, &alloc_obj_ctx); 535 err = gk20a_alloc_obj_ctx(cde_ctx->ch, required_class, 0);
540 if (err) { 536 if (err) {
541 nvgpu_warn(g, "cde: failed to allocate ctx. err=%d", 537 nvgpu_warn(g, "cde: failed to allocate ctx. err=%d",
542 err); 538 err);
diff --git a/drivers/gpu/nvgpu/common/linux/ioctl_channel.c b/drivers/gpu/nvgpu/common/linux/ioctl_channel.c
index ee4755c8..7814aea5 100644
--- a/drivers/gpu/nvgpu/common/linux/ioctl_channel.c
+++ b/drivers/gpu/nvgpu/common/linux/ioctl_channel.c
@@ -923,6 +923,10 @@ long gk20a_channel_ioctl(struct file *filp,
923 case NVGPU_IOCTL_CHANNEL_SET_NVMAP_FD: 923 case NVGPU_IOCTL_CHANNEL_SET_NVMAP_FD:
924 break; 924 break;
925 case NVGPU_IOCTL_CHANNEL_ALLOC_OBJ_CTX: 925 case NVGPU_IOCTL_CHANNEL_ALLOC_OBJ_CTX:
926 {
927 struct nvgpu_alloc_obj_ctx_args *args =
928 (struct nvgpu_alloc_obj_ctx_args *)buf;
929
926 err = gk20a_busy(ch->g); 930 err = gk20a_busy(ch->g);
927 if (err) { 931 if (err) {
928 dev_err(dev, 932 dev_err(dev,
@@ -930,10 +934,10 @@ long gk20a_channel_ioctl(struct file *filp,
930 __func__, cmd); 934 __func__, cmd);
931 break; 935 break;
932 } 936 }
933 err = ch->g->ops.gr.alloc_obj_ctx(ch, 937 err = ch->g->ops.gr.alloc_obj_ctx(ch, args->class_num, args->flags);
934 (struct nvgpu_alloc_obj_ctx_args *)buf);
935 gk20a_idle(ch->g); 938 gk20a_idle(ch->g);
936 break; 939 break;
940 }
937 case NVGPU_IOCTL_CHANNEL_ALLOC_GPFIFO_EX: 941 case NVGPU_IOCTL_CHANNEL_ALLOC_GPFIFO_EX:
938 { 942 {
939 struct nvgpu_alloc_gpfifo_ex_args *alloc_gpfifo_ex_args = 943 struct nvgpu_alloc_gpfifo_ex_args *alloc_gpfifo_ex_args =