msm: mdss: Display gamma control

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
mdss: dsi: Resolving memory leak in parse dsi commands

Free buf variable before exiting function in error cases
in order to avoid possible memory leaks.

Signed-off-by: Krishna Chaitanya Parimi <cparimi@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: mdss: remove interruptible timeout waits

Currently display driver contexts are not utilizing interruptible
wake-ups while using wait_for_completion_interruptible_timeout. This
can lead to incorrect context wake-up and un-predictable outcome. Since
there is already a timeout attached to these kind of context sleeps, it
is safe to replace them with wait_for_completion_timeout.

Signed-off-by: Ujwal Patel <ujwalp@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: Use ammended interruptible threads

Use ammended interruptible threads to reduce high load avg.

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: mdss: Make notify update waits interruptible

Wait for completion in notify update call are uninterruptible
causing excessive delay during suspend cases. Making them
interruptible.

Signed-off-by: Krishna Chaitanya Parimi <cparimi@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
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.

Signed-off-by: Shuo Yan <shuoy@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: mdss: Add missing BL lock around BL-related info

The bl_updated variable requires the BL lock. Otherwise, it can be
corrupted and cause backlight issues.

Signed-off-by: Benet Clark <benetc@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: mdss: control backlight level during blank and unblank events

Add code to set the backlight level to zero for blank event
and restore the backlight level to its previous value during
unblank event. This will fix any unexpected panel flicker
that might show up on the screen during panel ON sequence.

Signed-off-by: Chandan Uddaraju <chandanu@codeaurora.org>
Signed-off-by: Benet Clark <benetc@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: mdss: fb: null check mfd data

Add appropriate null check for mfd data structure
before accessing it's members. This prevents null
pointer accesses in the driver.

Signed-off-by: Manoj Rao <manojraj@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: mdss: Add error handling in mdss_fb_no_update_notify_timer_cb

Return in case mfd is NULL to avoid NULL pointer dereference.

Signed-off-by: Jayant Shekhar <jshekhar@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: mdss: Fix for bus bandwidth issue

Fixing possible large values handling.

Signed-off-by: Radhika Ranjan Soni <rrsoni@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
mdss: display: remove the pwm gpio request from edp backlight

There is no use of the pwm gpio inside the driver so cleaning up the code
and removing it from devicetree.

Signed-off-by: Asaf Penso <apenso@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: mdss: cleanup MDP3 driver compilation

Enable MDP3 driver compilation only on chip-sets where MDP3 core is
present. This helps reduce the size of kernel binary where MDP3 is
not present.

Signed-off-by: Ujwal Patel <ujwalp@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: mdss: Validate input argument

MDP kernel function allocates memory using one of the input
parameters. Add sanity check for this input parameter to
ensure proper memory allocation.

Signed-off-by: Shalabh Jain <shalabhj@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: mdss: Balance clock requests in histogram enable

Balance the clock requests in histogram enable to prevent clocks from being
left on.

Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: mdss: Add an extra write of zero to clear dsi-ack-err bit

In addition to writing 1 to clear dsi-ack-err bit, an extra write
of 0 is also needed to clear error bit completely.

CRs-fixed: 574066
Signed-off-by: Shivaraj Shetty <shivaraj@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
mdss: Fix null point dereference in mdss_mdp_pp_init

Fixed null point dereference in case of memory allocation
failure in mdss_mdp_pp_init.

Signed-off-by: Krishna Chaitanya Parimi<cparimi@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: mdss: Fix error in BL linearity inverse LUT check

Associate the maximum index for the BL linearity inverse LUT with the
table size and not the maximum backlight value. The maximum backlight
value can cause an out of bounds index for the BL linearity inverse LUT.

Signed-off-by: Benet Clark <benetc@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: Add CPU freq limiter driver

* When enabled, it will override max frequency on
  resume/suspend events and when explicitly set by user.
* When enabled, it will override min frequency on
  suspend event and when explicitly set by user.
* Enabled by default.
* Interface is generated here: /sys/kernel/msm_limiter

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
cpufreq: Add cpu-boost driver

When certain bursty and important events take place, it might take a while
for the current cpufreq governor to notice the new load and react to it.
That would result in poor user experience. To alleviate this, the cpu-boost
driver boosts the frequency of a CPU for a short duration to maintain good
user experience while the governor catches up.

Specifically, this commit deals with ensuring that when "important" tasks
migrate from a fast CPU to a slow CPU, the frequency of the slow CPU is
boosted to be at least as high as the fast CPU for a short duration.

Since this driver enforces the boost by hooking into standard cpufreq
ADJUST notifiers, it has several advantages:
- More portable across kernel versions where the cpufreq internals might
  have been rewritten.
- Governor agnostic and hence works with multiple governors like
  conservative, ondemand, interactive, etc.
- Does not affect the sampling period/logic of existing governors.
- Can have the boost period adjusted independent of governor sampling
  period.

Signed-off-by: Saravana Kannan <skannan@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>