msm: mdss: Print task name when fb_open fails

Certain process is trying to open the frame buffer node
when target shutdown is in progress. This process keeps
calling fb_open if request fails. Printing name of the process
helps to pinpoint it when user space log is not provided.

Change-Id: I83601d478113a7b8ee78c1ee0e79d91c11e59826
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
msm: mdss: ensure pipe is halted before freeing buffers

When pipe is being detached from mixer, there is potential corner case
if underrun occurs at the same time which can cause pipe to flood the
VBIF. On the other hand unmapping a buffer requires VBIF to be idle to
sync TLB, so need to ensure pipe halt is done before freeing the pipe
buffers.

Change-Id: I9686b9d7d17d8dc2a8334157cfa8fa23ba5b47ee
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
msm: mdss: update pipe params on first update after suspend

Whenever panel is turned off, need to ensure that pipe is reprogrammed
fully when turned back on in case the pipes are not properly unset.

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

Conflicts:
	drivers/video/msm/mdss/mdss_mdp_overlay.c
msm: mdss: Use MDSS reg for version

MDSS and MDP regs have same version value for all the targets
other than mpq8092. In mpq, MDSS version is different, so using
it instead of MDP version to get the unique value, and using this
new version to check correct write-back format.

Change-Id: Ide7335815d61681c7a6909b9da95d0b6f4851d54
Signed-off-by: Zohaib Alam <zalam@codeaurora.org>
msm: mdss: mdp revision initialization

Make sure mdp revision is initialized when user space
application retrieves it.

Change-Id: Ib09767ac5db3af3958a82c83ed553e8bd69637e0
Signed-off-by: Zohaib Alam <zalam@codeaurora.org>
Signed-off-by: Ken Zhang <kenz@codeaurora.org>
msm: mdss: add sysfs link to mdss_fb device

Add a symlink to mdss_fb device from fbdev node. This allows referring to
it more easily from userspace applications.

Change-Id: Ie0abacc6c376af89f62a5328afba2245ca082f7c
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
msm: display: Making vsync_clk optional in dt parsing

vsync_clk is optional for non-smart panels, so need to make its check
optional in device tree parsing to prevent probe failure.

Change-Id: Ic364c1c1ecde07c44c13f7925bc85e2278c1de2a
Signed-off-by: Zohaib Alam <zalam@codeaurora.org>
msm: mdss: avoid probe failure if MDP LUT clock registration fails

MDP LUT clock is not present on all MDSS revisions, so this clock
registration can fail on some targets. Hence, do not fail the mdp
probe during boot up if the clk_get fails for this clock.

Change-Id: Ib46886662e34a39236b6453ec84f63ea4ba815a7
Signed-off-by: Padmanabhan Komanduru <pkomandu@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: mdp: fix incorrect pointer casts

Modify mdp drivers to ensure pointer casts
are done in an appropriate manner

Change-Id: I6b1dacf64e0c33bbdd02b0e9da7a7491c6970177
Signed-off-by: Manoj Rao <manojraj@codeaurora.org>
video: mdss: Cleanup sysfs linkage

Change-Id: I87720e0e4a0bf75f2ee3f24cdff7ec451b0b45fa
msm: mdss: move MDSS revision macros to uapi/linux/msm_mdp.h

Currently kernel driver and user mode libraries keep their own
copies of HW revision numbers. This strategy is prone to errors
and usually frowned upon. Fix this by moving revision information
to sanitized header which is shared by kernel drivers and user mode
libraries.

Change-Id: I59d1256ffd98e07f4ef9ae2b534f04b67abd2119
Signed-off-by: Ujwal Patel <ujwalp@codeaurora.org>
msm: mdss: Change the writeback format enumerations

The enumerations used for writeback format through metadata set
and get ioctls should be the same in HAL and kernel.

Change-Id: I5fb7f9266d01c3ba4390a5a6bb168af507e3c298
Signed-off-by: Sree Sesha Aravind Vadrevu <svadrevu@codeaurora.org>
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.

Change-Id: I1a4ff6ce3e0add21d4e46a41372b076b277d10f5
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>

Conflicts:
	drivers/video/msm/mdss/mdss_mdp_overlay.c
msm: mdss: Copy IGC LUT data correctly to userspace

During IGC read operation, IGC LUT's data was copied to
userspace incorrectly because of swapping color components.

Fix component data swapping during IGC LUT data copy to
user space to provide the correct IGC LUT data to user space.

Change-Id: I301a3500f0e0c4bbf9f52affa66373585c72d987
Signed-off-by: Krishna Chaitanya Parimi <cparimi@codeaurora.org>
msm: mdss: Correct ARGC read write for all DSPP

Currently ARGC read write is done for DSPP0 irrespective of
dspp_num, as the dspp_num corresponding to the block provided
is not calculated.

Added the calculation of the dspp_num to get correct address
of ARGC registers.

Change-Id: Id787e76debb26d23d75d3cdb859a697b6f0016f5
Signed-off-by: Krishna Chaitanya Parimi <cparimi@codeaurora.org>
msm: mdss: Unify histogram function naming

All histogram functions use 'hist' as an identifier rather than alternating
between 'hist' and 'histogram'

Change-Id: I9ef91bc39418dd6e7ea2baf6a9b6ee1c2127995b
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>
msm: mdss: Pass shift instead of bit field to hist_disable

pp_hist_disable will always use the same bit field for differing histogram
locations, just with different shift values. Store the base bit field in
pp_hist_disable.

Change-Id: I86a2f9014f0eb5cdc82a3b5998948f3a11cdff87
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>
msm: mdss: Store static histogram data on histogram struct

Store hardware base address and interrupt register offset on histogram
hardware structure.

Change-Id: I28b921622ab9c6d6143a54f97864e6f9c4697bde
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>