sm8750: init kernel modules repo

This commit is contained in:
2025-08-11 12:21:01 +02:00
parent 2681143b87
commit facad83b01
8851 changed files with 6894561 additions and 0 deletions

View File

@@ -0,0 +1,126 @@
/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Copyright (c) 2010-2021, The Linux Foundation. All rights reserved.
* Copyright (c) 2022-2024 Qualcomm Innovation Center, Inc. All rights reserved.
*/
#ifndef __KGSL_PWRSCALE_H
#define __KGSL_PWRSCALE_H
#include "kgsl_pwrctrl.h"
#if IS_ENABLED(CONFIG_DEVFREQ_GOV_QCOM_ADRENO_TZ)
#include <linux/soc/qcom/msm_adreno_devfreq.h>
#else
#include "msm_adreno_devfreq.h"
#endif
/* devfreq governor call window in usec */
#define KGSL_GOVERNOR_CALL_INTERVAL 10000
struct kgsl_power_stats {
u64 busy_time;
u64 ram_time;
u64 ram_wait;
};
/**
* struct kgsl_pwrscale - Power scaling settings for a KGSL device
* @devfreqptr - Pointer to the devfreq device
* @gpu_profile - GPU profile data for the devfreq device
* @bus_profile - Bus specific data for the bus devfreq device
* @freq_table - GPU frequencies for the DCVS algorithm
* @accum_stats - Accumulated statistics for various frequency calculations
* @enabled - Whether or not power scaling is enabled
* @time - Last submitted sample timestamp
* @devfreq_wq - Main devfreq workqueue
* @devfreq_suspend_ws - Pass device suspension to devfreq
* @devfreq_resume_ws - Pass device resume to devfreq
* @next_governor_call - Timestamp after which the governor may be notified of
* a new sample
* @ctxt_aware_enable - Whether or not ctxt aware DCVS feature is enabled
* @ctxt_aware_busy_penalty - The time in microseconds required to trigger
* ctxt aware power level jump
* @ctxt_aware_target_pwrlevel - pwrlevel to jump on in case of ctxt aware
* power level jump
*/
struct kgsl_pwrscale {
struct devfreq *devfreqptr;
struct msm_adreno_extended_profile gpu_profile;
struct msm_busmon_extended_profile bus_profile;
unsigned long freq_table[KGSL_MAX_PWRLEVELS];
struct kgsl_power_stats accum_stats;
bool enabled;
ktime_t time;
struct workqueue_struct *devfreq_wq;
struct work_struct devfreq_suspend_ws;
struct work_struct devfreq_resume_ws;
/** @devfreq_notify_worker: kthread worker to handle devfreq notify event */
struct kthread_worker *devfreq_notify_worker;
/** @devfreq_notify_work: work struct to update devfreq as per request */
struct kthread_work devfreq_notify_work;
ktime_t next_governor_call;
bool ctxt_aware_enable;
unsigned int ctxt_aware_target_pwrlevel;
unsigned int ctxt_aware_busy_penalty;
/** @busmondev: A child device for the busmon governor */
struct device busmondev;
/** @bus_devfreq: Pointer to the bus devfreq device */
struct devfreq *bus_devfreq;
/** @devfreq_enabled: Whether or not devfreq is enabled */
bool devfreq_enabled;
};
/**
* kgsl_pwrscale_init - Initialize the pwrscale subsystem
* @device: A GPU device handle
* @pdev: A pointer to the GPU platform device
* @governor: default devfreq governor to use for GPU frequency scaling
*
* Return: 0 on success or negative on failure
*/
int kgsl_pwrscale_init(struct kgsl_device *device, struct platform_device *pdev,
const char *governor);
void kgsl_pwrscale_close(struct kgsl_device *device);
void kgsl_pwrscale_update(struct kgsl_device *device);
void kgsl_pwrscale_update_stats(struct kgsl_device *device);
void kgsl_pwrscale_sleep(struct kgsl_device *device);
void kgsl_pwrscale_wake(struct kgsl_device *device);
void kgsl_pwrscale_enable(struct kgsl_device *device);
void kgsl_pwrscale_disable(struct kgsl_device *device, bool turbo);
#if IS_ENABLED(CONFIG_DEVFREQ_GOV_QCOM_ADRENO_TZ)
static inline int msm_adreno_tz_init(void)
{
return 0;
}
static inline void msm_adreno_tz_exit(void)
{
}
#else
int msm_adreno_tz_init(void);
void msm_adreno_tz_exit(void);
#endif
#if IS_ENABLED(CONFIG_DEVFREQ_GOV_QCOM_GPUBW_MON)
static inline int devfreq_gpubw_init(void)
{
return 0;
}
static inline void devfreq_gpubw_exit(void)
{
}
#else
int devfreq_gpubw_init(void);
void devfreq_gpubw_exit(void);
#endif
void kgsl_pwrscale_fast_bus_hint(bool on);
#endif