From 2f6698b863c9cc1db6455637b7c72e812b470b93 Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Fri, 15 Dec 2017 09:04:15 -0800 Subject: 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 Reviewed-on: https://git-master.nvidia.com/r/1639532 Reviewed-by: Seshendra Gadagottu Tested-by: Seshendra Gadagottu Reviewed-by: svc-mobile-coverity GVS: Gerrit_Virtual_Submit Reviewed-by: Konsta Holtta Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c') 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, u32 lo; u32 hi; u64 pa; - struct channel_ctx_gk20a *ch_ctx = &ch->ch_ctx; + struct tsg_gk20a *tsg; + struct nvgpu_gr_ctx *ch_ctx; struct gk20a_fecs_trace *trace = g->fecs_trace; - struct nvgpu_mem *mem = &ch_ctx->gr_ctx->mem; + struct nvgpu_mem *mem; u32 context_ptr = gk20a_fecs_trace_fecs_context_ptr(g, ch); pid_t pid; u32 aperture; @@ -637,6 +638,13 @@ int gk20a_fecs_trace_bind_channel(struct gk20a *g, ch->chid, context_ptr, nvgpu_inst_block_addr(g, &ch->inst_block)); + tsg = tsg_gk20a_from_ch(ch); + if (!tsg) + return -EINVAL; + + ch_ctx = &tsg->gr_ctx; + mem = &ch_ctx->mem; + if (!trace) return -ENOMEM; -- cgit v1.2.2