Commit graph

566751 commits

Author SHA1 Message Date
Krishna Chaitanya Parimi
3d8f14bbc7 msm: mdss: Override partial update PP block using ioctl
Partial update when enabled blocks all PP ioctls. There is
currently no subtle way to enable PP. Providing an ioctl
to override the blockage of PP ioctls. This would allow
PP to override the blockage caused due to the default
enablement of partial update.

Change-Id: Ia120caa179bfa0414041bacd80328540f24dd6c8
Signed-off-by: Krishna Chaitanya Parimi <cparimi@codeaurora.org>
2016-03-23 20:33:02 -07:00
Jeevan Shriram
9e696e5b2c msm: mdss: add support to parse dynamic refresh rate range
DSI panel dynamic refresh rate range varies from panel to panel.
Add support to parse dynamic refresh range from the panel device
tree. If the range is not specified, use the default range from
30 to max panel supported rate.

Change-Id: Iac5adebe187bdc7abd4e82464de81305862df794
Signed-off-by: Jeevan Shriram <jshriram@codeaurora.org>
2016-03-23 20:33:01 -07:00
Ajay Singh Parmar
96833747dd msm: mdss: wb: enable wb when hdmi is primary
enable WB as secondary display when HDMI is configured as
primary panel.

Change-Id: Iffb635bdf4574d66e42c4320b122fde52ad1bf16
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
2016-03-23 20:33:00 -07:00
Jeevan Shriram
fe79ab60a6 msm: mdss: align frame buffer size to PAGE_SIZE
When updating userspace with the shared memory length,
the size of each buffer needs to be 4k aligned for
performance. This is also required to avoid mmap failures
in the case of recovery and other usecases where the
requested size is 4k aligned.

Change-Id: I6e97f9c76ea1aff07572c500f30f888b6e12f9b4
Signed-off-by: Jeevan Shriram <jshriram@codeaurora.org>
2016-03-23 20:32:59 -07:00
Ajay Singh Parmar
cbf7aaa27f msm: mdss: hdmi: get vic from cmdline in case hdmi is primary
In case of HDMI is primary, get the default VIC (Video Identification
Code) from the command line to configure the display pipeline with this
resolution data for continuous splash screen.

Change-Id: I96325045f4af0712d2f68fadf190edcf6d815841
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
2016-03-23 20:32:59 -07:00
Padmanabhan Komanduru
0cdfe89e5b msm: mdss: enable DSI timing register double buffering for 8916/8939
On 8916/8939, the DSI timing registers support double buffering.
Enable the double buffering support and flush DSI registers once
the timing parameters are configured.

Change-Id: I61c0a84f0fc015541fc8e0197e1b9997ebb123aa
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
2016-03-23 20:32:58 -07:00
Ujwal Patel
3f98aca786 msm: mdss: allow unused SMP for targets with high number of SMPs
Currently MDP driver rejects reusing of a pipe if this reuse results
in wastage of SMPs. i.e. VIG0 pipe reused from YUV layer to RGB layer.
In this case, since RGB layer needs only plane0, plane1 SMPs are unused.
This kind of wasting leads to un-necessary GPU fall-backs for composition
when number of SMPs and number of pipes are less. For this reason driver
used to prohibit such configuration. But in high tier chip-sets, there
are enough number of SMPs and pipes are available such that these
transient wastage of SMPs can be absorbed without much impact.

Change-Id: Ia7baec801add81e5c97bded920ae5bdca5083e0b
Signed-off-by: Ujwal Patel <ujwalp@codeaurora.org>
2016-03-23 20:32:57 -07:00
Jeevan Shriram
41dff92a63 msm: mdss: use appropriate api to get length of scatterlist
Moving away from using sg_dma_len() api to be inline with
ion driver, use sg->length for scatterlist length.

Change-Id: I3a33340dc1bda5b24a406c29601aff4d5b2c5748
Signed-off-by: Jeevan Shriram <jshriram@codeaurora.org>
2016-03-23 20:32:56 -07:00
Ken Zhang
c23100278d msm: mdss: hdmi: add sysfs node for audio video latency
Add edid_audio_latency and edid_video_latency sysfs nodes to
report the info extracted from edid. AV sync can use these info
to compensate the difference.

Change-Id: I2b1a3f6c0e2d892be8d41651ea898ce47c9d820b
Signed-off-by: Ken Zhang <kenz@codeaurora.org>
2016-03-23 20:32:55 -07:00
Jeevan Shriram
263b07efab msm: mdss: fix bug for validating pixel extension calculations
While validating pixel extension calculations from user space,
validate the over fetch pixels with image dimentions in both
horizontal and vertical directions.

Change-Id: I8e39e89d9ace8e26237b3b23ca375456abd804a1
Signed-off-by: Jeevan Shriram <jshriram@codeaurora.org>
2016-03-23 20:32:54 -07:00
Ujwal Patel
44a78e05e8 msm: mdss: add support to validate pixel extension calculations
If a layer needs a scaling than its pixel extension values are calculated
in the user-space library and passed down to driver. Currently driver
blindly programs these settings to HW without validating for correctness.
This leads to HW hangs and stability issues. Add a proper sanitization
checks for pixel extension and report error back to user-space if any.

Change-Id: I086cf0b23fbccd37a23bb509f067bffdf396c247
Signed-off-by: Ujwal Patel <ujwalp@codeaurora.org>
Signed-off-by: Jeevan Shriram <jshriram@codeaurora.org>
2016-03-23 20:32:53 -07:00
Ken Zhang
d9baf4d534 msm: display: hdmi: make CEC work properly after HDMI off and on
When HDMI is turned off, sending CEC will crash the system
and the logical address will be lost. Do not send CEC message
if CEC is not configured. Initialize CEC logical address when
config CEC during turning on HDMI. Return an error when sending
message fails so that HAL can know the result.

Change-Id: I2f5ced4d9be97361665138400bde435916c7373e
Signed-off-by: Ken Zhang <kenz@codeaurora.org>
2016-03-23 20:32:52 -07:00
Ajay Singh Parmar
89a614dd26 msm: mdss: hdmi: set av mute on power off
For smoother power off and resolution change, set av mute during
power off.

Change-Id: I96e2a9647f42c033acbab72e87593ef6fdedfbc0
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
2016-03-23 20:32:52 -07:00
Ajay Singh Parmar
3f6d6aba40 msm: mdss: hdmi: do not timeout on hdcp re-authentication
Keep re-authenticating until successful as sinks may choose
not to issue HPD while switching HDMI ports or powering on/off
which usually trigger HDCP on/off.

Change-Id: Ib4b13592df8753df1693c6279f04fc963ba9974f
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
2016-03-23 20:32:51 -07:00
Ajay Singh Parmar
aecb49dd9b msm: mdss: hdmi: support for mutliple adb
Some sinks may have more than one audio data block (adb).
Add support to parse more than one adb.

Change-Id: Icf324c2e8b6fbd3817bcdb54a62eb0af17996fa4
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
2016-03-23 20:32:50 -07:00
Ajay Singh Parmar
cf8575a1b8 msm: mdss: hdmi: proper audio channel numbers
add proper audio channels numbers for odd number of channels

Change-Id: Ic07c213102efe61505b16e4b692a2d1d32eb72c3
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
2016-03-23 20:32:49 -07:00
Shuo Yan
8122b1926d msm: mdss: add LP/HS mode DCS CMD support to MDP5 targets
LP/HS mode configuration for DCS Commands in currently not
supported on MDP5 targets. Add the required support to meet
all panel requirements.

Change-Id: Ib31ddc02f151033a59d6297c8f1a4f8897378947
Signed-off-by: Shuo Yan <shuoy@codeaurora.org>
2016-03-23 20:32:48 -07:00
Jeykumar Sankaran
23f368710e mdss: mdp: Add mdss version macro for 8992 target
Add mdss version macro for 8992 target and initialize maximum
blending stages supported for the target.

Change-Id: Ic741fb725907498791c1d17581561e3632a40cec
Signed-off-by: Jeykumar Sankaran <jsanka@codeaurora.org>
2016-03-23 20:32:47 -07:00
Benet Clark
65555dccaf msm: mdss: Switch order of histogram completions when disabling hist
There are two completion structures associated with the histogram. When
hist is being disabled, we complete_all() these structures to unblock the
waiting threads, however the completes were not done in the same order as
the waits.

Change-Id: I0dc39d56db9b4f141b619ae41f2c896d2e84c882
Signed-off-by: Benet Clark <benetc@codeaurora.org>
2016-03-23 20:32:46 -07:00
Jayant Shekhar
de1b8eea12 msm: mdss: Move iommu attach after overlay start in pan display
IOMMU page faults can happen if iommu is attached in pan display
if continuous splash is enabled as splash fetches from physical
memory. Splash cleanup is performed in overlay start and hence
move iommu attach after splash cleanup is done.

Change-Id: I703c925f964527f33108a3a09ee1ffdc0a3003cd
Signed-off-by: Jayant Shekhar <jshekhar@codeaurora.org>
2016-03-23 20:32:45 -07:00
Ingrid Gallardo
0d2c6b3f5a msm: mdss: fix programmable fetch calculation
Fix to consider all the vertical blanking lines for
the prefill bandwidth calculation and keep skipping
one pixel for the fetch start configuration.

Change-Id: I3407f8ef4c6427a307220bee10f9cac072582069
Signed-off-by: Ingrid Gallardo <ingridg@codeaurora.org>
2016-03-23 20:32:45 -07:00
Aravind Venkateswaran
43f7af5ebb msm: mdss: support transition from suspend to doze mode
If a transition from full suspend to doze mode is requested, first
unblank the panel and then enter the doze mode. This is necessary
to ensure that all necessary panel supplies are turned on and the
panel is brought out of reset first.

Change-Id: I5757f01ec9843a332fd2d1034c068ff993f466bd
Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
2016-03-23 20:32:44 -07:00
Ajay Singh Parmar
92592e399c msm: mdss_fb: Do not issue runtime suspend/resume for HDMI primary
When HDMI is primary, do not issue runtime suspend and resume events
to HDMI interface. Runtime suspend/resume may get triggered with cable
connect/disconnect when HDMI is primary which will result in unnecessary
power on/off of HPD module.

Change-Id: I6c0c9eb85832717be538b3fbf7583b1e4a5c10d5
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
2016-03-23 20:32:43 -07:00
Raghavendra Ambadas
19c2832f43 msm: mdss: Add bounds check in mdss_compat_overlay_ioctl
A bounds check has to be done on ovlist32->num_overlays variable
so as to prevent memory allocation of arbitrary size and avoid
subsequent undetermined behaviour.

Change-Id: Ic70726f1825040e793ef256195d236d77b392791
Signed-off-by: Nirmal Abraham <nabrah@codeaurora.org>
Signed-off-by: Raghavendra Ambadas <rambad@codeaurora.org>
Signed-off-by: Krishna Chaitanya Parimi <cparimi@codeaurora.org>
2016-03-23 20:32:42 -07:00
Benet Clark
153e6b81dd msm: mdss: Check if PP has split mode enabled for PAv2 features
The option for split mode in PP only checks the enable flag of the
feature in order to enable the same in the DSPP opmode. The opmode bits for
PAv2 features need to be disabled if PA bit is disabled.

Change-Id: I72019d0d03703e0698cf8d4ccd8b8f9c17889653
Signed-off-by: Benet Clark <benetc@codeaurora.org>
2016-03-23 20:32:41 -07:00
Terence Hampson
915faf80ec mdss: mdp: switch fget_light to fdget
fget_light was deprecated, made the switch to fdget.

Change-Id: I52a032f26002300a1bf58573ff40fcc84c35d74e
Signed-off-by: Terence Hampson <thampson@codeaurora.org>
[cip@codeaurora.org: Replace f_dentry with f_path.dentry]
Signed-off-by: Clarence Ip <cip@codeaurora.org>
2016-03-23 20:32:40 -07:00
Terence Hampson
2b0ce3331c mdss: mdp: Intermediate step in transitioning to new iommu apis
IOMMU APIs are changing in 3.14 kernel. ION IOMMU calls, such as
ion_unmap_iommu, are being deprecated. While transition to new
APIs calling msm_map_dma_buf is an intermediate stage when
transitioning to new APIs.

Change-Id: I7fb11575d3924073fa9917be32ac2f92634f2e13
Signed-off-by: Terence Hampson <thampson@codeaurora.org>
2016-03-23 20:32:39 -07:00
Clarence Ip
cad4a93abb msm: mdss: fix trace compilation warning
In order to prevent trace compilation warning, need to explicitly setup
compile include directive to search current source folder for header
files.

Change-Id: Ic17f841c88d911498d914f5339c99d2cb1ae3d1a
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
[cip@codeaurora.org: Resolved merge conflict]
Signed-off-by: Clarence Ip <cip@codeaurora.org>
2016-03-23 20:32:38 -07:00
Terence Hampson
60d31c26b7 mdss: mdp: sysfs_dirent changed to kernfs_node in 3.14 kernel
Changing all instances of sysfs_dirent -> kernfs_node.
Additionally parameters passed into sysfs_get_dirent changed
which is corrected in this patch.

Change-Id: I06ce0b6af0d88248fb8019a68fd637bd6ce5b12e
Signed-off-by: Terence Hampson <thampson@codeaurora.org>
2016-03-23 20:32:38 -07:00
Terence Hampson
8a3f359c47 mdss: mdp: usleep no longer in 3.14 kernel
Inline function usleep translating to usleep_range no longer
provided in 3.14 kernel. Moving all usleep in display code
to use usleep_range.

Change-Id: Ie2a465107f83beaedb82380ca8d57c1d9190ec7f
Signed-off-by: Terence Hampson <thampson@codeaurora.org>
2016-03-23 20:32:37 -07:00
Terence Hampson
27952e1ebb mdss: mdp: Correct msm-bus.h include
In porting Id726a65b5641b57c0edd3ba33f2e5b3f68aff643
misspelt header file that was change. This patch corrects
that mistake.

Change-Id: I6755b102742e663f272b10f3b9804493e81ac28f
Signed-off-by: Terence Hampson <thampson@codeaurora.org>
2016-03-23 20:32:36 -07:00
Terence Hampson
b0d3acbf1d mdss: mdp: kgsl_drm is removed for 3.14 kernel
Removing all calls to kgsl_drm, as it is no longer supported
in 3.14 kernel.

Change-Id: I835a946d6b032f47121e19b6ddb8629e672088ea
Signed-off-by: Terence Hampson <thampson@codeaurora.org>
2016-03-23 20:32:35 -07:00
Terence Hampson
309facd77e mdss: mdp: INIT_COMPLETION depricated to reinit_completion
INIT_COMPLETION is removed from 3.14 kernel. Replacing with
reinit_completion.

Change-Id: I64c43e313ff4e07dc7900bdce155f8c55e5ed420
Signed-off-by: Terence Hampson <thampson@codeaurora.org>
2016-03-23 20:32:34 -07:00
Aravind Venkateswaran
1db0999b9e msm: mdss: do not call dsi soft reset for idle power collapse
The DSI branch blocks needs to be on in order to issue a DSI software
reset. Commit e8c272ba5c3f23e6cece61bde7834cab7922a1d4 introduced the
change which moved the DSI software reset prior to enabling the DSI
branch clocks in order to support the idle power collapse feature.
This is not correct since a soft reset is not required at all when
resuming from an idle power collapsed state. Fix this by moving the
software reset to the DSI on sequence.

Change-Id: I663a44d04650f686ba98ea0b1fb7ab2ea29a3bcc
Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
2016-03-23 20:32:33 -07:00
Aravind Venkateswaran
49036d7c0e msm: mdss: use helper functions to check for panel power state
Whenever the display always-on feature is enabled, it is possible
that the display pipeline can be in an intermediate state between being
fully interactive to fully turned off. In the current implementation, a
number of state transition decisions are made based on whether the
display pipeline is on or not. Instead of explicitly checking for the
panel power state, define generic helper functions which classify the
panel power state into three different stages - interactive, low-power
and off. Replace any existing check for the panel power state with these
newly defined helper functions.

Change-Id: I4d6dd883ea6aca8abd57fa048a79e0c88da09a95
Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
2016-03-23 20:32:32 -07:00
Aravind Venkateswaran
789b61dcb3 msm: mdss: add support for display always on mode
Add a new panel power state to represent a panel low power mode. Add a
new sysfs node to control when to configure the panel into this new
mode.

Change-Id: I7df8bf63470bec893c6b7481678f00ce76b6875c
Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
2016-03-23 20:32:31 -07:00
Aravind Venkateswaran
b9095befda msm: mdss: add support for different panel power states
Currently a panel either be in a powered on state or a powered off
state. However, it is possible for panels to be configured in an
intermediate low-power state where the panel is always kept on. In
order to support such use-cases, it is necessary to add the concept
of panel power states in MDSS so that each software layer can
independently maintain it's state and manage transitions between them.
This change just refactors the driver with only two existing power
states - panel on and panel off.

Change-Id: I49d1fda506761546c5e22d9106c5177e75053a81
Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
2016-03-23 20:32:30 -07:00
Ken Zhang
38154a0ada msm: display: release kickoff before fence waiting
After configuration is done, save the acquired fences,
release the kickoff and ov_lock, then wait for the cached
fences. This way the next prepare will not be blocked by
waiting for acquired fences.

Change-Id: Id6f5b30e0d20cd59bd0aebf71af7cb47ecb1cf5b
Signed-off-by: Ken Zhang <kenz@codeaurora.org>
2016-03-23 20:32:30 -07:00
Ujwal Patel
30a12e0aec msm: mdss: fix mdp clock calculations for rotator
MDP clock requirement for rotator depends solely on source dimensions,
rot_clk = (src_w * src_h * fps). Fix current calculations where MDP clock
rate is incorrectly calculated as rot_clk = (dst_h * dst_h *fps). New
calculations are valid even when down-scale is done along with rotation.

Change-Id: I30d98b7a62beeb3a559a9c5f26de43c014fd25fd
Signed-off-by: Ujwal Patel <ujwalp@codeaurora.org>
2016-03-23 20:32:29 -07:00
Vishnuvardhan Prodduturi
c8aa18ff32 msm: mdss: Add support for different voting on RT/NRT AXI Ports
In 8939, MDSS has two AXI Ports one for real time client and the other
for non-real time clients. Bandwidth required on each of the port changes
according to the use case which necessitates the voting to separate on two
different ports. Separate vote is calculated for RT clients and NRT clients
which will be voted on respective ports.

Change-Id: If3d3d670c19a03d5d9659db6e3630a2958744f07
Signed-off-by: Vishnuvardhan Prodduturi <vproddut@codeaurora.org>
2016-03-23 20:32:28 -07:00
Padmanabhan Komanduru
06acb7bed1 msm: mdss: add ESD status support for NT35596 panel
In ESD thread implementation using DSI status read method,
currently we check the read value of only one register from
the panel. For NT35596 panel, the expected read back value
for the health status register is 8 bytes. Add support for
ESD status for this NT35596 panel accordingly.

Change-Id: Icc2ba4d662facb79432a07f72064db57d2e5dd8a
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
2016-03-23 20:32:27 -07:00
Dhaval Patel
feb0ac4506 msm: mdss: release pipes associated with respective process
It is possible that fb_open and fb_release APIs are called
from different processes for same file node. fb_release
finds correct process through file descriptor node in
such scenario and releases respective ref count. However,
overlay_release API tries to release the pipes associated
with current process id. This check fails to find correct
resources and does not release any pipe. This change calls
overlay release API with respective process id to release
all pipes associated with it.

Change-Id: Icc176032401483e05f347d3c08a4b344f61686f2
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
2016-03-23 20:32:26 -07:00
Charles Bin
ae7611148f mdss: hdmi: Fix null dereferences
Add null check to fix potential null dereferences in driver.

Change-Id: I913d4a8e5dc3e61e534243ab77d788ad64815b28
Signed-off-by: Charles Bin <cbin@codeaurora.org>
2016-03-23 20:32:25 -07:00
Aravind Venkateswaran
7c70e9299f msm: mdss: refactor MDSS idle power collapse logic
MDSS GDSC can be turned off, or power-collased for command mode panels
in static screen use-cases. In the current implementation, the power
collapse is triggered by a worker thread in the interface driver
whenever it enters the idle state. However, MDP driver already
registers pm_runtime callbacks for idle and suspend notifications and
also maintains a count of active overlay sessions. It is much simpler
and cleaner to trigger idle-power collapse based on that. This also
avoids unnecessary synchronization issues pertaining to the power
collapse worker thread.

Change-Id: I198e6d7685e5ef6eed7cd06a77fa76435940b805
Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
2016-03-23 20:32:24 -07:00
Shivaraj Shetty
8bf6f4e1a6 msm: mdss: Avoid dsi v2 compilation for ferrum
Ferrum uses DSI 6G, and there is no need to compile dsi v2
driver for this target. Update Makefile to take care of this.

Change-Id: Ifbbb320fd908bbdca5825cac7164b68b18360316
Signed-off-by: Shivaraj Shetty <shivaraj@codeaurora.org>
2016-03-23 20:32:23 -07:00
Vineet Bajaj
b385d4a599 msm: mdss: set the default mdp clcok rate to max supported by target
Set the default mdp clk rate to be used in mdp_probe at max supported.
For certain targets such as 8939 which support destination split and
use 2k panel the minimum clock rate required will be 320MHz. This will
apply only until first update comes from the userspace.

Change-Id: Ia4bf56401eaec86ffd8338b5dd0c8b730ad4b1fc
Signed-off-by: Vineet Bajaj <vbajaj@codeaurora.org>
2016-03-23 20:32:23 -07:00
Adrian Salido-Moreno
0d6433da03 msm: mdss: double check mdp ping pong done state
There are cases where the irq trigger may get delayed for more than
expected, in such cases the ping pong done status may have been updated
by MDP hw. Add additional check to see if this has been triggered even
though interrupt wasn't scheduled for pingpong done.

Change-Id: I4730d166d95f238f4525eab2b5c99be40b30699b
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
2016-03-23 20:32:22 -07:00
Charles Bin
54f233b591 mdss: mdp: Prevent false null dereference warnings
Remove null checks that were causing false warnings
for potential null dereferences in driver.

Change-Id: I3a097c926da47d897e8c8e4fe39808436c413f70
Signed-off-by: Charles Bin <cbin@codeaurora.org>
2016-03-23 20:32:21 -07:00
Charles Bin
9381d640cf msm: mdss: Fix null dereferences
Fix potential null dereferences in driver.

Change-Id: I990ea60a17e14cc438f534a2b65eb28aa9cc8cb8
Signed-off-by: Charles Bin <cbin@codeaurora.org>
2016-03-23 20:32:20 -07:00
Dhaval Patel
bd80e9f055 msm: mdss: support NRT VBIF XIN clients
WB interfaces' fetch XIN clients are connected to
Non-RealTime(NRT) VBIF on certain MDSS hardware. DMA
line mode fetch is connected to RealTime(RT) VBIF
while block mode fetch is connected to NRT VBIF on
such hardware. This change upgrades the driver to
support such MDSS hardware with NRT VBIF by updating
respective register space. It also selects RT vs NRT
VBIF client for DMA pipe based on operation mode.

Change-Id: Ia1680c2748ec0c9ef521df010ecfbcec78f5114f
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
2016-03-23 20:32:19 -07:00