msm_fb: display: change mdp clock while mdp is idle

Mdp clock need to be adjusted at run time base on the
performance level. However mdp clock can only be changed
when mdp blending/dma engine is idle.

Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
Signed-off-by: Ronny Schmatzler <schmatzler@googlemail.com>
msm_fb: display: add ioctl for mixer info

Add new ioctl to allow user to query mdp mixer detail configuration.

Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
Signed-off-by: Ronny Schmatzler <schmatzler@googlemail.com>
msmfb: display: support for overlay wait ioctl

this adds supports for overlay wait ioctl and it allows the
userapce start overlay play and HDMI and can call wait
later point of the time

Change-Id: I8000cc52a497861e0a5fdfe58c0c049219724ab6
Signed-off-by: Nagamalleswararao Ganji <nganji@codeaurora.org>
Signed-off-by: Ronny Schmatzler <schmatzler@googlemail.com>
msm_fb: display: Adjust overlay VG pipe src params for non-zero x_offset

Adjust overlay VG pipe src params for non-zero x_offset to avoid
overfetching of pixels from the left of x_offset

CRs-Fixed: 296185
Signed-off-by: Ravishangar Kalyanam <rkalya@codeaurora.org>
Signed-off-by: Ronny Schmatzler <schmatzler@googlemail.com>
msm_fb: display: vg pipe shared by both rgb and yuv format

VG pipe can carry both RGB and YUV format. This patch  will
allow VG pipe to switch between RGB and YUV format.

Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
Signed-off-by: Ronny Schmatzler <schmatzler@googlemail.com>
msm_fb: display: fix YCrCb planar input format support in mdp

MDP hardware expects source addresses to be in YCbCr order, in order to
support YCrCb, need to swap chroma planes addresses.

CRs-Fixed: 302408
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
Signed-off-by: Ronny Schmatzler <schmatzler@googlemail.com>
msm_fb: display: Add YV12 support in the MDP

Added changes to support YV12 input format in the MDP.

Change-Id: Id8344af1a1607cbf4a6c01ad35441bbdd4fcbd49
Signed-off-by: Pradeep Jilagam <pjilagam@codeaurora.org>
Signed-off-by: Ronny Schmatzler <schmatzler@googlemail.com>
msm_fb: display: disable timing generator before enable writeback mode

At pulling mode (lcdc and dsi video mode), timing generator need to
be turned off before enable wriback mode and turn it back on after
enabled.

CRs-fixed: 298593
Signed-off-by: kuogee Hsieh <khsieh@codeaurora.org>
Signed-off-by: Ronny Schmatzler <schmatzler@googlemail.com>
msm_fb: display: use spin_lock_irqsave before call disable_irq

disable_irq() will wait for irq handle to complete before disable
the specified irq. Therefore use spin_lock_irqsave() instead of
spin_lock() before call disable_irq() to avoid deadlock on same
spin lock.

CRs-fixed: 299938
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
Signed-off-by: Ronny Schmatzler <schmatzler@googlemail.com>
msm_fb: display: use mutex instead of spin lock to avoid deadlock

There has deadlock between mdp4_isr() and disable_irq() called by
LCDC thread. Disable_irq() will wait for mdp4_isr() to complete
before return. Meanwhile mdp4_isr() will try to acquire mdp_spin_lock
which had been acquired by lcdc thread before call disable_irq().
This patch replace spin lock with mutex to avoid deadlock from happening.

CRs-fixed: 301276
Signed-off-by: kuogee hsieh <khsieh@codeaurora.org>
Signed-off-by: Ronny Schmatzler <schmatzler@googlemail.com>
msm_fb: display: clear interrupt flag to properly wait for vsync

need to properly clear vsync interrupt flag so that subsequent waits
for vsync are handled properly, otherwise wait will return before next
vsync happens

CRs-Fixed: 299043
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
Signed-off-by: Ronny Schmatzler <schmatzler@googlemail.com>
msm_fb: display: synchronous UI and Video thread

Use mutex to synchronous between UI and Video thread.
Meanwhile, add yield() when at end of frame push of
UI thread to prevent UI thread from dominating cpu times.

CRs-fixed: 303246
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
Signed-off-by: Ronny Schmatzler <schmatzler@googlemail.com>
msm_fb: display: use blt mode to implement MDP writeback

MDP frame buffer mode was used to implement writeback for
pulling interface (lcdc and dsi video). However frame buffer
mode is not recommanded by hardware engineer due to lacking
of verification. This patch will replace frame buffer mode
with BLT mode to implement MDP writeback.

Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
Signed-off-by: Ronny Schmatzler <schmatzler@googlemail.com>
msm_fb: display: check BLT mode within overlay_done isr

At dsi video mode, overlay_done isr return immediately if blt mode
was not enabled. Aslo, since time between overlay_done interrupt and
dmap_done interrupt is very close, both may be serviced within same
ISR. In this case overlay_done is serviced first.

CRs-fixed: 310918
Change-Id: If8b6220c26ea8d08857f87f33609b1673238b2ec
Signed-off-by: kuogee hsieh <khsieh@codeaurora.org>
Signed-off-by: Ronny Schmatzler <schmatzler@googlemail.com>
msm_fb: display: Add support for HDMI as primary

Add support for using HDMI as primary. Includes changing number
of framebuffers to 2, using RGBA format, enabling HPD by default.

Change-Id: I7a01ee3cf981b08d05eed13cd0fb7a41983211b5
Signed-off-by: Ravishangar Kalyanam <rkalya@codeaurora.org>
Signed-off-by: Ronny Schmatzler <schmatzler@googlemail.com>
video: msm: Writeback support in mdp for WFD.

Adds writeback mode in mdp for wifi-display(WFD).
This mode can be used to get the captured
frames from mdp. This is added to support
wifi-display capture device.

Change-Id: Iae30cac65af181d8df4b514a128cd876fe7dda1c
Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>
Signed-off-by: Ronny Schmatzler <schmatzler@googlemail.com>
msm-fb: display: ion framework support

Add support for the ION memory manager
to the framebuffer driver

Change-Id: If012dcdbbc71eb0f7d4d429ad4789b3276d34a58
Signed-off-by: Nagamalleswararao Ganji <nganji@codeaurora.org>
Signed-off-by: Naseer Ahmed <naseer@codeaurora.org>
Signed-off-by: Ronny Schmatzler <schmatzler@googlemail.com>