MTK有835GPU驱动动吗?

MTK说Helio X10是今年旗舰,可那GPU简直翔一样啊【手机吧】_百度贴吧
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&签到排名:今日本吧第个签到,本吧因你更精彩,明天继续来努力!
本吧签到人数:0成为超级会员,使用一键签到本月漏签0次!成为超级会员,赠送8张补签卡连续签到:天&&累计签到:天超级会员单次开通12个月以上,赠送连续签到卡3张
关注:3,704,194贴子:
MTK说Helio X10是今年旗舰,可那GPU简直翔一样啊收藏
Helio X10在CPU方面确实没什么可讲的,基本处于旗舰水准,性能过剩的水平。可是搭载的那个Power VR G6200的GPU,简直被高通上一代的骁龙801都秒成渣啊。网上的视频对比评测,G6200大概也就是801性能的60%左右,平时系统界面的操作与轻度游戏还好,大型游戏直接就会出现卡顿了。这样的配置和n年前的品牌机pc很像,强力的Cpu为卖点,却配了个入门级显卡,买回家后发现居然玩游戏会卡。当然也不是说这样做不好,对于一些游戏需求不大的用户性能杠杠的,但是如果是游戏重度用户还是需要慎重考虑。MTK总是被用户黑,被队友黑低端估计也和这个有关吧。在这个日常使用经常“2核工作6核围观”的CPU性能过剩的时代,希望可以出一个配置平衡没有明显短板的好U。手机码字,排版不好说的不妥的地方还请轻喷
苏宁易购手机,官方授权,保证,买正品,就上苏宁易购网上商城!苏宁易购手机,全国联保,货到付款!
总比某某最强935好一点
g6200简直垃圾,估计还没320好
这些都不管你事儿
你们别乱黑我司,手机厂商也不傻好不好他们会不知道吗?只有你们消费者知道?
其实是这些软件都用不了多核,造成浪费
你们以为你们是什么,王俊凯是神,你有看到他压腿多疼么,你们还有没有良心啊,你没有看到小凯在80℃的时候依然坚持练习,因为你们说她的舞跳的不好,她就一直努力,根本顾不上自己还是低血糖,又因为你们说她头发油,她就在下雨天在学校厕所里洗头,还是下雨天,还有,为了节约资源,节约用水,她上完厕所都不洗手,你们有这样的环保意识吗,你能做到这样吗?做不到就请你不要黑她,谢谢你们,再黑我们掏粪,我们小胖鞋,钳纸盒,蛸螳猿 这些死也艹大军是不会放过你们的
菊花祖传,诶不说了
如果mt6795搭配mali-760mp2或者mp4就完美了
看需求,我用平板基本也只玩一个海岛奇兵,下载过极品飞车,nba之类的,觉得没啥意思,平时根本不玩什么游戏
高通系列cpu才是业界良心除了810mx4 pro那种8核的看个网页版小说翻页都卡。。哈哈笑我我Z3 805cpu 只开一个核心很低频率都无压力的东西
问题来了,mt6752的性能都能和麒麟93x不相上下
挖坟 实测x10t崩坏3体验吊打801,最高特效有20-30帧,我也不知道为什么,也许是flyme神优化
登录百度帐号高通620与mtk6755对比一下,特别是gpu性能,谁知道?感觉要被高通反超啊【联发科吧】_百度贴吧
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&签到排名:今日本吧第个签到,本吧因你更精彩,明天继续来努力!
本吧签到人数:0成为超级会员,使用一键签到本月漏签0次!成为超级会员,赠送8张补签卡连续签到:天&&累计签到:天超级会员单次开通12个月以上,赠送连续签到卡3张
关注:11,746贴子:
高通620与mtk6755对比收藏
高通620与mtk6755对比一下,特别是gpu性能,谁知道?感觉要被高通反超啊
登录百度帐号崖下潮起落,捣碎亦升花!
MTK平台CPU/GPU动态调频的实现之PerfService的源码分析
转自:http://blog.csdn.net/zhangyongfeiyong/article/details/
Zygote进程启动后会启动System进程,在System进程启动过程中会启动系统中的关键服务,如AMS、PMS以及这里要分析的PerfService。先看下流程图:
SystemServer启动PerfService服务是通过实例化PerfServiceImpl的对象perfService,并把该服务的Binder对象添加到ServiceManager中。
先看SystemServer类中的startOtherServices方法:
private void startOtherServices() {
PerfServiceStateNotifier perfServiceNotifier = null;
IPerfServiceManager perfServiceMgr = null;
if (mFactoryTestMode != FactoryTest.FACTORY_TEST_LOW_LEVEL) {
if (SystemProperties.get("ro.mtk_perfservice_support").equals("1")) {
Slog.i(TAG, "PerfService state notifier");
perfServiceNotifier = new PerfServiceStateNotifier();
mActivityManagerService.registerActivityStateNotifier(perfServiceNotifier);
} catch (Throwable e) {
Slog.e(TAG, "FAIL starting PerfServiceStateNotifier", e);
perfServiceMgr = new PerfServiceManager(context);
IPerfService perfService = null;
perfService = new PerfServiceImpl(context, perfServiceMgr);
Slog.d("perfservice", "perfService=" + perfService);
if (perfService != null) {
ServiceManager.addService(Context.MTK_PERF_SERVICE, perfService.asBinder());
} catch (Throwable e) {
Slog.e(TAG, "perfservice Failure starting PerfService", e);
final IPerfServiceManager perfServiceF = perfServiceM
mActivityManagerService.systemReady(new Runnable() {
public void run() {
Slog.i(TAG, "Making services ready");
if (SystemProperties.get("ro.mtk_perfservice_support").equals("1")) {
Trace.traceBegin(Trace.TRACE_TAG_SYSTEM_SERVER, "MakePerfServiceReady");
if (perfServiceF != null) perfServiceF.systemReady();
Trace.traceEnd(Trace.TRACE_TAG_SYSTEM_SERVER);
} catch (Throwable e) {
reportWtf("making PerfServiceManager ready", e);
private void startOtherServices() {
PerfServiceStateNotifier perfServiceNotifier =
IPerfServiceManager perfServiceMgr =
if (mFactoryTestMode != FactoryTest.FACTORY_TEST_LOW_LEVEL) {
/// M: add for PerfService feature @{
if (SystemProperties.get("ro.mtk_perfservice_support").equals("1")) {
Slog.i(TAG, "PerfService state notifier");
// 实例化PerfService的状态通知者
perfServiceNotifier = new PerfServiceStateNotifier();
// 把通知者注册到AMS的观察者中,有状态变化时会通知所有注册过的通知者
mActivityManagerService.registerActivityStateNotifier(perfServiceNotifier);
} catch (Throwable e) {
Slog.e(TAG, "FAIL starting PerfServiceStateNotifier", e);
// Create PerfService manager thread and add service
// 实例化PerfServiceManager线程
perfServiceMgr = new PerfServiceManager(context);
IPerfService perfService =
// 实例化服务
perfService = new PerfServiceImpl(context, perfServiceMgr);
Slog.d("perfservice", "perfService=" + perfService);
if (perfService != null) {
// 把服务添加到ServiceManager中
ServiceManager.addService(Context.MTK_PERF_SERVICE, perfService.asBinder());
} catch (Throwable e) {
Slog.e(TAG, "perfservice Failure starting PerfService", e);
/// M: add for hdmi feature
final IPerfServiceManager perfServiceF = perfServiceM
// We now tell the activity manager it is okay to run third party
It will call back into us once it has gotten to the state
// where third party code can really run (but before it has actually
// started launching the initial applications), for us to complete our
// initialization.
mActivityManagerService.systemReady(new Runnable() {
public void run() {
Slog.i(TAG, "Making services ready");
/// M: add for PerfService feature @{
if (SystemProperties.get("ro.mtk_perfservice_support").equals("1")) {
// Notify PerfService manager of system ready
Trace.traceBegin(Trace.TRACE_TAG_SYSTEM_SERVER, "MakePerfServiceReady");
// 系统启动后回调IPerfServiceManager的systemReady方法
if (perfServiceF != null) perfServiceF.systemReady();
Trace.traceEnd(Trace.TRACE_TAG_SYSTEM_SERVER);
} catch (Throwable e) {
reportWtf("making PerfServiceManager ready", e);
}再看PerfServiceStateNotifier类,先看下它实现的接口IActivityStateNotifier:
public interface IActivityStateNotifier {
public enum ActivityState {
Destroyed,
public void notifyActivityState(String packageName, int pid,
String className, ActivityState actState);
public void notifyAppDied(int pid, HashSet&String& packageList);
public interface IActivityStateNotifier {
public enum ActivityState {
Destroyed,
* Notify activity state change.
* @param packageName The target package name.
* @param pid The process id package belongs to.
* @param className The class name of the package.
* @param actState Current lifecycle state of the package.
public void notifyActivityState(String packageName, int pid,
String className, ActivityState actState);
* Notify the process of activity has died.
* @param pid The process id has died.
* @param packageList The whole packages runs on the process.
public void notifyAppDied(int pid, HashSet&String& packageList);
再看PerfServiceStateNotifier类的实现:
public final class PerfServiceStateNotifier implements IActivityStateNotifier {
static final String TAG = "PerfServiceStateNotifier";
IPerfServiceWrapper mPerfS
public PerfServiceStateNotifier() {
mPerfService = new PerfServiceWrapper(null);
public void notifyActivityState(String packageName, int pid,
String className, IActivityStateNotifier.ActivityState actState) {
switch(actState) {
case Paused:
state = IPerfServiceWrapper.STATE_PAUSED;
case Resumed:
state = IPerfServiceWrapper.STATE_RESUMED;
case Destroyed:
state = IPerfServiceWrapper.STATE_DESTROYED;
case Stopped:
state = IPerfServiceWrapper.STATE_STOPPED;
mPerfService.notifyAppState(packageName, className, state, pid);
public void notifyAppDied(int pid, HashSet&String& packageList)
Iterator i = packageList.iterator();
while (i.hasNext()) {
String packageName = (String) i.next();
mPerfService.notifyAppState(packageName, null, IPerfServiceWrapper.STATE_DEAD, pid);
// 观察者模式的使用
public final class PerfServiceStateNotifier implements IActivityStateNotifier {
static final String TAG = "PerfServiceStateNotifier";
IPerfServiceWrapper mPerfS
public PerfServiceStateNotifier() {
// 实例化PerfServiceWrapper
mPerfService = new PerfServiceWrapper(null);
* Notify activity state change
* Activity状态变化时回调该方法
public void notifyActivityState(String packageName, int pid,
String className, IActivityStateNotifier.ActivityState actState) {
//Slog.i(TAG,"[notifyActivityState] "+ packageName+ ", "+ className+ ", "+ actState);
switch(actState) {
case Paused:
state = IPerfServiceWrapper.STATE_PAUSED;
case Resumed:
state = IPerfServiceWrapper.STATE_RESUMED;
case Destroyed:
state = IPerfServiceWrapper.STATE_DESTROYED;
case Stopped:
state = IPerfServiceWrapper.STATE_STOPPED;
// 调用mPerfService的状态变化方法
mPerfService.notifyAppState(packageName, className, state, pid);
* Notify the process of activity has died
* Activity销毁时回调该方法
public void notifyAppDied(int pid, HashSet&String& packageList)
Iterator i = packageList.iterator();
while (i.hasNext()) {
String packageName = (String) i.next();
// 调用mPerfService的状态变化方法
mPerfService.notifyAppState(packageName, null, IPerfServiceWrapper.STATE_DEAD, pid);
当所监听的Activity生命周期方法被调用时会调用PerfServiceWrapper类的notifyAppState方法,那么下面先看下PerfServiceWrapper实现的接口IPerfServiceWrapper:
public interface IPerfServiceWrapper {
public static final int SCN_NONE
public static final int SCN_APP_SWITCH = 1;
public static final int SCN_APP_ROTATE = 2;
public static final int SCN_APP_TOUCH
public static final int SCN_DONT_USE1
public static final int SCN_SW_FRAME_UPDATE = 5;
public static final int SCN_APP_LAUNCH
public static final int SCN_GAMING
public static final int SCN_MAX
public static final int STATE_PAUSED
public static final int STATE_RESUMED
public static final int STATE_DESTROYED = 2;
public static final int STATE_DEAD
public static final int STATE_STOPPED
public static final int DISPLAY_TYPE_GAME
public static final int DISPLAY_TYPE_OTHERS = 1;
public static final int NOTIFY_USER_TYPE_PID = 0;
public static final int NOTIFY_USER_TYPE_FRAME_UPDATE = 1;
public static final int NOTIFY_USER_TYPE_DISPLAY_TYPE = 2;
public static final int NOTIFY_USER_TYPE_SCENARIO_ON
public static final int NOTIFY_USER_TYPE_SCENARIO_OFF = 4;
public static final int CMD_GET_CPU_FREQ_LEVEL_COUNT
public static final int CMD_GET_CPU_FREQ_LITTLE_LEVEL_COUNT = 1;
public static final int CMD_GET_CPU_FREQ_BIG_LEVEL_COUNT
public static final int CMD_GET_GPU_FREQ_LEVEL_COUNT
public static final int CMD_GET_MEM_FREQ_LEVEL_COUNT
public static final int CMD_GET_PERF_INDEX_MIN
public static final int CMD_GET_PERF_INDEX_MAX
public static final int CMD_GET_PERF_NORMALIZED_INDEX_MAX
public static final int CMD_SET_CPU_CORE_MIN
public static final int CMD_SET_CPU_CORE_MAX
public static final int CMD_SET_CPU_CORE_BIG_LITTLE_MIN = 2;
public static final int CMD_SET_CPU_CORE_BIG_LITTLE_MAX = 3;
public static final int CMD_SET_CPU_FREQ_MIN
public static final int CMD_SET_CPU_FREQ_MAX
public static final int CMD_SET_CPU_FREQ_BIG_LITTLE_MIN = 6;
public static final int CMD_SET_CPU_FREQ_BIG_LITTLE_MAX = 7;
public static final int CMD_SET_GPU_FREQ_MIN
public static final int CMD_SET_GPU_FREQ_MAX
public static final int CMD_SET_VCORE
public static final int CMD_SET_SCREEN_OFF_STATE
public static final int CMD_SET_CPUFREQ_HISPEED_FREQ
public static final int CMD_SET_CPUFREQ_MIN_SAMPLE_TIME = 13;
public static final int CMD_SET_CPUFREQ_ABOVE_HISPEED_DELAY = 14;
public static final int CMD_SET_CLUSTER_CPU_CORE_MIN
public static final int CMD_SET_CLUSTER_CPU_CORE_MAX
public static final int CMD_SET_CLUSTER_CPU_FREQ_MIN
public static final int CMD_SET_CLUSTER_CPU_FREQ_MAX
public static final int CMD_SET_ROOT_CLUSTER
public static final int CMD_SET_CPU_UP_THRESHOLD
public static final int CMD_SET_CPU_DOWN_THRESHOLD
public static final int CMD_SET_PERF_INDEX
public static final int CMD_SET_NORMALIZED_PERF_INDEX
public void notifyAppState(String packName, String className, int state, int pid);
public interface IPerfServiceWrapper {
// 已经实现的场景
public static final int SCN_NONE
public static final int SCN_APP_SWITCH = 1; /* apply for both launch/exit */ // 切换应用
public static final int SCN_APP_ROTATE = 2; // 旋转应用
public static final int SCN_APP_TOUCH
= 3; // 触摸应用,即点击屏幕
public static final int SCN_DONT_USE1
= 4; // 空闲???
public static final int SCN_SW_FRAME_UPDATE = 5; // 刷新帧率
public static final int SCN_APP_LAUNCH
= 6; // 应用启动
同SCN_APP_SWITCH
public static final int SCN_GAMING
= 7; // 游戏中。。。
public static final int SCN_MAX
= 8; /* should be (last scenario + 1) */
public static final int STATE_PAUSED
public static final int STATE_RESUMED
public static final int STATE_DESTROYED = 2;
public static final int STATE_DEAD
public static final int STATE_STOPPED
public static final int DISPLAY_TYPE_GAME
= 0; // 游戏模式显示类型
public static final int DISPLAY_TYPE_OTHERS = 1; // 非游戏模式
public static final int NOTIFY_USER_TYPE_PID = 0;
public static final int NOTIFY_USER_TYPE_FRAME_UPDATE = 1;
public static final int NOTIFY_USER_TYPE_DISPLAY_TYPE = 2;
public static final int NOTIFY_USER_TYPE_SCENARIO_ON
public static final int NOTIFY_USER_TYPE_SCENARIO_OFF = 4;
public static final int CMD_GET_CPU_FREQ_LEVEL_COUNT
= 0; // 获取CPU频率级别总数
public static final int CMD_GET_CPU_FREQ_LITTLE_LEVEL_COUNT = 1; // 获取小核CPU频率级别总数
public static final int CMD_GET_CPU_FREQ_BIG_LEVEL_COUNT
= 2; // 获取大核CPU频率级别总数
public static final int CMD_GET_GPU_FREQ_LEVEL_COUNT
= 3; // 获取GPU频率级别总数
public static final int CMD_GET_MEM_FREQ_LEVEL_COUNT
= 4; // 获取内存频率级别总数
public static final int CMD_GET_PERF_INDEX_MIN
= 5; // 获取性能优化最小索引值
public static final int CMD_GET_PERF_INDEX_MAX
= 6; // 获取性能优化最大索引值
public static final int CMD_GET_PERF_NORMALIZED_INDEX_MAX
= 7; // 获取普通性能优化最大索引值
public static final int CMD_SET_CPU_CORE_MIN
= 0; // 设置CPU最少核数
public static final int CMD_SET_CPU_CORE_MAX
= 1; // 设置CPU最多核数
public static final int CMD_SET_CPU_CORE_BIG_LITTLE_MIN = 2; // 设置大核小核的最少核数
public static final int CMD_SET_CPU_CORE_BIG_LITTLE_MAX = 3; // 设置大核小核的最多核数
public static final int CMD_SET_CPU_FREQ_MIN
= 4; // 设置CPU的最低频率值
public static final int CMD_SET_CPU_FREQ_MAX
= 5; // 设置CPU的最高频率值
public static final int CMD_SET_CPU_FREQ_BIG_LITTLE_MIN = 6; // 设置大核小核的最低频率值
public static final int CMD_SET_CPU_FREQ_BIG_LITTLE_MAX = 7; // 设置大核小核的最高频率值
public static final int CMD_SET_GPU_FREQ_MIN
= 8; // 设置GPU的最低频率值
public static final int CMD_SET_GPU_FREQ_MAX
= 9; // 设置GPU的最高频率值
public static final int CMD_SET_VCORE
= 10; // 设置图形模式,0/2:默认模式,1:低功耗模式,3:高性能模式
public static final int CMD_SET_SCREEN_OFF_STATE
= 11; // 设置锁屏时状态,0:锁屏无效,1:锁屏有效,2:锁屏暂停,开屏恢复
public static final int CMD_SET_CPUFREQ_HISPEED_FREQ
= 12; // 设置CPU高速频率
public static final int CMD_SET_CPUFREQ_MIN_SAMPLE_TIME = 13; // 设置采样CPU频率值的最小间隔时间
public static final int CMD_SET_CPUFREQ_ABOVE_HISPEED_DELAY = 14; // 设置CPU超高速频率延迟时间
public static final int CMD_SET_CLUSTER_CPU_CORE_MIN
= 15; // 设置CPU簇的最少核数
public static final int CMD_SET_CLUSTER_CPU_CORE_MAX
= 16; // 设置CPU簇的最多核数
public static final int CMD_SET_CLUSTER_CPU_FREQ_MIN
= 17; // 设置CPU簇的最低频率值
public static final int CMD_SET_CLUSTER_CPU_FREQ_MAX
= 18; // 设置CPU簇的最高频率值
public static final int CMD_SET_ROOT_CLUSTER
= 19; // 设置root簇
public static final int CMD_SET_CPU_UP_THRESHOLD
= 20; // 设置CPU温度的最高阈值
public static final int CMD_SET_CPU_DOWN_THRESHOLD
= 21; // 设置CPU温度的最低阈值
public static final int CMD_SET_PERF_INDEX
= 22; // 设置性能优化的索引值
public static final int CMD_SET_NORMALIZED_PERF_INDEX
= 23; // 设置普通性能优化的索引值
// 其他方法的声明
public void notifyAppState(String packName, String className, int state, int pid);
// 其他方法的声明
再看PerfServiceWrapper类的实现:
public class PerfServiceWrapper implements IPerfServiceWrapper {
private static final String TAG = "PerfServiceWrapper";
private IPerfService sService = null;
private Context mC
private int inited = 0;
private int setTid = 0;
private long mPreviousTime = 0;
private static final int RENDER_THREAD_UPDATE_DURATION = 400;
public static native int nativeGetPid();
public static native int nativeGetTid();
private void init() {
if (inited == 0) {
IBinder b = ServiceManager.checkService(Context.MTK_PERF_SERVICE);
if (b != null) {
sService = IPerfService.Stub.asInterface(b);
if (sService != null)
inited = 1;
log("ERR: getService() sService is still null..");
public PerfServiceWrapper(Context context) {
mContext =
public void notifyAppState(String packName, String className, int state, int pid) {
if (sService != null)
sService.notifyAppState(packName, className, state, pid);
} catch (RemoteException e) {
loge("ERR: RemoteException in notifyAppState:" + e);
private void log(String info) {
Log.d("@M_" + TAG, "[PerfServiceWrapper] " + info + " ");
private void loge(String info) {
Log.e("@M_" + TAG, "[PerfServiceWrapper] ERR: " + info + " ");
public class PerfServiceWrapper implements IPerfServiceWrapper {
private static final String TAG = "PerfServiceWrapper";
private IPerfService sService =
private Context mC
private int inited = 0;
private int setTid = 0;
private long mPreviousTime = 0;
private static final int RENDER_THREAD_UPDATE_DURATION = 400;
public static native int nativeGetPid();
public static native int nativeGetTid();
private void init() {
if (inited == 0) {
IBinder b = ServiceManager.checkService(Context.MTK_PERF_SERVICE);
if (b != null) {
// 获取服务
sService = IPerfService.Stub.asInterface(b);
if (sService != null)
inited = 1;
log("ERR: getService() sService is still null..");
public PerfServiceWrapper(Context context) {
mContext =
// 其他接口中声明方法的实现
public void notifyAppState(String packName, String className, int state, int pid) {
//log("boostEnable");
if (sService != null)
// 调用sService的notifyAppState方法
sService.notifyAppState(packName, className, state, pid);
} catch (RemoteException e) {
loge("ERR: RemoteException in notifyAppState:" + e);
// 其他接口中声明方法的实现
private void log(String info) {
Log.d("@M_" + TAG, "[PerfServiceWrapper] " + info + " ");
private void loge(String info) {
Log.e("@M_" + TAG, "[PerfServiceWrapper] ERR: " + info + " ");
该类中的方法都是通过Binder进程间通信方式调用PerfServiceImpl中的方法实现的。由下面分析知,最后调用的是PerfServiceManager中的方法。
下面看PerfServiceManager的实例化过程,该类实现了IPerfServiceManager接口:
public class PerfServiceManager implements IPerfServiceManager {
private static final String TAG = "PerfServiceManager";
private HandlerThread mHandlerT
private PerfServiceThreadHandler mH
private Context mC
final List&Integer& mTimeL
private boolean bDuringT
private boolean bRenderAwareV
private static final int RENDER_AWARE_DURATION_MS = 3000;
private static final int UI_UPDATE_DURATION_MS = 500;
private static final int RENDER_BIT = 0x800000;
private static final float HEAP_UTILIZATION_DURING_FRAME_UPDATE = 0.5f;
private int mDisplayT
private VMRuntime mR
private float mDefaultU
public static native int nativePerfNotifyAppState(String packName, String className,
int state, int pid);
public class PerfServiceAppState {
private String mPackN
private String mClassN
private int mS
private int mP
PerfServiceAppState(String packName, String className, int state, int pid) {
mPackName = packN
mClassName = classN
public PerfServiceManager(Context context) {
mContext =
mHandlerThread = new HandlerThread("PerfServiceManager", Process.THREAD_PRIORITY_FOREGROUND);
mHandlerThread.start();
Looper looper = mHandlerThread.getLooper();
if (looper != null) {
mHandler = new PerfServiceThreadHandler(looper);
mTimeList = new ArrayList&Integer&();
bDuringTouch = false;
bRenderAwareValid = false;
mDisplayType = IPerfServiceWrapper.DISPLAY_TYPE_OTHERS;
mRuntime = VMRuntime.getRuntime();
mDefaultUtilization = mRuntime.getTargetHeapUtilization();
log("Created and started PerfService thread");
public void notifyAppState(String packName, String className, int state, int pid) {
Message msg = mHandler.obtainMessage();
msg.what = PerfServiceThreadHandler.MESSAGE_NOTIFY_APP_STATE;
msg.obj = new PerfServiceAppState(packName, className, state, pid);
msg.sendToTarget();
private class PerfServiceThreadHandler extends Handler {
private static final int MESSAGE_NOTIFY_APP_STATE
public PerfServiceThreadHandler(Looper looper) {
super(looper);
public void handleMessage(Message msg) {
switch (msg.what) {
case MESSAGE_NOTIFY_APP_STATE:
PerfServiceAppState passedObject = (PerfServiceAppState) msg.
nativePerfNotifyAppState(passedObject.mPackName, passedObject.mClassName,
passedObject.mState, passedObject.mPid);
passedObject = null;
msg.obj = null;
} catch (NullPointerException e) {
loge("Exception in PerfServiceThreadHandler.handleMessage: " + e);
private void log(String info) {
Log.d("@M_" + TAG, "[PerfService] " + info + " ");
private void loge(String info) {
Log.e("@M_" + TAG, "[PerfService] ERR: " + info + " ");
public class PerfServiceManager implements IPerfServiceManager {
private static final String TAG = "PerfServiceManager";
private HandlerThread mHandlerT
private PerfServiceThreadHandler mH
private Context mC
final List&Integer& mTimeL
private boolean bDuringT
private boolean bRenderAwareV // render aware is only valid within 3 sec.渲染只在3秒内有效
private static final int RENDER_AWARE_DURATION_MS = 3000;
private static final int UI_UPDATE_DURATION_MS = 500;
private static final int RENDER_BIT = 0x800000;
private static final float HEAP_UTILIZATION_DURING_FRAME_UPDATE = 0.5f; // 刷新帧时的堆栈利用率
private int mDisplayT
private VMRuntime mR
private float mDefaultU
// 声明的一些native方法,追踪到native层后,MTK只提供了一个so库,具体实现是看不到的。。。
public static native int nativePerfNotifyAppState(String packName, String className,
int state, int pid);
// 声明的一些native方法
public class PerfServiceAppState {
private String mPackN
private String mClassN
private int mS
private int mP
PerfServiceAppState(String packName, String className, int state, int pid) {
mPackName = packN
mClassName = classN
Log.w(TAG, "load libperfservice_jni.so");
System.loadLibrary("perfservice_jni");
public PerfServiceManager(Context context) {
mContext =
// 创建并开启名为PerfServiceManager的线程
mHandlerThread = new HandlerThread("PerfServiceManager", Process.THREAD_PRIORITY_FOREGROUND);
mHandlerThread.start();
Looper looper = mHandlerThread.getLooper();
if (looper != null) {
// 初始化Handler
mHandler = new PerfServiceThreadHandler(looper);
mTimeList = new ArrayList&Integer&();
bDuringTouch =
bRenderAwareValid =
// 默认显示类型:非游戏模式
mDisplayType = IPerfServiceWrapper.DISPLAY_TYPE_OTHERS;
mRuntime = VMRuntime.getRuntime();
mDefaultUtilization = mRuntime.getTargetHeapUtilization();
log("Created and started PerfService thread");
// 接口中其他方法的实现
public void notifyAppState(String packName, String className, int state, int pid) {
//log("notifyAppState");
Message msg = mHandler.obtainMessage();
msg.what = PerfServiceThreadHandler.MESSAGE_NOTIFY_APP_STATE;
msg.obj = new PerfServiceAppState(packName, className, state, pid);
msg.sendToTarget();
private class PerfServiceThreadHandler extends Handler {
private static final int MESSAGE_NOTIFY_APP_STATE
public PerfServiceThreadHandler(Looper looper) {
super(looper);
public void handleMessage(Message msg) {
switch (msg.what) {
case MESSAGE_NOTIFY_APP_STATE:
PerfServiceAppState passedObject = (PerfServiceAppState) msg.
//log("MESSAGE_NOTIFY_APP_STATE");
// 通过调用native方法实现
nativePerfNotifyAppState(passedObject.mPackName, passedObject.mClassName,
passedObject.mState, passedObject.mPid);
passedObject =
} catch (NullPointerException e) {
loge("Exception in PerfServiceThreadHandler.handleMessage: " + e);
private void log(String info) {
Log.d("@M_" + TAG, "[PerfService] " + info + " ");
private void loge(String info) {
Log.e("@M_" + TAG, "[PerfService] ERR: " + info + " ");
再看PerfServiceImpl类的实现:
public class PerfServiceImpl extends IPerfService.Stub {
private static final String TAG = "PerfService";
private IPerfServiceManager perfServiceM
Context mC
class PerfServiceBroadcastReceiver extends android.content.BroadcastReceiver {
public void onReceive(Context context, Intent intent) {
final String action = intent.getAction();
if (Intent.ACTION_SCREEN_OFF.equals(action)) {
log("Intent.ACTION_SCREEN_OFF");
perfServiceMgr.userDisableAll();
else if (Intent.ACTION_SCREEN_ON.equals(action)) {
log("Intent.ACTION_SCREEN_ON");
perfServiceMgr.userRestoreAll();
log("Unexpected intent " + intent);
public PerfServiceImpl(Context context, IPerfServiceManager pm) {
perfServiceMgr =
mContext =
final IntentFilter broadcastFilter = new IntentFilter();
broadcastFilter.addAction(Intent.ACTION_SCREEN_OFF);
broadcastFilter.addAction(Intent.ACTION_SCREEN_ON);
mContext.registerReceiver(new PerfServiceBroadcastReceiver(), broadcastFilter);
public void notifyAppState(java.lang.String packName, java.lang.String className,
int state, int pid) {
perfServiceMgr.notifyAppState(packName, className, state, pid);
private void log(String info) {
Log.d("@M_" + TAG, "[PerfService] " + info + " ");
private void loge(String info) {
Log.e("@M_" + TAG, "[PerfService] ERR: " + info + " ");
public class PerfServiceImpl extends IPerfService.Stub {
private static final String TAG = "PerfService";
private IPerfServiceManager perfServiceM
Context mC
// 接收锁屏/开屏的广播
class PerfServiceBroadcastReceiver extends android.content.BroadcastReceiver {
public void onReceive(Context context, Intent intent) {
final String action = intent.getAction();
if (Intent.ACTION_SCREEN_OFF.equals(action)) {
log("Intent.ACTION_SCREEN_OFF");
perfServiceMgr.userDisableAll();
else if (Intent.ACTION_SCREEN_ON.equals(action)) {
log("Intent.ACTION_SCREEN_ON");
perfServiceMgr.userRestoreAll();
log("Unexpected intent " + intent);
public PerfServiceImpl(Context context, IPerfServiceManager pm) {
perfServiceMgr =
mContext =
final IntentFilter broadcastFilter = new IntentFilter();
broadcastFilter.addAction(Intent.ACTION_SCREEN_OFF);
broadcastFilter.addAction(Intent.ACTION_SCREEN_ON);
mContext.registerReceiver(new PerfServiceBroadcastReceiver(), broadcastFilter);
// aidl中声明的其他方法
public void notifyAppState(java.lang.String packName, java.lang.String className,
int state, int pid) {
//log("notifyAppState");
// 调用PerfServiceManager中的方法,最后调用的是native方法
perfServiceMgr.notifyAppState(packName, className, state, pid);
private void log(String info) {
Log.d("@M_" + TAG, "[PerfService] " + info + " ");
private void loge(String info) {
Log.e("@M_" + TAG, "[PerfService] ERR: " + info + " ");
在vendor\mediatek\proprietary\hardware\perfservice\mt**\app_list目录下的perfservapplist.txt文件中可以自定义应用白名单,默认值为:
CMD_SET_CPU_CORE_MIN com.imangi.templerun2 3
意思是用户使用“神庙逃亡”应用时,CPU最少核心数为3
在vendor\mediatek\proprietary\hardware\perfservice\mt**\scn_tbl目录下的perfservscntbl.txt文件中可以自定义场景,默认场景有:
CMD_SET_CPU_CORE_MIN, SCN_APP_TOUCH, 3
CMD_SET_CPU_FREQ_MIN, SCN_APP_TOUCH, 1014000
CMD_SET_CPU_CORE_MIN, SCN_SW_FRAME_UPDATE, 3
CMD_SET_CPU_FREQ_MIN, SCN_SW_FRAME_UPDATE, 1014000
CMD_SET_CPU_UP_THRESHOLD, SCN_SW_FRAME_UPDATE, 80
CMD_SET_CPU_DOWN_THRESHOLD, SCN_SW_FRAME_UPDATE, 65
CMD_SET_CPU_FREQ_BIG_LITTLE_MIN, SCN_APP_SWITCH, 44000
CMD_SET_CPU_CORE_BIG_LITTLE_MIN, SCN_APP_SWITCH, 4, 0
CMD_SET_VCORE, SCN_APP_SWITCH, 3
CMD_SET_CPU_FREQ_BIG_LITTLE_MIN, SCN_APP_ROTATE, 44000
CMD_SET_VCORE, SCN_APP_ROTATE, 3
CMD_SET_VCORE, SCN_GAMING, 1
Android CPU频率设置(MTK平台)
在MTK芯片上如何控制CPU的核数和频率-MTK PerfService
MTK 功耗优化(1)---MTK PerfService
高通GPU频率动态调整机制
高通---GPU&CPU频率和工作模式的获取设置
MTK PerfService(2)--PerfService的落地
MTK PerfService (2) - PerfService的落地
在MTK芯片上如何控制CPU的核心数和频率--MTK PerfService
PerfService介绍
MTK平台配置多核cpu oneline和gpu freq提升系统性能
没有更多推荐了,

我要回帖

更多关于 高通gpu驱动 的文章

 

随机推荐