video: msm: Add CSC and QSEED support to Overlay API

Add support for CSC and QSEED configuration through MSMFB_OVERLAY_SET and
MSMFB_OVERLAY_PLAY ioctls. Provide better integration than previous attempt
with the existing Overlay and PostProcessing APIs.

CRs-Fixed: 380750
Change-Id: If895391074ef1e7d7a6824d289e1ed9da6a52180
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>
video: msm: PCC/GC config register protection

PCC/GC configuration registers are shared with other features. This patch
makes sure that the other features implementations don't overwrite the
existing settings for PCC/GC.

CRs-Fixed: 345395
Change-Id: I5467a4c50eae214181d67a7976eee92c0ae26fe5
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>
Revert "msm: display: fb blend setting via MSMFB_METADATA_SET ioctl"

This reverts commit 0667e085db8e2c91996aad1598627d142d2e49cb.

Change-Id: I81e49c1ca4b6f94b23c85deab4a84b89e5d13de0

Conflicts:
	drivers/video/msm/mdp4.h
	drivers/video/msm/mdp4_overlay.c
	drivers/video/msm/msm_fb.c
video: msm: Allow PCC/GC to be disabled/select bins

Current implementation would not set enable/disable bits to PCC/GC nor be
able to select the zero'th bin after selecting the first.

Change-Id: I0f52beb8914cdaecbabe913455c00fb9ea6100db
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>
msm_fb: display: Configure blend after DMA for DSI video

Change-Id: I932c787b26f9f87c56adb35dcbe706cb7b0286d0
msm_fb: display: Enable scaling bit while setting x-flip bit

To enable left-right flip x-scaling bit should be set for
MDP 4.2 and above versions. This fixes the issue when RGB layer
pipes are not properly rotated.

Change-Id: I0afae4aecde39ce3ac4dcbefc0bda93510e7d18a
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
msm_fb: display: fix iommu leak during base layer swap

Retain RGB1 iommu information during  base layer swap
so that iommu used by RGB1 can be freed back to pool later.

Change-Id: Ibed85179284743dc8a9d1434f0c81626b0567e16
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
msm_fb: display: Timeout pan display if time greater than 100ms

Timeout if pan display is taking more than 100ms to complete. This
will unblock the userspace thread and continue. This will solve
the hang issues.

Change-Id: Ica6a395b0e992263567633d6dc93a92ee1fa59cf
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
(cherry picked from commit 7c270369ccb7eca4934d6005b1960ac7ec2ed2fc)

Conflicts:
	drivers/video/msm/mdp4_overlay_dsi_cmd.c
	drivers/video/msm/mdp4_overlay_dsi_video.c
	drivers/video/msm/mipi_dsi.c
msm_fb: display: extend mutex protection for mdp pan display

When mdp commits a buffer to play, functions inside pan display, e.g.
mdp4_overlay_mdp_perf_upd are based on the current state of play, so
extending mutex to the scope of pan display to avoid race conditions.

Change-Id: I2e55567fd21de3738be066a2dee298d8122f12a3
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>

Conflicts:
	drivers/video/msm/mdp4_overlay_dsi_cmd.c
	drivers/video/msm/mdp4_overlay_dsi_video.c
	drivers/video/msm/mdp4_overlay_dtv.c
msm_fb: display: Add SMP-safety for PPP Operations

Adds protection using spinlock for the variable used in
controlling the PPP operations

Change-Id: Iba6ef5e32d38668bd110ed23ee9631aa40de79e0
Signed-off-by: Pradeep Jilagam <pjilagam@codeaurora.org>
msm_fb : display : Block RGB downscale in MDP 4.0 and 4.1

Downscale is not allowed on RGB pipes in MDP 4.0 and 4.1. Hence,
fail the OVERLAY_SET ioctl for such configurations.

Signed-off-by: Pradeep Jilagam <pjilagam@codeaurora.org>
(cherry picked from commit 3545573720822ce97ec37586f10fdf74a6d4f090)

Change-Id: I8445c18ac21cb7322eb9eb4c802623df5da07eb7
Signed-off-by: Gopal Goberu <ggober@codeaurora.org>
msm_fb: display: add fput_light to frame buffer

Frame buffer's (fb0) ref_count need to be balanced. overlay_play()
increase fb0's ref_count (fget_light). This patch will decrease fb0's
ref_count by calling fput_light after commit

(cherry picked from commit 7d136bef71281855cd224ccc967e4e95286f5356)

Change-Id: I9ba6d5c73cdb29c32a665d2b7b90df996c5b39e6
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
msm_fb: display: free base layer pipe at adb stop

Base layer pipe need to be freed at adb stop so that same
pipe can be allocated at adb start.

CRs-fixed: 390644
Change-Id: I948bb27687cfe1c96cc3b071b7bb9bb84b2c52c6
Signed-off-by: Kalyan Thota <kalyant@codeaurora.org>
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
Revert "msm: display: add mutex for display driver entries"

This reverts commit 87bc4275423d2f4bc4a60aa6b3813f3f20358f17.

Change-Id: I33a2fc456b7ab07f267661ed8f64c03da65ca186

Conflicts:
	drivers/video/msm/msm_fb.c
msm_fb: unlock semaphore on error

Change-Id: Id9bc387d07319619cb100e961c7e84f8f3cc7af3
Signed-off-by: Iliyan Malchev <malchev@google.com>
msm_fb: display: Assign proper destination rectangles to mdp blit

Add check for (90 + Flip Horizontal) and Flip Vertical cases to assign
proper destination rectangle parameters to avoid corrupted frame
buffer content.

CRs-Fixed: 344807
Change-Id: I7e7b0b8d26f08f63a6f9c55eedd37f31cf0348d7
Signed-off-by: Jeevan Shriram <jshriram@codeaurora.org>
video: msm: Allow MDP to use max clock rate

Change-Id: Ifafee601093231869f490783a63a3d0f2206e512

Conflicts:
	arch/arm/mach-msm/board-8960-display.c