From 2f2e51bbae39009d0305f6aaf01596571a8f5d5c Mon Sep 17 00:00:00 2001 From: Martin Radev Date: Thu, 22 Feb 2018 14:06:48 +0200 Subject: gpu: nvgpu: Use gv11b_css_hw_set_handled_snapshots for GV11B The value of NV_PERF_PMASYS_MEM_BUMP is different for Volta and NVGPU_IOCTL_CHANNEL_CYCLE_STATS_SNAPSHOT_CMD_FLUSH did not have correct behavior on GV11B due to that. The patch adds an instance of css_hw_set_handled_snapshots for Volta to fix that. The patch also renames css_hw_set_handled_snapshots to gk20a_css_hw_set_handled_snapshots to make it more clear that the function is arch dependent. Bug 1960846 Change-Id: I92c35a862ecd7f918dd1458c086fc7ae42ca8fc5 Signed-off-by: Martin Radev Reviewed-on: https://git-master.nvidia.com/r/1662427 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gv11b/css_gr_gv11b.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'drivers/gpu/nvgpu/gv11b/css_gr_gv11b.c') diff --git a/drivers/gpu/nvgpu/gv11b/css_gr_gv11b.c b/drivers/gpu/nvgpu/gv11b/css_gr_gv11b.c index 617ea61d..d8ba332b 100644 --- a/drivers/gpu/nvgpu/gv11b/css_gr_gv11b.c +++ b/drivers/gpu/nvgpu/gv11b/css_gr_gv11b.c @@ -57,15 +57,6 @@ static inline u32 css_hw_get_pending_snapshots(struct gk20a *g) sizeof(struct gk20a_cs_snapshot_fifo_entry); } -/* informs hw how many snapshots have been processed (frees up fifo space) */ -static inline void gv11b_css_hw_set_handled_snapshots(struct gk20a *g, u32 done) -{ - if (done > 0) { - gk20a_writel(g, perf_pmasys_mem_bump_r(), - done * sizeof(struct gk20a_cs_snapshot_fifo_entry)); - } -} - /* disable streaming to memory */ static void gv11b_css_hw_reset_streaming(struct gk20a *g) { @@ -86,6 +77,17 @@ static void gv11b_css_hw_reset_streaming(struct gk20a *g) gv11b_css_hw_set_handled_snapshots(g, css_hw_get_pending_snapshots(g)); } +/* informs hw how many snapshots have been processed (frees up fifo space) */ +void gv11b_css_hw_set_handled_snapshots(struct gk20a *g, u32 done) +{ + if (done == 0u) { + return; + } + + gk20a_writel(g, perf_pmasys_mem_bump_r(), + done * sizeof(struct gk20a_cs_snapshot_fifo_entry)); +} + int gv11b_css_hw_enable_snapshot(struct channel_gk20a *ch, struct gk20a_cs_snapshot_client *cs_client) { -- cgit v1.2.2