msm_fb: Enable mdp clock during LVDS init.

Currently on 8064 CDP, MDP clock is off when configuring LVDS
PHY registers during boot up. This is causing display not to
come up. Enable MDP clock during the PHY configuration during
LVDS on and off.

CRs-fixed: 455620
Change-Id: Ie2b607591e936e9ab63d50cd0e2c8ba981aae6a2
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
msm_fb: display: add setting gpio-controlled backlight logic

For the panels which backlight is controlled by gpio, add this logic
in driver to turn on/off backlight, instead of calling board panel
on/off functions, to avoid garbage display due to early backlight
turn-on.

(cherry picked from commit 3eebb2e33570e32d11a757e493e12a8e79e08d6f)

CRs-fixed: 408728
Change-Id: I6f1b9bd78d96dbf1492e854edd59b05f8dec205f
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
msm_fb: display: adjust refx100 parameter to avoid tearing

refx100 is used to calculate how many mdp_vsync clocks to complete one
line in the panel. This info is used by mdp h/w to sync data transfer
between mdp h/w and command mode panel to avoid tearing.

CRs-fixed: 379223
Change-Id: I3880a350b77cb8165745ea343b1525e84100a62d
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
Revert "msm_fb: display: blt always enabled for 720p,1080p, secure buf"

This reverts commit ed3b07946fedf0b8736f737a2f14b1c2f6ef8b8e.

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

Conflicts:
	drivers/video/msm/mdp4_overlay.c
msm_fb: display: disable mdp blt mode

The switch of blt mode may cause mdp hang on some targets. To avoid
blt switch, we won't allocate the pipe that requires blt
mode. Basically this implies two things: downscaling is done by
rotator and gpu composition is used in case of blt mode is needed.

This implementation is to calculate mdp clk requirement based on the
req data passed from userspace before setting the actural pipe
data. If overlay_set asks for mdp clk that is greater than
mdp_max_clk, meaning blt is needed, overlay_set returns before pipe
allocation or pipe data change, so this way can avoid mdp to work on
wrong pipe data.

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

Conflicts:
	drivers/video/msm/mdp4_overlay.c

Conflicts:
	drivers/video/msm/mdp4_overlay.c
msm_fb: Add support for NT35590 720p panel

Add support for Truly NT35590 panel on 8930 EVT.

Change-Id: I415c264d9ad450293e7d7965a72095333e75d443
Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
Signed-off-by: Vishnuvardhan Prodduturi <vproddut@codeaurora.org>

Conflicts:
	arch/arm/mach-msm/board-8930-display.c
msm_fb: hdmi: Proper disabling of HDMI

This change allows customers to disable the HDMI in the build
itself. This can be achieved using kernelconfig macros. It fixes
issues where some of the functions got undefined after removing
the HDMI from kernelconfig. Also, fixes issues related to resume
where it was getting stuck in an empty list infinite iteration.

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

Conflicts:
	arch/arm/mach-msm/board-8930-display.c
	arch/arm/mach-msm/board-8960-display.c
	arch/arm/mach-msm/clock-8960.c
	drivers/video/msm/mdp4.h
msm: display: Adjust video timing generator parameters for 8930 EVT device.

This change adjusts the video timing generator parameters to properly configure
porch values for the panel.

Change-Id: I920646f1edbf4fe0043336dd0e2914f0302be2d8
Signed-off-by: Sangani Suryanarayana Raju <csuryan@codeaurora.org>
msm: vidc: Move metadata shared input mem to firmware heap.

Metadata shared input is used to communicate between the
video core and video driver. Allocate it from firmware
heap for specific targets as MFC command heap size is
limited.

CRs-Fixed: 450118
Change-Id: I3d04cf6dd498ae67adcec7a8cba513bd7932d158
Signed-off-by: Shobhit Pandey <cshopan@codeaurora.org>
Signed-off-by: Deepak Verma <dverma@codeaurora.org>
msm: vidc: Reduce priority of unwanted logs

Change reduces the priority of unwanted logs
which are coming in kernel logs by default
in video driver. Now these logs will come
only when enabled.

Change-Id: I18a534c7aaf8a2819be1b8812fad9e0710c49bd3
CRs-fixed: 454273
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
vidc: Handle descriptor buffer error as warning

Driver will consider descriptor buffer empty error
as warning and will continue to decode next frame.

Change-Id: Ia89ea520131f9b3e1bbe68727c34fb72685d5af9
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
Vidc: Treat Non-IDR frame type error as bit stream error

Hardware error is being generated from driver when video
core returns NON IDR frame type error during thumbnail
decoding. This change handles this error by treating
it as BIT_STREAM_ERR.

Change-Id: I16a19eea679d42a22b336d6ebbd0bd1f57c0a8a4
CRs-fixed: 414858
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>

Conflicts:
	drivers/video/msm/vidc/1080p/ddl/vcd_ddl_errors.c
	drivers/video/msm/vidc/1080p/ddl/vidc.h
msm: vidc: Fix various NULL pointer accesses, memory leaks.

This commit fixes various NULL pointer and memory leak bugs.

Change-Id: I3b3ac40b5e440b9665858913921a06de14741b6f
Signed-off-by: Rajeshwar Kurapaty <rkurapat@codeaurora.org>

Conflicts:
	drivers/video/msm/vidc/1080p/resource_tracker/vcd_res_tracker.c
	drivers/video/msm/vidc/common/vcd/vcd_client_sm.c
	drivers/video/msm/vidc/common/vcd/vcd_device_sm.c
	drivers/video/msm/vidc/common/vcd/vcd_scheduler.c
msm: vidc: Fix codec config frame with EOS flag issue

This change fixes the issue with improper handling of
codec config frame with eos flag in smooth streaming
scenario.

CRs-fixed: 467211
Change-Id: Iafd0a1a5a9073458fd139ed5845585747e51be8a
Signed-off-by: Deepak Verma <dverma@codeaurora.org>
msm: vidc: Print clip information in the logs

This change prints the required information of
the clip being played.

CRs-Fixed: 459477
Change-Id: I2fd2271cbb540e5d57d82cfcbd83cf91f7c55c93
Signed-off-by: Rajeshwar Kurapaty <rkurapat@codeaurora.org>
msm:vidc: Add support for MP2 sequence end code

ISDB-T client requires end of sequence notification
in the flags of the output buffer when sequence end
code is queued to the video core. Add support by reading
from video core shared memory and update the output buffer
flags for MPEG-2 codec.

Change-Id: Idd88fc6a5cdccb41fa61ba902a0014ec8359739a
Signed-off-by: Rajeshwar Kurapaty <rkurapat@codeaurora.org>

Conflicts:
	drivers/video/msm/vidc/1080p/ddl/vcd_ddl_interrupt_handler.c
	drivers/video/msm/vidc/1080p/ddl/vcd_ddl_shared_mem.c
	drivers/video/msm/vidc/1080p/ddl/vcd_ddl_shared_mem.h
msm: vidc: Fix klocwork error

This change fixes the klocwork errors

Change-Id: I73a6ed0e568e98a51c8e095b824a783f91ce6657
Signed-off-by: Deepak Verma <dverma@codeaurora.org>
msm: vidc: Correct the display size of small resolution clips

We change the frame height in the decoder to MDP_MIN_TILE_HEIGHT
for the videos with frame height less than 96. Due to which these
videos were not being displayed properly. This change fixes the
display change.

Change-Id: I7acc74742a8cfbdfc79b02bd20bb9109f4389fa2
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>

Conflicts:
	drivers/video/msm/vidc/1080p/ddl/vcd_ddl_properties.c
msm: vidc: Fix possible memory corruption

This change fix the possible memory corruption
by increasing the local array sizes in video
encoder.

Change-Id: If03cee2f428c3cef863178da70bc083159f203f5
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
msm: vidc: unsecure heaps in the right order during error handling

Unsecure MM and CP heaps in the right order in case of failure
CRs-Fixed: 445400

Change-Id: I2b5d414c5d9f109740a931b75b0cfbdb196c465f
Signed-off-by: Praveen Chavan <pchava@codeaurora.org>