msm: mdss: indicate splash screen condition explicitly

Earlier, we were using if the iommu is attached condition
to check if it is in the splash screen. In the command
mode panel, as part of xo shutdown, we need to detach the
iommu as well, in the idle screen case. So, it is not a
proper condition to determine if it is in the splash screen.

Change-Id: I1740e381abf2e4a8989cfb2f2f7f4819363ffaa2
Signed-off-by: Xiaoming Zhou <zhoux@codeaurora.org>
msm: mdss: Prevent excessive logging during rotation set failure

Changing the error log to debug log in case SMP reserve fails
for rotation. The use case falls back to GPU. Same is being
done in  case of mdp interface set path.

Change-Id: I00a9e05b3a04a87e354fd0e60ad900f4f71cdfc1
Signed-off-by: Vineet Bajaj <vbajaj@codeaurora.org>
msm: mdss: Remove init phase programming

Init phase should only be programmed to a non zero value only through
a user program. Default value of zero is programmed by the driver to
avoid hardware hangs

Change-Id: Iff99394d2f3a937c5bb4456c2f7ca5669a5c732b
Signed-off-by: Sree Sesha Aravind Vadrevu <svadrevu@codeaurora.org>
msm: mdp3: underflow color adjust support on 8x10

This adds the underflow color adjustment support on
8x10. Customer can order underflow color by modifying
the parameter in panel device tree.

Change-Id: I0660f35e3a0052e5a995256978f354cf30e76161
Signed-off-by: Shuo Yan <shuoy@codeaurora.org>
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.

Change-Id: I29cf869af4135e1199bc0feb4369700b994520ec
Signed-off-by: Krishna Chaitanya Parimi <cparimi@codeaurora.org>
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.

Change-Id: Ifd0f5f131b7ff1fd7d1fb122425241a0e0cec328
Signed-off-by: Krishna Chaitanya Parimi <cparimi@codeaurora.org>
mdss: mdp3: Group together resource enable, simplifying xo shutdown

Grouping calls to prepare and unprepare of clocks along with enable
and disable for saving power in the case of static screen on command
mode panels. This makes sure that corresponding source clocks are
also disabled allowing xo shutdown to happen.

On top of that bandwidth request and iommu enable was grouped with
enabling/disabling clocks so that all display related clocks are
disable in static screen allowing for xo shutdown to happen.

Change-Id: I2db3844cbab5c41ea1bb37f5a5ed76c3c63e3a1d
Signed-off-by: Terence Hampson <thampson@codeaurora.org>
msm: mdss: Hold MDP clock Ref count in pan_display path

If handoff fails, the clock ref count becomes 0 and iommu
will get detached. In pan display path, since at that
particular instant iommu gets detached, we use physical
address. After this if iommu is again attached and physical
address is fetched, it can result in continuous IOMMU page
faults. To address this hold MDP clock ref count
in pan display path.

Change-Id: I2370b276acdced2cf22083eb80fcad1b2e454315
Signed-off-by: Jayant Shekhar <jshekhar@codeaurora.org>
mdss: Add newline to VSYNC timestamp for mdp3 driver

This makes sure that the userspace correctly interprets the end
of the vsync timestamp.

CRs-Fixed: 639039
Change-Id: I8a0810283a42a9c39a3c8fe36b862bbfd3ecdbea
Signed-off-by: Shivaraj Shetty <shivaraj@codeaurora.org>
mdss: mdp3: fix logic when verifying if image can be scaled by 1

There was an issue where images that could be scaled by 1 were not
being blit by ppp due to logic error.

Change-Id: I6f8cdf43d5398a7894e5b7f8a867ec59341345b8
Signed-off-by: Terence Hampson <thampson@codeaurora.org>
mdss: mdp3: Remove extra call to clk_prepare

clk_prepare got moved inside mdp3_clk_update. Prior to this patch
unprepare would never be called successfully.

Change-Id: I28ab035b42d433f379d63748ac4f506a8575ea66
Signed-off-by: Terence Hampson <thampson@codeaurora.org>
msm: mdss: Add update notify for backlight change in static screen

Previously, the change of backlight sysfs node value will not trigger
notify updates if display is in static screen case. This will cause
delay or wrong configuration for assertive display. This patch fixes
the above issue by adding an update notify if backlight changes when
there are no display updates.

Change-Id: I1475896214a50dc1fa71739aa751b2e626d27adb
Signed-off-by: Ping Li <quicpingli@codeaurora.org>
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.

Change-Id: Ic5d4e97e70c87e5b6e956e27a766136610d6f345
Signed-off-by: Shuo Yan <shuoy@codeaurora.org>
msm: mdss: Add core clock level selection in MDSS

Currently core clock is calculated for each frame and
depending upon the calculated value clock driver rounds it
to the nearest clock level from clock table. Now do
quantization of required clock rate at mdp driver itself
once before the request goes to clock driver.

Change-Id: Ie30947fb8f7d2978bb121b28920c05888332bf3f
Signed-off-by: Jayant Shekhar <jshekhar@codeaurora.org>
msm: mdss: Configure minimum voltage for CX power rail

For smart panels, we observe abnormal waveforms and
unexpected voltage spikes on DSI data lanes when the cx
power rail goes to minimum voltage. Vote for the cx
regulator in mdp3 driver and control the voltage to
avoid frame shifting.

Change-Id: I8ce8d7621f903966f519da563a9c57701146be24
Signed-off-by: Shivaraj Shetty <shivaraj@codeaurora.org>
mdss: Move te parameters to dtsi file for 8x10

There may be need to fine-tune the te parameters depending on
panel. Move te parameters to panel dtsi file so that this can
be configured from panel dtsi file.

CRs-Fixed: 616178
Change-Id: I465b96f1631a96cddfa15c9c3004e3dbdcea5982
Signed-off-by: Shivaraj Shetty <shivaraj@codeaurora.org>
msm: mdss: provide an exclusive access to SSPP op_mode

IGC/SPA/QSEED effects are supported by PP module and
calibration service. User is not able observe the effect
when both modules try to enable/disable the effect
at the same time. This change provides calibration
service an exclusive access to SSPP_SRC_OP_MODE on
all source pipes and VIG_OP_MODE on all VIG pipes
during tuning state.

Change-Id: Ice50f579fcb900f673c52a6b17f40aeb3a0e0a66
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
msm: mdss: provide an exclusive access to QSEED2 block

Calibration tool and pp module uses the QSEED2 block on
VIG pipe to set the sharpness. This sharpness effect
is overwritten when both modules tries to update it
at the same time. Hence, it is required to provide
an exclusive access to QSEED2 block when target is in
display tuning mode.

Change-Id: I41b85313e529a3cca70de7e652c3abb7d4defbca
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
msm: mdss: update layer mixer access for calibration tool

Calibration tool should have register access on all layer
mixers connected to DSPP pipe and WB path. It should
also have control layer register access to read
the current layer mixer configuration.

Change-Id: If2cc86c2e6f470e090746a400b16cb540948c3e9
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
msm: mdss: fix pp setup on SSPP pipe in rotation scenario

mfd is not updated on controller when pipe is setup
for rotation scenario. However, post processing module
check it for all use cases that leads to pp update
failure SSPP pipe. This change avoids the extra checking
and allows pp module to update SSPP pipe in all use
case scenarios.

Change-Id: I8718e67ca49067c9af7b492da7cdb1344e826389
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>