gpu: host1x: Export normalized actmon active time

The exported interface will be used by devfreq framework to get the
load information of the monitored device.

Bug 3788919

Signed-off-by: Johnny Liu <johnliu@nvidia.com>
Change-Id: Id95c8398f44e2c94bd83c1f83d7a7d93d1f2609d
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2892879
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Johnny Liu
2023-04-24 06:44:43 +00:00
committed by mobile promotions
parent 0544985a0f
commit 3b42f92d4d
2 changed files with 19 additions and 0 deletions

View File

@@ -446,6 +446,24 @@ void host1x_actmon_update_client_rate(struct host1x_client *client,
}
EXPORT_SYMBOL(host1x_actmon_update_client_rate);
void host1x_actmon_read_active_norm(struct host1x_client *client, unsigned long *usage)
{
struct host1x_actmon *actmon = client->actmon;
struct host1x_actmon_module *module;
u64 val;
if (!actmon || !actmon->num_modules) {
*usage = 0;
return;
}
module = &actmon->modules[HOST1X_ACTMON_MODULE_ACTIVE];
host1x_actmon_module_avg_norm_get(module, &val);
*usage = (unsigned long)val;
}
EXPORT_SYMBOL(host1x_actmon_read_active_norm);
int host1x_actmon_read_avg_count(struct host1x_client *client)
{
struct host1x *host = dev_get_drvdata(client->host->parent);

View File

@@ -530,5 +530,6 @@ int host1x_actmon_unregister(struct host1x_client *client);
void host1x_actmon_update_client_rate(struct host1x_client *client,
unsigned long rate,
u32 *weight);
void host1x_actmon_read_active_norm(struct host1x_client *client, unsigned long *usage);
#endif