Commit graph

566736 commits

Author SHA1 Message Date
Krishna Chaitanya Parimi
44cc5e8027 msm: mdss: Restrict vote for bandwidth by histogram based on dts
Histogram read and histogram LUT writes vote for additional
bandwidth on mdss ahb clocks for speeding up the register access.
This is not required on 8916 and 8939 targets.
Restricting the call for vote based on dts property.

Change-Id: I944e07c80c678ef75bd7e4e0270be6a23becce00
Signed-off-by: Krishna Chaitanya Parimi <cparimi@codeaurora.org>
2016-03-23 20:32:05 -07:00
Charles Bin
1a99744dc8 mdss: mdp: Fix null dereferences and buffer overflows
Fix potential null dereferences and buffer overflows in driver.

Change-Id: Ibce1bb120207e0a54ac9bd53de9952bd6ac8d0fe
Signed-off-by: Charles Bin <cbin@codeaurora.org>
2016-03-23 20:32:04 -07:00
Ken Zhang
9b5df6079a msm: display: set up vsync_retire_handler in commit thread
Setting up vsync_retire_handler needs accessing hardware, move it into
commit thread so that buf_sync ioctl has no hardware related operation.

Change-Id: I646b5fa5f103bf07e409c41842b59ac2ed204c83
Signed-off-by: Ken Zhang <kenz@codeaurora.org>
2016-03-23 20:32:03 -07:00
Jeevan Shriram
4c34d85747 mdss: mdp: Add programmable fetch for mdp
Currently, MDP fetches only at the vertical backporch.
All through the vertical front porch, hardware sits idle
doing nothing. Starting from MDP v1.5, hardware has the
capability to fetch at the programmable line in the vertical
front porch.

Change-Id: Ib2482fa610acdfc5cbf944415a344c11f313bc81
Signed-off-by: Jeevan Shriram <jshriram@codeaurora.org>
2016-03-23 20:32:03 -07:00
Jeevan Shriram
eb0fceea87 mdss: mdp: fix incorrect programming of scalar enable
In use-cases where scaling is required in one direction
and not on other, scalar extension parameter will be set
to update the scale register. Add proper check to this enable
scale bit only in the required direction.

Change-Id: I5527f22c83fe456d0124af12516c5bdb240e80a9
Signed-off-by: Jeevan Shriram <jshriram@codeaurora.org>
2016-03-23 20:32:02 -07:00
Kuogee Hsieh
1112626b4d msm: mdss: always set mdp_busy when partial update is disabled
mdp_busy flag is used to serialze kickoff operations by ensuring
that any pending kickoffs are first completed before issuing any
new kickoffs. This avoids any potential mpd_busy_wait timeouts.
Therefore, for normal operations (partial update disabled), mdp_busy
flag should always be set. However, when partial update is enabled,
width and height of panel's ROI need to be checked before setting
mdp_busy flag. Otherwise mdp_busy_wait will timeout since no update
will be sent to the panel. In addition, perform roi merge from both
panels if roi-merge is enabled to decide whether column and page address
has changed. If it was changed, then new column and page address need
to be sent to the panel.

CRs-Fixed: 692382
Change-Id: Ib0070b84a626afffd4c51a65f59bc97aae1d8994
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
2016-03-23 20:32:01 -07:00
Ajay Singh Parmar
fd0f947b29 msm: mdss: decouple clk ctrl and bw ctrl
Move bandwidth control to panel on and off functions
to speed up the clock control.

CRs-Fixed: 673613
Change-Id: Ib3828687ab54fb7a5aad7e97dec46c6e76a7311a
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
2016-03-23 20:32:00 -07:00
Ingrid Gallardo
44e70385b9 msm: mdss: Add debugfs parameter to disable prefill BW
Add parameter in debugfs to avoid using prefill
calculations for the bandwidth vote.

Change-Id: I7e1d748128335e6ced4d094d77544005e393e218
Signed-off-by: Ingrid Gallardo <ingridg@codeaurora.org>
2016-03-23 20:31:59 -07:00
Kuogee Hsieh
db066eaba4 msm: mdss: call MDSS_XLOG_TOUT_HANDLER at thread context
MDSS_XLOG_TOUT_HANDLER() is for debug purpose. It acquires
a mutex and thus should not be called from an interrupt
context. Move this call to a thread context instead.

CRs-Fixed: 692386
Change-Id: I631ffa4c972b66991eb65ad0de294378e0d3f266
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
2016-03-23 20:31:58 -07:00
Krishna Chaitanya Parimi
6510724f36 msm: mdss: Correct set backlight call during unblank
If brightness node is written prior to unblank by surfaceflinger
the backlight level being applied would not be correct. The
stored value is also overwritten.

Passing the correct unset backlight value during unblank.

Change-Id: I430bc759e09ecc6dfbc616af47fbc953aa542b9a
Signed-off-by: Krishna Chaitanya Parimi <cparimi@codeaurora.org>
2016-03-23 20:31:57 -07:00
Ingrid Gallardo
573a19c182 msm: mdss: Add debugfs parameter to disable panic
Add parameter in debugfs to disable panic feature
for debug and validation.

Change-Id: Id28288147f549fadea7ac0d038c7466338b08cd8
Signed-off-by: Ingrid Gallardo <ingridg@codeaurora.org>
2016-03-23 20:31:56 -07:00
Dhaval Patel
d7206c1f54 msm: mdss: update MDSS driver to support latency ram
Different MDSS hardware variants support fixed pixel
latency ram for each pipe vs SMP (Shared Memory Pool).
Software does not have to handle SMP allocation/deallocation
for hardware with fixed pixel latency ram. This change
enables the driver to handle such MDSS hardware.

Change-Id: Ia55f45d65c3eb19350c7195acd83af8ffc0e9a10
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
2016-03-23 20:31:56 -07:00
Dhaval Patel
843808743c mdss: mdp: start vreg release index from PANEL_PM
Start vreg release index from PANEL_PM to avoid
release call with DSI_MAX_PM in error case. This
avoids crash in dsi_probe if panel node parsing fails.

Change-Id: I236f40851d41831fe37eea77aa83e2f4ce031a3b
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
2016-03-23 20:31:55 -07:00
Dhaval Patel
81554b9ea0 msm: mdss: support reduced dspp and WB interfaces
MDSS driver has condition check for 1:1 mapping for dspp to
interface and WB to ctrl. This check is not valid for all MDP
version hardware.  It can support less dspp compared to number
of interfaces. It can also support less number of WB paths
compared to controllers. This change enables MDSS driver
to handle such hardware conditions.

Change-Id: Ic08e274c73cc41e80245a0d3d4ae7b854bd5a2d3
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
2016-03-23 20:31:54 -07:00
Ping Li
4a445683c9 msm: mdss: Disable the PP features if partial update feature is enabled
Check the whether partial update feature is enabled or not before enabling
any post processing features.

Change-Id: Ibf2111d5ca8714279903980d14e63bab556bb41f
Signed-off-by: Ping Li <quicpingli@codeaurora.org>
2016-03-23 20:31:53 -07:00
Casey Piper
b35f4850ee msm: mdss: hdmi: add hdmi_ahb clock to HPD
Power on HPD accesses HDMI registers. HDMI AHB clock needs to be
enabled while HPD is being powered on.

Change-Id: I483ac56b41e3bd3794878940fbd0d5242dd5d1cd
Signed-off-by: Casey Piper <cpiper@codeaurora.org>
2016-03-23 20:31:52 -07:00
Dhaval Patel
5f1c60463e msm: mdss: add new line character at the end of log message
Add new line character at the ned of the log message
to avoid printing multiple messages on same line.

Change-Id: I7f7127d28c089ae0add172e42295a9d4cfce9297
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
2016-03-23 20:31:51 -07:00
Adrian Salido-Moreno
3aa9b00988 msm: mdss: refactor mdp debug statistics
Move debug statistics to mdp5 specific debug file and make use of
simpler seq_* calls to display MDP statistics through debugfs file.

Change-Id: I424b9c62e993390670448c9db6d0800e97c830eb
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
2016-03-23 20:31:50 -07:00
Adrian Salido-Moreno
b45bf50413 msm: mdss: dump MDP state through debugfs
Add debugfs file to dump complete MDP state and gives a complete
snapshot of MDP state.

Change-Id: I9c3b5ebf9981a7197bff011c13cc3aeea7af5b78
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
[cip@codeaurora.org: Moved new file locations]
Signed-off-by: Clarence Ip <cip@codeaurora.org>
2016-03-23 20:31:49 -07:00
Adrian Salido-Moreno
dd676e9bdf msm: mdss: refactor register space io remap to use common utility
Refactor MDSS and VBIF registers ioremap to go through common utility
functions and add API to allow adding any register base which uses
utility structure. Expose VBIF register base through this utility.

Change-Id: I97ca2db07e40b261abf1a46b427a373295886cb2
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
2016-03-23 20:31:48 -07:00
Ujwal Patel
7e9ccef551 msm: mdss: fix bandwidth vote release for dual-dsi cmd mode panels
For dual-dsi command mode panels, bandwidth(bw) vote is supposed to be
released once ping-pong done interrupt for both controller is received.
In current implementation, if secondary ctl finishes last, which is the
case most of the times, then bw release is called using secondary ctl.
But bw is calculated/stored using main ctl because of which bw vote is
never released as expected. Fix this by releasing bw vote using main ctl.

Change-Id: Iadbd150ed6a35478da2cb376e29b01e579a526b8
Signed-off-by: Ujwal Patel <ujwalp@codeaurora.org>
2016-03-23 20:31:48 -07:00
Casey Piper
33fcbb988d msm: mdss: add pinctrl support to HDMI driver
Add support for intialization and setting pinctrl
states to the HDMI driver. This allows for HDMI
driver to use pinctrl gpio initialization on
msm8994 targets.

Change-Id: I751bdca032772b5ccbd4029d320026ea2ffa7120
Signed-off-by: Casey Piper <cpiper@codeaurora.org>
2016-03-23 20:31:47 -07:00
Jeevan Shriram
d7580b4b65 msm: mdss: share fb memory ion fd to userspace
Add new operation request to share ion fd to userspace
for mapping to the frame buffer memory.

Change-Id: I404c73c19e3fffec593ffd32c34e7b1a74a500d8
Signed-off-by: Jeevan Shriram <jshriram@codeaurora.org>
2016-03-23 20:31:46 -07:00
Ken Zhang
a757da753b msm: display: display prepare unblock for command mode
Release kick off and unlock ov_lock before waiting for pingpong
so that next prepare can start.

Change-Id: I92b62272777b3734e2c7dc44add8a49fb96911f5
Signed-off-by: Ken Zhang <kenz@codeaurora.org>
2016-03-23 20:31:45 -07:00
Kuogee Hsieh
59abfc3ee7 msm: mdss: add support for edp panel
Add edp support functions so that edp can be enabled through
dtsi.

CRs-Fixed: 661151
Change-Id: I6d29f39b836075c59a691ab27904dbe9ea0df28a
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
2016-03-23 20:31:44 -07:00
Ping Li
56fe7f0625 msm: mdss: Update condition check for AD BL attenuation calculation
Enable the AD backlight attenuation calculation every time the
mdss_fb_set_backlight function is called, so that the backlight
sent to panel can be properly attenuated if AD is enabled.

Change-Id: If751b69fe5f927c15580332645e7e26fe6cb778c
Signed-off-by: Ping Li <quicpingli@codeaurora.org>
2016-03-23 20:31:43 -07:00
Clarence Ip
ba42ef01f3 msm: mdss: handle secure display state for MDP
Secure display state is MDP hardware state instead of
individual interface state. All interfaces should push
only secure content data when MDP hardware is in secure state.
All non-secure content should be rejected to avoid XPU
violation. DSI hardware should also avoid DCS command
communication in this state to avoid non-secure VBIF access.

CRs-fixed: 686451
Change-Id: I3beb6c24361e3c42e18107d2a2ebebafc5da1b52
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
[cip@codeaurora.org: Resolved merge conflict]
Signed-off-by: Clarence Ip <cip@codeaurora.org>
2016-03-23 20:31:42 -07:00
Kuogee Hsieh
9cafea84cb mdss: display: add unicast support when sync_wait_broadcast enabled
To support partial update, different dcs command should be
sent to individual panel at same dcs cmd kickoff while
sync_wait_broadcast mode is enabled.

CRs-Fixed: 667682
Change-Id: I1959a5c6576f2608b6926dccc12df3c883bc9937
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
2016-03-23 20:31:42 -07:00
Kuogee Hsieh
58f5dbb727 msm: mdss: avoid flickering by configuring both dsi ctrl at same time
At DFPS, to avoid flickering at right half panel, right dsi controller
needs to be configured along with left controller at same time when split
display enabled.

Change-Id: Ibbe451bd72e9740d5902d664a5e9e73db90bba5a
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
2016-03-23 20:31:41 -07:00
Jeevan Shriram
87f3edd438 mdss: fb: update smem_len when user updates parameters
There is an ioctl for userspace to update the variable
parameters. Frame buffer driver has to update the shared
memory length according to the new variable information.

Change-Id: Ic24ee3e4b1101b4e1ef4e9db2182602aa5175812
Signed-off-by: Jeevan Shriram <jshriram@codeaurora.org>
2016-03-23 20:31:40 -07:00
Casey Piper
21c7e77cb7 msm: mdss: hdmi: add debug messages to HDMI
Update HPD and CEC with debug messages. Reduce the
level of debug messages that say only that interrupts
are being ignored due to the feature not being
enabled, and add messages saying that HPD is enabled
or disabled. Also adding dynamic ioremap of addresses
based on dtsi configurations as phy init/shutdown
is not needed on msm8994.

Change-Id: I25d9d7a6737f84e7dd0c653326a37b0046accfb9
Signed-off-by: Casey Piper <cpiper@codeaurora.org>
2016-03-23 20:31:39 -07:00
Kalyan Thota
69ab21701b msm: mdss: add support for destination split
MDSS 1.8.0 supports split mux with which we can
support resolution of 2k driving both the interfaces
on single control path.

Add support for both video mode and command mode
interfaces

Change-Id: I40b6a66a9cb0b7a62fb269e31300df22e9b7cff9
Signed-off-by: Kalyan Thota <kalyant@codeaurora.org>
2016-03-23 20:31:38 -07:00
Aravind Venkateswaran
40fd052dc3 msm: mdss: ensure correct dsi phy init sequence is called
The DSI phy init sequence differs based on the hardware version and
the driver needs to execute the corresponding sequence appropriately.
Commit I0564216737cc6e98c1e8658862cf7af5dabd363c introduced a bug which
removes the hardware version check resulting in the incorrect phy
init sequence being called. Fix this by adding the required version
checks back in the driver.

kernel 3.14 upgrade conflicts:
	drivers/video/msm/mdss/msm_mdss_io_8974.c

Change-Id: Ia48f5dd7986920b9064b66c1de7c6abe10bcd365
Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
2016-03-23 20:31:37 -07:00
Radhika Ranjan Soni
b7ed11b1b1 msm: mdss: add debug prints for RT and NRT traffic
Currently there is no way to identify if a pipe is used for
real time or non real time traffic. Adding debug prints to
identify the same which would be helpful for debugging.

Change-Id: Id24bbe029ead66924c897ba81cfed50d4ce6217d
Signed-off-by: Radhika Ranjan Soni <rrsoni@codeaurora.org>
2016-03-23 20:31:36 -07:00
Vishnuvardhan Prodduturi
23305791cc msm: mdss: Enable mdp clocks before accessing panic control registers
Crashes are observed during bootup due to unclocked access of Panic
control registers. Take care of the same by enabling appropriate clocks.

Change-Id: Ic8df1f9c3c3928b9a3e9b21d63a5d9bba4f2152c
Signed-off-by: Vishnuvardhan Prodduturi <vproddut@codeaurora.org>
2016-03-23 20:31:35 -07:00
Padmanabhan Komanduru
022d7ffdfd msm: mdss: update the PHY settings for DSI1 for 8939
For 8939, the DSI_1_PHY_DSIPHY_GLBL_TEST_CTRL register setting
is different when compared to other chipsets. Update the
register settings for this based on the DSI_HW_VERSION check.
This enables dual DSI panel support on 8939.

Change-Id: Iebf8015d4a4c978283e74b104bd955a6bf7004c2
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
2016-03-23 20:31:35 -07:00
Ujwal Patel
3323780924 msm: mdss: reset ping-pong registers when display is turned off
Ping-pong registers are used for tear check when command mode panel
is used. They are used for frame buffer compression configuration if
panel supports it. But if video mode panel is used, like HDMI or eDP,
those registers should be at their reset value otherwise it can cause
unpredictable hw state and results in under-runs. To avoid this, reset
ping-pong registers when panel is turned off.

Change-Id: If792c71ac584550a24fd3424481b34179fbf1d77
Signed-off-by: Ujwal Patel <ujwalp@codeaurora.org>
2016-03-23 20:31:34 -07:00
Sree Sesha Aravind Vadrevu
fcef677bda msm: mdss: modify userspace src format during MSMFB_SET on rotator
The req->src.format field should be changed to the destination
format and propagated to the user so that appropriate buffer size
calculations for the destination buffer can be made. Note, this
only changes the user copy and the driver fetches the source buffer
based on source format.

CRs-fixed: 686496
Change-Id: I590829796c00aeea8e3d9b10578126dd7afe9c82
Signed-off-by: Sree Sesha Aravind Vadrevu <svadrevu@codeaurora.org>
2016-03-23 20:31:33 -07:00
Radhika Ranjan Soni
480f1cb4f9 mdss: Fix MISR register offset calculation for 8939
Add MDP Version check for 8939 to fix MISR register
offset calculation

Change-Id: I77f7ea8f63ef2599f64f619bf89d77849806a87d
Signed-off-by: Radhika Ranjan Soni <rrsoni@codeaurora.org>
2016-03-23 20:31:32 -07:00
Sandeep Panda
fece5962fd msm: mdss: add ESD support by register read for DSI v2
Add support to check ESD status by register read for
DSI v2 based platforms.

Change-Id: I013d31c67b3e5c61b7723ecb234be06c2fd5a451
Signed-off-by: Sandeep Panda <spanda@codeaurora.org>
2016-03-23 20:31:31 -07:00
Jeykumar Sankaran
ba6ec83385 msm: mdss: Update MDP capability node with blending stages supported
Update sysfs_node for MDP capability with max blending stages
supported for individual revisions.

Change-Id: I5c7feebb6c4a99c1604cb67e200ded44dd443580
Signed-off-by: Jeykumar Sankaran <jsanka@codeaurora.org>
2016-03-23 20:31:30 -07:00
Ujwal Patel
3c55880afc msm: mdss: return error -E2BIG when per pipe bandwidth check fails
In current implementation, it is possible that user-space tries to
configure pipe beyond its bandwidth (BW) limits. When driver detects this
condition, in few use-cases it can return -EINVAL which is not the proper
representation of the error and can lead to incorrect behavior from
user-space process. Correct this by always returning -E2BIG error
whenever per pipe BW check fails.

Change-Id: I90f429ad0bafd5bb5ec6da66d75d44ec48c0f299
Signed-off-by: Ujwal Patel <ujwalp@codeaurora.org>
2016-03-23 20:31:29 -07:00
Jayant Shekhar
c1a91dcd1e msm: mdss: Wait for vsync before iommu attach during cont splash
During first borderfill commit in splash cleanup, wait for vsync
before iommu attach to prevent IOMMU page faults during bootup.

Change-Id: I68b7162d090513b082cbd4c0013731cedc0ebdbe
Signed-off-by: Jayant Shekhar <jshekhar@codeaurora.org>
2016-03-23 20:31:29 -07:00
Charles Bin
9476b9439b mdss: Fix null dereferences
Fix potential null dereferences in driver.

Change-Id: I1ab83b8c7f60109580b1255f631bdff9a8287011
Signed-off-by: Charles Bin <cbin@codeaurora.org>
2016-03-23 20:31:28 -07:00
Charles Bin
602a467cc0 mdss: dsi: Fix null dereferences
Fix potential null dereferences in driver.

Change-Id: Idd8d4eb16bb1b9562da1f5225d91cf90d8230bfe
Signed-off-by: Charles Bin <cbin@codeaurora.org>
2016-03-23 20:31:27 -07:00
Charles Bin
389791cd50 mdss: hdmi: Fix null dereferences
Fix potential null dereferences in driver.

Change-Id: I47791e09094ef2b6e64660ef62328e5c1f03bd3e
Signed-off-by: Charles Bin <cbin@codeaurora.org>
2016-03-23 20:31:26 -07:00
Ping Li
945c0c58a4 msm: mdss: Add AD BL ATT debug log and checks
Enable more checks and add more debug logs for AD BL attenuation
functionality tests.

Change-Id: I088657bdbed553970c3550aab5bdc399970d9b23
Signed-off-by: Ping Li <quicpingli@codeaurora.org>
2016-03-23 20:31:25 -07:00
Adrian Salido-Moreno
ed041f76ef msm: mdss: handle get buffer failure gracefully
If unable to map a buffer, set the pipe in a non-buffer mode which would
cause it to go to a black solid fill. This is better than fetching from
a stale address or a buffer with a different frame configuration.

Change-Id: Ia5b281e695a096c885a2eae0f96126cd3b4da828
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
2016-03-23 20:31:24 -07:00
Adrian Salido-Moreno
ea45dc60a1 msm: mdss: ensure retire fences are signaled during panel off
When turning off command mode panel, if retire fences are still active
and suspend sequence goes through some fences may remain active.
If fences remain active command panel off sequence would stop signaling
vsyncs and would throw off the timeline. To fix this clear the retire
timeline when turning panel off.

Change-Id: I32a5fe0f81b16fa2ef959c7f05e484fb9f9f8598
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
2016-03-23 20:31:23 -07:00
Jeevan Shriram
1b769308cc mdss: mdp: remove the mdss clock vote in case of error
While applying dynamic refresh rate, there is a possibility of
failure to apply new refresh rate and has to release all resources
acquired. Remove the clock vote in the case of failure to
apply new refresh rate.

Change-Id: I882b51a94499b1984b10b176ed9dac3daf595d81
Signed-off-by: Jeevan Shriram <jshriram@codeaurora.org>
2016-03-23 20:31:22 -07:00