gpu: host1x: move actmon specific code under CONFIG_PM_DEVFREQ

Move actmon.c file under CONFIG_PM_DEVFREQ and
stub the functions when it is not enabled.

Jira HOSTX-5885

Change-Id: I8e6f86c617061587e4034a184f9a7d82a41a4a03
Signed-off-by: Santosh BS <santoshb@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3297630
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
Santosh BS
2025-02-06 06:23:09 +00:00
committed by Jon Hunter
parent 2a4ac9e68f
commit aa7bcad3cf
3 changed files with 56 additions and 6 deletions

View File

@@ -581,6 +581,7 @@ static inline void host1x_memory_context_unmap(struct host1x_context_mapping *m)
}
#endif
#ifdef CONFIG_PM_DEVFREQ
int host1x_actmon_read_avg_count(struct host1x_client *client);
int host1x_actmon_register(struct host1x_client *client);
void host1x_actmon_unregister(struct host1x_client *client);
@@ -597,5 +598,49 @@ void host1x_actmon_update_active_wmark(struct host1x_client *client,
u32 consec_lower_wmark,
bool upper_wmark_enabled,
bool lower_wmark_enabled);
#else
static inline int host1x_actmon_read_avg_count(struct host1x_client *client)
{
return -ENODEV;
}
static inline int host1x_actmon_register(struct host1x_client *client)
{
return -ENODEV;
}
static inline void host1x_actmon_unregister(struct host1x_client *client)
{
}
static inline void host1x_actmon_enable(struct host1x_client *client)
{
}
static inline void host1x_actmon_disable(struct host1x_client *client)
{
}
static inline void host1x_actmon_update_client_rate(struct host1x_client *client,
unsigned long rate,
u32 *weight)
{
}
static inline void host1x_actmon_read_active_norm(struct host1x_client *client, unsigned long *usage)
{
*usage = 0;
}
static inline void host1x_actmon_update_active_wmark(struct host1x_client *client,
u32 avg_upper_wmark,
u32 avg_lower_wmark,
u32 consec_upper_wmark,
u32 consec_lower_wmark,
bool upper_wmark_enabled,
bool lower_wmark_enabled)
{
}
#endif
#endif