msm: mdss: add iommu attach in bus bandwidth control request

Add mdss_iommu_attach in mdss_bus_bandwidth_ctrl to
attach iommu on bus bandwidth enable request.
mdss_iommu_attach/mdss_iommu_dettach can happen in
separate thread, which may lead to a race condition
where attach/detach may happen at same time. Add lock
to properly synchronize the iommu attach/detach to
fix race condition.

Change-Id: I45c8ef1fa1fa1c2da9c6c3702bd007856e469b9d
Signed-off-by: Pawan Kumar <pavaku@codeaurora.org>
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>
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>

Conflicts:
	drivers/video/msm/mdss/mdss_mdp_overlay.c
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>

Conflicts:
	drivers/video/msm/mdss/mdss_mdp_overlay.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>
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>
msm: mdss: Do not program DSI PLL registers from DSI controller

MDSS DSI driver currently programs certain DSI PLL registers as
part of the DSI PHY off sequence. This is incorrect and could
lead to some unexpected errors such as DSI PLL getting turned off
while the branch clocks are still on. Fix this by removing all
such register programming.

Change-Id: Ie1e88cd18de6b8ef8804f7a2b34b8b8282166c96
CRs-Fixed: 509801
Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
msm: mdss: Move bus scale table implementation to device-tree

Bus scale table is chip-set dependent where number of paths per
bandwidth use-case can differ chip-set to chip-set. Current
implementation has a static table where it supports only one path per
use-case. Expand MDSS bus scaling implementation to accommodate
chip-sets where more than one path per use-case, i.e. apq8084, is
possible and move table initialization to device-tree so that every
chip-set configures its own table.

Change-Id: Ia6f76654d129fe0ec1a7124aa87b16f96167fe84
Signed-off-by: Ujwal Patel <ujwalp@codeaurora.org>
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
Signed-off-by: Jayant Shekhar <jshekhar@codeaurora.org>

Conflicts:
	drivers/video/msm/mdss/mdss.h