Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2d0e3ba8 authored by Pracheer's avatar Pracheer
Browse files

Perf: Make launch boost configurable for various msm

Launchboost is now controlled through a variable,
which can be set in a config.xml file. Also it takes
various parameters that could be msm specific and
are required to be set through target specific
config.xml.

Change-Id: I1e8fa64164d304e0764ed03a98dd10ac41497fc1
parent 628bc01b
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -2035,4 +2035,12 @@
    <!-- set to false if we dont need to consider data
         service state to display signal strength bars -->
    <bool name="config_combined_signal">true</bool>

    <!-- Whether cpu boost is enabled for AppLaunch -->
    <bool name="config_enableCpuBoostForAppLaunch">false</bool>
    <integer name="launchboost_timeout_param">0</integer>
    <integer name="launchboost_schedboost_param">0</integer>
    <integer name="launchboost_cpuboost_param">0</integer>
    <integer name="launchboost_pcdisbl_param">0</integer>
    <integer name="launchboost_ksmboost_param">0</integer>
</resources>
+9 −0
Original line number Diff line number Diff line
@@ -2167,4 +2167,13 @@
  <java-symbol type="bool" name="config_softap_extention" />

  <java-symbol type="bool" name="config_enable_mms_with_mobile_data_off" />

  <!-- cpu boost for AppLaunch -->
  <java-symbol type="bool" name="config_enableCpuBoostForAppLaunch" />
  <java-symbol type="integer" name="launchboost_timeout_param" />
  <java-symbol type="integer" name="launchboost_schedboost_param" />
  <java-symbol type="integer" name="launchboost_cpuboost_param" />
  <java-symbol type="integer" name="launchboost_pcdisbl_param" />
  <java-symbol type="integer" name="launchboost_ksmboost_param" />

</resources>
+0 −4
Original line number Diff line number Diff line
@@ -927,10 +927,6 @@ final class ActivityRecord {
            if (displayStartTime != 0) {
                reportLaunchTimeLocked(SystemClock.uptimeMillis());
            }
            if(mStackSupervisor.mIsPerfLockAcquired == true) {
                mStackSupervisor.mPerf.perfLockRelease();
                mStackSupervisor.mIsPerfLockAcquired = false;
            }
            mStackSupervisor.sendWaitingVisibleReportLocked(this);
            startTime = 0;
            finishLaunchTickingLocked();
+25 −5
Original line number Diff line number Diff line
@@ -143,7 +143,12 @@ public final class ActivityStackSupervisor implements DisplayListener {
    static final int SLEEP_TIMEOUT_MSG = FIRST_SUPERVISOR_STACK_MSG + 3;
    static final int LAUNCH_TIMEOUT_MSG = FIRST_SUPERVISOR_STACK_MSG + 4;
    public Performance mPerf = null;
    public boolean mIsPerfLockAcquired = false;
    public boolean mIsPerfBoostEnabled = false;
    public int lBoostTimeOut = 0;
    public int lBoostCpuBoost = 0;
    public int lBoostSchedBoost = 0;
    public int lBoostPcDisblBoost = 0;
    public int lBoostKsmBoost = 0;
    static final int HANDLE_DISPLAY_ADDED = FIRST_SUPERVISOR_STACK_MSG + 5;
    static final int HANDLE_DISPLAY_CHANGED = FIRST_SUPERVISOR_STACK_MSG + 6;
    static final int HANDLE_DISPLAY_REMOVED = FIRST_SUPERVISOR_STACK_MSG + 7;
@@ -301,6 +306,21 @@ public final class ActivityStackSupervisor implements DisplayListener {
    public ActivityStackSupervisor(ActivityManagerService service) {
        mService = service;
        mHandler = new ActivityStackSupervisorHandler(mService.mHandler.getLooper());
        /* Is perf lock for cpu-boost enabled during App 1st launch */
        mIsPerfBoostEnabled = mService.mContext.getResources().getBoolean(
                   com.android.internal.R.bool.config_enableCpuBoostForAppLaunch);
        if(mIsPerfBoostEnabled) {
           lBoostSchedBoost = mService.mContext.getResources().getInteger(
                   com.android.internal.R.integer.launchboost_schedboost_param);
           lBoostTimeOut = mService.mContext.getResources().getInteger(
                   com.android.internal.R.integer.launchboost_timeout_param);
           lBoostCpuBoost = mService.mContext.getResources().getInteger(
                   com.android.internal.R.integer.launchboost_cpuboost_param);
           lBoostPcDisblBoost = mService.mContext.getResources().getInteger(
                   com.android.internal.R.integer.launchboost_pcdisbl_param);
           lBoostKsmBoost = mService.mContext.getResources().getInteger(
                   com.android.internal.R.integer.launchboost_ksmboost_param);
       }
    }

    /**
@@ -2638,12 +2658,12 @@ public final class ActivityStackSupervisor implements DisplayListener {
            }
        }
        /* Acquire perf lock during new app launch */
        if (mPerf == null) {
        if (mIsPerfBoostEnabled == true && mPerf == null) {
            mPerf = new Performance();
        }
        if (mPerf != null && mIsPerfLockAcquired == false) {
            mPerf.perfLockAcquire(2000,0x1E01,0x20D,0x1C00);
            mIsPerfLockAcquired = true;
        if (mPerf != null) {
            mPerf.perfLockAcquire(lBoostTimeOut, lBoostPcDisblBoost, lBoostSchedBoost,
                                  lBoostCpuBoost, lBoostKsmBoost);
        }

        if (DEBUG_TASKS) Slog.d(TAG, "No task found");