mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 17:25:35 +03:00
drivers: pva: enable profiling when it is active
Bug 5467846 Change-Id: Iad35078b05e0dbfa5ac638a718b1a900fd054d9e Signed-off-by: Johnny Liu <johnliu@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3465128 Reviewed-by: svcacv <svcacv@nvidia.com> Reviewed-by: Nan Wang <nanwa@nvidia.com> GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com> Reviewed-by: Omar Nemri <onemri@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
eb29d03e62
commit
bf60517305
@@ -143,6 +143,7 @@ static int64_t get_vpu_stats(struct pva_kmd_device *dev, void *file_data,
|
||||
kmd_tegra_stats.average_vpu_utilization[0] = 0;
|
||||
kmd_tegra_stats.average_vpu_utilization[1] = 0;
|
||||
|
||||
if (pva_kmd_device_maybe_on(dev))
|
||||
pva_kmd_notify_fw_get_tegra_stats(dev, &kmd_tegra_stats);
|
||||
|
||||
return print_vpu_stats(&kmd_tegra_stats, out_buffer, offset, size);
|
||||
|
||||
@@ -63,18 +63,8 @@ pva_kmd_notify_fw_get_tegra_stats(struct pva_kmd_device *pva,
|
||||
uint64_t buffer_offset = 0U;
|
||||
enum pva_error err = PVA_SUCCESS;
|
||||
struct pva_kmd_fw_tegrastats fw_tegra_stats = { 0 };
|
||||
bool stats_enabled = pva->debugfs_context.stats_enable;
|
||||
uint64_t duration = 0U;
|
||||
|
||||
if (stats_enabled == false) {
|
||||
pva_kmd_log_err("Tegra stats are disabled");
|
||||
goto err_out;
|
||||
}
|
||||
|
||||
if (!pva_kmd_device_maybe_on(pva)) {
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* Power on PVA if not already */
|
||||
err = pva_kmd_device_busy(pva);
|
||||
if (err != PVA_SUCCESS) {
|
||||
@@ -85,7 +75,7 @@ pva_kmd_notify_fw_get_tegra_stats(struct pva_kmd_device *pva,
|
||||
|
||||
pva_kmd_set_cmd_get_tegra_stats(&cmd, pva->tegra_stats_resource_id,
|
||||
pva->tegra_stats_buf_size,
|
||||
buffer_offset, stats_enabled);
|
||||
buffer_offset, true);
|
||||
|
||||
err = pva_kmd_submit_cmd_sync(&pva->submitter, &cmd, sizeof(cmd),
|
||||
PVA_KMD_WAIT_FW_POLL_INTERVAL_US,
|
||||
@@ -100,7 +90,6 @@ pva_kmd_notify_fw_get_tegra_stats(struct pva_kmd_device *pva,
|
||||
|
||||
pva_kmd_device_idle(pva);
|
||||
|
||||
out:
|
||||
duration = sat_sub64(fw_tegra_stats.window_end_time,
|
||||
fw_tegra_stats.window_start_time);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user