msm: mdss: allow histogram stop operation while display is off

After the display is off, the user space can still call histogram
stop operation.

Change-Id: I5c28b3e7e0529319de9d22ca49bdd606994cf7fd
Signed-off-by: Xiaoming Zhou <zhoux@codeaurora.org>
Signed-off-by: Krishna Chaitanya Parimi <cparimi@codeaurora.org>
msm: mdss: Fix race condition for vsync irq enable/disable

Disable and enable of vsync happens in separate thread, which
may lead to a race condition where enable/disable may
happen at the same time and resulting irq in disable state.
Add lock to properly synchronize the enabling/disabling
of vsync interrupts to fix race condition.

Change-Id: Ib52bea5ca7a3612c866a4a962f09725a77e40563
Signed-off-by: Pawan Kumar <pavaku@codeaurora.org>
msm: mdss: hdmi: clean up cn/itc bit set/unset

Properly set/unset the ITC/CN bits by using proper mutex,
error checks and other cleanup things.

Change-Id: I2730689dc70df1bce65bb1699938ce7793937688
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
mdp3: Enable sw vsync when dma is not active

Recently in an attempt to enhance sync event reporting we
prevented sw vsync when dma is turned of from toggleing display
off and on.

Change-Id: I71c9be55d36dc92e513d9f5ead4d1e42157285c6
Signed-off-by: Terence Hampson <thampson@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: Returning NOTIFY_SUSPEND while polling NOTIFY_UPDATE

mdss_fb_update_notify does not return Suspend in NOTIFY_UPDATE
case. Daemon polls on NOTIFY_UPDATE but does not get Suspend
notification. Hence Daemon would not stop polling.

Suspend Case is added in UPDATE case.

Change-Id: Iaeaf819a6849acda2eb7eb78f0fc3306866d1b64
Signed-off-by: Krishna Chaitanya Parimi <cparimi@codeaurora.org>
msm: mdss: Fix ARGC error when writing LUT to registers

When updating the ARGC LUT registers, the data is incorrectly written
such that the arrays are off by one index. This patch fixes that error
by starting from the correct index.

Also, when the READ flag is enabled for ARGC, the dirty flag is no longer
set.

Change-Id: I7e8e19c51d5891cd11344a425f1a8ac47d57368c
Signed-off-by: Benet Clark <benetc@codeaurora.org>