summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2017-12-15 12:04:15 -0500
committermobile promotions <svcmobile_promotions@nvidia.com>2018-01-17 15:29:09 -0500
commit2f6698b863c9cc1db6455637b7c72e812b470b93 (patch)
treed0c8abf32d6994b9f54bf5eddafd8316e038c829 /drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c
parent6a73114788ffafe4c53771c707ecbd9c9ea0a117 (diff)
gpu: nvgpu: Make graphics context property of TSG
Move graphics context ownership to TSG instead of channel. Combine channel_ctx_gk20a and gr_ctx_desc to one structure, because the split between them was arbitrary. Move context header to be property of channel. Bug 1842197 Change-Id: I410e3262f80b318d8528bcbec270b63a2d8d2ff9 Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1639532 Reviewed-by: Seshendra Gadagottu <sgadagottu@nvidia.com> Tested-by: Seshendra Gadagottu <sgadagottu@nvidia.com> Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Konsta Holtta <kholtta@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c b/drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c
index d283a82e..409661fc 100644
--- a/drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c
@@ -625,9 +625,10 @@ int gk20a_fecs_trace_bind_channel(struct gk20a *g,
625 u32 lo; 625 u32 lo;
626 u32 hi; 626 u32 hi;
627 u64 pa; 627 u64 pa;
628 struct channel_ctx_gk20a *ch_ctx = &ch->ch_ctx; 628 struct tsg_gk20a *tsg;
629 struct nvgpu_gr_ctx *ch_ctx;
629 struct gk20a_fecs_trace *trace = g->fecs_trace; 630 struct gk20a_fecs_trace *trace = g->fecs_trace;
630 struct nvgpu_mem *mem = &ch_ctx->gr_ctx->mem; 631 struct nvgpu_mem *mem;
631 u32 context_ptr = gk20a_fecs_trace_fecs_context_ptr(g, ch); 632 u32 context_ptr = gk20a_fecs_trace_fecs_context_ptr(g, ch);
632 pid_t pid; 633 pid_t pid;
633 u32 aperture; 634 u32 aperture;
@@ -637,6 +638,13 @@ int gk20a_fecs_trace_bind_channel(struct gk20a *g,
637 ch->chid, context_ptr, 638 ch->chid, context_ptr,
638 nvgpu_inst_block_addr(g, &ch->inst_block)); 639 nvgpu_inst_block_addr(g, &ch->inst_block));
639 640
641 tsg = tsg_gk20a_from_ch(ch);
642 if (!tsg)
643 return -EINVAL;
644
645 ch_ctx = &tsg->gr_ctx;
646 mem = &ch_ctx->mem;
647
640 if (!trace) 648 if (!trace)
641 return -ENOMEM; 649 return -ENOMEM;
642 650