msm: mdss: Retry clk_prepare() for byte clk.

- Randomly, clk_prepare() call for the DSI byte clock is failed that
  triggers the DSI IRQ storming soft-locked up issue.
- Until rootcause this issue, retry clk_prepare() for byte clock when
  it fails for 3 more times.

Change-Id: Icb742563de8bff0498829179ccc9caf77954e470
Signed-off-by: Bang Nguyen <bnguyen1@motorola.com>
Reviewed-on: http://gerrit.pcs.mot.com/576182
SLTApproved: Slta Waiver <sltawvr@motorola.com>
Tested-by: Jira Key <jirakey@motorola.com>
Reviewed-by: Zachary Crosby <zac@motorola.com>
Reviewed-by: Stephen Rossbach <rossbach@motorola.com>
SLTApproved: Stephen Rossbach <rossbach@motorola.com>
Reviewed-by: Klocwork kwcheck <klocwork-kwcheck@sourceforge.mot.com>
Submit-Approved: Jira Key <jirakey@motorola.com>
msm: mdss: hdmi: parse for resolutions in EDID block 0

If EDID block 1 is not available or video data block is not
available, allow parsing of resolutions from block 0.

CRs-Fixed: 596518
Change-Id: I8574de3f80c817ac764d467e622ded7430c0df86
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
msm: mdss: synchronize wfd driver iommu mmap/munmap with mdss

Add clocks reference during wfd driver iommu mdp_mmap/mdp_munmap
to ensure iommu is in proper state while wfd driver map/un-map
any buffers.

Change-Id: Id1a24285b81d5047e5e9f002ade9694ea49be59d
Signed-off-by: Pawan Kumar <pavaku@codeaurora.org>

Conflicts:
	drivers/video/msm/mdss/mdss_mdp_wb.c

Conflicts:

	drivers/video/msm/mdss/mdss_mdp_wb.c
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.

Change-Id: I17f3d5517d9a0583221fdb5c354bf1992ddeddbd
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
Signed-off-by: Pawan Kumar <pavaku@codeaurora.org>
msm: mdss: add bus bandwidth request enable/disable during get/free buffer

Enable bus bandwidth request during get/free buffer to ensure
iommu is in proper state while mapping/un-mapping any buffers.

Change-Id: I85cc74a666dbfd29abd26609cbdd3e968d1ecd01
Signed-off-by: Pawan Kumar <pavaku@codeaurora.org>
msm: mdss: Fix mdss iommu detach-attach issue

Move iommu attach logic to rotator play and writeback
queue buffer from overlay_kickoff to make sure iommu is
enable before mapping any buffers.

Change-Id: I92eb3d4686c1641728980d057f2de6c0d324be71
Signed-off-by: Pawan Kumar <pavaku@codeaurora.org>
msm: mdss:Add splash logo configuration entry in fb

Framebuffer driver displays penguin logo image
for all targets. Bootloader also displays the
same image. However, customer has to change this
boot image at two places if they want to display
different image than penguin logo. This change allows
customer to disable/enable the splash image from
framebuffer driver.

Change-Id: I56e78ce93aa8c218adffef03bfebd462d6bda254
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
msm: mdss: Check extra mmb allocated to a pipe

If set call to a pipe changes smp configuration such that
calculated no. of  mmb blocks are less than allocated mmb
blocks, fail this set call. This ensures pipe disconnection
and smp configuration is possible in next commit cycle.
Also, check that no extra mmb is left allocated to any plane
when pipe's format changes. If so, fail the set call to let
correct smp configuration happen in next commit cycle.

Change-Id: Iec2b8cb18088587655cf0c68dc81e3ac7b819cbc
Signed-off-by: Mayank Chopra <makchopra@codeaurora.org>

Conflicts:
	drivers/video/msm/mdss/mdss_mdp_pipe.c

Conflicts:

	drivers/video/msm/mdss/mdss_mdp_pipe.c
msm: mdss: Enable EOT packets for DSI

Expose properties to enable ignoring and appending of
EOT packets for DSI panels.

CRs-Fixed: 575875
Change-Id: Ib1ad4fedf7bea7f47b5468621793c6845c4d1180
Signed-off-by: Mayank Chopra <makchopra@codeaurora.org>
msm: mhl: sii8334: handle MHL discovery failure cases

Reset mhl mode on disconnect and suspend to avoid discovery wait
timeout in case connect interrupt is received before start of wait.

Free IRQ on suspend and reconfigure in discovery to avoid unnecessary
wakups and suspends during PM shutdown.

Notify USB in case discovery is failed and on suspend to take over
the control.

CRs-Fixed: 579997
Change-Id: If0747b067d53563c3eb380e80be1254d38b140d6
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
msm: mdss: Decimation and BWC cannot be enabled together

Hardware cannot support decimation and bwc together.
The use case should be failed.

Change-Id: Ic7547340eb08d542a296aa9cfdd150e7eb0bea4b
Signed-off-by: Sree Sesha Aravind Vadrevu <svadrevu@quicinc.com>
msm: mdss: Correct element name for dtsi parsing

Color order was mistakenly updated without the qcom,
prefix, so the dtsi entry will have no effect.
Change updates the parse function so field will
be parsed correctly.

Change-Id: I69030f3a267572cc90bd33a53162deae34a4f168
Signed-off-by: Casey Piper <cpiper@codeaurora.org>
mdss: display: Add support for variable refresh rate

Add support for variable refresh rate by changing the
VFP immediately and programming it to MDP TG and
DSI registers.

Change-Id: I186e80cf38d42f4224afedadda96cc613ae68470
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
msm: mdss: Update wr mem fields with correct names

wr mem start and continue were incorrectly named in
the documentation and dtsi files. Changing the names
to wr-mem-start and wr-mem-continue to more accurately
reflect the fields.

Change-Id: If2cdd410fd50a4690dcb6c87cb0b9f4818848848
CRs-Fixed: 578028
Signed-off-by: Casey Piper <cpiper@codeaurora.org>
msm: mdss: Fix assertive display HW range checks

Fix off by one error leading to log spam. 'nad_cfgs' is the upper bound of
the zero-indexed mixer/AD/dspp pipe enumeration.

Change-Id: I963d175aad23a8eb621772d6c9bd06676fa2e27e
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>
Signed-off-by: Ping Li <quicpingli@codeaurora.org>
msm: mdss: add retire fence support

Retire fence timeline should follow the actual panel vsync more closely.
For video mode the retire fence can be signaled along with the release
timeline with +1 offset, since this is signaled at vsync.
In case of command mode the panel vsync can be different from buffer
release timeline. To handle the command mode panel vsyncs better, create
a new timeline for the retire fence signaling.

Change-Id: If8a1eb717d733ca215275a8be4f0054091dbc147
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>

Conflicts:
	drivers/video/msm/mdss/mdss_fb.c

Conflicts:

	drivers/video/msm/mdss/mdss_fb.c
msm: mdss: Return suspend without delay in NOTIFY UPDATE

NOTIFY_UPDATE returns Suspend after 4 seconds delay.
Delay would cause HISTOGRAM_STOP ioctl to be called late.

Return suspend case without setting timer for no delay.

Change-Id: I356086de96cab85cd203bf1ad529ecf0b3bbfce3
Signed-off-by: Krishna Chaitanya Parimi <cparimi@codeaurora.org>
msm: mdss: Allow writeback panel to start overlay during handoff

There is no longer a need to delay the hardware initialization for WB.
Previously, iommu attach was done automatically in overlay_start,
which caused page faults. However, now the iommu is attached at the same
time as continuous splash handoff, which prevents any unwanted page
faults.

Change-Id: I79f021da1ada7e342b9db84167032df5ac840e4e
Signed-off-by: Benet Clark <benetc@codeaurora.org>
msm: mdss: hdmi: add missing sentinel to of_match_table

The DT of_match_table is missing the NULL entry that is needed to
terminate the table. Without this there is a risk of corrupting memory.

Change-Id: Ida223b91b00c72a6a2990653e3cb5ee693bd7e05
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
msm: mdss: remove panel type check for split display case.

Split display flag is derived from dsi controller configuration
specified at dtsi. Therefore no need to add checking panel
type at FB registration.

Change-Id: I5b60656c1f5724bdc358d743b8d7600d5beba0b3
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>