Commit graph

5025 commits

Author SHA1 Message Date
Gopikrishnaiah Anandan
008f1e84da vidc: Handle EOS with Codec config buffer.
Change will handle codec config buffer with EOS.
Video driver will make sure that the codec config buffer with
EOS will be requeued in case of reconfig and non-reconfig paths.

CRs-fixed: 399347
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
(cherry picked from commit 43b203869814fe5f0ddcb265a8f859aebdaa652f)

Change-Id: Ib9a41fb842d2295804db86b2e03a62238c29984d
Signed-off-by: Dhivya Subramanian <dthiru@codeaurora.org>
Signed-off-by: Neha Pandey <nehap@codeaurora.org>
2013-03-07 15:17:46 -08:00
Arun Menon
328c0a86e3 msm: vidc: enable video core clock to 266Mhz
This change will ensure that video core clock is
set to 266Mhz on supported devices, else fallback
to 228Mhz.

Signed-off-by: Arun Menon <menon@codeaurora.org>
(cherry picked from commit 2cd6f1a77d845c162966b974b0e9dd4db0878020)

Change-Id: Ie9d28b218150f2e21fa95c4d4346251ddab3ee50
Signed-off-by: Dhivya Subramanian <dthiru@codeaurora.org>
Signed-off-by: Neha Pandey <nehap@codeaurora.org>
2013-03-07 15:17:45 -08:00
Shobhit Pandey
326157392f msm:vidc: Add the support for MPEG-2 extension and user data
Support is added for MPEG-2 extension and user data. With this
changes Core returns extension and user data as an extradata.

Change-Id: I66a230aa651dabafa883625ce9f687d5c35b8671
Signed-off-by: Shobhit Pandey <cshopan@codeaurora.org>
Signed-off-by: Neha Pandey <nehap@codeaurora.org>
2013-03-07 15:17:44 -08:00
Maheshwar Ajja
01ec926a68 vidc: 1080p: Copy input frame tag to the output frame tag
In slice delivery mode, sometimes video hardware is giving
zero frame tag on output slices instead of input frame tag
value. This commit will fix the issue by copying the input
frame tag value to the output slice frame tag when video
hardware gives zero frame tag values.

Change-Id: Icc75ca72375c4445ff9becaea45b43c03a6ddc17
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
Signed-off-by: Ramakrishna Prasad N <crpn@codeaurora.org>
Signed-off-by: Neha Pandey <nehap@codeaurora.org>
2013-03-07 15:17:43 -08:00
Maheshwar Ajja
fc8e2371a4 msm:vidc: add support for pause in eos state
This commit will add support for pause command in
eos state along with run state of the video driver.

Change-Id: I7edd064bb68845f63f0a085165e99f60ed0f3bfe
CRs-fixed: 387562
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
Signed-off-by: Neha Pandey <nehap@codeaurora.org>
2013-03-07 15:17:43 -08:00
Maheshwar Ajja
3b6e9b2b35 vidc: fix wrong number of slices in slice delivery mode
The slices completed is not matching with the expected number
of slices in frame done. The fix is available in July firmware
release and this commit will have the corresponding video driver
changes.

Change-Id: Ic0c3c7ce4f9fdbcd6e8bed852a93dcc533d83a02
CRs-fixed: 380629
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
Signed-off-by: Neha Pandey <nehap@codeaurora.org>
2013-03-07 15:17:42 -08:00
Arun Menon
087c528ff5 msm: vidc: suppress non-fatal error messages.
These messages are non-fatal and appear frequently
during video session. Hence suppressing them.

Change-Id: I539bc966bd79b4074c82a432ba7eb3fd2746bf54
CRs-Fixed: 389408
Signed-off-by: Arun Menon <menon@codeaurora.org>
Signed-off-by: Neha Pandey <nehap@codeaurora.org>
2013-03-07 15:17:42 -08:00
Shobhit Pandey
7746f06a7a msm:vidc: Add temporary buffer for MPEG-2 extension and user data.
Support is added to enable temporary buffer for processing
the MPEG-2 extension and user data for the first sequence
done.

Change-Id: Ib7fdc8bfd50bfb0da651e8da6fca26a3542c671e
Signed-off-by: Shobhit Pandey <cshopan@codeaurora.org>
Signed-off-by: Neha Pandey <nehap@codeaurora.org>
2013-03-07 15:17:42 -08:00
Mitchel Humpherys
19ce209f2d msm: vidc: include msm-specific ion header
All msm_ion clients need to use <linux/msm_ion.h> instead of
<linux/ion.h>

Change-Id: I521a079686780c117ccc9d91f27b9c59aaeafa04
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
Signed-off-by: Neha Pandey <nehap@codeaurora.org>
2013-03-07 15:17:41 -08:00
Maheshwar Ajja
c2f931c52e vidc: 1080p: IDR picture type support for H264 format
Read IDR picture type from 1080p core register set
and propagate it to user space using IDR frame type
enumeration in api header file. The IDR frame type
info is used in SYNCFRAME logic for H264 format in
userspace.

Change-Id: I6f87aea9f3c6e26b06effe68f7cb5a6c17d4bb1c
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
Signed-off-by: Neha Pandey <nehap@codeaurora.org>
2013-03-07 15:17:41 -08:00
Srinu Gorle
96ae73bff0 msm: vidc: Enable turbo mode based on client request.
- video core is bumped up to turbo mode, if more performance
  level required from multiple clients.

- Enable turbo mode atleast one of client set turbo mode.

Change-Id: Ied777463fdfe54ea6ff3b2a29cbaf0d27a9586cb
CRs-Fixed: 385454
Signed-off-by: Srinu Gorle <sgorle@codeaurora.org>
Signed-off-by: Neha Pandey <nehap@codeaurora.org>
2013-03-07 15:17:40 -08:00
Naseer Ahmed
d49be7e3d4 msm_fb: display: fix dsi controller hang up during blt enable/disable
Wait for 2 ms to make sure both dsi lanes are in stop state and
fifo are empty before reseting dsi controller.

Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
2013-03-04 12:48:12 -08:00
Jeff Brown
93d182f55a mako: backlight: use linear brightness ramp 2013-03-04 12:48:09 -08:00
Devin Kim
b797c941d2 backlight: lm3530: remove board specific hard-coding value
get the board specific data from pdata. do not hard coding in driver.

Change-Id: Id2ebc4475755adcd81297064f32cc3169c55eaca
2013-03-04 12:48:08 -08:00
Naseer Ahmed
254ea5d54d msm: mdp: Set clock rates on external interface as needed
This allows the clock on the external to go to maximum

Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
2013-03-04 12:47:58 -08:00
Iliyan Malchev
32115585ca Revert "Revert "mako: display: change color value to displayed in case of underflow""
This reverts commit ab22e7d8068b973ad4f9a547fdf4cfc1bfdb29b9.
2013-03-04 12:47:57 -08:00
Naseer Ahmed
627979d3d8 msm: display: add delay after taking out the base layer.
During the blank sequence, base layer will be removed if mfd
reference count is 0. Need to add some delay to make sure it
takes effect before turning off panel.

Signed-off-by: Ken Zhang <kenz@codeaurora.org>
2013-03-04 12:47:56 -08:00
Naseer Ahmed
5cb75f672e msm_fb: display: Fix flickering when BLT is enabled/disabled
The transition of BLT enable and disable start at the beginning
of vsync. This ensures that the transition is completed within the
same vsync period. We Wait for DMA-P done after turning off the
timing generator and do not prefill the frame.

Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
2013-03-04 12:47:54 -08:00
Naseer Ahmed
810e0ef6ed msm_fb: HDMI: Add support for hdmi_audio switch node
- Add switch device node for hdmi audio on initialization.
- Final node path will be /devices/virtual/switch/hdmi_audio
- Set the node state to 1 when the HDMI EDID for the sink
  supports audio
- Set the node state to 0 otherwise(DVI)

Signed-off-by: Arun Kumar K.R <akumarkr@codeaurora.org>
2013-03-04 12:47:50 -08:00
Naseer Ahmed
ca3342169d msm: mdp: Initialize vsync sysfs in probe
Signed-off-by: Mayank Chopra <makchopra@codeaurora.org>
Signed-off-by: Naseer Ahmed <naseer@codeaurora.org>
2013-03-04 12:47:45 -08:00
Naseer Ahmed
c6128ebec5 msm: display: display idle checking update
msm_fb_blank_sub might be called for UNBLANK from
display update work queue, which is at commit state.
Idle detection is invalid in this situation
Add detection for external snd earlyuspend/resume interface.

Signed-off-by: Ken Zhang <kenz@codeaurora.org>
2013-03-04 12:47:27 -08:00
Naseer Ahmed
e486051c01 msm_fb: display: blt always enabled for 720p,1080p, secure buf
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
2013-03-04 12:47:26 -08:00
Naseer Ahmed
ffde53dc8f msm_fb: display: add options to switch blt mode for dsi video
Currently switching mdp blt mode is done in dmap done isr which could
cause mdp hang for some panels/targets. One option is added: turning
off timing generator when switching blt mode, to avoid hang issues.

Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
2013-03-04 12:47:26 -08:00
Naseer Ahmed
ca82d7b7cd msm: mdp: Remove mixer1 blt for external
BLT mode is not needed for external displays since
there is no extra downscaling needed for videos.
2013-03-04 12:47:25 -08:00
Naseer Ahmed
c2975c4ed3 msm: display: add more checking to ensure display is idle
Before execute operation on display, make sure it is complete idle
Because non-blocking display update has been introduced, need make sure
display update has finished in all entrances except the ones for
initialization.

Change-Id: I0660080262b7e5895f5f558c0a9f71aa84b9aa99
Signed-off-by: Ken Zhang <kenz@codeaurora.org>
Signed-off-by: Naseer Ahmed <naseer@codeaurora.org>
2013-03-04 12:47:16 -08:00
Naseer Ahmed
8bc7f7dfd6 msm: mdp: Fix clocks
The max supported clock was wrong
2013-03-04 12:47:14 -08:00
Ajay Dudani
b6c60c851b msm: vidc: fix buffer pool index
While searching for the available buffer entry in the buffer pool the search
should begin from index 1 as zeroth entry is reserved.

Change-Id: I051b0232bb782f073ba9ad0b757a799703814df3
Signed-off-by: Mohan Kumar Gubbihalli Lachma Naik <mgubbi@codeaurora.org>
Signed-off-by: Iliyan Malchev <malchev@google.com>
2013-03-04 12:47:10 -08:00
choongryeol.lee
36faabbf48 mako: display: reduce mipi line clock per LGSI spec
Mako's MIPI line clock is a little bit higher than LGSI's recommendation.  Due
to this higher clock, flickering could happen in some panels.  This patch
reduces the MIPI line clock as LGSI's recommendation.

This also reduces current consumption by ~10mA when the LCD is on.

Signed-off-by: Iliyan Malchev <malchev@google.com>
2013-03-04 12:47:07 -08:00
Naseer Ahmed
eae171b96b msm: display: Do not create release fence in suspend
When in suspend state, display operation will be stopped,
fence will not be signaled

Signed-off-by: Ken Zhang <kenz@codeaurora.org>
2013-03-04 12:47:04 -08:00
Naseer Ahmed
590f819b66 msm: display: panel recovering from suspend
In suspend state, fb_open cannot turn on panel, need save this info
for resume.
In suspend state, blank setting needs be cached to be used at resuming.

Signed-off-by: Ken Zhang <kenz@codeaurora.org>
2013-03-04 12:47:03 -08:00
Naseer Ahmed
4c1b041757 msm: display: allow fb open even in suspend state
resume might be coming later, allow fb open sucessfully, only
panel driver needs be delayed

Signed-off-by: Ken Zhang <kenz@codeaurora.org>
2013-03-04 12:47:03 -08:00
Saurabh Shah
4c241bf133 msm: display: Allow MDP clocks to use Max clock.
Allowing the MDP clock to use its Max clock in order to avoid the blt
mode switch issues for both MDP mixers, as blt mode switch resulting
in HW hung

Signed-off-by: Nagamalleswararao Ganji <nganji@codeaurora.org>
2013-03-04 12:47:02 -08:00
Naseer Ahmed
6c9ad4d7e6 msm: fb: make the pan task interruptible 2013-03-04 12:46:58 -08:00
Deva Ramasubramanian
299732780b vidc: handle secure and non-secure session concurrency
Non-secure session should be rejected if a secure session is
running.

Change-Id: I13364a7bc4417a682728be333681278e7de8a1f7
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
2013-03-04 12:46:58 -08:00
Naseer Ahmed
6c79a98a56 msm_fb: display: empty pending queue during suspend
Overlay_play() adds a pipe into pending queue and pan_display()
will commit those pipes to hardware and empty queue. This patch
will make sure queue is empty at suspend so that no unexpected
pipes will be commited to hardware by pan_display() at resume.
Otherwise, iommu page fault may happen.

Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
Signed-off-by: Naseer Ahmed <naseer@codeaurora.org>
2013-03-04 12:46:57 -08:00
Saurabh Shah
001200a326 msm_fb: HDMI: HDCP: Start HDCP authentication as a work item
HDCP authentication should be kicked off as a scheduled work
item so as to ensure that MDP is already configured and frames
are being transmitted over the HDMI channel prior to the start
of the HDCP authentication procedure.

Change-Id: I27cab44babfc24d91a318b0641674f85910cc33f
Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
Signed-off-by: Saurabh Shah <saurshah@codeaurora.org>
2013-03-04 12:46:57 -08:00
Naseer Ahmed
8f8c3d414d msm: mdp: vsync sysfs bug
Make the read interruptible

Signed-off-by: Iliyan Malchev <malchev@google.com>
2013-03-04 12:46:55 -08:00
Naseer Ahmed
c5ab413277 mdp: Do not start LUT for overlay0
The post processing daemon is not used currently.
Enabling the LUT without using it can potentially
cause display hangs.
2013-03-04 12:46:54 -08:00
Naseer Ahmed
8b804aaf0b msm: display: buf sync enhancement
Support waiting for acquire fences in the buffer sync ioctl.

Signed-off-by: Ken Zhang <kenz@codeaurora.org>
Signed-off-by: Naseer Ahmed <naseer@codeaurora.org>
2013-03-04 12:46:51 -08:00
Naseer Ahmed
504021da52 msm: display: add display commit ioctl
Display commit ioctl will do what pan_display
can do, addtionally has customized setting, such
as non-blocking call.

Signed-off-by: Ken Zhang <kenz@codeaurora.org>
Signed-off-by: Naseer Ahmed <naseer@codeaurora.org>
2013-03-04 12:46:50 -08:00
Naseer Ahmed
c2f0fb04a0 msm: display: make pan display as a non-blocking call
Schedule a workqueue, do the current job in the workqueue handler.
Block the second entry if the first one has not finished

Change-Id: I9466c7795bd9d6765f468bf30f4021802d904c36
Signed-off-by: Ken Zhang <kenz@codeaurora.org>

Conflicts:

	drivers/video/msm/msm_fb.c

Signed-off-by: Naseer Ahmed <naseer@codeaurora.org>
2013-03-04 12:46:49 -08:00
Naseer Ahmed
e0501cd8dd msm: display: add sync point support in overlay commit
Wait for fence signaled before commit, signal previous
fence after commit done. Same as pan display

Signed-off-by: Ken Zhang <kenz@codeaurora.org>
Signed-off-by: Naseer Ahmed <naseer@codeaurora.org>
2013-03-04 12:46:49 -08:00
Naseer Ahmed
7bf0610f43 msm_fb: display: Send vsync events using sysfs for MDP4 targets
Replace sending of vsync timestamp using uevents with sysfs entry
as uevent result in increase in power numbers due to broadcast in
nature. Also, for smart panel, wait4vsync is removed.

Change-Id: I5219e85b837b8bab9d00a9f40c1048d2a2355194
Signed-off-by: Mayank Chopra <makchopra@codeaurora.org>
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>

Conflicts:

	drivers/video/msm/mdp4_overlay_dsi_video.c

Signed-off-by: Naseer Ahmed <naseer@codeaurora.org>
2013-03-04 12:46:48 -08:00
Naseer Ahmed
55a848bcdb msm_fb: display: add support of mdp clocks controlled by vsync
Mdp related clocks are controlled through vsync enable/disable
ioctl from userspace frame work.

Crs-fixed: 384482
Change-Id: I5999ad17955e0f862f64036a6390016ff3a6782f
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>

Conflicts:

	drivers/video/msm/mdp4_overlay_dsi_cmd.c

Signed-off-by: Naseer Ahmed <naseer@codeaurora.org>
2013-03-04 12:46:48 -08:00
Naseer Ahmed
5e6d6c1c23 msm_fb: display: add dcs command list for dsi command mode
DSI dcs commands and mdp pixel stream share same dsi link.
Add dcs command list to serialize sending dcs command and mdp
pixel stream to avoid contention which may cause dsi controller
to stall.

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

Conflicts:

	drivers/video/msm/mdp4.h

Signed-off-by: Naseer Ahmed <naseer@codeaurora.org>
2013-03-04 12:46:47 -08:00
Naseer Ahmed
f212305887 msm: mdp: Release all fences on blank
Signed-off-by: Ken Zhang <kenz@codeaurora.org>
Signed-off-by: Naseer Ahmed <naseer@codeaurora.org>
Signed-off-by: Iliyan Malchev <malchev@google.com>
2013-03-04 12:46:45 -08:00
Iliyan Malchev
0d312d6ec3 Revert "mako: display: change color value to displayed in case of underflow"
Reverting this change allows display underflows to cause flashes of blue, which
will help prove that underflows are occurring.

This reverts commit e6f596dbcd307e33e4e4842914a027c7f7138bd9.
2013-03-04 12:46:44 -08:00
Devin Kim
68866784f6 backlight: lm3530: set CABC register on first bootup
If we don't apply CABC register setting at the first bootup, then it makes a
power difference between the bootup time and the first suspend and resume,
approximately 38mA.

Change-Id: I91c915af31e9ff6934ce733f3fb2c8b96e1adf31
Signed-off-by: Iliyan Malchev <malchev@google.com>
2013-03-04 12:46:42 -08:00
Ajay Dudani
18ffec4a52 vidc: close instance if securing session fails.
Video driver will close the instance if secure call fails.

Change-Id: I39147272a9183f011529078fe8a18ac8cb2726fd
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
Signed-off-by: Ajay Dudani <adudani@codeaurora.org>
Signed-off-by: Iliyan Malchev <malchev@google.com>
2013-03-04 12:46:40 -08:00
Deva Ramasubramanian
5b896d7477 msm: vidc: Allow client to request sps/pps per IDR frame
Expose SET_SPS_PPS_FOR_IDR to allow client request sps/pper per IDR
frame.

Change-Id: I0316d751bd1e0b412972cba9d4d59b142500a51d
Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>
2013-03-04 12:46:39 -08:00
Saurabh Shah
736cf9db3b msm_fb: display: Add MSMFB_OVERLAY_COMMIT ioctl.
MSMFB_OVERLAY_COMMIT ioctl is used to display on external.
This is used instead of the default PAN mechanism to avoid delays in that path.
This ioctl for external also waits for DMAE thus fixing tearing.

Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
Signed-off-by: Arun Kumar K.R <akumarkr@codeaurora.org>
2013-03-04 12:46:38 -08:00
Ajay Dudani
18f0324bea vidc: Error handling for memory heap mapping.
Memory heap should be unsecured if secure call is successful.
This change will make sure that an unsecure will be called
only if securing of the memory heap went through fine.

CRs-Fixed: 393041
Change-Id: I49dd81d1846fc6936518c750a32921c8498ddb95
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
Signed-off-by: Riaz Ur Rahaman <riazr@codeaurora.org>
Signed-off-by: Ajay Dudani <adudani@codeaurora.org>
2013-03-04 12:46:32 -08:00
Naseer Ahmed
2c889a591a msm_fb: hdmi: Add support for HDMI Audio caps
Add sysfs nodes to export the data contained in the
audio data block and the speaker allocation data block
from the EDID of a connected HDMI sink.

Change-Id: Ie558e930cc5790965d46eb2c30156a23643fa1f7
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
Signed-off-by: Naseer Ahmed <naseer@codeaurora.org>
2013-03-04 12:46:30 -08:00
Naseer Ahmed
59a8a43802 msm_fb: hdmi: Fix parsing of audio capabilities
Fix bugs in the parsing of the Audio Data Blocks and the
Speaker Allocation Data Blocks in the EDID data.

Change-Id: I666cf82d149c8ebb02d3bca3a053e494890870c0
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
Signed-off-by: Naseer Ahmed <naseer@codeaurora.org>
2013-03-04 12:46:29 -08:00
Devin Kim
07cd434307 msm_fb: call the backlight control before FB_BLANK_POWERDOWN
You might see the white line while lcd off. You should turn lcd backlight
off before lcd off to avoid that issue. So call the notifier for backlight
before handling of FB_BLANK_POWERDOWN in msm_fb.

Change-Id: I3bd08025a949ec02a1fba7cef98a13d8977c135b
2013-03-04 12:46:29 -08:00
Naseer Ahmed
3aa5b914d3 msm_fb: display: empty queue at suspend
Change-Id: Iafdf469c6cdbf5d469c9dee114555a8d1adb9c66
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
Signed-off-by: Naseer Ahmed <naseer@codeaurora.org>
2013-03-04 12:46:27 -08:00
Naseer Ahmed
94f97545b1 msm : display: buffer sync point update
Do not put sync point if it has been added to
a fence successfully in error handling

Signed-off-by: Ken Zhang <kenz@codeaurora.org>
Signed-off-by: Naseer Ahmed <naseer@codeaurora.org>
2013-03-04 12:46:26 -08:00
Naseer Ahmed
1816d1eb76 msm: mdp: Disable vsync in video off.
Signed-off-by: Naseer Ahmed <naseer@codeaurora.org>
2013-03-04 12:46:26 -08:00
Naseer Ahmed
fdf06a0c73 msm_fb: display: remove extra dmap irq disable
irq enable and disable need to be called symmetrically.
Remove an extra dmap irq disable call.

Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
Signed-off-by: Naseer Ahmed <naseer@codeaurora.org>
2013-03-04 12:46:25 -08:00
jh.koo
cbff6e7a0c slimport: Modify to support slimport-to-VGA and slimport-to-DP dongles
Change-Id: I4bbe996351d50bfa2a4073987c97db37a4ed3484
2013-03-04 12:46:21 -08:00
Devin Kim
ae71d63d07 msm_fb: Fix display corruption with continuous splash screen feature
During boot up, we observe random lines on screen between the
splash_screen image and the android animation. MDP clocks
were turned off during bootup. Fix this issue by enabling
the clocks when this feature is enabled.

Add check to see that the video mode engine is not busy before
turning off the dsi controller to avoid any underruns.

CRs-Fixed: 399634

Change-Id: I8fdb50fa848362a548b8cdd53ee1817346b57716
Signed-off-by: Chandan Uddaraju <chandanu@codeaurora.org>
2013-03-04 12:46:18 -08:00
Naseer Ahmed
ccd2059e3c msm_fb: display: check base layer pipe at irq handler
Change-Id: Ib188d575044f5479672503508042c8c1e9c759c4
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
Signed-off-by: Naseer Ahmed <naseer@codeaurora.org>
2013-03-04 12:46:15 -08:00
Naseer Ahmed
5f2bdb1c5f msm_fb: display: add blt condition check at video/lcdc off
Blt mode may be enabled during system suspend. Need to make
sure blt overlay done  before turn off video/lcdc timig generator.

Change-Id: Iad54ee544499213bb7c9cfe60d00919f819aacb1
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
Signed-off-by: Naseer Ahmed <naseer@codeaurora.org>
2013-03-04 12:46:14 -08:00
Kinjal Bhavsar
70f7421a80 msm: display: Buffer sync point support
Add MSMFB_BUFFER_SYNC ioctl for the communication of
the acquired and released fence fd between kernel and hwc.

Wait for acquired fence before pan display.
Release the previous released fence after pan display

Change-Id: I6534aed574a025d948581e70465f06a86b46c868
Signed-off-by: Ken Zhang <kenz@codeaurora.org>
2013-03-04 12:46:14 -08:00
Naseer Ahmed
bd7a66d33a msm: mdp: Send fake vsync only when enabled from userspace
Signed-off-by: Naseer Ahmed <naseer@codeaurora.org>
2013-03-04 12:46:13 -08:00
Naseer Ahmed
53e65eac9e msm_fb: Clear real pipe attributes in the pipe free
Clear original pipe attributes in the pipe free call.

Change-Id: I776869e7997e5b70e4c2b102e1a394034247bbcd
Signed-off-by: Kalyan Thota <kalyant@codeaurora.org>
Signed-off-by: Naseer Ahmed <naseer@codeaurora.org>
2013-03-04 12:46:08 -08:00
Jongrak Kwon
a5a9c40226 msm: dsi: use timeout for dma transfer
Use wait_for_completion_timeout instead of wait_for_completion
not to stuck in the kernel even when the DMA fails.

Change-Id: I29702c3c62f78399c173d660bbbc17a07ed27468
Signed-off-by: Iliyan Malchev <malchev@google.com>
2013-03-04 12:46:07 -08:00
Jongrak Kwon
73161d35e7 Revert "[ARM] msm: fix mipi_dsi_off"
Preserve original dsi-off sequence to remove DMA failure.  Previously the power
off sequence was modified to resolve display turn on/off issue, but the changes
were not necessary in current kernel and just caused side effects which
resulted in fb_blank being stuck due to occasional DMA failures.

This reverts commit e1a9b1bda7691e4f62728d09e1993eb9ae9db8d6.

Change-Id: Ia0a60cfdf697675d34066852f106d9e37578073d
Signed-off-by: Iliyan Malchev <malchev@google.com>
2013-03-04 12:46:07 -08:00
Jongrak Kwon
7060213779 Revert "[ARM] msm: fix mdp_off"
Preserve original mdp off sequence to remove DMA failure.  Previously the power
off sequence was modified to resolve display turn on / off issue, but the
changes is not necessary in current kernel and just causes side effects
resulting in fb_blank being stuck due to occasional DMA failures.

This reverts commit 0b3bc7e958f98432538a8537739fbaa560761434.

Change-Id: Ia82fb79b56b57f6696c55d9b079eeadebe8c40bf
Signed-off-by: Iliyan Malchev <malchev@google.com>
2013-03-04 12:46:06 -08:00
Devin Kim
f80be7d12e backlight: lm3530: decrease a little more backlight level
decrease backlight level to 70 nit at the charging mode

Change-Id: I3ad14dbcfc5daf5090219da21c3f348fdb97ff77
2013-03-04 12:45:59 -08:00
choongryeol.lee
23580403bd Revert "mako: backlight: sync backlight on/off with lcd on/off"
This reverts commit af3f22de5dd769b555c018c12be837450cd59dd6.

Due to the order of backlight and lcd on/off will be guaranteed by
PowerManagerService, this patch is reverted.

Change-Id: I2e54dc14d338b5bfa1aca1bddcc37b46928a94e8
Signed-off-by: Iliyan Malchev <malchev@google.com>

Conflicts:
	drivers/video/msm/msm_fb.c
2013-03-04 12:45:51 -08:00
Iliyan Malchev
77af5d3270 msm_fsb: handle pipe-allocation errors
In mdp4_overlay_writeback_on, return -EIO is pipe allocation fails.

Signed-off-by: Iliyan Malchev <malchev@google.com>
2013-03-04 12:45:49 -08:00
Ajay Dudani
475ec34506 msm_fb: Add option to enable/disable mixer commit
Adds support to enable or disable mixer commit during pipe staging operations.
Depending on the current activity, this selection can be made.

Change-Id: Ia2f5dbab58f73ef4de90abf7f278332d8d73df46
Signed-off-by: Pradeep Jilagam <pjilagam@codeaurora.org>
Signed-off-by: Ajay Dudani <adudani@codeaurora.org>
Signed-off-by: Iliyan Malchev <malchev@google.com>
2013-03-04 12:45:49 -08:00
Ajay Dudani
af539886f6 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: Kuogee Hsieh <khsieh@codeaurora.org>
Signed-off-by: Ajay Dudani <adudani@codeaurora.org>
2013-03-04 12:45:48 -08:00
Devin Kim
ce9d76b093 mako: display: disable LP stop mode
Enabling LP stop flag caused flicking or after image.

Change-Id: I91066bebc3b4c5277ef524435615c1b8bde70e80
2013-03-04 12:45:32 -08:00
Devin Kim
1c659927e5 mako: display: increase mipi line speed
increase mipi speed to 470Mbps from 450Mbps
too low line speed don't support HD resolution

Change-Id: I572afcc82f0c67aa0d45547f3f7f10214f4ebf81
2013-03-04 12:45:32 -08:00
Deva Ramasubramanian
eb9863d4c8 vidc: Correct start and stop sequence.
Video core stop should be called only if start is successful.

Change-Id: Ie2a8d970355387ee3fcdc34b62184972e89dd6cc
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
2013-03-04 12:45:29 -08:00
jh.koo
6ff2586036 slimport: Add slimport detection function
It will be used for charger detection codes. slimport is also used
as charger like as usb charger

Change-Id: Idd40dd88b8a5f035dfb207dd787d7fd3f4ae713b
2013-03-04 12:45:23 -08:00
Deva Ramasubramanian
de751b9e44 vidc: Add secure node support for encoder.
Encoder driver will expose a new node for clients
intending to start a secure encoding session.

Change-Id: I2a104155fd19534a3b3b35e6606d39047f34c42f
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
2013-03-04 12:45:22 -08:00
Deva Ramasubramanian
a7b1a91bbb msm: vidc: Use MM heap for prediction buffer during secure encode
We are incorrectly using the firmware heap to allocate prediction
buffers. This violates an agreement between TZ and HLOS that only
the firmware will reside in the FW heap. As such, move the buffer
to MM heap.

Change-Id: I2c91499c38043abfa21ae3443d3a8f22d6474eaa
CRs-fixed: 380161
Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>
2013-03-04 12:45:21 -08:00
jaekyung.oh
0e4c04388a mako: display: update lcd initial code.
Added OTP read protection code for prevent skew value read error.

Change-Id: Ic91031c41ccf6a43346eb0e20f82ad6144fccab2
Signed-off-by: Iliyan Malchev <malchev@google.com>
2013-03-04 12:45:16 -08:00
Devin Kim
7e45a10da4 backlight: lm3530: add the backlight map in platform data
Add the backlight map into platform data for calibrating
by the board specific values

Change-Id: Ib997a8cbf738b2700305028f47178f31420f9e85
2013-03-04 12:45:13 -08:00
Ajay Dudani
c271edce37 Revert "msm: vidc: Correct calculation of yuv buffer size"
This reverts commit 3a2945ef2385ae934ab4df98f26651d132b7b4fc.
2013-03-04 12:44:56 -08:00
Ajay Dudani
27cf9b7743 msm_fb: display: add mutex on overlay_play to fix iommu page fault
An iommu page fault may heppen When a pipe_commit is executed
in between of frame dropped and pipe_queue during overlay play.
An mutex is necessary to mutual exclusive between pipe_commit
and overlay_play.

Change-Id: I736e821c6c648a6ebd435303a1906a40e9b75791
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
Signed-off-by: Ajay Dudani <adudani@codeaurora.org>
2013-03-04 12:44:51 -08:00
Ajay Dudani
6d8f25a183 msm_fb: display: add wait for overlay0 done
Dcs command mode BLT involves both overlay0 done interrupt
and dmap done interrupt. A transaction is start at kickoff and
end with done interrupt.  At some cornor cases both overlay0 and
dmap transaction need to be completed before kickoff new transaction.

Change-Id: I5a3cc6e8255acf2c61fc627d35f990182d226f63
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
Signed-off-by: Ajay Dudani <adudani@codeaurora.org>
2013-03-04 12:44:51 -08:00
Ajay Dudani
83a5244576 msm_fb: display: fix mdp crash during overlay unset
Check real_pipe address before refer to it.

Change-Id: I2f8c6fa6f8e657801dc676f7d9887e7eb0f10e73
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
Signed-off-by: Ajay Dudani <adudani@codeaurora.org>
2013-03-04 12:44:50 -08:00
Ajay Dudani
523352899a msm_fb: display: alloc/free writeback buffer done at do_blt()
To avoid double freeing writeback at end of blt mode, let
both alloc and free writeback buffer done at do_blt().

Change-Id: Ida5d24589c19be8f6f655eca6add00badca356b2
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
Signed-off-by: Ajay Dudani <adudani@codeaurora.org>
2013-03-04 12:44:50 -08:00
Ajay Dudani
de46e23776 msm_fb: display: fix page fault during supend/resume
There has VG1 pipe commit (pan display) happen after system
suspended. This left VG1 still staged up at mdp mixer. Once timing
generator is enabled at resume, VG1 pipe start fetching contents from
address 0 since VG1 has not yet be configured. This cause page fault.
This patch has sanity check at system suspend to make sure no any pipe
stage up at mixer after suspend.

Change-Id: Idcf974ceb4afe2a3ec55b9603b700fa497f84045
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
Signed-off-by: Ajay Dudani <adudani@codeaurora.org>
2013-03-04 12:44:49 -08:00
Naseer Ahmed
71be284a8e mdp: Fix incorrect reserved[3] usage 2013-03-04 12:44:10 -08:00
Naseer Ahmed
8b1bd63cfb msm: mdp: Fix reserved field usage
An earlier commit(ec5b2f)increased the number of reserved fields
in the kernel standard fb.h header changing the struct size.
This caused issues with userland applications using the corresponding
bionic header. This patch revert the earlier increas in size
and makes corresponding adjustments to the reserved field usage.
A follow up patch will remove usage of reserved fields entirely.
2013-03-04 12:44:09 -08:00
Iliyan Malchev
d3e1e3e13e [ARM] msm: call video start function
Signed-off-by: Iliyan Malchev <malchev@google.com>
2013-03-04 12:44:04 -08:00
Iliyan Malchev
6a72f05a4f [ARM] msm: fix mipi_dsi_off
Signed-off-by: Iliyan Malchev <malchev@google.com>

Conflicts:
	drivers/video/msm/mipi_dsi.c
2013-03-04 12:44:03 -08:00
Iliyan Malchev
89244c5bea [ARM] msm: fix mdp_off
Signed-off-by: Iliyan Malchev <malchev@google.com>
2013-03-04 12:44:02 -08:00
taeyol.kim
55499f5ac1 display: removed the code exhausts file descriptor in mdp overlay and rotator.
Fix the problem crashed while playing video clips and VT camera test.
ion_share_dma_buf is called in pr_debug.
So, it is called depends on build option and makes crash problem.
2013-03-04 12:43:58 -08:00
choongryeol.lee
a87d0e534a msm_fb: check null pointer before reading backlight on status
Since msm_fb_blank_sub() can be called from hdmi which has no
backlight, we should check the null pointer before to run the
get_backlight_on_status().

Change-Id: I9a91dc337b56e20fbfd82347cf429350f1a72b37
2013-03-04 12:43:49 -08:00
jaekyung.oh
781f6d1c2f mako: display: fixed lcd blink in the first boot.
VGL/VGH power generation is reenabled when first boot.
So Skip this routine when booting.
2013-03-04 12:43:34 -08:00
choongryeol.lee
2cb854aebc mako: backlight: sync backlight on/off with lcd on/off
To avoid dispalying garbage during lcd on/off, the turning on
lcd should be done before backlight on and turning off backlight
should be finished before lcd off. But current implementation
doesn't guarantee these on/off sequence. This patch ensure the
sequence of lcd and backligth on/off.

Change-Id: I11771d395c1a68b4e70b63639f50c773a665b441
Signed-off-by: Iliyan Malchev <malchev@google.com>

Conflicts:
	drivers/video/msm/msm_fb.c
2013-03-04 12:43:34 -08:00
choongryeol.lee
20c283689b backlight: lm3530: add level setting to bl_set_intensity()
When application calls FBIOBLANK ioctl without backlight control,
even though bl_set_intensity() is called by fb_notifier_callback,
the backlight level cannot be set properly. So this patch add the
level changing to bl_set_intensity().

Change-Id: Id512c2f1bffbde2d47186d40071d05bc1388dc03
2013-03-04 12:43:33 -08:00
choongryeol.lee
dc93c5a1ec mako: display: change color value to displayed in case of underflow
In case of data underflow, MDP display specific color on lcd.
Due to data underflow rarely happen during display on/off,
we can see unintended blue screen at that time.
So this patch changes this underflow control color from blue to black
for hiding unintended blue image displaying during display on/off.

Change-Id: I26910065b5210a2571125d25f3f1b41a67ba1c1c
2013-03-04 12:43:32 -08:00
choongryeol.lee
6a18ef8007 mako: display: enable lcd color temperature calibration
Add lcd color temperature calibration interface and apply
the calibrated value to the target using mdp lut.

Change-Id: Ibdd606a155e0d7708ba79be6f817c3d89b51a282
2013-03-04 12:43:31 -08:00
choongryeol.lee
01fc0013e4 mako: display: enable CABC function
CABC(Content Adaptive Backlight Control) is supported by
mako lcd panel. So this patch enables it to reduce power
consumption.

Change-Id: I433281bc5fe4e638cfeba1beb9cb61e1775f3896
2013-03-04 12:43:27 -08:00
choongryeol.lee
58aa102331 Revert "mako: temoprarily blocked mdp error message"
This reverts commit 0fca8a4db86917c28b9c8161b1ae5ee73743605d.
2013-03-04 12:43:20 -08:00
choongryeol.lee
b4826d07a0 mako: slimport: enable slimport for mako
apply slimport driver to mako

Change-Id: I411d89784ab2796db61cb9f3202952e0e5744107
2013-03-04 12:43:20 -08:00
choongryeol.lee
fe01ac999e mako: display: update lcd initial code
update lcd initial code and change power on sequence for
new initial code.

Change-Id: Ic876d5dbef3528591ca374ba0f67f073f4584534
Signed-off-by: Iliyan Malchev <malchev@google.com>
2013-03-04 12:43:14 -08:00
choongryeol.lee
c56669fd51 mako: display: clean up the mako display code
remove unused features and clean up the mako
display related code

Change-Id: I1a6fa783a83eef747a98a3e70341c50de2cfd74f
2013-03-04 12:43:13 -08:00
choongryeol.lee
572895635a mako: display: remove unused config from Kconfig
Change-Id: I8ea6a5600869d41480eb8fbcfe54ea1bea03802a
2013-03-04 12:43:13 -08:00
Devin Kim
3b795c2300 backlight: lm3530: cleanup codes
- add include/linux/platform_data/lm35xx_bl.h
- remove redundant variables and codes
- handle the erorrs in probe
- fix the memory leak

Change-Id: I279ebc9098f70e78d618abdcc75df23bbf8e604a
2013-03-04 12:43:08 -08:00
Devin Kim
578dee3739 msm_fb: clean fb to prevent displaying old fb
clean fb to prevent displaying old fb on resume.

Change-Id: Iab169e7a36b6bd168631bbf9763319ba4388f82d
2013-03-04 09:12:34 -08:00
Devin Kim
7ef56e4f71 backlight: lm3530: fix the abnormal backlght control
- use global mutex
- remove unneccessary earlysuspend codes

Change-Id: I999786f2879e27d1749bfee98cd0451eb24a9ccf
2013-03-04 09:12:25 -08:00
Devin Kim
f203643910 msm_fb: HACK: wait until completing backlight control
sleep 300ms until completing the backlight control. and then set
the panel_power_on and bl_updated as false

Change-Id: Ia289cdcd08ad012d192a079dd1b765d74b911be2
2013-03-04 09:12:24 -08:00
Devin Kim
9690f1d0a6 mako: add LCD calibration codes and enble
- set initial qcom lcdc lock up table
- interface to calibrate lcd color temperature
- interface to calibrate lcd color temperature by qlut

Change-Id: Iae2607a2ec3447211cdce5e55fac5767cc6d7fb4
2013-03-04 09:12:04 -08:00
Devin Kim
3259f9d959 hdmi: able to build kernel without hdmi feature
If not using HDMI, compiling errors occur. it's fixes to build
kernel without HDMI feature

Change-Id: Ida5babdc2f8ebaf73cd5c52b3f4686b27f6f1aa1
2013-03-04 09:11:48 -08:00
Jaeseong GIM
da8dc4323c mako: enable lgit lcd driver
bring-up lgit lcd for mako board.

Change-Id: I343064255935eacba4ea48bec4dbaff59fd7026d
Signed-off-by: Iliyan Malchev <malchev@google.com>
2013-03-04 09:11:42 -08:00
Jaeseong GIM
8b589d364f mako: enable lm3530 backlight driver
bring-up lm3530 backlight for mako board.

Change-Id: Ib1746f0ce13603e7f981e61f9b9ea83f91fa2b1a
2013-02-28 12:14:26 -08:00
Devin Kim
90b502b496 mako: temporarily enable fake display (for booting)
temporarily enable fake display for booting.

Change-Id: I55a5e11167c7c96c9de87952983c0189f2977f38
2013-02-28 12:14:24 -08:00
Devin Kim
06ce948e5c mako: temoprarily blocked mdp error message
blocked until enabling LCD. if not, too much errors in console

Change-Id: I38bc1bec4559f9d4d830d8f6e024cb5a121abf35
2013-02-28 12:14:23 -08:00
Adrian Salido-Moreno
c5180403ed msm: mdss: fix suspend coming to MDP before panel drivers
If suspend event is received by MDP before panels, MDP needs to ensure
other panels are off before turning MDP clocks off. Remove handlers from
framebuffer driver and handle all suspend logic within MDP driver to
handle this scenario.

Change-Id: Idcda2dd29b28a9993edca78b7e0778985e44b664
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
2013-02-27 18:21:27 -08:00
Adrian Salido-Moreno
b6d7c6c8f9 msm: mdss: improve clock and bus scaling logic
Current clock logic only considers panel pixel clock to calculate mdp
clock speed, MDP clock speed should also consider other factors such
as surface scaling. Bus scaling should also consider surface scaling
factor. Update logic to consider these new factors and perform these
performance updates together.

Change-Id: If274a7f40f496e1a730e1d0e8d7c35fa4384a832
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
2013-02-27 18:21:27 -08:00
Adrian Salido-Moreno
659be67242 msm: mdss: allocate framebuffer memory from ion pool
When panel size is increased dma_alloc_coherent is not able to find
a chunk of contiguous memory big enough to hold framebuffer, this causes
framebuffer initialization to fail. Allocate buffer from ion pool which
has reserved contiguous memory at earlier stage.

Change-Id: Ibf7e3f7fc2c7ad991d69c106bbb6a9dd4c7f0e79
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
2013-02-27 18:21:25 -08:00
Huaibin Yang
f98218cd22 msm_fb: display: commit mdp baselayer pipe
When in resume or boot time, baselayer pipes need to be committed for
mdp to play, otherwize underruns and blue screens are seen. The
previous pipe stage up func has this commit which is removed now, so
the commit calls have to be added for the cases where base pipe is
initialized.

Change-Id: I63a7d0ac3fb078b3d7f604eb646a0430326a478c
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
2013-02-27 18:21:17 -08:00
Adrian Salido-Moreno
c6f7e9ceed msm: mdss: fix incorrect programming of timing generator setting
Fix typo in code which is causing incorrect setting of vertical front
porch on timing generator settings and incorrect output to panel.

Change-Id: I4de61209443fcb284b7d4064a2039b5f546935d1
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
2013-02-27 18:21:05 -08:00
Siddhartha Agrawal
911d294bef msm_fb: display: change implementation of updating mdp_clk and blt mode
Currently mdp clk and bw requests are predefined in a 4-entry table
passed from the board file, and the logic to decide which level to use
is mainly based on source resolution. This patch is intended to
address several issues with this approach.

One major issue is clk and bandwidth depends on seperate things, and
need to be considered seperately. e.g. with mdp composition of
multiple pipes, bw request may be high but clk requirement may still
be low. The current approach that binds these two things together
causes inefficiency of power.

Another major issue is that there is no logic to calculate mdp clk
requirement of a single pipe based upon panel clk and downscale
parameters. Further the worst case of mdp clk should be determined by
all pipe usage. Without proper logic, many underrun have been
experienced, and blt mode may not be enalbed properly.

Also mdp_clk or blt mode update must be on right timing especially
between these two pathes: overlay play and pan display. In the
situations of performance from high to low or from low to high clk and
blt must be handled properly to avoid underruns.

In a summary, to support many different panels and targets and
complicated mdp pipe usage(mdp composition), mdp driver related to clk
and bw needs to be implemented differently. This patch is to seperate
clk and bw, and maily to deal with mdp clk and blt. Later increasing
granuity of bw will be added.

Change-Id: I678fbf86d6997ed7b602ce81cf2e0fff6164d129
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
2013-02-27 18:21:04 -08:00
Siddhartha Agrawal
5bcec1d31d msm_fb: display: Set timing generator after register flush
Timing generator was getting started before the register flush.
Stale values were sometimes causing IOMMU page faults on bootup.

Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
Change-Id: Ia671c3603e383af94197a23a8e5e5f32274a9978
2013-02-27 18:20:53 -08:00
Kuogee Hsieh
17555c096f msm_fb: display: add stage commit before kickoff to WFD
Since stage commit had been splited out of stage up fucnction,
it needed to be called to stage pipes into mixer befroe
kickoff mixer. Add this function into overlay writeback for WFD.

Change-Id: I11e4486d92b89a15e58531033d474b3137b5935a
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
2013-02-27 18:20:35 -08:00
Lei Zhou
286342fc1a msm_fb: display: Correct LVDS bitmap setting
In case ASIC 1.1 is used on 8064 platform, LVDS bit mapping
misalignment is fixed and no remapping is needed. LVDS bit
mapping should comply with VESA format to get correct panel
display.

Data line #3's bit mapping should be coded in this sequence:
DE + VS + HS + .... Change the original codes to go with this
sequence.

Change-Id: Iaebcfcea9c52207e16bac54ec37dc63e97286ff4
Signed-off-by: Lei Zhou <leizhou@codeaurora.org>
2013-02-27 18:20:35 -08:00
Huaibin Yang
2353b50a01 msm_fb: display: add dmap waiting before turn off timing generator
Wait for dmap done to turn off TG to avoid underruns before base
pipe setup and after constant splash during boot time.

Change-Id: I64bc3935d996af1d2d54db4c11319301ea454ced
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
2013-02-27 18:20:34 -08:00
Riaz Rahaman
b3d8206872 msm: 8660: Add config setting for enabling content protection
Enable content protection by setting CONFIG_MSM_VIDC_CONTENT_PROTECTION in
target config file

Change-Id: I8e9b43b6eb09a11c0b5d987903b8bbffde1572e3
Signed-off-by: Riaz Ur Rahaman <riazr@codeaurora.org>
2013-02-27 18:20:33 -08:00
Deepak Verma
5218c0ec5c msm: vidc: Reduce the priority of incorrect PAR value message
We get the error message for the incorrect aspect ratio
with each frame of the video. By reducing the priority,
error message will appear only when we enable it.

Change-Id: Iacb8002383ea6c0b7ee86e9cfe14478c0e5ca5c3
Signed-off-by: Rajeshwar Kurapaty <rkurapat@codeaurora.org>
2013-02-27 18:20:30 -08:00
Mayank Chopra
c5f73ed5b2 msm_fb: display: Update mdp clock counter for unsuccessful probes
If a panel probe does not succeed, call mdp_clk_ctrl to maintain
mdp_clk_cnt counter else mismatch in counter results in mdp clock
to never go off in cases like suspend-resume.

CRs-Fixed: 385560
Change-Id: I4ca54b051af98e823dc7f3ff7b9bcb960532c7e8
Signed-off-by: Mayank Chopra <makchopra@codeaurora.org>
2013-02-27 18:20:16 -08:00
Chandan Uddaraju
825b800e91 msm_fb: Increase the pixel clock range for DSI panels
Increase the upper limit for the pixel clock that
changed with the newer version of the DSI controller.

CRs-Fixed: 380003
Change-Id: Ibbeaa478b4d12ae8f350be41f959d53a6ae6c923
Signed-off-by: Chandan Uddaraju <chandanu@codeaurora.org>
2013-02-27 18:20:16 -08:00
Chandan Uddaraju
e46979d2ba msm_fb: Display: Fix Dithering issue for rgb565 format
Using RGB888 as source format and rgb565 as destination pixel format,
will cause image corruption on the display. Fix this issue by
setting the destination format as RGB888 in MDP and DSI controller
pixel format as RGB565 for DSI specific panels.

CRs-Fixed: 377484
Change-Id: If58976ee9cd4825efb39437170e54796fa2213e0
Signed-off-by: Chandan Uddaraju <chandanu@codeaurora.org>
2013-02-27 18:20:16 -08:00
Deepak Verma
ed0b88a700 msm: vidc: Correct calculation of yuv buffer size
Improper yuv buffer size is being calculated using frame
height directly, which is resulting into failures during
encoding if the frame height is not aligned to 16.
With this change, yuv buffer size calculation is done
properly by using scanlines in place of frame height.

Change-Id: I22602d6a0eddfa4016f4bdc3479e5b7d9b89a4e7
CRs-Fixed: 378988
Signed-off-by: Deepak Verma <dverma@codeaurora.org>
2013-02-27 18:20:09 -08:00
Kuogee Hsieh
f525fa2753 msm_fb: display: Add BLT support to dsi command mode panel
At run time, mdp BLT (writeback) mode is enabled and disabled
base on performance level to avoid mdp underrun. Move BLT
enabled/disabled logic to pan display so that enabled/disable
is done per commit instead of per queue. Since all panels
are shared same logic, dsi video mode and lcdc panel BLT logic
have been changed accordingly.

Change-Id: I6e04bf0f7bf1c13634e19b18d8ac4368affbc4d8
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
2013-02-27 18:20:09 -08:00
Rajeshwar Kurapaty
2b93cd78cc vidc: 1080p: Reset meta data offset to zero
For multi-resolution clips, the meta data offset used while
doing cache clean of meta data buffer is from the previous
resolution & resulting in kernel panic. Resetting the offset
to zero during meta data buffer initialization for new
resolution fixes the issue.

Change-Id: I06b20e10efc837fcfe44f532e90293734b4d2df8
CRs-fixed: 386245
Signed-off-by: Rajeshwar Kurapaty <rkurapat@codeaurora.org>
2013-02-27 18:20:07 -08:00
Ajay Singh Parmar
675b4daa08 msm_fb: hdmi: Give proper buffer size
Need to give proper buffer size for snprintf function calls.

CRs-Fixed: 378343
Change-Id: Ia4df74c9871b26255572bb3ba226317c3076b5b6
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
2013-02-27 18:20:00 -08:00
Kuogee Hsieh
f2495f9688 msm_fb: display: retrieve correct base layer pipe
Base layer pipe is cloned and cached at satge array.
Retrive the real base layer pipe before used it.

Change-Id: I6fc606559684156348a57b500083ed4089fc71b5
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
2013-02-27 18:19:59 -08:00
Kuogee Hsieh
f4844bd8ab msm_fb: display: free dtv iommu buffer
Free iommu buffer after pipe is committed to hardware.

Change-Id: I00506d6fd55d99fec7921c02953fd755a7536d3e
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
2013-02-27 18:19:58 -08:00
Pravin Tamkhane
e0392a217f 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>
2013-02-27 18:19:57 -08:00
Pradeep Jilagam
c7fd27e761 msm_fb: Allow MDP hardware init for continuous splashscreen
MDP hw init is getting avoided for MDP3.x targets to support
continuous splashscreen. This avoids complete initialization
of MDP and hence usecases are failing. This change allows the
hw init.

Change-Id: Ib0304b54bda4a62a20716bde85fe94b2dcfe6824
Signed-off-by: Pradeep Jilagam <pjilagam@codeaurora.org>
2013-02-27 18:19:54 -08:00
Huaibin Yang
a03d536c88 msm_fb: display: clean pipe free or unlock calls
A few places have unnecessary mutex unlock calls, and iommu pipe free
depends on pipe parameters so move it before pipe is zeroed.

Change-Id: I7ef39c66be611907b1b0c38675b15f8bc919d0c0
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
2013-02-27 18:19:53 -08:00
Huaibin Yang
4bf6321bd9 msm_fb: display: fix fake iommu buffer drop
During pipe free, some content of pipe is backed up and then after
pipe is zeroed out, the content get restored, in between there should
be no actions to change the content since any change will be wiped out
by the restore.

Change-Id: Ia6da0162d1f9b614682e1fc36edab1db003b42ab
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
2013-02-27 18:19:52 -08:00
Gopikrishnaiah Anandan
b877256f5d vidc: 1080p: Handle flush for interlaced clips.
Video core expects one field per buffer for interlaced
clip playback.If a flush is issued we should reset the
need next field flag, so that new bitstream is processed
after flush is completed.
Reconfig flag shouldn't be reset in case of EOS.

Change-Id: Idf50a24c29e904a958b0b1e850813e2d9fc4346d
CRs-fixed: 382368
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
2013-02-27 18:19:36 -08:00
Kuogee Hsieh
c72cdf38b5 msm_fb: display: clear correct pending isr
Clear correct pending isr during irq enable/disable
to avoid unexpected side effects

Change-Id: I5e7afc778cb8d5feda40f359ff2aae6493dc7cd2
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
2013-02-27 18:19:30 -08:00
Kuogee Hsieh
2754ec7303 msm_fb: display: fix iommu leaking
Fixed iommu map buffer dropped after overlay unset by saving
origianl iommu list before zero out overlay pipe structure.

Change-Id: I498dd4cf62e93f4571883fe20a0298e9fad4ccab
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
2013-02-27 18:19:24 -08:00
Padmanabhan Komanduru
3fcd1d0f89 msm_fb: Add support for Vsync driven composition on MDP 3.03 targets
Add support for vsync notification to user space using user events.
This is to trigger frame composition based on Vsync.

Change-Id: Ie94edfcdb5e540dd2f9a4a5df4bc3b7c4eb9041c
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
Signed-off-by: Jeevan Shriram <jshriram@codeaurora.org>
2013-02-27 18:19:22 -08:00
Maheshwar Ajja
f5a3312d0e msm: vidc: Add support for ION memory on 8x55 target
This commit will add support for ION memory on
8x55 target for video encoder and decoder.

Change-Id: I23be61d698cf3c6ee81846bad61be15b9e3f824f
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
2013-02-27 18:19:17 -08:00
Kuogee Hsieh
d4348b12ab msm_fb: display: enable sending uevent as default
Enable sending vsync uevent as default so that uevent will
be sent to usersapce frame work when first request recevied

Change-Id: If72248007d68cba8fc814d449b46a58d842544ba
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
2013-02-27 18:19:13 -08:00
Ajay Singh Parmar
b4a90273a7 msm_fb: display: vsync support for HDMI as primary
When HDMI is primary, dtv is associated with node 0. In this case,
DTV vsync and ctrl need to be called for node 0.

CRs-Fixed: 383877
Change-Id: I425cddf453dd159259883e71f92c32918ca8e6c7
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
2013-02-27 18:19:12 -08:00
Chandan Uddaraju
c350849461 msm_fb: MDSS: Add DSI driver support for MDSS
Add the dsi driver implementation for
DSI version 3.0. Use the panel information
retrieved from the 'dts' to configure the
interface parameters.

Add the device tree binding file to specify the
basic configuration and panel features.

Change-Id: I6a3677401454ad1d2bc29b0b845b0366eb7842b7
Signed-off-by: Chandan Uddaraju <chandanu@codeaurora.org>
2013-02-27 18:19:10 -08:00
Huaibin Yang
ef86cf8310 msm_fb: display: add iommu mapping for mdp cursor buffer address
The mdp h/w cursor buffer physical address needs to be mapped to an
iommu virtual address when iommu domain is enabled.

Change-Id: I73b4492fc4d63632117074136e4d908f5089eb93
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
2013-02-27 18:19:09 -08:00
Huaibin Yang
e65fd5191d msm_fb: display: set pipe src and dst size same in solid fill mode
When a mdp pipe is in solid fill mode, the pipe outputs constant color
and pipe itself does not fetch data from memory, so pipe src size
should not matter. However, when src size is greater than dst size in
solid mode which means downscaling, underrun happens. In this
situation, setting src size to be same as dst size can remove underrun.

CRs-fixed: 368478
Change-Id: Ie3ffc34486129cddcc872fe6e5317873db985b97
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
2013-02-27 18:19:02 -08:00
Huaibin Yang
0814419a71 msm_fb: display: remove mdp_lut_enable call to avoid hang issue
Calling this function is not necessary in mdp overlay2 writeback
driver. If called, it causes command mode primary hang.

CRs-fixed: 365332
Change-Id: Id7054c3e56224035ec5939d91f8ce152b038e858
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
2013-02-27 18:19:01 -08:00
Huaibin Yang
c5cef34a76 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>
2013-02-27 18:19:00 -08:00
Deepak Verma
98261841be msm: vidc: Add PAR value extradata support for H264 and Mpeg2
Core gives aspect ratio information for H264/Mpeg2 in a
shared memory register. This change will fetch the value
of the aspect ratio from the designated register and append
this information to the frame_info extradata which can be
used by the client.

Change-Id: Iacacaf1b1181546ba2d09362a51bbe5178a63999
Signed-off-by: Deepak Verma <dverma@codeaurora.org>
2013-02-27 18:18:57 -08:00
Padmanabhan Komanduru
544057f7ea msm_fb: Add "Continuous Splash Screen" support for LCDC panel
Add changes to support continuous splash screen on 8x25 SKU7
for LCDC panel. Delay the MDP hardware initialisation,
keep LCDC timing generator enable during boot up, do not
disturb the GPIO/regulator configurations and skip the
panel initialization sequence during boot up.

Change-Id: Ied091b01ad2f26acdff73e3ffe158d844198923c
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
2013-02-27 18:18:46 -08:00
Padmanabhan Komanduru
7323887d8a msm_fb: Add support for "Continuous Splash Screen" on 8x25 EVB
Add changes to support continuous splash screen on 8x25
for video and command mode panels. Delay the MDP hardware
initialisation, keep video timing generator enable during boot up,
do not disturb the GPIO/regulator configurations and skip the
panel initialization sequence during boot up.

Change-Id: Id5e635ca986e66abb3cbf7c5a174f952ea489708
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
2013-02-27 18:18:45 -08:00
Ravishangar Kalyanam
cb0a7894e2 Revert "msm_fb: display: Register MDP fault handler with IOMMU driver."
This reverts commit 9f36ce34dc0e6f840c6198430adfb44142d91f4b.
This enables the IOMMU page fault register dumps from default
handler.

Change-Id: Icddd2394f5aa337e1a4998247cc4e3201f752e84
Signed-off-by: Ravishangar Kalyanam <rkalya@codeaurora.org>
2013-02-27 18:18:34 -08:00
Deva Ramasubramanian
5fed32c16c msm: mdss: Use YCrCb 420 as the output format for writeback
Use YCrCb 420 (NV12) as the output format for writeback.  For Wifi Display
use case, NV12 is required as the encoder requires this as the output
format.

Change-Id: Ica8851073476b9c05f3b5b41232803c2d71f7a3e
Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>
2013-02-27 18:18:26 -08:00
Deva Ramasubramanian
b59d111e75 msm: mdss: Return proper msmfb_data back to client
For local clients, return the relevant msmfb_data which contains a
cookie relevant to the client.

Change-Id: I9b845c0cd7fde1bc8c53a5063ba331460d67427d
Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>
2013-02-27 18:18:25 -08:00
Gopikrishnaiah Anandan
54071a910c msm: vidc: Increase video driver clients count.
Video driver currently supports registration of 4 clients.
Increasing number of clients count to 6 to support new usecases.
Video driver will limit number of instances to 4.

Change-Id: If00911ef1027b1e44917465791ef3612e6c59ed1
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
2013-02-27 18:18:24 -08:00
Mayank Chopra
4be93d0110 msm_fb: display: Add pre-multiplied alpha support for MDP4.
MDP4 blend logic differs from GPU blend implementation as MDP4
does not differentiate between pre-multiplied alpha layers and
non pre-multiplied alpha layers. Check layers for pre-multiplied
alpha and change blend logic accordingly.

CRs-Fixed: 355755
CRs-Fixed: 361729
Change-Id: Id8253d3888f1ebbadba1b6bbd87e7d98bac22da7
Signed-off-by: Mayank Chopra <makchopra@codeaurora.org>
2013-02-27 18:18:21 -08:00
Ravishangar Kalyanam
0ffbb83d74 msm_fb: display: Set LVDS Chimei panel frequency to run at 60 fps
Modify LVDS Chimei panel pixel clock from 75 MHz to 79.4 MHz
and update PLL settings to achieve refresh rate of 60 Hz for
better user experience.

CRs-Fixed: 375510
Change-Id: Ifb4036c790552b1c43d5a3c817ed05691f86c7f6
Signed-off-by: Ravishangar Kalyanam <rkalya@codeaurora.org>
2013-02-27 18:18:19 -08:00
Ravishangar Kalyanam
03c98071ea 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
2013-02-27 18:18:16 -08:00
Nagamalleswararao Ganji
c4015c723a 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>
2013-02-27 18:18:12 -08:00
Adrian Salido-Moreno
8324566fb0 mdss: display: expose panel parameters through framebuffer API
Panel porch values and pixel clock can be used to calculate the refresh
rate from user space. Assign these values with information from panel
driver.

Change-Id: I29995d27904e50892d72de5e8c7dd39285f9d421
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
2013-02-27 18:18:07 -08:00
Kuogee Hsieh
1fc675f27f msm_fb: display: free writeback buffer at correct time
When mdp pipe is freed at end of video play back, Writeback
buffer is freed while mdp still fetchs data from it. This cause
system crashed and blue screen shows on screen. This patch
will free writeback buffer at correct time.

Change-Id: I46a5031c13d86f943d6604713e1841b482dffe96
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
2013-02-27 18:18:07 -08:00
Adrian Salido-Moreno
6252708c00 mdss: display: allocate buffer from ion when debug writeback enabled
Debug writeback is used to output MDSS framebuffer contents to memory to
for debugging of MDSS core. Use ion buffer allocation for debug
writeback buffer instead of using memory from framebuffer base layer to
allow entire framebuffer area to be used for composition.

Change-Id: Ia1a91f5f14bed1d29691092142fc94f7a8b6f4d2
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
2013-02-27 18:18:05 -08:00
Adrian Salido-Moreno
a1eb2beb6e mdss: display: fix incorrect rotator programming
Source format should indicate that source is to be rotated 90 degrees
instead of indicating source has been rotated 90 degrees. This is needed
for hardware to fetch source in correct order and generate correct 90
degree output image.

Change-Id: If8d1e12ef3e7a291e67ec9763f5ca92ec6fa983c
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
2013-02-27 18:18:04 -08:00
Adrian Salido-Moreno
6a12cf3410 mdss: display: remove check for odd dst offsets
MDSS does not support odd width, height or src offsets for YUV formats,
however odd coordinates are acceptable for dst offsets. Remove odd check
done for dst offsets

CRs-Fixed: 372900
Change-Id: I69230640f94bf080a8be4ea6d79f0901a7fa72cd
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
2013-02-27 18:18:04 -08:00
Kuogee Hsieh
1299d2f5a3 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>
2013-02-27 18:17:53 -08:00
Carl Vanderlip
a2f86cc692 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>
2013-02-27 18:17:51 -08:00
Carl Vanderlip
90bf348a06 video: msm: Remove old post processing overlay integration
Remove old implementation of HSIC and QSEED smoothing/sharpening overlay
integration. Need to replace with new implementation that better integrates
the existing functions of the two APIs.

CRs-Fixed: 380750
Change-Id: Id3469fad16764ed88e74a8da75bb873f726ba366
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>
Signed-off-by: Pravin Tamkhane <pravint@codeaurora.org>
2013-02-27 18:17:51 -08:00
Carl Vanderlip
60946d6a89 video: msm: Add QSEED Table2 Support
Add support for QSEED Table2 reads/writes. Table 2 is a table of coeffients
for QSEED Table 1 to offset into. Table 2 is quite large, caution should be
taken when writing into it.

CRs-Fixed: 380315
Change-Id: I89be18c0047dcf1d9a3bcd538967b2bbe7b4efe1
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>
2013-02-27 18:17:50 -08:00
Carl Vanderlip
daefca8ffc video: msm: Add QSEED Table reading support
Add support to read the tables of QSEED values. When the values of the
QSEED tables are able to be written to, it is beneficial to be able to read
what's there as well.

CRs-Fixed: 380315
Change-Id: I3110721906424f70a12bf5736de7875dec03f4c6
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>
2013-02-27 18:17:50 -08:00
Ajay Singh Parmar
d7de548423 msm_fb: hdmi: Proper switching of switch device
Switch device used to tell userspace about HDMI connection
needs to be enabled when:
1. HPD connect
2. Authentication successful

And disable when:
1. HPD disconnect
2. Authentication failed

Change-Id: I8d4529fa2335ec1b2dc1196e57e3c8bad7d6b657
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
2013-02-27 18:17:46 -08:00
Huaibin Yang
34e21b3f0c msm_fb: display: switch blt mode on/off without turning off TG
Turning off dtv TG may cause blink. MDP requires h/w idle to change
blt mode, turning off TG can make sure mdp h/w is idle. If turning off
TG is not desired, one way to do is to check busy bits of overlay and
dmae and once they are both idle, the mode can be changed.

CRs-Fixed: 363717
Change-Id: I2817d7751ed04fd9ed144974328c4518c54af3d6
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
2013-02-27 18:17:45 -08:00
Huaibin Yang
678f51df0f msm_fb: display: add out of range check for display sizes
MDP pipe or mixer size registers have 12-bit number, so boundary
checks are needed for those parameters. If not, input req sizes could
be very large 32 bit unsigned numbers, e.g. 0xffffffff, unsigned
operations may have overflow to pass all later checks, causing MDP
underruns or hang issues.

CRs-fixed: 380469
Change-Id: I096d7022ede21d54266b46a140782ab0348dd54b
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
2013-02-27 18:17:27 -08:00
Siddhartha Agrawal
3f82627581 msm-fb: display: Tearing issue during video playback
Tearing was observed while playing 1080p H264 videos in
potrait mode. Enabled blt mode check for MIPI command
mode panel as well.

CRs-Fixed: 369365
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
Change-Id: Iac980050e5966db4731240c11e89e1f68118f2b7
2013-02-27 18:17:13 -08:00
Jeevan Shriram
c40cefee61 msm: HDMI: Re-initialize the scan details for every HPD
After disconnecting the phone from TV which doesn't support
underscan, and connected to TV which support underscan,
underscan is not working due to non re-initialization of
scan variables. Re-initialize the underscan variables for
every HDP events.

CRs-Fixed: 375862
Change-Id: I22b7b8785ec93f9cf226e9b646a851ffb3ceff62
Signed-off-by: Jeevan Shriram <jshriram@codeaurora.org>
2013-02-27 18:16:58 -08:00
Ajay Singh Parmar
e3a76baf8f msm_fb: display: suspend-resume on HDMI
When HDMI is primary, suspend-resume is not happening.
For HDMI as primary case, early suspend and resume can be
used. This change implements early suspend and resume for
hdmi as primary case.

CRs-fixed: 381097
Change-Id: I7b83d07a8b109294f3606c60f58b760836b88685
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
2013-02-27 18:16:58 -08:00
Ajay Singh Parmar
5ea85a3a6b msm_fb: display: Remove unnecessary dtv_pipe checks
In case of PAN display, PAN update function would return
without allocating dtv pipe resulting in no HDMI display.
This change removes unnecessary checks and enable dtv pipe
for PAN display as well.

CRs-Fixed: 379625
Change-Id: I533392a1120a21e962fbbbf0c07a89997832406f
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
2013-02-27 18:16:57 -08:00
Ajay Singh Parmar
bd9f9b6bb3 msm_fb: hdmi: Boot param support for resolution change
Boot param support for dynamic resolution change for HDMI
as primary case like MPQ. With this change, MPQ can also
be configured for different resolutions than the default
1080p@60Hz using boot parameters.

CRs-Fixed: 373211
Change-Id: I2c8537724ddd1ece7e81e6022afb9315c5147aa2
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
2013-02-27 18:16:52 -08:00
Nagamalleswararao Ganji
f962a6f711 msm_fb: display: Configure MDP clock table based on DSI Video pixel clk
To avoid display underrun issues, configure the MDP clock table's rate
according to DSI Video mode panel's pixel clock frequency by 1.15 times.

Change-Id: I9bc864a754c2d51c9d86ece79863820eb72cdae8
Signed-off-by: Nagamalleswararao Ganji <nganji@codeaurora.org>
2013-02-27 18:16:51 -08:00
Abhishek Kharbanda
d619231807 msm_fb: MHL: Adding MHL api's for USB interaction.
Adding MHL api's for  device discovery and registering
callback mechanism.USB driver use these API's for
synchronization with MHL driver.

Change-Id: I0846951302e3b5f5d20d566c92c2f224528ca455
Signed-off-by: Manoj Rao <manojraj@codeaurora.org>
Signed-off-by: Abhishek Kharbanda <akharban@codeaurora.org>
2013-02-27 18:16:30 -08:00
Padmanabhan Komanduru
1a42983a75 msm_fb: Add histogram support for MPQ 8064
Currently, there is no support for histogram on MPQ 8064. Add
support for histogram ioctls to support histogram testing.

CRs-fixed: 375580
Change-Id: I24ccf73c6ea6d230da4624ea196cba2d8195f8b2
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
2013-02-27 18:16:23 -08:00
Ajay Singh Parmar
df42878287 msm_fb: hdmi: Turn on switch dev when connect to HDMI
Audio is not routed to TV after deep sleep and resume.
Userspace is dependent on switch device to indentify audio
route. When HDMI is turned on, this switch needs to be turned
on as well.

CRs-Fixed: 377159
Change-Id: I7faaad5ff772ad2045876cc084aa71d120b77139
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
2013-02-27 18:16:22 -08:00
Rajeshwar Kurapaty
e6979fe6ea msm:vidc: force constrained baseline profile for H264 BP encoding
Core is returning improper header information for H264 128kbps,
level-1b and baseline profile settings. Forcing the setting to
constrained baseline profile for normal baseline profile as
per the updated interface specification resolves the issue.

Change-Id: Ib106b17be9453cfd80264cc2167dda919893b1e2
CRs-Fixed: 371606
Signed-off-by: Rajeshwar Kurapaty <rkurapat@codeaurora.org>
2013-02-27 18:16:21 -08:00
Matt Wagantall
5faa20b270 msm_fb: Remove control of HDMI PLL regulator
The regulators required by the HDMI PLL are now controlled within
the clock driver. Remove the explicit control from mdp.c.

Change-Id: Ia2975a5a83b77cd9e21fc43cabea754b7b040dd5
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
2013-02-27 18:16:12 -08:00
Carl Vanderlip
8e4844398c 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>
2013-02-27 18:15:51 -08:00
Ravishangar Kalyanam
64ec2e5e8d msm_fb: display: Configure DMA before Layer Mixer for writeback mode switch
DMA addresses are configured after Layer Mixer is set to writeback mode.
This leads to IOMMU page faults due to incorrect addresses read from DMA.
Hence DMA is programmed before Mixer setting.

Change-Id: I4c5e41a56f05e3fabb46b4cadde03168589eeb17
Signed-off-by: Ravishangar Kalyanam <rkalya@codeaurora.org>
2013-02-27 18:15:48 -08:00
Padmanabhan Komanduru
48f52432f3 video: msm: Fix corner cases of "read twice" error
Fix several cases where histogram's completion structure is completed
multiple times which causes the next histogram read to force the histogram
software state machine into believing that the histogram is always being
read by someone.

When the timeout in mdp_do_histogram times out and then soon after the work
that was being waited on completes, the next do_histogram call that is
processed will not wait (and thus will not have its hist field set to
NULL). This will cause all subsequent do_histograms to think that the
histogram is currently being read, and will cause the "read twice" message
to flood the kernel logs.

This error is fixed by always initializing the completion structure before
waiting for the histogram to complete. That way if the completion happens
after the timeout, instead of causing the error, the completion's internal
counter is reset to zero, which prevents the next histogram read from
completing without waiting.

Change-Id: Ic1bc4b8688cd191d226de1df15d389de09996106
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>
2013-02-27 18:15:46 -08:00
Aravind Venkateswaran
469d59eab6 msm_fb: HDMI: Fix for high HDMI sleep current
In certain cases, the HPD circuitry is not switched off when the
device goes to suspend state, resulting in high sleep current on
the HDMI power rail. This patch ensures that the HPD circuitry is
always turned off during suspend operation by removing an
unnecessary condition check.

Change-Id: I5846255ff4405ff1f449158f4b2f0d5ed0cd96bb
Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
2013-02-27 18:15:41 -08:00
Ajay Singh Parmar
e6ed1f23d7 msm_fb: hdmi: Do not turn on HPD at boot
HPD is getting turned on by userspace if HDMI is enabled.
We don't need to turn on the HPD from HDMI driver.

CRs-Fixed: 377899
Change-Id: I29af0ca6ba222c7af61b1a0e8b51be35dee6426c
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
2013-02-27 18:15:39 -08:00
Kuogee Hsieh
4286d98937 msm_fb: display: use spin_lock_bh() when turns on/off dsi_clk
Since dsi clock is accessed by both thread and timer context,
spin_lcok_bh()/spin_unlcok_bh() must be used to serialize accessing
of dsi clock.

Change-Id: Iac80400d871c90413dcbb10a12efc6bc6247e986
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
2013-02-27 18:15:38 -08:00
Manoj Rao
50a44dd006 msm_fb: MHL: Driver changes for Integrated MHL
Power up and GPIO functions have been moved to the driver
MHL HPD event also triggers the HDMI HPD event since 8x30
FLUID device doesn't connect HPD line from 8334 to HPD
line from MSM HDMI. The pull-up resistance in 8334 has
been set to the recommended value so that the interrupts
are sent over to MSM-USB driver.

Change-Id: Ib8bb462c81706ff2dc027535ef766917bb7da39d
Signed-off-by: Manoj Rao <manojraj@codeaurora.org>
2013-02-27 18:15:32 -08:00
Ravishangar Kalyanam
a00a29607c msm_fb: display: Add DMA and Overlay blt mode address to MDP driver
For handling split IOMMU domain cases, BLT mode requires DMA to map
for reads and Overlay for writes. DMA and Overlay blt addresses are
added to configure the respective registers to avoid page faults and
normal operation of supported panel interfaces.

Change-Id: Id007cf96588f817bcfe8559177abb073a9b00755
Signed-off-by: Ravishangar Kalyanam <rkalya@codeaurora.org>
2013-02-27 18:15:26 -08:00
Rajeshwar Kurapaty
0022fcd21c vidc: Adjust core timeout based on input frame size
Video core is dropping certain IDR frames due to timeout.
This is resulting in video corruption. Computing the core
timeout based on input frame size and programming it for
each input frame fixes the issue.

Change-Id: I75d5039bc09f9be6a3028461ee4a2f13064bf53a
CRs-fixed: 370570
Signed-off-by: Rajeshwar Kurapaty <rkurapat@codeaurora.org>
2013-02-27 18:15:19 -08:00
Stephen Boyd
b928bbb222 msm_fb: HDMI: Fix lockdep warning
Locks must always be taken in the same order to prevent AB-BA
scenarios from occuring:

======================================================
[ INFO: possible circular locking dependency detected ]
3.4.0-g55e6e49-00052-g71783d6-dirty #3258 Tainted: G        W
-------------------------------------------------------
kworker/0:1/15 is trying to acquire lock:
 (hdmi_msm_state_mutex){+.+...}, at: [<c0340e98>]
 hdmi_msm_hpd_state_work+0x78/0x2d8

but task is already holding lock:
 (external_common_state_hpd_mutex){+.+...}, at: [<c0340e8c>]
 hdmi_msm_hpd_state_work+0x6c/0x2d8

which lock already depends on the new lock.

the existing dependency chain (in reverse order) is:

-> #1 (external_common_state_hpd_mutex){+.+...}:
       [<c00cd744>] __lock_acquire+0x950/0xa10
       [<c00cd990>] lock_acquire+0x18c/0x1e8
       [<c080c248>] mutex_lock_nested+0x68/0x3c4
       [<c0341510>] hdmi_msm_hpd_on.clone.0+0x230/0x2c4
       [<c07e5dfc>] hdmi_msm_probe+0x378/0x588
       [<c03dcc00>] platform_drv_probe+0x18/0x1c
       [<c03db920>] driver_probe_device+0x148/0x334
       [<c03d9f5c>] bus_for_each_drv+0x48/0x84
       [<c03db7ac>] device_attach+0x78/0xa4
       [<c03daa4c>] bus_probe_device+0x28/0x9c
       [<c03d97e4>] device_add+0x438/0x5e0
       [<c03dd13c>] platform_device_add+0x13c/0x1a0
       [<c0d255d8>] hdmi_msm_init+0x218/0x2d0
       [<c0008708>] do_one_initcall+0x94/0x168
       [<c0d002fc>] kernel_init+0xe4/0x1b8
       [<c000f4f8>] kernel_thread_exit+0x0/0x8

-> #0 (hdmi_msm_state_mutex){+.+...}:
       [<c00cc6b8>] validate_chain+0x944/0x1080
       [<c00cd744>] __lock_acquire+0x950/0xa10
       [<c00cd990>] lock_acquire+0x18c/0x1e8
       [<c080c248>] mutex_lock_nested+0x68/0x3c4
       [<c0340e98>] hdmi_msm_hpd_state_work+0x78/0x2d8
       [<c0097420>] process_one_work+0x37c/0x694
       [<c0099978>] worker_thread+0x22c/0x3bc
       [<c009ecdc>] kthread+0x8c/0x9c
       [<c000f4f8>] kernel_thread_exit+0x0/0x8

other info that might help us debug this:

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(external_common_state_hpd_mutex);
                               lock(hdmi_msm_state_mutex);
                               lock(external_common_state_hpd_mutex);
  lock(hdmi_msm_state_mutex);

 *** DEADLOCK ***

3 locks held by kworker/0:1/15:
 #0:  (hdmi_hdcp){.+.+..}, at: [<c00972b8>] process_one_work+0x214/0x694
 #1:  ((&hdmi_msm_state->hpd_state_work)){+.+...}, at: [<c00972b8>]
 process_one_work+0x214/0x694
 #2:  (external_common_state_hpd_mutex){+.+...}, at: [<c0340e8c>]
 hdmi_msm_hpd_state_work+0x6c/0x2d8

stack backtrace:
[<c001521c>] (unwind_backtrace+0x0/0x12c) from [<c00cbb14>]
(print_circular_bug+0x288/0x2d4)
[<c00cbb14>] (print_circular_bug+0x288/0x2d4) from [<c00cc6b8>]
(validate_chain+0x944/0x1080)
[<c00cc6b8>] (validate_chain+0x944/0x1080) from [<c00cd744>]
(__lock_acquire+0x950/0xa10)
[<c00cd744>] (__lock_acquire+0x950/0xa10) from [<c00cd990>]
(lock_acquire+0x18c/0x1e8)
[<c00cd990>] (lock_acquire+0x18c/0x1e8) from [<c080c248>]
(mutex_lock_nested+0x68/0x3c4)
[<c080c248>] (mutex_lock_nested+0x68/0x3c4) from [<c0340e98>]
(hdmi_msm_hpd_state_work+0x78/0x2d8)
[<c0340e98>] (hdmi_msm_hpd_state_work+0x78/0x2d8) from [<c0097420>]
(process_one_work+0x37c/0x694)
[<c0097420>] (process_one_work+0x37c/0x694) from [<c0099978>]
(worker_thread+0x22c/0x3bc)
[<c0099978>] (worker_thread+0x22c/0x3bc) from [<c009ecdc>]
(kthread+0x8c/0x9c)
[<c009ecdc>] (kthread+0x8c/0x9c) from [<c000f4f8>]
(kernel_thread_exit+0x0/0x8)

Change-Id: I251049edbc97a5fe0e6c67801cf472fdc48722a7
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2013-02-27 18:15:12 -08:00
Ravishangar Kalyanam
ae7e09c9d6 msm_fb: display: Wait for overlay done after DSI Video writeback switch
After writeback mode is switched for DSI Video interface, wait for
overlay done for prefill frame to avoid unnecessary fetches from previous
buffers resulting in page faults.

CRs-Fixed: 372389
Signed-off-by: Ravishangar Kalyanam <rkalya@codeaurora.org>
Change-Id: Iacd3775a718fe8e08404b4d119d447a88b628617
2013-02-27 18:15:11 -08:00
Olav Haugan
c4b6ef8de1 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>
2013-02-27 18:15:05 -08:00
Jeevan Shriram
3667c5e78f msm_fb: display: Add ion support for PPP
Add support for ion in MDP PPP drivers for accessing
source images and destination images.

Change-Id: I1ba07fb826447abb13ff73752089577cf9924ce5
Signed-off-by: Jeevan Shriram <jshriram@codeaurora.org>
2013-02-27 18:15:01 -08:00
Padmanabhan Komanduru
a8576690b3 msm_fb: Handle multiple histogram reader errors during suspend/resume
If a histogram reader waits for completion in the do_histogram ioctl
and during this time the device is suspended, the complete for this
gets called from mdp_histogram_ctrl_all() in the panel_next_off()
sequence. This results in mgmt->hist not set to NULL. The subsequent
do_histogram ioctls after device resume fail due to multiple reader
failure condition since the histogram irq will be enabled now from
the same mdp_histogram_ctrl_all() during panel_next_on() sequence and
this by-passes mgmt->hist getting set to NULL that is present in
histogram_start() ioctl. Handle this scenario.

Change-Id: Ib0485da24c0f09a3f26768b75231903c8a2e0033
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
2013-02-27 18:14:39 -08:00
Carl Vanderlip
827601c6d5 Revert "Revert "video: msm: Always queue histogram work""
This reverts commit 2423ba8ae07458ec93efa07d777454f26d1d7c90.
commit 2423ba8... will be refered to as commit X

Commit X should have been listed as a parent of commit
56a123baaab84af584fbbf5cbb29955ec5c92f39 (i.e. video: msm: Always queue
histogram work & lock histogram calls).

commit 56a123b... will be refered to as commit Y

Commit Y is composed of 3 commits that were squashed together after they
caused errors when only one of them merged into mainline. Commit X was
created to revert the first of these 3 commits, and thus resolve the
errors.

However, when updating commit Y, commit X was omitted as the parent commit.
So when commit Y merged as a parent of commit X, commit X reverted part of
commit Y. By reverting commit X, this commit restores commit Y.

Change-Id: Ibfad464a2579354c92bc62d406672dcfc6a24009
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>
2013-02-27 18:14:39 -08:00
Laura Abbott
bc478d4c60 gpu: ion: Pull in patches for 3.4
Pull in Ion patches for 3.4 upgrade. Inclues the following
patches from google:

 commit 7191e9ba25
 Author: Rebecca Schultz Zavin <rebecca@android.com>
 Date:   Mon Jan 30 14:18:08 2012 -0800

     ion: Switch map/unmap dma api to sg_tables

     Switch these api's from scatterlists to sg_tables

     Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>

 commit 6f9e56945d
 Author: Rebecca Schultz Zavin <rebecca@android.com>
 Date:   Tue Jan 31 09:40:30 2012 -0800

     ion: Add reserve function to ion

     Rather than requiring each platform call memblock_remove or reserve
     from the board file, add this to ion

     Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>

 commit 9ae7e01de1
 Author: KyongHo Cho <pullip.cho@samsung.com>
 Date:   Wed Sep 7 11:27:07 2011 +0900

     gpu: ion: several bugfixes and enhancements of ION

     1. Verifying if the size of memory allocation in ion_alloc() is aligned
     by PAGE_SIZE at least. If it is not, this change makes the size to be
     aligned by PAGE_SIZE.

     2. Unmaps all mappings to the kernel and DMA address spaces when
     destroying ion_buffer in ion_buffer_destroy(). This prevents leaks in
     those virtual address spaces.

     3. Makes the return value of ion_alloc() to be explicit Linux error code
     when it fails to allocate a buffer.

     4. Makes ion_alloc() implementation simpler. Removes 'goto' statement and
     relavant call to ion_buffer_put().

     5. Checks if the task is valid before calling put_task_struct() due
     to failure on creating a ion client in ion_client_create().

     6. Returns error when buffer allocation requested by userspace is failed.

     Signed-off-by: KyongHo Cho <pullip.cho@samsung.com>

 commit 043a61468f
 Author: Rebecca Schultz Zavin <rebecca@android.com>
 Date:   Wed Feb 1 11:09:46 2012 -0800

     ion: Switch ion to use dma-buf

     Ion now uses dma-buf file descriptors to share
     buffers with userspace.  Ion becomes a dma-buf
     exporter and any driver that can import dma-bufs
     can now import ion file descriptors.

     Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>

 commit 0d1259b5f8
 Author: Rebecca Schultz Zavin <rebecca@android.com>
 Date:   Mon Apr 30 16:45:38 2012 -0700

     gpu: ion: Use alloc_pages instead of vmalloc from the system heap

     With this change the ion_system_heap will only use kernel address
     space when the memory is mapped into the kernel (rare case).

     Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>

 commit be4a1ee79a
 Author: Rebecca Schultz Zavin <rebecca@android.com>
 Date:   Thu Apr 26 20:44:10 2012 -0700

     gpu: ion: support begin/end and kmap/kunmap dma_buf ops

     These ops were added in the 3.4 kernel.  This patch adds support
     for them to ion.  Previous ion_map/unmap_kernel api is also
     retained in addition to this new api.

     Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>

 commit 46d71337f9
 Author: Rebecca Schultz Zavin <rebecca@android.com>
 Date:   Mon May 7 16:06:32 2012 -0700

     gpu: ion: Allocate the sg_table at creation time rather than dynamically

     Rather than calling map_dma on the allocations dynamically, this patch
     switches to creating the sg_table at the time the buffer is created.
     This is necessary because in future updates the sg_table will be used
     for cache maintenance.

     Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>

 commit 903f6c716d
 Author: Rebecca Schultz Zavin <rebecca@android.com>
 Date:   Wed May 23 12:55:55 2012 -0700

     gpu: ion: Get an sg_table from an ion handle

     This patch adds an interface to return and sg_table given a
     valid ion handle.

     Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>

The commit also includes fixups needed for MSM specific code.

Change-Id: Idbcfa9d6af0febf06f56daaa6beaa59cc08e4351
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
2013-02-27 18:14:28 -08:00
Ravishangar Kalyanam
ebd424b458 msm_fb: display: Attach IOMMU for DSI cmd mode in kickoff call
Attach IOMMU call is currently done from DSI cmd mode DMA
update method. Move the attach call to kickoff which enables
it from restore and video paths

Signed-off-by: Ravishangar Kalyanam <rkalya@codeaurora.org>
Change-Id: I06d39e31b3ab1cf797fb655e7e558c1cabd98ebf
2013-02-27 18:14:26 -08:00
Riaz Rahaman
249e5104d7 vidc: Add required variables in platform data for content protection
Add, initialize variables for firmware addr & secure write back
buffers in vidc platform data.

Change-Id: Ibb1e464af2e0e9038c8d43d6756d5a8481c7f618
Signed-off-by: Riaz Ur Rahaman <riazr@codeaurora.org>
2013-02-27 18:14:22 -08:00
Ravishangar Kalyanam
5480254e16 msm_fb: display: Enable MDP clock's overlay block during panel on
MDP clock's overlay block is enabled during first update after panel
on currently. This is now moved to panel on to keep clock enabled
right from display on time.

Signed-off-by: Ravishangar Kalyanam <rkalya@codeaurora.org>
Change-Id: Ie201186c1471201874f2eff246486bc4a73b5872
2013-02-27 18:14:21 -08:00
Ravishangar Kalyanam
700b3607ce msm_fb: display: Fix Toshiba WSVGA panel porch and timing settings
Fix the porch and timing settings for DSI Toshiba WSVGA panel
to enable writeback mode switch efficiently.

Signed-off-by: Ravishangar Kalyanam <rkalya@codeaurora.org>
Change-Id: Ib768d13617470f75ae027970c6ca4779d6b5a367
2013-02-27 18:14:16 -08:00
Ravishangar Kalyanam
239a5c28be msm_fb: display: Set HDMI PLL footswitch regulator to 1.8V after get()
After regulator_get call for HDMI PLL footswitch purpose, set
output voltage to 1.8 V to ensure proper state while enabling and
disabling regulator.

Signed-off-by: Ravishangar Kalyanam <rkalya@codeaurora.org>
Change-Id: Ifdd0cdbf614524b53038074b943cca65b71bbd24
2013-02-27 18:14:14 -08:00
Praveen Chavan
1a9efd2c10 mm-video:vidc: Set max performance level for high framerate content
Performance issue is observed with 60fps content as the vcodec clock
set based on number of macroblocks and framerate is not sufficient.
This fix checks for the framerate and sets max performance level if
fps is more than 60 (59 to be more precise)

Change-Id: I5d41643a32ec895565406fadec04dc95e04655a4
Signed-off-by: Praveen Chavan <pchava@codeaurora.org>
2013-02-27 18:14:14 -08:00
Maheshwar Ajja
c29b0f997a Revert "msm: vidc: Avoid reconfig if EoS is received after SPS/PPS"
This reverts commit fcd8763cbf25679c999e363ac63e65a234e4192d.
The above commit will break the trick mode playback functionality.

CRs-fixed: 370048
Change-Id: I6b3d116e8339520ef347eb387973db6f78b560b5
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
2013-02-27 18:13:55 -08:00
Ravishangar Kalyanam
cf9c758d14 msm_fb: display: Flush pipe registers before staging for Mixer 0 or 1
For Mixer 2, register flush need not be called. Flushing is done
only for pipes on mixer 0 and 1.

Signed-off-by: Ravishangar Kalyanam <rkalya@codeaurora.org>
Change-Id: I54758f79552790de2ad936703ba6140ac57b76c4
2013-02-27 18:13:54 -08:00
Maheshwar Ajja
849e25608e vidc:720p: Fix first buffer with EOS flag in video decoder
The video driver is throwing error for erronious header
input buffer with EOS flag enabled. This commit will
fix the error case by amending the EOS handling for the
first buffer.

CRs-fixed: 370048
Change-Id: I8917aa288d6547319e8b1df54e27afd69ab36162
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
2013-02-27 18:13:53 -08:00
Ajay Singh Parmar
5df9b5f1f3 msm_fb: display: Increase wait for VSYNC
Wait time for VSYNC needs to be increased to accomodate 1080p
24HZ resolution which requires around 41ms.

CRs-Fixed: 368521
Change-Id: Ideda24bb83e32a6d5035c6193ef3dfd5e0c947fc
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
2013-02-27 18:13:36 -08:00
Matt Wagantall
311882694b mdss: display: Correct regulator API usage
A device pointer should be passed to regulator_get() as the first
argument, and the regulator mapped to the MDSS device in the device
tree. Do this.

This also resolves the following message seen in debugfs, which
is present when regulator_get() is called with a NULL device:
<4>[ 1.145507] gdsc_mdss: Failed to create debugfs directory

Change-Id: I70a5137a31dbf82ae1e6634249f274cb16fe7a71
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
2013-02-27 18:13:35 -08:00
Maheshwar Ajja
2998394a12 vidc:vdec: Clean extradata portion and invalidate whole buffer
This commit will ensure to clean the extradata portion in
output buffer changed by the CPU before sending the buffer
to Video hardware and invalidate the output buffer changed
by Video hardware before CPU access the buffer.

Change-Id: I05ea24fb381a164f6cfd520bd9071a94349ed2df
CRs-fixed: 366446
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
2013-02-27 18:13:34 -08:00
Huaibin Yang
7c29317f2f msm_fb: display: change ion memory map for mdp mixer2 writeback
One way that mdp mixer2 gets writeback address is to get ion memory fd
from userspace, then mdp driver maps this fd in kernel. When mdp iommu
domain was not enabled, this maps to a physical address. Now after mdp
iommu domain is enabled, the map is changed to an iommu virtual addr.

Change-Id: I461a00cc93169de586565834af4fb9a43949cf95
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
2013-02-27 18:13:33 -08:00
Ravishangar Kalyanam
038de030b0 msm: display: Add MDP footswitch regulator control for HDMI PLL
Add support for enabling HDMI PLL regulator along with footswitch
enable/disable to avoid PLL lock detection failures during
suspend/resume

Change-Id: I9b161cab50d2b6c39de39b588e326f5ff97cbc65
Signed-off-by: Ravishangar Kalyanam <rkalya@codeaurora.org>
2013-02-27 18:13:30 -08:00
Adrian Salido-Moreno
627620e84f mdss: display: Add writeback support for WFD
- Implement APIs used to support wifi display (WFD) based on ioctls and
  functions declared in linux/msm_mdp.h.
- Restructure writeback interface file to support custom output formats
  and take buffers from WFD APIs.

Change-Id: I3e6b75bd8b7d73eb20c97899de1891bbd85e9fa4
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
2013-02-27 18:13:19 -08:00
Abhishek Kharbanda
c204610494 msm_fb: HDMI: Removing unnecessary HPD detection code.
HPD read work is used to detect HPD at bootup which
is not required as HPD detection is taken care at
bootup by toggling the HPD circuit. So we can safely
remove this redundant code.

CRs-Fixed: 368865
Change-Id: I8eed00c4f5af2ed2ca37e86da622ab518e5eb887
Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
2013-02-27 18:13:03 -08:00
Carl Vanderlip
14a14ceb18 Revert "video: msm: Always queue histogram work"
This reverts commit c0d815c2a4118d1ba51e316c6cb59bee4d68eb9b.

Revert patch that is causing excessive histogram logging.
Will merge original patch with fix when issue is resolved and tested.

Change-Id: I99b04362f6acd4f75a72e4b3ca52406907971e67
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>
2013-02-27 18:12:59 -08:00
Mayank Chopra
2f70b3b7b1 Revert "msm: iommu: Split rotator/mdp iommu domains"
This reverts commit 9ae9beaf0a79f929c4f9928b8daed5a9ed131d6a.

Change-Id: Ie93cbb23eaa1e35bfbacc53cd18f05b345acea4b
Signed-off-by: Mayank Chopra <makchopra@codeaurora.org>
2013-02-27 18:12:57 -08:00
Mayank Chopra
627ae71f33 Revert "msm_fb: display: Add DMA and Overlay blt mode address to MDP driver"
This reverts commit 5f979254a80b7a844df3d9c1f49e16427f2477cc.

Change-Id: I595afa529d96e8378d00e75bd836cfa191ab5135
Signed-off-by: Mayank Chopra <makchopra@codeaurora.org>
2013-02-27 18:12:57 -08:00
Ravishangar Kalyanam
249f8efb3c msm_fb: display: Add DMA and Overlay blt mode address to MDP driver
For handling split IOMMU domain cases, BLT mode requires DMA to map
for reads and Overlay for writes. DMA and Overlay blt addresses are
added to configure the respective registers to avoid page faults and
normal operation of supported panel interfaces.

Change-Id: I522944b804fe65925df428d6bb312262328a11d7
Signed-off-by: Ravishangar Kalyanam <rkalya@codeaurora.org>
2013-02-27 18:12:46 -08:00
Olav Haugan
c2243eff90 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: If3e556171645e8ea02deb12ca543df36233db5f2
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
2013-02-27 18:12:43 -08:00
Adrian Salido-Moreno
d673e17729 mdss: display: implement common irq handler for different mdss blocks
All of MDSS blocks (mdp, dsi, edp, hdmi) share same irq line. Implement
function to manage MDSS irq line with common API with support for irq
callback handler for each of block. Also fix incorrect calculation of
MDP interface interrupts.

Change-Id: I1271f7e1065aac95175b6e92504917264f4043a5
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
2013-02-27 18:12:43 -08:00
Adrian Salido-Moreno
0b73752fe7 mdss: display: add video display interface support
Video mode display interface is used by DSI, HDMI and EDP controllers.
Implement MDP support in order to setup data path to these controllers.

Change-Id: Ibc766a1d10a55bcf64a3ab693db034a378afe4ee
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
2013-02-27 18:12:42 -08:00
Adrian Salido-Moreno
44910c9771 mdss: display: implement csc matrix programming
Implement color conversion matrix programming to support YUV surfaces.
Also add dspp initialization stub function.

Change-Id: I7ba57eca24e15acffbddf7b81fac6b8a6ce3bba5
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
2013-02-27 18:12:42 -08:00
Adrian Salido-Moreno
edfe39d325 mdss: display: add rotator interface to mdss driver
Add rotator session management support with overlay interface using MDP
flag MDSS_MDP_ROT_ONLY. Overlay interface can only support overlay
surface or rotator (written back to memory) but not both.

Change-Id: Ib2f494683b2e6c2fd8c67818df2b57afb82a3df3
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
2013-02-27 18:12:41 -08:00
Adrian Salido-Moreno
1cda65e65f mdss: display: add clock and bus scaling logic
MDSS hardware supports different bus bandwidth and clock frequencies
depending on the load on the hardware. Add support to driver to
calculate the bus bandwidth and clock frequency requirements and
activate changes before the load on hardware changes.

Change-Id: I9bb5bbc7b3e18fb1a738f527b875506dfa0c5c81
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
2013-02-27 18:12:40 -08:00
Adrian Salido-Moreno
a49e0236fb msm: copper: add device nodes and clock information for mdss
Copper uses Mobile Display SubSystem, add device tree and clock
information to be used in mdss driver.

Change-Id: I67397a28168407b3268f4f026f35d69a04062995
Signed-off-by: Nagamalleswararao Ganji <nganji@codeaurora.org>
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
2013-02-27 18:12:40 -08:00
Carl Vanderlip
6a6140271b video: msm: Always queue histogram work & lock histogram calls
Always queue histogram read worker in order to gain concurrency protection
from the histogram management mutex (move previous checks/calls into worker
itself).

Lock the mdp_histogram_start and mdp_histogram_stop calls with the same
lock used currently by mdp_do_histogram to maintain that every do_histogram
called between a start and stop will be completed.

Add a timeout to do_histogram wait_for_completion so that it will unlock
and yield to other histogram calls if it waits for longer than 33 msec.

CRs-fixed: 363763
Change-Id: Icc503aed4e60dd01941682003ca3dbc844aed8d9
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>
2013-02-27 18:12:22 -08:00
Mohan Kumar Gubbihalli Lachma Naik
1ac5a17751 msm:vidc: provide support to raise video clks to turbo mode.
This change provides support to raise video clks to turbo mode for mpeg4
clips with high number of slices. The firmware performance degrades if
the number of slices is more than 10. Without this fix, we see lot of
frame drops happening, causing a freeze effect.

Change-Id: I79d0b9a438f73d87384b9e03761a65b9de3c9fc7
CRs-Fixed: 358615
Signed-off-by: Mohan Kumar Gubbihalli Lachma Naik <mgubbi@codeaurora.org>
2013-02-27 18:12:20 -08:00
Ajay Singh Parmar
963700f76a Revert "msm_fb: display: Fix for HDMI bootup issue"
This reverts commit a369ce03ca048fb511642ac1cb73c1f652d70c50.

The change is no more required as pan_update is not being called
and overlay set is now being used instead.

Change-Id: I7b25c256ab57e620f319058638371e079642c448
CRs-Fixed: 367233
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
2013-02-27 18:12:05 -08:00
Arun Menon
3658e5175d msm:vidc: provide support to raise afab and ebi1 clks to turbo mode.
This change provides support to raise the clks to turbo mode for mpeg4
clips with high number of slices. The firmware performance degrades if
the number of slices is more than 10. Without this fix, we see lot of
frame drops happening, causing a freeze effect.

Change-Id: Ia897854ef6d30bb97cd37810b22eb1ab5ad818fb
CRs-Fixed: 358615
Signed-off-by: Arun Menon <menon@codeaurora.org>
2013-02-27 18:11:59 -08:00
Amir Samuelov
987d4f11e5 msm_fb: display: Fix D2L register I2C driver more than once
Fix error message seen on kernel log after suspend/resume

Change-Id: I908efec9fde6e9de838e28d2c778fa4b3567e4f6
Signed-off-by: Amir Samuelov <amirs@codeaurora.org>
2013-02-27 18:11:51 -08:00
Arun Menon
8d98510db4 vidc: Move prediction scratch buffer to FW Heap.
The encoded output was corrupted for wvga and lower resolutions
during HFR. Moving the prediction scratch buffer from MM Heap to
FW Heap avoids this corruption.

CRs-Fixed: 353979
Change-Id: Ife3be7ccd9f19bb285c6c348721a1d54bbbd4734
Signed-off-by: Arun Menon <menon@codeaurora.org>
2013-02-27 18:11:49 -08:00
Carl Vanderlip
b813b9eafb video: msm: Resolve post processing memory leaks
Allocate memory for post processing only once. Free post processing memory
when MDP is removed.

CRs-fixed: 366325
Change-Id: I244f4e10a6933e2acaf69a83d8b91ee5f6e27557
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>
2013-02-27 18:11:46 -08:00
Adrian Salido-Moreno
02d2604cc5 mdss: display: add overlay ioctl apis to mdss driver
- Add support for overlay IOCTL APIs defined in linux/msm_mdp.h
- Support for ion client buffers and framebuffer memory

Change-Id: I0418ecab9aacf826d900f82f179fa20688fc763e
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
2013-02-27 18:11:37 -08:00
Adrian Salido-Moreno
40c4d9f2d3 mdss: display: implement writeback interface for mdss
Add writeback interface support, using one page of framebuffer memory
for writeback output.

Change-Id: I0a44c6907cbc10d97c78642f45dc018dfb2d1750
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
2013-02-27 18:11:36 -08:00
Adrian Salido-Moreno
145cc2b53c mdss: display: Add Mobile Display SubSystem driver
- Implements Linux frame buffer interface to interact with userspace
  libraries and applications, based on msm_fb frame buffer.
- Implement MDP driver which handles MDP core data path setup and
  hardware blocks programming.
- Support for UI through Linux frame buffer FBIOPAN_DISPLAY ioctl.

Change-Id: Ib98677b8d81d74283b27dea08a9f1a705c101bce
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
2013-02-27 18:11:36 -08:00
Ashray Kulkarni
1c7bd554f6 msm: video: Fix compiler warnings
changed array definitions, #defines and variable repetition to resolve
warnings in compilation.

Change-Id: Ic26f1924da389f4a8638728963c6a4c8b2f859d0
Signed-off-by: Jessica Gonzalez <jgaona@codeaurora.org>
2013-02-27 18:11:35 -08:00
Ajay Singh Parmar
3a2bc77249 msm_fb: display: Fix compilation error for non-HDMI builds
HDMI dependent functions need to be guarded under HDMI panel
macro to avoid non HDMI builds complilation errors.

CRs-Fixed: 366864
Change-Id: Ib2a9f6db4eb511b2a170fcc7ac979f6c41046baf
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
2013-02-27 18:11:31 -08:00
Abhishek Kharbanda
1f19de9579 msm_fb: HDMI: Do not add HPD state timer during probe
Currently all HDMI 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 HPD timer being
fired 5 minutes after boot even though cable  is not
connected. This change fixes this issue by not starting the HPD
timer during probe.

Change-Id: I9eeb8b892be2476e8debdd4ec5897a103cc34665
Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
Signed-off-by: Abhishek Kharbanda <akharban@codeaurora.org>
Signed-off-by: Manoj Rao <manojraj@codeaurora.org>
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
2013-02-27 18:11:30 -08:00
Huaibin Yang
da626c729d msm_fb: display: detect if timing generator is on when do dma waiting
If the timing generator is not on, dma waiting won't return and system
crashes. So add TG on detection to avoid the issue.

CRs-fixed: 362503
Change-Id: Ic472e7b75be1fd8960e5ac18929181513085212e
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
2013-02-27 18:11:30 -08:00
Vinay Kalia
432d1563f5 msm: vidc: Fixes bug in handling duplicate frames.
Fixes bug while closing encoder which supports
duplicate input frames. This fix decrements
the reference count of original frames
appropriately.

Change-Id: Ib542cf5fd790b8ba7f77e9a748a25c3cb132f40a
Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>
2013-02-27 18:11:25 -08:00
Siddhartha Agrawal
4c0b73f95e msm: display: reduce pwm frquency to fix the broswer blank issue
screen goes completely blank while loading a webpage at low back
light value. reducing the pwm frequency range to fix the issue.

Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
Change-Id: I44018b9f19d2dd3c8731d94588c606cd081fa3cb
CRs-fixed: 362987
2013-02-27 18:11:23 -08:00
Padmanabhan Komanduru
6ac1e93bfc msm_fb: Add backlight support using both GPIO 96 and PWM
Add support for backlight control on EVB using both the
LCD_BACKLIGHT GPIO and also the PWM approach on 8x25 EVB.
Also increase the backlight levels supported on 7x27A
from 100 levels to 256 levels.

CRs-fixed: 365523
Change-Id: I4806644783cc98e01192a3101bc852487bb3b592
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
2013-02-27 18:11:20 -08:00
Aravind Venkateswaran
2acf358130 msm_fb: HDMI: Start HDCP authentication only on device open
Currently HDCP authentication is started for a default resolution
upon HPD connection event. With this change, HDCP authentication
is only triggered after the HDMI interface has been configured for
an appropriate resolution following the call to open the HDMI device.

CRs-Fixed: 368865
Change-Id: I7b9ce85aed989b78b448bff6a545a194dfed5b1d
Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
2013-02-27 18:11:15 -08:00
Ajay Singh Parmar
b5e0c4d39c msm_fb: display: HPD rework for cleaner approach
Currently HPD is turned on and off with HDMI turn on and off
and turned on again after HDMI off so as to detect the cable
plugin.
With this change, HPD will be turned on when HDMI drvier is
initialized and turned off and on with suspend - resume. The
HPD handling during HDMI turn on and off has been removed.

CRs-Fixed: 368865
Change-Id: I1fb42b4587e58086d643b87a1600ecf09754423d
Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
2013-02-27 18:11:15 -08:00