msm_fb: Restructure PCC and AR-GC code for clean implementation

Current PCC & AR-GC implementation uses macros for base
addresses, while other post processing features use
mdp_block2base() function. Also, in current implementation
check for feature supported for MDP version in device is not
performed, currently function which implements AR-GC, is
named as mdp4_pgc_cfg() which is bit misnomer.

This change uses uniform method for calculating block base
using mdp_block2base(). For checking MDP version and
feature supported using mdp_pp_block2pcc() and
mdp_pp_block2argc() functions.

This change also renames mdp4_pgc_cfg() to mdp4_argc_cfg() to
correctly indicate the functionality it implements.

Change-Id: I99a9948c987e3270c246aa44e569f94e35026c2f
Signed-off-by: Pravin Tamkhane <pravint@codeaurora.org>

Conflicts:

	drivers/video/msm/mdp4.h
	drivers/video/msm/mdp4_util.c
msm_fb: display: HDMI power reduction at suspend

During suspend, HDMI clocks are still running and power
consumption is high. Usually HPD module is kept on even
when the cable is not connected to sense the cable
re-connect. But cable connect sense is not required when
the device is suspended. This change makes sure that HPD,
along with other HDMI modules, are totally shutdown during
suspend and there is no power consumption by HDMI.

CRs-fixed: 335821
Change-Id: I90c6ec6ca99a9396609028fda9f1768324e7d3da
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>

Conflicts:

	drivers/video/msm/hdmi_msm.c
upadate
Revert "upadate"

This reverts commit d69224eb8d51146bb297468a582fcaa0b8c3ae70.
msm: Display: Add support for "Continuous Splash Screen" feature.

The image displayed on the screen by the android bootloader
driver should continue till the android animation shows up.
Delay the display initialization for MDP, display dependent clocks
and panel power on functions.

Change-Id: Iaec53879def6f4a9d2f6b7b8090f572e64e55d87
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
Signed-off-by: Chandan Uddaraju <chandanu@codeaurora.org>

Conflicts:

	drivers/video/msm/mdp.c
	drivers/video/msm/mdp4_overlay.c
	drivers/video/msm/mipi_dsi.c
	drivers/video/msm/mipi_dsi.h
	drivers/video/msm/mipi_toshiba.c
	drivers/video/msm/msm_dss_io_7x27a.c
	drivers/video/msm/msm_dss_io_8960.c
	drivers/video/msm/msm_dss_io_8x60.c
	drivers/video/msm/msm_fb.c
msm_fb: display: Add IOMMU support to MDP and rotator driver

Add IOMMU support to MDP and rotator driver for operating with
virtual addresses instead of physical addresses

Change-Id: Ia5afcf33220e0e75e92948649c2bd4d7ef32917d
Signed-off-by: Ravishangar Kalyanam <rkalya@codeaurora.org>

Conflicts:

	drivers/char/msm_rotator.c
	drivers/video/msm/mdp4.h
	drivers/video/msm/mdp4_overlay.c
	drivers/video/msm/mdp4_overlay_dsi_cmd.c
	drivers/video/msm/mdp4_overlay_dsi_video.c
	drivers/video/msm/mdp4_overlay_dtv.c
	drivers/video/msm/mdp4_overlay_lcdc.c
	drivers/video/msm/mdp4_overlay_writeback.c
	drivers/video/msm/msm_fb.c
msm_fb: display: MSM V4l2 video overlay driver

Provides a V4L2 device that uses the MDP overlay pipes (on MDP4),
or the PPP interface (MDP3) to overlay frames on top of display
framebuffer.

Signed-off-by: Alhad Purnapatre <alhadp@codeaurora.org>
Change-Id: Iab69d0a5acfe993d13cb7a585e292b9a87eb90ee

Conflicts:

	arch/arm/mach-msm/board-msm7627a-display.c
	arch/arm/mach-msm/board-msm7x30.c
	drivers/media/video/msm/Kconfig
	drivers/media/video/msm/Makefile
	drivers/video/msm/mdp.h
	drivers/video/msm/mdp4.h
	drivers/video/msm/mdp4_overlay.c
	drivers/video/msm/mdp_ppp.c
msm_fb: display: Update video format on fps change

Added check for frame rate change. Corner case if there is no
change in xres,yres and pixclock.

Change-Id: I0ff5eb65364d2a370e0973da7e84f738bd042a20
CRs-Fixed: 356328
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>

Conflicts:

	drivers/video/msm/msm_fb.h
msm_fb: display: disable pan display and memory access to fb1 and fb2

The native fb1 and fb2 framebuffer memory is not used and not
allocated on the board file. So on the driver side, pan display ioctl
or other operations on fb1 or fb2 framebuffer memory is checked and
invalidated.

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

Conflicts:

	drivers/video/msm/msm_fb.c
msm_fb: display: Keep fb1 for MDP version < 4.0.2

For better memory usage, fb1 memory allocation is removed for
targets like 8960 which support BF pipe and true mirroring but
required for targets like 7x30 and 8660 which still needs fb1
for border fill.

CRs-fixed: 364669
Change-Id: Id741223a0107e356b9164b582aa1f901caa21988
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>

Conflicts:

	drivers/video/msm/msm_fb.c
video: msm: Migrate away from subsystem map APIs

The subsystem map APIs are no longer the preferred method
for mapping into the the IOMMU. Migrate away from those
APIs to the newer map_contig_buffer APIs.

Change-Id: I29608bd1cf7f9fb8c5584952826b6f3ae56bc3d8
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>

Conflicts:

	drivers/video/msm/mdp4_overlay.c
video: msm: Don't make the framebuffer cached

The video framebuffer should not be cached when mapping into the
rotator or video domains. Change it.

Change-Id: I407c68ac21a030aff801ebfae01d360bb6bf338c
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
msm: iommu: Split rotator/mdp iommu domains

Finer granularity is needed when mapping into the IOMMU's for
rotator and mdp for secure playback. During secure playback
HLOS will only have access to map into one context bank. The
other context bank is secured and programmed by TrustZone.

Divide DISPLAY_DOMAIN into DISPLAY_WRITE_DOMAIN and
DISPLAY_READ_DOMAIN. Divide ROTATOR_DOMAIN into ROTATOR_SRC_DOMAIN
and ROTATOR_DST_DOMAIN.

Change-Id: I2d67525d6026b8a1fb2f2cb00e4bb118c8eb6f27
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>

Conflicts:

	arch/arm/mach-msm/board-8064-display.c
	arch/arm/mach-msm/board-8064.c
	arch/arm/mach-msm/board-8930-display.c
	arch/arm/mach-msm/board-8960-display.c
	arch/arm/mach-msm/board-msm8x60.c
	arch/arm/mach-msm/devices-8064.c
	arch/arm/mach-msm/devices-8930.c
	arch/arm/mach-msm/devices-8960.c
	arch/arm/mach-msm/devices-msm8x60.c
	arch/arm/mach-msm/devices.h
	arch/arm/mach-msm/include/mach/board.h
	arch/arm/mach-msm/include/mach/iommu_domains.h
	arch/arm/mach-msm/subsystem_map.c
	drivers/char/msm_rotator.c
	drivers/media/video/msm/wfd/wfd-ioctl.c
	drivers/video/msm/mdp.c
	drivers/video/msm/mdp4_overlay.c
	drivers/video/msm/mdp4_overlay_writeback.c
	include/linux/msm_rotator.h
video: msm: Add user-defined backlight scaling

Add method for scaling backlight based off of a user provided ratio and
minimum level for the scaling to be applied.

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

Conflicts:

	drivers/video/msm/msm_fb.c
msm_fb: display: vsync driven screen update

This patch will queue multiple surfaces and commit those
surfaces into mdp at same instance so that surfaces will
be blended and displayed at same time. Hardware vsync event
is delivered to the user space frame work via uevent. Both
queue and commit are controlled by frame work and synchonized
with vsync event. Therefore frame rate will match with vsync rate.

Change-Id: If630a6d94fd38483ee313f575b1a71ed8bd65a52
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>

Conflicts:

	drivers/video/msm/Kconfig
	drivers/video/msm/mdp.c
	drivers/video/msm/mdp4.h
	drivers/video/msm/mdp4_overlay.c
	drivers/video/msm/mdp4_overlay_dsi_cmd.c
	drivers/video/msm/mdp4_overlay_dsi_video.c
	drivers/video/msm/mdp4_overlay_dtv.c
	drivers/video/msm/mdp4_overlay_lcdc.c
	drivers/video/msm/mdp4_util.c
	drivers/video/msm/mdp_debugfs.c
	drivers/video/msm/mipi_NT35510.c
	drivers/video/msm/mipi_dsi.c
	drivers/video/msm/mipi_dsi.h
	drivers/video/msm/mipi_dsi_host.c
	drivers/video/msm/mipi_novatek.c
	drivers/video/msm/mipi_orise.c
	drivers/video/msm/mipi_renesas.c
	drivers/video/msm/mipi_simulator.c
	drivers/video/msm/mipi_tc358764_dsi2lvds.c
	drivers/video/msm/mipi_toshiba.c
	drivers/video/msm/mipi_truly.c
	drivers/video/msm/mipi_truly_tft540960_1_e.c
	drivers/video/msm/msm_fb.c
msm: display: use the fb reserved fields same as kernel 3.0

Reserved fields of fb structure used for various use cases
in qcom fb driver. Reducing the reserved fields caused lot
of side effects and it will change the reserved fields same
as kernel 3.0.

Change-Id: I7bf82a9b5667cb5c84b54e428bbfcb6869157bd7
Signed-off-by: Nagamalleswararao Ganji <nganji@codeaurora.org>

Conflicts:

	drivers/video/msm/external_common.c
	include/linux/fb.h
msm_fb: display: Map framebuffer region in Display Write Domain

Framebuffer is currently mapped for Display read and rotator source
domains. For MDP writeback mode, Display write domain requires
framebuffer region and it is mapped at initialization time.

CRs-Fixed: 382550
Signed-off-by: Ravishangar Kalyanam <rkalya@codeaurora.org>
Change-Id: Iba6fd0201a48fe1864bf42e9576f063cd58646fd
msm_fb: display: no early suspend for writeback panel

Writeback panel is not real physical panel and no power consumption
concern, so it is removed from early suspend registration to avoid
open fb2 error during suspend/resume.

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

Conflicts:

	drivers/video/msm/msm_fb.c
video: msm_fb: Increase display timeout to 2 seconds

One second time out for no frame update, as in current implementation,
does not allow CABL to reach minimum backlight level possible because
histograms dont get generated after one second. So increase time out
period to two seconds which seem to be sufficient for complete black to
complete white and vice versa transitions.

CRs-Fixed: 370804
Change-Id: I0712924d669abcb820654cd6ca5f7da37bed57e6
Signed-off-by: Pravin Tamkhane <pravint@codeaurora.org>
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>

Conflicts:

	drivers/video/msm/msm_fb.c
msm_fb: Retain CSC values across suspend/resume sequence

CSC values pertaining to various H/W blocks are stored in a
global structure and will be re-applied during resume sequence.

CRs-Fixed: 376159
Change-Id: Ieb151185efd106041e28feedf4fa271ae4ba2666
Signed-off-by: Kalyan Thota <kalyant@codeaurora.org>

Conflicts:

	drivers/video/msm/mdp.h
	drivers/video/msm/mdp4_overlay.c
	drivers/video/msm/mdp4_util.c