msm_fb: display: wfd with vsync driven frame push

To improve performance, hardware vsync event at mdp driver
is passed to framework so that both composition and frame
update are aligned at vsync event. This patch will upgrade
wfd to incorporate vsync driven frame push in consistence
with other interfaces.

Change-Id: If088826ec387446301f1f6acc311d909edb04163
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
(cherry picked from commit d74db5fcf24a223570137087aa5632593b315fcc)

Conflicts:

	drivers/video/msm/mdp4_overlay.c
	drivers/video/msm/mdp4_overlay_writeback.c

Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
msm_fb: Wifi display changes for commit ioctl

This change handles panel updates for WFD panel via
overlay_commit interface, along with conglomeration of
some common code across pan_update and overlay_commit ioctls

Signed-off-by: Kalyan Thota <kalyant@codeaurora.org>

Conflicts:

	drivers/video/msm/mdp4_overlay.c
	drivers/video/msm/msm_fb.c
	include/linux/msm_mdp.h

Change-Id: I9e332856782c59ab598bb388a2ec482076746ad2
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
Revert "msm: mdp: Initialize vsync sysfs in probe"

This reverts commit 41db433cc845eb27bb765cc0cf599e872edd709f.
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>

Change-Id: Ie353ed5bc3dd8d23c428973aa260774c7cff0361
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>

Conflicts:
	drivers/video/msm/mdp4_overlay_dsi_cmd.c
	drivers/video/msm/msm_fb.h
msm_fb: display: Create sysfs entries in mdp_probe for MDP4 targets

vsync sysfs entries should be created in mdp_probe instead of
creating in panel on. This avoids waiting for the first event
control in framework

Change-Id: I983731481ea89bb7666be5f2a9f75a1e04fd963f
Signed-off-by: Mayank Chopra <makchopra@codeaurora.org>
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>

Conflicts:
	drivers/video/msm/mdp4_overlay_dsi_cmd.c
	drivers/video/msm/msm_fb.h
video: msm: Dynamically toggle histogram interrupt

Make histogram enable/disable functions also enable/disable the histogram
"interrupt enabled" bit on the MDP enabled interrupts register.

CRs-Fixed: 398556
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>
Change-Id: I56f811e88cf3fd44ae0a2df8a6e5de32ba9a0c1c
(cherry picked from commit 1026832c51cbadeea9a717fa20fb42b6a7c5661f)

Signed-off-by: Pravin Tamkhane <pravint@codeaurora.org>
msm_fb: display: replace msleep with wait4vsync

vsync is controlled by frame work which means vsync irq
off may happen at any instance. This patch use a reference
count to control vsync irq enable/disable so that
wait4vsync can replace msleep safely during suspend.

Change-Id: Ief84b1b421436e1f750288eb9a9760a9cb96c555
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
msm_fb: display: balance secure map and unmap in each mfd

Make sure secure map and unmap get called in each mfd and balanced.
Otherwise, secure contents can not be played for both primary and
hdmi.

CRs-fixed: 450427
Change-Id: I5399be64fbb104dc3cbe2c5c65b3f4406f47473c
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>

Conflicts:
	drivers/video/msm/mdp4_overlay.c

Conflicts:
	drivers/video/msm/msm_fb.h
msm_fb: display: add wfd clk ctrl in pipe_commit

mdp_clk_ctrl on is not called when commit is from overlay commit path
which can cause mdp hang. mdp_clk_ctrl off should be after mdp
overlay2 is done, so schedule a work in overlay2 done isr.

Change-Id: I94fd08da27cfda114f5cc0056a5103f0a9b772f6
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
video: msm: Calibration config implementation

Allow software to selectively read/write MDP color calibration registers.
This is needed to allow calibration tool to individually configure
registers.

Change-Id: I5db2dcbca0b3433c7fedf9033ceff0cf6a5e0e1f
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>
(cherry picked from commit afc6fbf054d079761d5c2ee85242e56d640ee409)
Signed-off-by: Pravin Tamkhane <pravint@codeaurora.org>

Conflicts:
	drivers/video/msm/mdp4.h
	drivers/video/msm/mdp4_util.c
msm_fb: hdmi: update data on resolution change

On changing resolution, all information related to display
needs to be updated which helps in calculating the right mdp
clock for each resolution.

CRs-Fixed: 436151
Change-Id: I1ab6e5859491936a7fa8c62247da9ef5a0ff45ef
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>

Conflicts:
	drivers/video/msm/hdmi_msm.c
	drivers/video/msm/msm_fb.h
msm_fb: hdmi: Do not turn on HDMI if not ready

At bootup, if HPD is not configured, HDMI is not in
the state of getting turned on. This change makes sure
HDMI is not turned on/off unnecessarily which turns on
clocks as well.

CRs-Fixed: 447511
Change-Id: I074d9c463943770775b060c4a93b9120dfe9bcf0
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
msm: display: panel frame rate report

Add metadata ioctl for retrieving panel frame rate.
Get ready to remove reserved fields usage.

Change-Id: I51a4aed9d85efd5f83a184100b6a3dc682c7a67c
Signed-off-by: Ken Zhang <kenz@codeaurora.org>

Conflicts:
	drivers/video/msm/msm_fb.c
msm_fb: Calibration config API

Add definition for struct to be used in post processing calibration API.
Needed by OEM calibration tool to provide better support of post processing
features.

Change-Id: I40760a85bb58730bfe64469ecf3e2ab3b6e7609e
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>
(cherry picked from commit e8ed5ec0bd9fd5b298464b7f08b5807afa3291a8)
msm: display: Add data stuctures for MSM8974 target support

Add data structures for picture adjustment, IGC, QSEED2 sharpening/smooth
feature support on MSM8974.
These data structures are needed by the hardware/qcom/display project,
which is shared between multiple jb branches, including B-family jb
branches.

Change-Id: I0e228c90b70dbe4655173b753032eaae5748f7d9
Signed-off-by: Ping Li <quicpingli@codeaurora.org>
msm: mdp: Move wfd state signalling into mdp driver

Previously the WFD driver was reponsible for signalling the
online/offline events to userspace listeners.  This led to redundant
notifications due to the manner in which the WFD driver is used. The
signalling is better purposed when done from MDP driver.

Change-Id: Ifffbacb565f8758b65139f7b0e32df0773247e2d
Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>

Conflicts:
	drivers/media/video/msm_wfd/mdp-4-subdev.c
	drivers/video/msm/msm_fb.h
msm: display: reduce timeline to 1 for smart panel

For smart display, dsi command and wfd, since it has its
own buffer, the input buffer can be released once the
display commit finishes, hence the fence threshold for
creation can be smaller. This patch reduce the timeline
from 2 to 1 for samrt panels. Also, it needs to
wait4dmap/wait4ov after kicked off. Otherwise, tearing may
happen.

Change-Id: I9eca871d8d863ef23b1d67b6e1e9cffea40ae4a6
Signed-off-by: Ken Zhang <kenz@codeaurora.org>
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>

Conflicts:
	drivers/video/msm/mdp4_overlay_dsi_cmd.c
	drivers/video/msm/msm_fb.c
AIO: Don't plug the I/O queue in do_io_submit()

Asynchronous I/O latency to a solid-state disk greatly increased
between the 2.6.32 and 3.0 kernels. By removing the plug from
do_io_submit(), we observed a 34% improvement in the I/O latency.

Unfortunately, at this level, we don't know if the request is to
a rotating disk or not.

Change-Id: I7101df956473ed9fd5dcff18e473dd93b688a5c1
Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
Cc: linux-aio@kvack.org
Cc: Chris Mason <chris.mason@oracle.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Jeff Moyer <jmoyer@redhat.com>
Slim_msm: Wait for reconfig sequence to complete

Wait for current reconfiguration to complete during
reconfigure_now sequnce. Earlier we are not waiting
for reconfiguration done interrupt after sending the
reconfiguration message to the slimus hardware. This
may lead to hardware synchronization issues in lower
slimbus clock frequencies.

In this patch we are waiting for the reconfiguration
done interrupt from slimbus hardware.

CRs-Fixed: 490022
Change-Id: If0126dac9a1ad2d931e9a0e345d19559fe36f67a
Signed-off-by: Kiran Gunda <kgunda@codeaurora.org>
qseecom:  Add SFAB clock voting.

Add SFAB voting in  QSEECOM_IOCTL_PERF_ENABLE_REQ.
The SFAB clock needs to be bumped up to its optimal
value when opearting in high bandwidth mode (for max
crypto performance)

Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
(cherry picked from commit 8e2d73a0ade94ffd27882043d562c7ee825d9f7c)

Conflicts:

	drivers/misc/qseecom.c

Change-Id: I281e544756304f19969afbab7196a227dad0e2b1
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
qseecom: Enable clocks for the Crypto Engine used by Trustzone.

All interactions with secure applications on TZ by non-secure
apps on HLOS need the crypto clocks on.
Without this, simple operations as loading secure apps in
Trust zone fail.

Change-Id: I37097cb401508f7582de014e502f3709170ca6b2
Signed-off-by: Ramesh Masavarapu <rameshm@codeaurora.org>

Conflicts:
	arch/arm/mach-msm/clock-8974.c