summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c
diff options
context:
space:
mode:
authorAlex Waterman <alexw@nvidia.com>2017-10-25 12:56:09 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-10-29 14:02:15 -0400
commit4d2d890c01b94d10ad55643a4c2c159a98419efe (patch)
tree1043316e5e0dc163da79ae17c089b7818dc54d4b /drivers/gpu/nvgpu/gk20a/fifo_gk20a.c
parenta681c505c96dba58231ac050e4c8f4f81d79540f (diff)
gpu: nvgpu: Move ctxsw_trace_gk20a.c to common/linux
Migrate ctxsw_trace_gk20a.c to common/linux/ctxsw_trace.c. This has been done becasue the ctxsw tracing code is currently too tightly tied to the Linux OS due to usage of a couple system calls: - poll() - mmap() And general Linux driver framework code. As a result pulling the logic out of the FECS tracing code is simply too large a scope for time time being. Instead the code was just copied as much as possible. The HAL ops for the FECS code was hidden behind the FECS tracing config so that the vm_area_struct is not used when QNX does not define said config. All other non-HAL functions called by the FECS ctxsw tracing code ha now also been hidden by this config. This is not pretty but for the time being it seems like the way to go. JIRA NVGPU-287 Change-Id: Ib880ab237f4abd330dc66998692c86c4507149c2 Signed-off-by: Alex Waterman <alexw@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1586547 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/fifo_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/fifo_gk20a.c27
1 files changed, 19 insertions, 8 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c
index d10af9e9..17ae626b 100644
--- a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c
@@ -1228,16 +1228,24 @@ void gk20a_fifo_reset_engine(struct gk20a *g, u32 engine_id)
1228 if (nvgpu_pmu_disable_elpg(g)) 1228 if (nvgpu_pmu_disable_elpg(g))
1229 nvgpu_err(g, "failed to set disable elpg"); 1229 nvgpu_err(g, "failed to set disable elpg");
1230 } 1230 }
1231 /* resetting engine will alter read/write index. 1231
1232 * need to flush circular buffer before re-enabling FECS. 1232#ifdef CONFIG_GK20A_CTXSW_TRACE
1233 /*
1234 * Resetting engine will alter read/write index. Need to flush
1235 * circular buffer before re-enabling FECS.
1233 */ 1236 */
1234 if (g->ops.fecs_trace.reset) 1237 if (g->ops.fecs_trace.reset)
1235 g->ops.fecs_trace.reset(g); 1238 g->ops.fecs_trace.reset(g);
1236 /*HALT_PIPELINE method, halt GR engine*/ 1239#endif
1240
1241 /* HALT_PIPELINE method, halt GR engine. */
1237 if (gr_gk20a_halt_pipe(g)) 1242 if (gr_gk20a_halt_pipe(g))
1238 nvgpu_err(g, "failed to HALT gr pipe"); 1243 nvgpu_err(g, "failed to HALT gr pipe");
1239 /* resetting engine using mc_enable_r() is not 1244
1240 enough, we do full init sequence */ 1245 /*
1246 * Resetting engine using mc_enable_r() is not enough; we must
1247 * do full init sequence.
1248 */
1241 gk20a_gr_reset(g); 1249 gk20a_gr_reset(g);
1242 if (g->support_pmu && g->can_elpg) 1250 if (g->support_pmu && g->can_elpg)
1243 nvgpu_pmu_enable_elpg(g); 1251 nvgpu_pmu_enable_elpg(g);
@@ -1618,6 +1626,8 @@ static bool gk20a_fifo_handle_mmu_fault(
1618 } 1626 }
1619 } 1627 }
1620 } 1628 }
1629
1630#ifdef CONFIG_GK20A_CTXSW_TRACE
1621 /* 1631 /*
1622 * For non fake mmu fault, both tsg and ch pointers 1632 * For non fake mmu fault, both tsg and ch pointers
1623 * could be valid. Check tsg first. 1633 * could be valid. Check tsg first.
@@ -1626,10 +1636,11 @@ static bool gk20a_fifo_handle_mmu_fault(
1626 gk20a_ctxsw_trace_tsg_reset(g, tsg); 1636 gk20a_ctxsw_trace_tsg_reset(g, tsg);
1627 else if (ch) 1637 else if (ch)
1628 gk20a_ctxsw_trace_channel_reset(g, ch); 1638 gk20a_ctxsw_trace_channel_reset(g, ch);
1639#endif
1629 1640
1630 /* disable the channel/TSG from hw and increment 1641 /*
1631 * syncpoints */ 1642 * Disable the channel/TSG from hw and increment syncpoints.
1632 1643 */
1633 if (tsg) { 1644 if (tsg) {
1634 if (!g->fifo.deferred_reset_pending) { 1645 if (!g->fifo.deferred_reset_pending) {
1635 if (!fake_fault) 1646 if (!fake_fault)