power: don't use SCROLL_PREFILING

The current use of the SCROLL_PREFILING hint hurts scroll performance
and results in a lot of dropped frames.

The hint ID corresponding to SCROLL_PREFILING only takes into effect for
a default timeout value of 80 ms (as found in perfboostsconfig.xml),
while the duration value in the process_interaction_hint function runs
for a much longer time, from 1500 ms up to 5000 ms (bounds of
kMinFlingDuration and kMaxInteractiveDuration). During the period
of time, when the timeout value has elapsed and current time is less
than duration, another interaction hint cannot be processed. Therefore,
if the user decides to scroll during this period, high frame drops can be
experienced as the CPU freq isn't raised by processing another hint to
account for this additional scrolling.
By only using SCROLL_VERTICAL, fluidity can be maintained, improving user
experience.

Furthmore, kMinInteractiveDuration has been lowered to 400 ms for some
platforms as it is more than sufficient to maintain fluidity (minimal
frames dropped) while scrolling.

Change-Id: I42edd07a67c7dca43a10ae2fa1b44b64b7794b43
diff --git a/power-660.c b/power-660.c
index 66a9e46..e7daa08 100644
--- a/power-660.c
+++ b/power-660.c
@@ -54,8 +54,7 @@
 
 const int kMaxLaunchDuration = 5000; /* ms */
 const int kMaxInteractiveDuration = 5000; /* ms */
-const int kMinInteractiveDuration = 500; /* ms */
-const int kMinFlingDuration = 1500; /* ms */
+const int kMinInteractiveDuration = 400; /* ms */
 
 static int video_encode_hint_sent;
 
@@ -305,11 +304,7 @@
     s_previous_boost_timespec = cur_boost_timespec;
     s_previous_duration = duration;
 
-    if (duration >= kMinFlingDuration) {
-        perf_hint_enable_with_type(VENDOR_HINT_SCROLL_BOOST, -1, SCROLL_PREFILING);
-    } else {
-        perf_hint_enable_with_type(VENDOR_HINT_SCROLL_BOOST, duration, SCROLL_VERTICAL);
-    }
+    perf_hint_enable_with_type(VENDOR_HINT_SCROLL_BOOST, duration, SCROLL_VERTICAL);
 }
 
 int power_hint_override(power_hint_t hint, void *data)
diff --git a/power-845.c b/power-845.c
index cf3eed7..c7ddd04 100644
--- a/power-845.c
+++ b/power-845.c
@@ -57,7 +57,6 @@
 const int kMaxLaunchDuration = 5000; /* ms */
 const int kMaxInteractiveDuration = 5000; /* ms */
 const int kMinInteractiveDuration = 100; /* ms */
-const int kMinFlingDuration = 1500; /* ms */
 
 static int display_fd;
 
@@ -253,11 +252,8 @@
     s_previous_boost_timespec = cur_boost_timespec;
     s_previous_duration = duration;
 
-    if (duration >= kMinFlingDuration) {
-        perf_hint_enable_with_type(VENDOR_HINT_SCROLL_BOOST, -1, SCROLL_PREFILING);
-    } else {
-        perf_hint_enable_with_type(VENDOR_HINT_SCROLL_BOOST, duration, SCROLL_VERTICAL);
-    }
+    perf_hint_enable_with_type(VENDOR_HINT_SCROLL_BOOST, duration, SCROLL_VERTICAL);
+
     return HINT_HANDLED;
 }
 
diff --git a/power-8937.c b/power-8937.c
index 2dcff8c..fb4643f 100644
--- a/power-8937.c
+++ b/power-8937.c
@@ -53,7 +53,6 @@
 const int kMaxLaunchDuration = 5000; /* ms */
 const int kMaxInteractiveDuration = 5000; /* ms */
 const int kMinInteractiveDuration = 500; /* ms */
-const int kMinFlingDuration = 1500; /* ms */
 
 static int video_encode_hint_sent;
 
@@ -252,12 +251,7 @@
     s_previous_boost_timespec = cur_boost_timespec;
     s_previous_duration = duration;
 
-    if (duration >= kMinFlingDuration) {
-        // Use launch boost resources for fling boost
-        perf_hint_enable_with_type(VENDOR_HINT_FIRST_LAUNCH_BOOST, -1, LAUNCH_BOOST_V1);
-    } else {
-        perf_hint_enable_with_type(VENDOR_HINT_SCROLL_BOOST, duration, SCROLL_VERTICAL);
-    }
+    perf_hint_enable_with_type(VENDOR_HINT_SCROLL_BOOST, duration, SCROLL_VERTICAL);
 }
 
 int power_hint_override(power_hint_t hint, void *data)
diff --git a/power-8953.c b/power-8953.c
index ee073ed..37296cc 100644
--- a/power-8953.c
+++ b/power-8953.c
@@ -55,7 +55,6 @@
 const int kMaxLaunchDuration = 5000; /* ms */
 const int kMaxInteractiveDuration = 5000; /* ms */
 const int kMinInteractiveDuration = 500; /* ms */
-const int kMinFlingDuration = 1500; /* ms */
 
 static int current_power_profile = PROFILE_BALANCED;
 
@@ -341,12 +340,7 @@
     s_previous_boost_timespec = cur_boost_timespec;
     s_previous_duration = duration;
 
-    if (duration >= kMinFlingDuration) {
-        // Use launch boost resources for fling boost
-        perf_hint_enable_with_type(VENDOR_HINT_FIRST_LAUNCH_BOOST, -1, LAUNCH_BOOST_V1);
-    } else {
-        perf_hint_enable_with_type(VENDOR_HINT_SCROLL_BOOST, duration, SCROLL_VERTICAL);
-    }
+    perf_hint_enable_with_type(VENDOR_HINT_SCROLL_BOOST, duration, SCROLL_VERTICAL);
 
     return HINT_HANDLED;
 }
diff --git a/power-8996.c b/power-8996.c
index d0f6b58..dae575b 100644
--- a/power-8996.c
+++ b/power-8996.c
@@ -55,7 +55,6 @@
 const int kMaxLaunchDuration = 5000; /* ms */
 const int kMaxInteractiveDuration = 5000; /* ms */
 const int kMinInteractiveDuration = 500; /* ms */
-const int kMinFlingDuration = 1500; /* ms */
 
 static int current_power_profile = PROFILE_BALANCED;
 
@@ -332,12 +331,7 @@
     s_previous_boost_timespec = cur_boost_timespec;
     s_previous_duration = duration;
 
-    if (duration >= kMinFlingDuration) {
-        // Use launch boost resources for fling boost
-        perf_hint_enable_with_type(VENDOR_HINT_FIRST_LAUNCH_BOOST, -1, LAUNCH_BOOST_V1);
-    } else {
-        perf_hint_enable_with_type(VENDOR_HINT_SCROLL_BOOST, duration, SCROLL_VERTICAL);
-    }
+    perf_hint_enable_with_type(VENDOR_HINT_SCROLL_BOOST, duration, SCROLL_VERTICAL);
 
     return HINT_HANDLED;
 }
diff --git a/power-8998.c b/power-8998.c
index 6fb0ff9..15d158a 100644
--- a/power-8998.c
+++ b/power-8998.c
@@ -55,8 +55,7 @@
 
 const int kMaxLaunchDuration = 5000; /* ms */
 const int kMaxInteractiveDuration = 5000; /* ms */
-const int kMinInteractiveDuration = 500; /* ms */
-const int kMinFlingDuration = 1500; /* ms */
+const int kMinInteractiveDuration = 400; /* ms */
 
 static int current_power_profile = PROFILE_BALANCED;
 
@@ -328,11 +327,7 @@
     s_previous_boost_timespec = cur_boost_timespec;
     s_previous_duration = duration;
 
-    if (duration >= kMinFlingDuration) {
-        perf_hint_enable_with_type(VENDOR_HINT_SCROLL_BOOST, -1, SCROLL_PREFILING);
-    } else {
-        perf_hint_enable_with_type(VENDOR_HINT_SCROLL_BOOST, duration, SCROLL_VERTICAL);
-    }
+    perf_hint_enable_with_type(VENDOR_HINT_SCROLL_BOOST, duration, SCROLL_VERTICAL);
 
     return HINT_HANDLED;
 }