mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-24 10:34:43 +03:00
gpu: nvgpu: support for clk.measure_freq for igpu
Add support for the measure_freq clock op for igpu:
- add nvgpu_clk_measure_freq(), which in turn calls
the get_rate() clock op.
- Initialize the measure_freq clock op to nvgpu_clk_measure_freq()
for native linux and vgpu.
JIRA ESRM-398
Change-Id: I8a3b2ee79e29e3491a16f55281494f05cd841b07
Signed-off-by: Peter Daifuku <pdaifuku@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1850585
Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Debarshi Dutta <ddutta@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Nirav Patel <nipatel@nvidia.com>
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
82baff9f6f
commit
1e125f245e
@@ -1049,6 +1049,20 @@ int nvgpu_clk_arb_get_arbiter_actual_mhz(struct gk20a *g,
|
||||
return err;
|
||||
}
|
||||
|
||||
unsigned long nvgpu_clk_measure_freq(struct gk20a *g, u32 api_domain)
|
||||
{
|
||||
unsigned long freq = 0UL;
|
||||
|
||||
switch (api_domain) {
|
||||
case CTRL_CLK_DOMAIN_GPC2CLK:
|
||||
freq = g->ops.clk.get_rate(g, CTRL_CLK_DOMAIN_GPCCLK) * 2UL;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return freq;
|
||||
}
|
||||
|
||||
int nvgpu_clk_arb_get_arbiter_effective_mhz(struct gk20a *g,
|
||||
u32 api_domain, u16 *freq_mhz)
|
||||
{
|
||||
|
||||
@@ -369,6 +369,8 @@ void nvgpu_clk_notification_queue_free(struct gk20a *g,
|
||||
|
||||
void nvgpu_clk_arb_event_post_event(struct nvgpu_clk_dev *dev);
|
||||
|
||||
unsigned long nvgpu_clk_measure_freq(struct gk20a *g, u32 api_domain);
|
||||
|
||||
#ifdef CONFIG_DEBUG_FS
|
||||
int nvgpu_clk_arb_debugfs_init(struct gk20a *g);
|
||||
#endif
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#include "platform_gk20a.h"
|
||||
|
||||
#include <nvgpu/gk20a.h>
|
||||
#include <nvgpu/clk_arb.h>
|
||||
|
||||
#define HZ_TO_MHZ(x) ((x) / 1000000)
|
||||
|
||||
@@ -280,4 +281,5 @@ void nvgpu_linux_init_clk_support(struct gk20a *g)
|
||||
g->ops.clk.clk_domain_get_f_points = nvgpu_linux_clk_get_f_points;
|
||||
g->ops.clk.get_clk_range = nvgpu_clk_get_range;
|
||||
g->ops.clk.clk_get_round_rate = nvgpu_clk_get_round_rate;
|
||||
g->ops.clk.measure_freq = nvgpu_clk_measure_freq;
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
|
||||
#include <nvgpu/vgpu/vgpu.h>
|
||||
#include <nvgpu/vgpu/vgpu_ivc.h>
|
||||
#include <nvgpu/clk_arb.h>
|
||||
|
||||
#include "gk20a/gk20a.h"
|
||||
#include "clk_vgpu.h"
|
||||
@@ -214,6 +215,7 @@ void vgpu_init_clk_support(struct gk20a *g)
|
||||
g->ops.clk.clk_get_round_rate = vgpu_clk_get_round_rate;
|
||||
g->ops.clk.get_clk_range = vgpu_clk_get_range;
|
||||
g->ops.clk.clk_domain_get_f_points = vgpu_clk_get_f_points;
|
||||
g->ops.clk.measure_freq = nvgpu_clk_measure_freq;
|
||||
}
|
||||
|
||||
int vgpu_clk_get_freqs(struct gk20a *g, unsigned long **freqs_out,
|
||||
|
||||
Reference in New Issue
Block a user