msm: mdss: Display gamma control

TODO: confirm rgb channels, identify other tunables, cleanup,
apply values without switching screen (off and) on.

sysfs: /sys/devices/qcom,mdss_dsi_jdi_command_ors.69/*
Signed-off-by: Dan Trifan <jimsth@gmail.com>
msm: mdss: Apply commands values without switching screen (off and) on

Signed-off-by: Dan Trifan <jimsth@gmail.com>
msm: mdss: Remove tunable for command 32

Even slight changes look ugly or distort the screen.

Signed-off-by: Dan Trifan <jimsth@gmail.com>
msm: mdss: distinguish between Gamma RGB polarity Positive/Negative

Signed-off-by: Paul Reioux <reioux@gmail.com>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
msm: mdss: Remove sysfs for unused commands

Signed-off-by: Dan Trifan <jimsth@gmail.com>
msm: mdss: Identify white point in sysfs

Signed-off-by: Dan Trifan <jimsth@gmail.com>
msm: mdss: Add safety check for user input

Leave more checks either to the control app or the user's intelligence.

Signed-off-by: Dan Trifan <jimsth@gmail.com>
msm: mdss: Finalize gamma interface and cleanup

- Remove all sysfs files of unused commands
- Remove auto sync for negative polarities, these must be written separately
- Protect offset bit of white point command as well
- Apply white point bit 2 as duplicate of bit 1

Signed-off-by: Dan Trifan <jimsth@gmail.com>
msm: mdss: Send panel commands via separate function

Sending panel comnmands is very expensive, add a separate function to
accomplish this. Once all commands have been stored write anything to
the kgamma_send file.

Signed-off-by: Dan Trifan <jimsth@gmail.com>
msm: mdss: Add hardware revision check

Our gamma interface works with both current hardware revisions,
11 and 11j, although all testing was carried out on 11. As we
don't know about possible future revisions, let's bail out until
correct offsets for panel commands have been added.

Signed-off-by: Dan Trifan <jimsth@gmail.com>
msm: mdss: Use workqueue to send panel commands

Sending panel commands is known to be expensive, honor this by
scheduling this task. Also check for panel state and send commands
only when we're actually awake.

These fixes adress bug reports regarding behaviour during boot.

Signed-off-by: Dan Trifan <jimsth@gmail.com>
msm: mdss: Find a stable sysfs node for the gamma interface

Move sysfs files to /sys/module/dsi_panel/*

Signed-off-by: Dan Trifan <jimsth@gmail.com>
defconfig: log L1 cache errors

Signed-off-by: Dan Trifan <jimsth@gmail.com>
Input: Send events one packet at a time

On heavy event loads, such as a multitouch driver, the irqsoff latency
can be as high as 250 us.  By accumulating a frame worth of data
before passing it on, the latency can be dramatically reduced.  As a
side effect, the special EV_SYN handling can be removed, since the
frame is now atomic.

This patch adds the events() handler callback and uses it if it
exists. The latency is improved by 50 us even without the callback.

Change-Id: Iebd9b1868ae6300a922a45b6d104e7c2b38e4cf5
Cc: Daniel Kurtz <djkurtz@chromium.org>
Tested-by: Benjamin Tissoires <benjamin.tissoires@enac.fr>
Tested-by: Ping Cheng <pingc@wacom.com>
Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>

Input: Improve the events-per-packet estimate

The events-per-packet estimate has so far been used by MT devices
only. This patch adjusts the packet buffer size to also accomodate the
KEY and MSC events.  Keyboards normally send one or two keys at a
time. MT devices normally send a number of button keys along with the
MT information.  The buffer size chosen here covers those cases, and
matches the default buffer size in evdev. Since the input estimate is
now preferred, remove the special input-mt estimate.

Reviewed-and-tested-by: Ping Cheng <pingc@wacom.com>
Tested-by: Benjamin Tissoires <benjamin.tissoires@enac.fr>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
defconfig: set proper CPU min/max speeds

Signed-off-by: Dan Trifan <jimsth@gmail.com>
net: loopback: set default mtu to 64K

loopback current mtu of 16436 bytes allows no more than 3 MSS TCP
segments per frame, or 48 Kbytes. Changing mtu to 64K allows TCP
stack to build large frames and significantly reduces stack overhead.

Performance boost on bulk TCP transferts can be up to 30 %, partly
because we now have one ACK message for two 64KB segments, and a lower
probability of hitting /proc/sys/net/ipv4/tcp_reordering default limit.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
arm/dt: msm8974: Lower GPU voltage constraints

Signed-off-by: Dan Trifan <jimsth@gmail.com>
PM: devfreq: Fix simple_ondemand crashing on startup

Signed-off-by: Dan Trifan <jimsth@gmail.com>
PM: devfreq: Add sysfs nodes for devfreq governors

Signed-off-by: Dan Trifan <jimsth@gmail.com>
PM: devfreq: Move governor node to gpufreq

Final path is: /sys/class/devfreq/fdb00000.qcom,kgsl-3d0/gpufreq

Signed-off-by: Dan Trifan <jimsth@gmail.com>