int mtk_thermal_get_gpu_info(
    int *nocores,
    int **gpufreq,
    int **gpuloading)
{
    //******************
    // GPU Index
    //******************
#if defined(CONFIG_ARCH_MT6589)
    if (nocores)
        *nocores = NO_GPU_CORES;

    if (gpufreq)
    {
        gpufreqs[0] = mt_gpufreq_cur_freq()/1000; // the return value is KHz
        *gpufreq = gpufreqs;
    }

    if (gpuloading)
    {
        gpuloadings[0] = mt_gpufreq_cur_load();
        *gpuloading = gpuloadings;
    }

    return 0;

#else
    return -1;
#endif
}
Esempio n. 2
0
static void wq_get_sample(struct work_struct *work)
{
    if (met_gpu.mode) {
        int cpu;
        unsigned int value[7];
        unsigned long long stamp;

        cpu = smp_processor_id();
        stamp = cpu_clock(cpu);

        value[0] = (mt_gpufreq_cur_freq()/1000);  //GPU Clock
        value[1] = mt_gpufreq_cur_load();      //GPU Utilization
        value[2] = 0;                             //GP Frame Rate
        value[3] = 0;                             //PP Frame Rate
        value[4] = 0;                             //Instruction Complete Count

        ms_gpu(stamp, 5, value);
        msleep(metDelay);
        schedule_delayed_work(&dwork, 0);
    }
}