mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-23 09:57:08 +03:00
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 <mradev@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1662427 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
d98232ab21
commit
2f2e51bbae
@@ -75,7 +75,7 @@ static inline u32 css_hw_get_pending_snapshots(struct gk20a *g)
|
||||
}
|
||||
|
||||
/* informs hw how many snapshots have been processed (frees up fifo space) */
|
||||
void css_hw_set_handled_snapshots(struct gk20a *g, u32 done)
|
||||
void gk20a_css_hw_set_handled_snapshots(struct gk20a *g, u32 done)
|
||||
{
|
||||
if (done > 0) {
|
||||
gk20a_writel(g, perf_pmasys_mem_bump_r(),
|
||||
@@ -102,7 +102,7 @@ static void css_hw_reset_streaming(struct gk20a *g)
|
||||
perf_pmasys_control_membuf_clear_status_doit_f());
|
||||
|
||||
/* pointing all pending snapshots as handled */
|
||||
css_hw_set_handled_snapshots(g, css_hw_get_pending_snapshots(g));
|
||||
gk20a_css_hw_set_handled_snapshots(g, css_hw_get_pending_snapshots(g));
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -129,7 +129,7 @@ struct gk20a_cs_snapshot {
|
||||
struct gk20a_cs_snapshot_fifo_entry *hw_get;
|
||||
};
|
||||
|
||||
void css_hw_set_handled_snapshots(struct gk20a *g, u32 done);
|
||||
void gk20a_css_hw_set_handled_snapshots(struct gk20a *g, u32 done);
|
||||
int css_hw_enable_snapshot(struct channel_gk20a *ch,
|
||||
struct gk20a_cs_snapshot_client *cs_client);
|
||||
void css_hw_disable_snapshot(struct gr_gk20a *gr);
|
||||
|
||||
@@ -577,7 +577,7 @@ static const struct gpu_ops gm20b_ops = {
|
||||
.enable_snapshot = css_hw_enable_snapshot,
|
||||
.disable_snapshot = css_hw_disable_snapshot,
|
||||
.check_data_available = css_hw_check_data_available,
|
||||
.set_handled_snapshots = css_hw_set_handled_snapshots,
|
||||
.set_handled_snapshots = gk20a_css_hw_set_handled_snapshots,
|
||||
.allocate_perfmon_ids = css_gr_allocate_perfmon_ids,
|
||||
.release_perfmon_ids = css_gr_release_perfmon_ids,
|
||||
},
|
||||
|
||||
@@ -689,7 +689,7 @@ static const struct gpu_ops gp106_ops = {
|
||||
.enable_snapshot = css_hw_enable_snapshot,
|
||||
.disable_snapshot = css_hw_disable_snapshot,
|
||||
.check_data_available = css_hw_check_data_available,
|
||||
.set_handled_snapshots = css_hw_set_handled_snapshots,
|
||||
.set_handled_snapshots = gk20a_css_hw_set_handled_snapshots,
|
||||
.allocate_perfmon_ids = css_gr_allocate_perfmon_ids,
|
||||
.release_perfmon_ids = css_gr_release_perfmon_ids,
|
||||
},
|
||||
|
||||
@@ -623,7 +623,7 @@ static const struct gpu_ops gp10b_ops = {
|
||||
.enable_snapshot = css_hw_enable_snapshot,
|
||||
.disable_snapshot = css_hw_disable_snapshot,
|
||||
.check_data_available = css_hw_check_data_available,
|
||||
.set_handled_snapshots = css_hw_set_handled_snapshots,
|
||||
.set_handled_snapshots = gk20a_css_hw_set_handled_snapshots,
|
||||
.allocate_perfmon_ids = css_gr_allocate_perfmon_ids,
|
||||
.release_perfmon_ids = css_gr_release_perfmon_ids,
|
||||
},
|
||||
|
||||
@@ -699,7 +699,7 @@ static const struct gpu_ops gv100_ops = {
|
||||
.enable_snapshot = gv11b_css_hw_enable_snapshot,
|
||||
.disable_snapshot = gv11b_css_hw_disable_snapshot,
|
||||
.check_data_available = gv11b_css_hw_check_data_available,
|
||||
.set_handled_snapshots = css_hw_set_handled_snapshots,
|
||||
.set_handled_snapshots = gv11b_css_hw_set_handled_snapshots,
|
||||
.allocate_perfmon_ids = css_gr_allocate_perfmon_ids,
|
||||
.release_perfmon_ids = css_gr_release_perfmon_ids,
|
||||
},
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -30,5 +30,6 @@ int gv11b_css_hw_enable_snapshot(struct channel_gk20a *ch,
|
||||
void gv11b_css_hw_disable_snapshot(struct gr_gk20a *gr);
|
||||
int gv11b_css_hw_check_data_available(struct channel_gk20a *ch, u32 *pending,
|
||||
bool *hw_overflow);
|
||||
void gv11b_css_hw_set_handled_snapshots(struct gk20a *g, u32 done);
|
||||
|
||||
#endif /* CSS_GR_GV11B_H */
|
||||
|
||||
@@ -688,7 +688,7 @@ static const struct gpu_ops gv11b_ops = {
|
||||
.enable_snapshot = gv11b_css_hw_enable_snapshot,
|
||||
.disable_snapshot = gv11b_css_hw_disable_snapshot,
|
||||
.check_data_available = gv11b_css_hw_check_data_available,
|
||||
.set_handled_snapshots = css_hw_set_handled_snapshots,
|
||||
.set_handled_snapshots = gv11b_css_hw_set_handled_snapshots,
|
||||
.allocate_perfmon_ids = css_gr_allocate_perfmon_ids,
|
||||
.release_perfmon_ids = css_gr_release_perfmon_ids,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user