Fixes for kernel compile w/ 4.8

Change-Id: I82fa63d95b567a77063b70df0076e8ba6b443da0
Add more optimization levels

Change-Id: Icd73c785211ef0756ec7bbe7f8eff5067d32371e
Makefile: Add more optimization levels
Defconfig:  Add more optimization levels
Signed-off-by: RobbieL811 <RobbieLancaster811@gmail.com>
Fixes for Linaro GCC 4.9 [SQUASHED]

Change-Id: I3dfa1bad3e6218c16218172bc7dd4808bec98950
Signed-off-by: RobbieL811 <RobbieLancaster811@gmail.com>
msm8974: Add ultra-low-latency audio instance

 * Replace deprecated LPA output with new ULL feature.

Change-Id: I81bcf998ccf0740509a40d9c166dad07d7337bf3
block: fiops ioscheduler core

FIOPS (Fair IOPS) ioscheduler is IOPS based ioscheduler, so only targets
for drive without I/O seek. It's quite similar like CFQ, but the dispatch
decision is made according to IOPS instead of slice.

The algorithm is simple. Drive has a service tree, and each task lives in
the tree. The key into the tree is called vios (virtual I/O). Every request
has vios, which is calculated according to its ioprio, request size and so
on. Task's vios is the sum of vios of all requests it dispatches. FIOPS
always selects task with minimum vios in the service tree and let the task
dispatch request. The dispatched request's vios is then added to the task's
vios and the task is repositioned in the sevice tree.

Unlike CFQ, FIOPS doesn't have separate sync/async queues, because with I/O
less writeback, usually a task can only dispatch either sync or async requests.
Bias read or write request can still be done with read/write scale.

One issue is if workload iodepth is lower than drive queue_depth, IOPS
share of a task might not be strictly according to its priority, request
size and so on. In this case, the drive is in idle actually. Solving the
problem need make drive idle, so impact performance. I believe CFQ isn't
completely fair between tasks in such case too.

Change-Id: I7779e4edc64bf1a534a1c7eb82ed510bfcd2dd29
Signed-off-by: Shaohua Li <shaohua.li@intel.com>
Signed-off-by: RobbieL811 <RobbieLancaster811@gmail.com>
block: fiops read/write request scale

read/write speed of Flash based storage usually is different. For example,
in my SSD maxium thoughput of read is about 3 times faster than that of
write. Add a scale to differenate read and write. Also add a tunable, so
user can assign different scale for read and write.

By default, the scale is 1:1, which means the scale is a noop.

Change-Id: I028363d76b56adb00d74dbbda76cb4eb5ed42e3b
Signed-off-by: Shaohua Li <shaohua.li@intel.com>
Signed-off-by: RobbieL811 <RobbieLancaster811@gmail.com>
block: fiops sync/async scale

CFQ gives 2.5 times more share to sync workload. This matches CFQ.

Note this is different with the read/write scale. We have 3 types of
requests:
1. read
2. sync write
3. write
CFQ doesn't differentitate type 1 and 2, but request cost of 1 and 2
are usually different for flash based storage. So we have both sync/async
and read/write scale here.

Change-Id: I10e0405dce90415777d1196fa90f146fc937dbe0
Signed-off-by: Shaohua Li <shaohua.li@intel.com>
Signed-off-by: RobbieL811 <RobbieLancaster811@gmail.com>
block: fiops add ioprio support

Add CFQ-like ioprio support. Priority A will get 20% more share than priority
A+1, which matches CFQ.

Change-Id: Iad9e5c1191d55347ccb3d9b6d9baabfd5c522542
Signed-off-by: Shaohua Li <shaohua.li@intel.com>
Signed-off-by: RobbieL811 <RobbieLancaster811@gmail.com>
block: fiops preserve vios key for deep queue depth workload

If the task has running request, even it's added into service tree newly,
we preserve its vios key, so it will not lost its share. This should work
for task driving big queue depth. For single depth task, there is no approach
to preserve its vios key.

Change-Id: I79061274c56f761e3cae93c6b13e72958ddd8e86
Signed-off-by: Shaohua Li <shaohua.li@intel.com>
Signed-off-by: RobbieL811 <RobbieLancaster811@gmail.com>
block: fiops bias sync workload

If there are async requests running, delay async workload. Otherwise
async workload (usually very deep iodepth) will use all queue iodepth
and later sync requests will get long delayed. The idea is from CFQ.

Change-Id: I4df70736165bcfc6d6996f5e36db8f3a0b83668c
Signed-off-by: Shaohua Li <shaohua.li@intel.com>
Signed-off-by: RobbieL811 <RobbieLancaster811@gmail.com>
block: fiops add some trace information

Add some trace information, which is helpful when I do debugging.

Change-Id: I51481570ca191f7bd4bac702268981ea9f22d0bb
Signed-off-by: Shaohua Li <shaohua.li@intel.com>
Signed-off-by: RobbieL811 <RobbieLancaster811@gmail.com>
Defconfig: Add and enable FIOPS io scheduler

Change-Id: I88de92fda2248f33072e31b0a03ed5e2f2d1bb85
Signed-off-by: RobbieL811 <RobbieLancaster811@gmail.com>
msm8974: Adjust ROI horizonal alignment to 4 pixels

 * Eliminate another case (keyboard window + chrome + dim layer) where
   partial update may have issues.

Change-Id: Ie939c4d453b4c5c34e31cdd81c05fc4372a0ce05