[Galaxy Note 3 Android Development] temasek:
Temasek Kernel v3.96

Changelog since v3.95

ARM: dts: msm: i2c: change clock rates to 19.2 MHz

- derived from Qualcomm

net: Performance fix for process_backlog

In process_backlog the input_pkt_queue is only checked once for new

packets and quota is artificially reduced to reflect precisely the

number of packets on the input_pkt_queue so that the loop exits

appropriately.

This patches changes the behavior to be more straightforward and

less convoluted. Packets are processed until either the quota

is met or there are no more packets to process.

This patch seems to provide a small, but noticeable performance

improvement. The performance improvement is a result of staying

in the process_backlog loop longer which can reduce number of IPI's.

Performance data using super_netperf TCP_RR with 200 flows:

Before fix:

88.06% CPU utilization

125/190/309 90/95/99% latencies

1.46808e+06 tps

1145382 intrs.sec.

With fix:

87.73% CPU utilization

122/183/296 90/95/99% latencies

1.4921e+06 tps

1021674.30 intrs./sec.

SELinux: possible NULL deref in context_struct_to_string

It's possible that the caller passed a NULL for scontext. However if this

is a defered mapping we might still attempt to call *scontext=kstrdup().

This is bad. Instead just return the len.

SELinux: use ARRAY_SIZE

ARRAY_SIZE is more concise to use when the size of an array is divided

by the size of its type or the size of its first element.

Revert "qup_i2c: Initialize I2C resource before registering."

- One of cause of battery drainage

msm: mdss: move MDSS revision macros to /linux/msm_mdp.h

Currently kernel driver and user mode libraries keep their own

copies of HW revision numbers. This strategy is prone to errors

and usually frowned upon. Fix this by moving revision information

to sanitized header which is shared by kernel drivers and user mode

libraries.

Revert "Revert "msm: vidc: Free OCMEM during power collapse""

- This ""msm: vidc: Free OCMEM during power collapse" was my hrs of seek & destory and found it was the cause of the infamous YouTube 720p prolong pause issue. As I've no solution to fix it, reverting it fixes the YouTube issue but the following commit is a better solution hence I've restored the commit and uses the following commit to fix it.

msm: vidc: Don't free OCMEM when there is an open video instance

Currently, vidc enters power collapse after a video has been paused

for 10 seconds; however, the video instance is not closed. Resuming

the video after vidc has entered power collapse causes our vidc

firmware to crash, thus breaking video functionality until the device

is rebooted.

Not freeing OCMEM during power collapse in the middle of an open

video instance works around this issue and is good enough until

the underlying issue has been fixed.

msm: mdss: change MDP writeback priority

Default priority for writeback is set to lowest, which can lead to other

clients' requests to come before MDP writeback. Change the priority to

P1 to match the rotator fetch QoS settings.

msm: mdss: Acquire shared lock after getting frame on wfd

Currently there is a deadlock when wfd and rotation is done

simultaneously and trying to acquire the shared lock. To

prevent this, acquire shared lock after rotated frame is

ready for wfd.

video: mdss: Remove stray mutex lock

arm/dt: Update Samsung DT for recent MDSS changes

msm: mdss: synchronize recovery handler access

The recovery handler is used in the dsi event thread, and

the recovery handler variable was configured from a different

thread. Earlier, there is no synchronization between the two

threads accessing the recovery handler, causing kernel panics.

msm: mdss: Cancel ESD workqueue whenever display off happens

Display can be turned off by using different ioctls. Make sure that

in all the cases ESD workqueue is cancelled.

msm: mdss: Dynamically enabling ESD

Allow the check_status interval time to be configurable via /sys interface.

Allow the dsi_check_status function to be enabled or disabled via /sys interface

Combine MDP3 & MDP5 code and separate the platform specific code.

mdss: mdp: fix incorrect programming of scalar enable

In use-cases where scaling is required in one direction

and not on other, scalar extension parameter will be set

to update the scale register. Add proper check to this enable

scale bit only in the required direction.

msm: mdss: Support scalar programming for all usecases

Program scalar registers for both RGB and VIG pipes

when requested by the user. The scalar factors are

also computed by the user.

msm: mdss: Increase commit count for first kickoff

During panel unblank a kickoff is done to turn on the panel so that the

first update is not delayed. It is also used to give buffer to command

mode panel prior to enabling backlight prevent junk data from appearing.

In order to prevent release fence timeline from being signaled too

early we will increase the commit count. This allow next sync point

to be added to the appropriate point on timeline, instead of relying

on frame done being called before sync/commit calls.

msm: display: only release kickoff when no cleanup pipe

If there is some pipe to clean up, need wait for it be done to

make sure the pipe can be used for the second cycle and recover

mode can be executed.

msm: mdss: Move histogram completion initialization to pp_init

The histogram completion structure only needs to be initialized fully

once, and this can be done when the pp resource structure is created.

Otherwise, when enabling the histograms, it is sufficient to use the

reusable INIT_COMPLETION, in order to avoid any wait_queue errors.

mdss: Dynamic timeout calculation for cmd stop

Time out condition was hard coded to 60 fps. If dynamic fps

feature was used, an invalid timeout might occur.

msm: mdss: Turn off backlight while power off

Turn off the backlight while shut down panel as it

could show white flicker depending on the panel.

msm: mdss: Reading IGC and PGC LUT from cached values

Certain targets like msm8226 do not have capability of reading

IGC and PGC LUT from hardware registers.

Adding functions to read the LUT values from software cache.

msm: mdss: Copy IGC LUT data correctly to userspace

During IGC read operation, IGC LUT's data was copied to

userspace incorrectly because of swapping color components.

Fix component data swapping during IGC LUT data copy to

user space to provide the correct IGC LUT data to user space.

msm: mdss: Correct ARGC read write for all DSPP

Currently ARGC read write is done for DSPP0 irrespective of

dspp_num, as the dspp_num corresponding to the block provided

is not calculated.

Added the calculation of the dspp_num to get correct address

of ARGC registers.

ARM: dts: mdss: Add boolean property for LUT readability

LUT read is not supported by hardware in the case of msm8226.

Adding property to dtsi file to denote the absense of support

for read in hardware.

msm: mdss: Enable EOT packets for DSI

Expose properties to enable ignoring and appending of

EOT packets for DSI panels.

msm: mdss: perform proper clock handoff during cont. splash screen

During continuous splash screen need to ensure clocks are properly ref

counted once and released once handoff has happened. Doing it in

different places can lead to improper order and cause clocks to be

disabled. Fix this by centralizing this into footswitch ctrl which is

called when continous splash screen is enabled.

msm: mdss: Fix BWC width alignment

BWC src width is segmented into 16 aligned RAUs. The segmentation

into 16 RAUs needs to be rounded up for corner cases.

msm: mdss: Reserve single SMP block for writeback mixer pipes

Writeback does not have stringent requirement for latency

buffers. So, SMP blocks reservation for the pipes attached

to writeback block can be restricted to single SMP block for

each plane. This makes more SMP block available for other

clients.

mdss: display: use local_clock() instead of ktime for xlog

For better analysis, time stamp of xlog should synchronize with

the time stamp of printk. Use local_clock() to log time stamp.

msm: mdss: Notify userspace of idle screen case

Expose two new sysfs nodes - idle_time and idle_notify - that

are used to notify userspace whenever the display is idle with

no screen updates. The idle_time node needs to be configured

with the duration in milliseconds to detect no screen updates.

The userspace app can poll on the idle_notify node to get

notifications of the idle state.

video: mdss: Cleanup Samsung bits after merge

msm: mdss: apply BW fudge factor to all controllers when video mode present

If there is a video mode controller enabled and other controllers

non-video mode, current display driver apply the bw fudge factor

only to the controller that it is video mode.

This change will apply the fudge factor to all the

controllers enabled if any of those it is video mode to

fix some of the underruns observed in the video interfaces.

msm: mdss: Fix check for highest of overlap and prefill bw calc

This check is supposed to be used to get the max between overlap and

prefill bandwidth value. This value is used when calculating the ib

bandwidth value to request when bus bandwidth is updated. Having a value

that is too low results in mdp underrun.

msm: mdss: remove unnecessary mutex lock.

Remove additional mutex lock at the time of releasing retire

fences.

msm: mdss: Prevent modification to image roi when scaling

If pixel extension is enabled by scaler, and layer content is

deinterlaced, the modifications to the layers region of interest

to be used by mdp hw has already been modified. We should not

further changing these values.

msm: mdss: ensure retire fences are signaled during panel off

When turning off command mode panel, if retire fences are still active

and suspend sequence goes through some fences may remain active.

If fences remain active command panel off sequence would stop signaling

vsyncs and would throw off the timeline. To fix this clear the retire

timeline when turning panel off.

msm: mdss: add property to set from device tree the overlap BW fudge factor

Current calculations apply one fudge factor to the final bandwidth

regardless if this is a result from the overlap or prefill calculation.

With this change the final bandwidth can be tuned up to apply a different

fudge factor when the bandwidth depends on the overlap calculation.

msm: mdss: protect command mode BW votes by tracking HW/SW states

Track two states where the BW is needed for the command mode panels

and prevent the BW vote to be released during any of those two states:

1. SW Commit State: This state is the time when the SW has requested

a BW vote, and it will be processing it; it starts at the beginning of

Commit and finish once the kickoff is issued.

2. HW MDP State: This state is the time when the HW is busy

doing the actual transaction, so bandwidth must be kept until

HW finishes; it starts at the beginning of the kickoff and finishes

once the ping pong done interrupt is received.

msm: mdss: add real time debug log

To analyze issues like underruns and other timing issues

add xlogs. Add debugfs entry for xlog to enable or disable

logging and register dumping at run time.

msm: mdss: Fix mdp clock rate assignment when apply fudge is false

When apply fudge is false, currently mdp clock rate can take

garbage values, hence assign the calculated clock rate without

applying any fudge factors.

msm: mdss: MDP clock optimization for single layer video playback

MDP core clock bumping is not required for single layer video

playback in 8x26 targets. Hence add revision check to avoid fudge

factor.

msm: mdss: Perform bandwidth check before applying any fudge

Earlier the bandwidth check is done after applying an ib_fudge.

This causes some valid use cases to fall back to GPU. Perform

bandwidth check against the actual value without considering

any fudges.

tspdrv: Move vibrator sysfs node

asoc: msm: Check headset insertion for consistency

* It's possible to get a noisy reading during polling when

transitioning to PLUG_TYPE_HEADSET. Poll again to double

check that it's really a headset.

* This helps when music is at full volume and a headphone

is inserted. Double-checking the reading vastly improves

the case where a noisy reading causes a mic to be detected.

ext4: Speedup WB_SYNC_ALL pass called from sync(2)

When doing filesystem wide sync, there's no need to force transaction

commit (or synchronously write inode buffer) separately for each inode

because ext4_sync_fs() takes care of forcing commit at the end (VFS

takes care of flushing buffer cache, respectively). Most of the time

this slowness doesn't manifest because previous WB_SYNC_NONE writeback

doesn't leave much to write but when there are processes aggressively

creating new files and several filesystems to sync, the sync slowness

can be noticeable. In the following test script sync(1) takes around 6

minutes when there are two ext4 filesystems mounted on a standard SATA

drive. After this patch sync takes a couple of seconds so we have about

two orders of magnitude improvement.

intellithemal v2: an in-kernel thermal monitor for Qualcomm 8974+ SOCs

intellithermal version 2 is based originally from Qualcomm's repo adapted to

operate as a standalone in-kernel thermal throttling worker. It can read

DTS entries for configuration as well as sysfs tunable knobs for both compile

time and run time configurations.

this kernel worker can completely replace the closed source thermald and

thermal-engine daemons from Qualcomm.

Revert "intelliactive: be aware of SEC_PM"

android: logger: resized to 128kb

Sound Control: add line gain to cached and register lock

- bump version to 3.6 (FauxSound)

staging: android: logger: fixed checkpatch.pl warnings.

Staging: android: timed_gpio.c: improved logic of gpio_get_time()

This patch improves the logic of gpio_get_time() and, thereafter,

makes checkpatch.pl happy.

Enjoy :)