msm_fb: HDMI: Compile error when HDMI is disbaled

Resolve compilation error when HDMI is disabled through
kernel config.

Change-Id: Ie89ac666fe4db83294cce07f59f61790b200d463
CRs-Fixed: 341412
Signed-off-by: Manoj Rao <manojraj@codeaurora.org>
(cherry picked from commit 7a62a68bfa68cf9767b9cb6432c05a47e296067b)

Conflicts:

	drivers/video/msm/mdp4.h
msm_fb: display: remove mixer1 waiting4vsync when staging down the pipe

dtv_pipe is the base layer pipe for mixer1. Waiting for vsync when
staging down this pipe (it happens when we unplug HDMI cable) causes
mixer1 under run because at the vsync moment dtv_pipe is disconnected
to mixer1.

CRs-fixed: 349765, 355110
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
(cherry picked from commit b2bdae8ee4262a4e1d8e8e7f9c91b80790bdff27)

Change-Id: Ifcc38e5c954c4e58a9328ea3c85a5a1baa5ad826
Signed-off-by: Ram Kumar Chakravarthy Chebathini <rcheba@codeaurora.org>

Conflicts:

	drivers/video/msm/mdp4_overlay_dtv.c
vidc: Check for proper buffer handle before free.

Check for proper buffer handle and client handle
before unmapping and freeing the buffer.

CRs-Fixed: 351100
Change-Id: I88f5e142839f12cc19360dbe26a8d4e6a7ec99de
Signed-off-by: Deepak Kotur <dkotur@codeaurora.org>
(cherry picked from commit 974a96c1634659213f7d226fa5092398ddd46398)

Conflicts:

	drivers/video/msm/vidc/common/dec/vdec.c
	drivers/video/msm/vidc/common/init/vidc_init.c
msm_fb: HDMI: Do not add HDCP reauth timer during probe

Currently all HDMI/HDCP timers are initialized in the driver's
probe function with a maximum possible expiration value. However,
the 32-bit jiffies value is initialized in the kernel so as to
wrap 5 minutes after boot. This results in the HDCP timer being
fired 5 minutes after boot even though reauthentication is not
necessary. This change fixes this issue by not starting the HDCP
reauth timer during probe. The timer is only started when an
authentication failure is detected from an existing valid HDCP
session.

CRs-Fixed: 352080
Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
(cherry picked from commit ca15287e50fe00dd6526fdc166cb526298099fb2)

Change-Id: I9e7931c51ebb3f9ec2053d02f865342ae7ca4753
Signed-off-by: Ram Kumar Chakravarthy Chebathini <rcheba@codeaurora.org>
vidc: upgrade video core clock rate based on time taken to decode a frame

Currently video clock rate is set based on the resolution
and fps of the given clip. But some clips have a high bit
rate for a given resolution which causes high decode time.
Changes were made to consider frame decode time and upgrade
the clock rate accordingly

CRs-fixed: 346580

Conflicts:

	drivers/video/msm/vidc/1080p/ddl/vcd_ddl_utils.h
	drivers/video/msm/vidc/1080p/ddl/vcd_ddl_vidc.c
	drivers/video/msm/vidc/common/vcd/vcd.h
	drivers/video/msm/vidc/common/vcd/vcd_sub.c

Change-Id: Iec3a59b5ede6105a8784160a1068db32579fb20e
Signed-off-by: Mohan Kumar Gubbihalli Lachma Naik <mgubbi@codeaurora.org>

Conflicts:

	drivers/video/msm/vidc/1080p/ddl/vcd_ddl.c
	drivers/video/msm/vidc/1080p/ddl/vcd_ddl_interrupt_handler.c
	drivers/video/msm/vidc/1080p/ddl/vcd_ddl_utils.c
	drivers/video/msm/vidc/1080p/ddl/vcd_ddl_utils.h
	drivers/video/msm/vidc/1080p/ddl/vcd_ddl_vidc.c

Conflicts:

	drivers/video/msm/vidc/1080p/ddl/vcd_ddl.h
	drivers/video/msm/vidc/1080p/resource_tracker/vcd_res_tracker.c
	drivers/video/msm/vidc/1080p/resource_tracker/vcd_res_tracker_api.h
	drivers/video/msm/vidc/720p/resource_tracker/vcd_res_tracker.c
	drivers/video/msm/vidc/720p/resource_tracker/vcd_res_tracker_api.h
	drivers/video/msm/vidc/common/vcd/vcd.h
	drivers/video/msm/vidc/common/vcd/vcd_sub.c
msm_fb: hdmi: 3D configurations in HDMI

3D configurations using Generic0 packets need to be done
after enabling HDMI Control to take these configurations
into effect.

CRs-fixed: 349578
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
(cherry picked from commit 514b1c651a33b7b73fb6f654d04355eac5ecb146)

Change-Id: Ib5dab4a8ce4e69690d1cd61640d05ce61fa68bfc
Signed-off-by: Srivalli Oguri <oguri@codeaurora.org>

Conflicts:

	drivers/video/msm/hdmi_msm.c

Conflicts:

	drivers/video/msm/hdmi_msm.c
msm: vidc: Metadata memory release issue.

Metadata memory is not freed when there is
memory allocation failure in ddl open. Fixed
this issue by freeing the metadata memory.

CRs-Fixed: 353109
Change-Id: I3f6fd93498aea0ce78092bd3a28cf08625b0ca77
Signed-off-by: Anil Gahlot <anilg@codeaurora.org>
Signed-off-by: Mohan Kumar Gubbihalli Lachma Naik <mgubbi@codeaurora.org>
(cherry picked from commit af296715bd5db6c38997d1171d079331c8650287)
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.

CRs-Fixed: 356328
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
(cherry picked from commit 1b92af6e05320b6f5858a0e4b5c9aa40e54a9b54)

Change-Id: I43cb099068ef4c69a364b142eb3c34a3fc426db6
Signed-off-by: Ramakrishna Prasad N <crpn@codeaurora.org>

Conflicts:

	drivers/video/msm/msm_fb.h
	drivers/video/msm/msm_fb_panel.h
vidc: Flush the cached buffer only if the buffer is valid.

Before flushing the cached buffer check for the following
- When buffer allocation fails, do not flush the buffer
  report error and return.
- Check if the buffer handle is valid, before flushing the
  buffer.

CRs-Fixed: 358873
Signed-off-by: Deepak Kotur <dkotur@codeaurora.org>
(cherry picked from commit 17c876f259ce77ad1e47d40ed28149109a8327cb)

Change-Id: I802f7f2c4d1076bc593f15cec5e4d43636803088
Signed-off-by: Ram Kumar Chakravarthy Chebathini <c_rcheba@qualcomm.com>

Conflicts:

	drivers/video/msm/vidc/1080p/ddl/vcd_ddl_helper.c
	drivers/video/msm/vidc/common/dec/vdec.c
	drivers/video/msm/vidc/common/enc/venc.c
	drivers/video/msm/vidc/common/enc/venc_internal.c
msm: vidc: Avoid reconfig if EoS is received after SPS/PPS

After core init, there is a hang if the data buffers
are not sent to the core as the core is not responding
to the STOP command. With this commit, reconfig is
avoided and EoS done message is sent to the client.

CRs-Fixed: 360438
Signed-off-by: Saikumar Kondaparthi <saikumar@codeaurora.org>
(cherry picked from commit fcd8763cbf25679c999e363ac63e65a234e4192d)

Change-Id: Ib7a438742de113a97c6317a7420fdee15406bd4a
Signed-off-by: Srivalli Oguri <oguri@codeaurora.org>

Conflicts:

	drivers/video/msm/vidc/720p/ddl/vcd_ddl_interrupt_handler.c
msm_fb: display: Clear background solid fill on closing video pipe

Clear background pipe's solid fill setting on closing Video pipe
to avoid blink issues in display

Signed-off-by: Ravishangar Kalyanam <rkalya@codeaurora.org>
(cherry picked from commit 29c5fb0392a1bf36ac385f5e8790999d70f6d2a6)

Change-Id: I2f98b65d2af635934ea487b301aa31ea7d45445b
Signed-off-by: Sridhar Gujje <sgujje@codeaurora.org>

Conflicts:

	drivers/video/msm/mdp4_overlay.c
video: msm: Add QSEED API to MDP_PP IOCTL

Add the ability to program the QSEED Table 1 coefficients to the features
supported by the MSMFB_MDP_PP IOCTL

Doesn't support table2 writes currently, however, the code to write to them
is already present.

QSEED support is currently only configurable via a tuneable parameter that
maps to a small subset of possible  QSEED settings. By moving to the
MSMFB_MDP_PP IOCTL, QSEEDs tables will be able to programmed to any value
requested by userspace. This also allows for future expasion of the QSEED
feature by allowing dynamic loading of the table2 coefficients (rather than
only configuring them at init).

CRs-Fixed: 351256
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>
(cherry picked from commit e01bb5a4944eea27e87ca00a869105185c13664d)

Change-Id: I533a5db95bf83b796323d0b948abf59dc5a1ed60
Signed-off-by: Ram Kumar Chakravarthy Chebathini <rcheba@codeaurora.org>

Conflicts:

	drivers/video/msm/mdp4.h

Conflicts:

	drivers/video/msm/mdp4.h
	drivers/video/msm/mdp4_util.c
	drivers/video/msm/msm_fb.c
msm: vidc: Set dpb count based on target for smooth streaming

- The min_dpb required for smooth streaming is set for the
  max requirement of 1080p playback session. For 8960 num of
  dpb required is 18 and for 8660 it is 8. This is set in
  vidc platform data in the respective device file.
- OMX IL client is adding three more buffers for graphics and
  smooth streaming. These additional buffers are not submitted till
  the first FBD.
- Port reconfiguration is not raised as the core buffer requirement is
  lesser than the client requirement.
- Add two unused graphic buffer count to the core buffer requirement
  while validating the need for port reconfiguration.

Change-Id: I40d2ae1f9b9eca8bf67626cca59c8d41ae3d4c04
CRs-fixed: 353531
Signed-off-by: Srinu Gorle <sgorle@codeaurora.org>

Conflicts:

	arch/arm/mach-msm/devices-8960.c
	arch/arm/mach-msm/devices-msm8x60.c

Conflicts:

	arch/arm/mach-msm/devices-8960.c
	arch/arm/mach-msm/devices-msm8x60.c
	arch/arm/mach-msm/include/mach/board.h
	drivers/video/msm/vidc/1080p/ddl/vcd_ddl_core.h
	drivers/video/msm/vidc/1080p/ddl/vcd_ddl_helper.c
	drivers/video/msm/vidc/1080p/ddl/vcd_ddl_properties.c
msm_fb: HDMI: Video Quantization Ranges changed

Quantization settings applied based on default range for
source format for 480p. If a non-zero value is sent then it must
correspond to transmitted video format as per the standard.
Setting RGB Quantization values in AVI Infoframe for 480p to
default range (0x0).

Change-Id: I290037c6b5240b79327f90eaea69616ab94534e0
CRs-Fixed: 349246
Signed-off-by: Manoj Rao <manojraj@codeaurora.org>

Conflicts:

	drivers/video/msm/external_common.c
	drivers/video/msm/hdmi_msm.c
	drivers/video/msm/mdp.h
	drivers/video/msm/mdp4_overlay.c
vidc: For CP2.0 do not program the iommu.

For CP2.0 do not call the ion_map_iommu api
use the ion_phys api to get the physical address

Change-Id: I8e39fb3bfb7f68df167b9432fbc008980e28742e
Signed-off-by: Deepak Kotur <dkotur@codeaurora.org>
(cherry picked from commit cbca051abe96cca82037a37dd70054132b2e8171)

Conflicts:

	drivers/video/msm/vidc/1080p/ddl/vcd_ddl_utils.c
	drivers/video/msm/vidc/1080p/resource_tracker/vcd_res_tracker.c
	drivers/video/msm/vidc/common/enc/venc_internal.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
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
(cherry picked from commit aa356f6c4d44965233c79d68bd293a258730d8c1)

Change-Id: I8585eba4aa4a5b466b1ca828453e1d473fc579be
Signed-off-by: Srivalli Oguri <oguri@codeaurora.org>

Conflicts:

	drivers/video/msm/msm_fb.c

Conflicts:

	drivers/video/msm/logo.c
	drivers/video/msm/msm_fb.c

Conflicts:

	drivers/video/msm/logo.c
	drivers/video/msm/msm_fb.c
vidc: Adjust core timeout based on current core frequency.

Core timeout value is calculated based on the current core
clock rate during video play back.

Change-Id: I52f38560eda71dd0eaf208da68b4c3f74955661b
CRs-fixed: 354069
Signed-off-by: Mohan Kumar Gubbihalli Lachma Naik <mgubbi@codeaurora.org>

Conflicts:

	drivers/video/msm/vidc/1080p/ddl/vcd_ddl_shared_mem.c
	drivers/video/msm/vidc/1080p/ddl/vcd_ddl_shared_mem.h

Signed-off-by: Mohan Kumar Gubbihalli Lachma Naik <mgubbi@codeaurora.org>

Conflicts:

	drivers/video/msm/vidc/1080p/ddl/vcd_ddl.h
	drivers/video/msm/vidc/1080p/ddl/vcd_ddl_shared_mem.c
	drivers/video/msm/vidc/1080p/ddl/vcd_ddl_shared_mem.h
fix-up

Change-Id: I3bc84b0450daaaebb5892e9c87da2331ba9713de

Conflicts:

	drivers/video/msm/msm_fb.c
Revert "fix-up"

This reverts commit 8cafb8fe863412609b8669a5140573ec89ac931e.
Revert "fix-up"

This reverts commit 2fb9789bb68cc0b5f424f834214f3dd938c6ce51.

Conflicts:

	drivers/video/msm/mdp_dma.c