summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/gr_gk20a.h
diff options
context:
space:
mode:
authorDeepak Nibade <dnibade@nvidia.com>2014-06-18 09:02:03 -0400
committerDan Willemsen <dwillemsen@nvidia.com>2015-03-18 15:10:17 -0400
commitee66559a0b3b82b3dc9be684261ddd0954731ff5 (patch)
tree34156c1d4f3393a5a5fe945185b8548ae2427a07 /drivers/gpu/nvgpu/gk20a/gr_gk20a.h
parentb6466fbe07d28fcc1a2ea93715a1f88b48dd8550 (diff)
gpu: nvgpu: add TSG support for engine context
All channels in a TSG need to share same engine context i.e. pointer in RAMFC of all channels in a TSG must point to same NV_RAMIN_GR_WFI_TARGET To get this, add a pointer to gr_ctx inside TSG struct so that TSG can maintain its own unique gr_ctx Also, change the type of gr_ctx in a channel to pointer variable so that if channel is part of TSG it can point to TSG's gr_ctx otherwise it will point to its own gr_ctx In gk20a_alloc_obj_ctx(), allocate gr_ctx as below : 1) If channel is not part of any TSG - allocate its own gr_ctx buffer if it is already not allocated 2) If channel is part of TSG - Check if TSG has already allocated gr_ctx (as part of TSG) - If yes, channel's gr_ctx will point to that of TSG's - If not, then it means channels is first to be bounded to this TSG - And in this case we will allocate new gr_ctx on TSG first and then make channel's gr_ctx to point to this gr_ctx Also, gr_ctx will be released as below ; 1) If channels is not part of TSG, then it will be released when channels is closed 2) Otherwise, it will be released when TSG itself is closed Bug 1470692 Change-Id: Id347217d5b462e0e972cd3d79d17795b37034a50 Signed-off-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-on: http://git-master/r/417065 Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/gr_gk20a.h')
-rw-r--r--drivers/gpu/nvgpu/gk20a/gr_gk20a.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.h b/drivers/gpu/nvgpu/gk20a/gr_gk20a.h
index 05c27ffd..cae69ba6 100644
--- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.h
@@ -20,6 +20,7 @@
20 20
21#include <linux/slab.h> 21#include <linux/slab.h>
22 22
23#include "tsg_gk20a.h"
23#include "gr_ctx_gk20a.h" 24#include "gr_ctx_gk20a.h"
24 25
25#define GR_IDLE_CHECK_DEFAULT 100 /* usec */ 26#define GR_IDLE_CHECK_DEFAULT 100 /* usec */
@@ -414,4 +415,6 @@ void gr_gk20a_get_sm_dsm_perf_ctrl_regs(struct gk20a *g,
414 u32 **sm_dsm_perf_regs, 415 u32 **sm_dsm_perf_regs,
415 u32 *perf_register_stride); 416 u32 *perf_register_stride);
416int gr_gk20a_setup_rop_mapping(struct gk20a *g, struct gr_gk20a *gr); 417int gr_gk20a_setup_rop_mapping(struct gk20a *g, struct gr_gk20a *gr);
418
419void gr_gk20a_free_tsg_gr_ctx(struct tsg_gk20a *c);
417#endif /*__GR_GK20A_H__*/ 420#endif /*__GR_GK20A_H__*/