diff --git a/drivers/gpu/host1x/Makefile b/drivers/gpu/host1x/Makefile index d7d56ac3..1545b42b 100644 --- a/drivers/gpu/host1x/Makefile +++ b/drivers/gpu/host1x/Makefile @@ -10,8 +10,8 @@ host1x-y = \ channel.o \ job.o \ debug.o \ - fence.o \ - actmon.o + fence.o + ifneq ($(filter y, $(CONFIG_ARCH_TEGRA_2x_SOC) $(CONFIG_ARCH_TEGRA_3x_SOC)),) host1x-y += hw/host1x01.o @@ -25,8 +25,7 @@ host1x-$(CONFIG_ARCH_TEGRA_234_SOC) += hw/host1x08.o host1x-$(CONFIG_ARCH_TEGRA_264_SOC) += hw/host1x09.o host1x-$(CONFIG_DRM_TEGRA_HAVE_DISPLAY) += mipi.o - -host1x-$(CONFIG_IOMMU_API) += \ - context.o +host1x-$(CONFIG_PM_DEVFREQ) += actmon.o +host1x-$(CONFIG_IOMMU_API) += context.o obj-m := host1x.o diff --git a/drivers/gpu/host1x/actmon.h b/drivers/gpu/host1x/actmon.h index 798bfd8e..870094f0 100644 --- a/drivers/gpu/host1x/actmon.h +++ b/drivers/gpu/host1x/actmon.h @@ -2,7 +2,7 @@ /* * Tegra host1x Actmon * - * Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * Copyright (c) 2023-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. */ #ifndef HOST1X_ACTMON_H @@ -44,6 +44,12 @@ struct host1x_actmon { struct host1x; +#ifdef CONFIG_PM_DEVFREQ void host1x_actmon_handle_interrupt(struct host1x *host, int classid); +#else +static inline void host1x_actmon_handle_interrupt(struct host1x *host, int classid) +{ +} +#endif #endif diff --git a/include/linux/host1x-next.h b/include/linux/host1x-next.h index 9d695776..e548ec57 100644 --- a/include/linux/host1x-next.h +++ b/include/linux/host1x-next.h @@ -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