Advertisement
Guest User

Untitled

a guest
Jan 24th, 2017
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.13 KB | None | 0 0
  1. diff --git a/power/performance.h b/power/performance.h
  2. index 0378842..d212779 100755
  3. --- a/power/performance.h
  4. +++ b/power/performance.h
  5. @@ -168,6 +168,26 @@ enum INTERACTIVE_TIMER_RATE_LVL_CPU4_8939 {
  6. TR_MS_CPU4_20 = 0x3BFD,
  7. };
  8.  
  9. +/* This timer rate applicable to big.little arch */
  10. +enum INTERACTIVE_TIMER_RATE_LVL_BIG_LITTLE {
  11. + BIG_LITTLE_TR_MS_100 = 0x64,
  12. + BIG_LITTLE_TR_MS_50 = 0x32,
  13. + BIG_LITTLE_TR_MS_40 = 0x28,
  14. + BIG_LITTLE_TR_MS_30 = 0x1E,
  15. + BIG_LITTLE_TR_MS_20 = 0x14,
  16. +};
  17. +
  18. +/* INTERACTIVE opcodes */
  19. +enum INTERACTIVE_OPCODES {
  20. + INT_OP_CLUSTER0_TIMER_RATE = 0x41424000,
  21. + INT_OP_CLUSTER1_TIMER_RATE = 0x41424100,
  22. + INT_OP_CLUSTER0_USE_SCHED_LOAD = 0x41430000,
  23. + INT_OP_CLUSTER1_USE_SCHED_LOAD = 0x41430100,
  24. + INT_OP_CLUSTER0_USE_MIGRATION_NOTIF = 0x41434000,
  25. + INT_OP_CLUSTER1_USE_MIGRATION_NOTIF = 0x41434100,
  26. + INT_OP_NOTIFY_ON_MIGRATE = 0x4241C000
  27. +};
  28. +
  29. enum INTERACTIVE_HISPEED_FREQ_LVL {
  30. HS_FREQ_1026 = 0xF0A,
  31. HS_FREQ_800 = 0xF08,
  32. diff --git a/power/power-8952.c b/power/power-8952.c
  33. index 119a3de..3462614 100644
  34. --- a/power/power-8952.c
  35. +++ b/power/power-8952.c
  36. @@ -106,87 +106,15 @@ static void set_power_profile(int profile) {
  37. int power_hint_override(struct power_module *module, power_hint_t hint,
  38. void *data)
  39. {
  40. - int duration, duration_hint;
  41. - static struct timespec s_previous_boost_timespec;
  42. - struct timespec cur_boost_timespec;
  43. - long long elapsed_time;
  44. - int resources_launch_boost[] = {
  45. - ALL_CPUS_PWR_CLPS_DIS,
  46. - SCHED_BOOST_ON,
  47. - SCHED_PREFER_IDLE_DIS,
  48. - 0x20f,
  49. - 0x4001,
  50. - 0x4101,
  51. - 0x4201,
  52. - };
  53. - int resources_cpu_boost[] = {
  54. - ALL_CPUS_PWR_CLPS_DIS,
  55. - SCHED_BOOST_ON,
  56. - SCHED_PREFER_IDLE_DIS,
  57. - 0x20d,
  58. - };
  59. - int resources_interaction_boost[] = {
  60. - SCHED_PREFER_IDLE_DIS,
  61. - 0x20d,
  62. - 0x3d01,
  63. - };
  64.  
  65. - if (hint == POWER_HINT_SET_PROFILE) {
  66. - set_power_profile(*(int32_t *)data);
  67. - return HINT_HANDLED;
  68. - }
  69. -
  70. - // Skip other hints in custom power modes
  71. - if (current_power_profile != PROFILE_BALANCED) {
  72. - return HINT_HANDLED;
  73. - }
  74. -
  75. - switch (hint) {
  76. - case POWER_HINT_INTERACTION:
  77. - duration = 500;
  78. - duration_hint = 0;
  79. -
  80. - if (data) {
  81. - duration_hint = *((int *)data);
  82. - }
  83. -
  84. - duration = duration_hint > 0 ? duration_hint : 500;
  85. -
  86. - clock_gettime(CLOCK_MONOTONIC, &cur_boost_timespec);
  87. - elapsed_time = calc_timespan_us(s_previous_boost_timespec, cur_boost_timespec);
  88. - if (elapsed_time > 750000)
  89. - elapsed_time = 750000;
  90. - // don't hint if it's been less than 250ms since last boost
  91. - // also detect if we're doing anything resembling a fling
  92. - // support additional boosting in case of flings
  93. - else if (elapsed_time < 250000 && duration <= 750)
  94. - return HINT_HANDLED;
  95. -
  96. - s_previous_boost_timespec = cur_boost_timespec;
  97. -
  98. - if (duration >= 1500) {
  99. - interaction(duration, ARRAY_SIZE(resources_cpu_boost),
  100. - resources_cpu_boost);
  101. - } else {
  102. - interaction(duration, ARRAY_SIZE(resources_interaction_boost),
  103. - resources_interaction_boost);
  104. - }
  105. - return HINT_HANDLED;
  106. - case POWER_HINT_LAUNCH_BOOST:
  107. - duration = 2000;
  108. - interaction(duration, ARRAY_SIZE(resources_launch_boost),
  109. - resources_launch_boost);
  110. - return HINT_HANDLED;
  111. - case POWER_HINT_CPU_BOOST:
  112. - duration = *(int32_t *)data / 1000;
  113. - if (duration > 0) {
  114. - interaction(duration, ARRAY_SIZE(resources_cpu_boost),
  115. - resources_cpu_boost);
  116. - }
  117. - return HINT_HANDLED;
  118. + switch(hint) {
  119. + case POWER_HINT_VSYNC:
  120. + break;
  121. case POWER_HINT_VIDEO_ENCODE:
  122. + {
  123. process_video_encode_hint(data);
  124. return HINT_HANDLED;
  125. + }
  126. }
  127. return HINT_NONE;
  128. }
  129. @@ -212,8 +140,9 @@ int set_interactive_override(struct power_module *module, int on)
  130. /* Display off. */
  131. if ((strncmp(governor, INTERACTIVE_GOVERNOR, strlen(INTERACTIVE_GOVERNOR)) == 0) &&
  132. (strlen(governor) == strlen(INTERACTIVE_GOVERNOR))) {
  133. - int resource_values[] = {TR_MS_CPU0_50, TR_MS_CPU4_50};
  134. -
  135. + int resource_values[] = {INT_OP_CLUSTER0_TIMER_RATE, BIG_LITTLE_TR_MS_50,
  136. + INT_OP_CLUSTER1_TIMER_RATE, BIG_LITTLE_TR_MS_50,
  137. + INT_OP_NOTIFY_ON_MIGRATE, 0x00};
  138. perform_hint_action(DISPLAY_STATE_HINT_ID,
  139. resource_values, ARRAY_SIZE(resource_values));
  140. } /* Perf time rate set for CORE0,CORE4 8952 target*/
  141. @@ -271,7 +200,20 @@ static void process_video_encode_hint(void *metadata)
  142. if ((strncmp(governor, INTERACTIVE_GOVERNOR,
  143. strlen(INTERACTIVE_GOVERNOR)) == 0) &&
  144. (strlen(governor) == strlen(INTERACTIVE_GOVERNOR))) {
  145. - int resource_values[] = {TR_MS_CPU0_30, TR_MS_CPU4_30};
  146. + /* Sched_load and migration_notif*/
  147. + int resource_values[] = {INT_OP_CLUSTER0_USE_SCHED_LOAD,
  148. + 0x1,
  149. + INT_OP_CLUSTER1_USE_SCHED_LOAD,
  150. + 0x1,
  151. + INT_OP_CLUSTER0_USE_MIGRATION_NOTIF,
  152. + 0x1,
  153. + INT_OP_CLUSTER1_USE_MIGRATION_NOTIF,
  154. + 0x1,
  155. + INT_OP_CLUSTER0_TIMER_RATE,
  156. + BIG_LITTLE_TR_MS_40,
  157. + INT_OP_CLUSTER1_TIMER_RATE,
  158. + BIG_LITTLE_TR_MS_40
  159. + };
  160. if (!video_encode_hint_sent) {
  161. perform_hint_action(video_encode_metadata.hint_id,
  162. resource_values,
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement