Commit graph

566827 commits

Author SHA1 Message Date
Shivaraj Shetty
cb838c2110 msm: mdss: Use the common interface for irq handling for mdp3
mdss provides a common interface for handling the interrupts.
Use this interface for mdp3 and dsi v2.

Change-Id: If9ca804359210211e037311a5de89666653d0a9a
Signed-off-by: Shivaraj Shetty <shivaraj@codeaurora.org>
2016-03-23 20:34:08 -07:00
Ingrid Gallardo
75f891685a msm: mdss: fix split display configuration
Split display configuration requires that lower
and upper control registers get programmed accordingly.
This change fixes a configuration bit which can cause
page faults if the timing engine gets flushed after enabled.

Change-Id: I5b5112f36ee3855a81632eab495c94d96893bdfa
Signed-off-by: Ingrid Gallardo <ingridg@codeaurora.org>
2016-03-23 20:34:07 -07:00
Shivaraj Shetty
5f96bd289b msm: mdss: Add bus/bandwidth related changes for ferrum
Ferrum has one AXI port of width 128 compared to 8x10 which had two
AXI ports of width 64. Add changes to take care of this.

Change-Id: I8644769d2133f42cb0602b6a4cc726772e233aec
Signed-off-by: Shivaraj Shetty <shivaraj@codeaurora.org>
2016-03-23 20:34:06 -07:00
Sandeep Panda
05d6044951 msm: mdss: Support iommu version v2 on MPD3
Ferrum uses iommu version v2, but where as MDP3
driver is based on iommu version v0. So this code
change adds support for iommu version v2 in MDP3 driver.

Change-Id: I754b46a5faf2e22e863bb6d077cc66f4a8e28ece
Signed-off-by: Sandeep Panda <spanda@codeaurora.org>
2016-03-23 20:34:05 -07:00
Ingrid Gallardo
c4501255d6 msm: mdss: fix to reduce rotator bandwidth
Rotator path needs to consider 60fps whenever
traffic shapper is not enabled. Add change
to use this frame rate if traffic shaper is
not in use.

Change-Id: I70a28a36be4894e4a8874bcda5fb23363ca843cc
Signed-off-by: Ingrid Gallardo <ingridg@codeaurora.org>
2016-03-23 20:34:04 -07:00
Ingrid Gallardo
6892685c74 msm: mdss: consider memory controller channels for bw vote
Add property to sepecify the number of memory controller
channels. This property is used by the driver to
reduce the display bandwidth vote by the number of
channels.

Change-Id: Id8fbdc2cac532569627fd6b4c0bf4e71061f6673
Signed-off-by: Ingrid Gallardo <ingridg@codeaurora.org>
2016-03-23 20:34:03 -07:00
Dhaval Patel
684b3e4579 msm: mdss: fix panic signal support for RT interfaces
Wrong interface check in commit
2ab750c344d81b65e6b62684b127af5b6ba2f9b0 (support
danger safe signal per pipe) enables panic signal
for pipes connected to Non-RealTime(NRT) interfaces
instead of RealTime(RT). This inverts danger-safe
logic in MDSS driver. This change fixes the panic
signal support for RT interfaces.

Change-Id: If4bb363e312b25621b283a2dca429e88d14d5f84
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
2016-03-23 20:34:02 -07:00
Ingrid Gallardo
3ee962653b msm: mdss: fix race condition between commit thread and power off
There is a deadlock in use cases where the power off
is called concurrently with the overlay kickoff from
different threads. To avoid this condition, during
power off sequence we first make sure to stop the
fb display thread before the power off sequence is
handled.

Change-Id: I708143206b914f6f72c440c4dc3a1c73fceea6b2
Signed-off-by: Ingrid Gallardo <ingridg@codeaurora.org>
2016-03-23 20:34:02 -07:00
Jayant Shekhar
71c3d682f9 msm: mdss: Prevent backlight update during continuous splash
Store backlight level during continuous splash transition and
update the same in first commit. This ensures the backlight
is restored. Change prevents IOMMU page faults seen during
continuous splash due to backlight update commands sent during
continuous splash.

Change-Id: Ib09d90d7cf8020fcceb5f04d1750f59fd648be3d
Signed-off-by: Jayant Shekhar <jshekhar@codeaurora.org>
2016-03-23 20:34:01 -07:00
Kuogee Hsieh
7a88704ea6 msm: mdss: add pwm back light support
Add pwm back light support through pmi gpio and
lpg channel.

Change-Id: I33f321ee67b739209bd40b08ae0e3d4be0cdf9d4
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
2016-03-23 20:34:00 -07:00
Siddhartha Agrawal
164b5e2e36 msm: dsi: Do not divide porch parameters when FBC is enabled
Horizontal porch values for DSI were set incorrectly when
Frame-Buffer Compression(FBC) is enabled. This fixes incorrect
DSI clock frequency calculations when FBC is enabled.

Change-Id: Iba9c3fc193148e3dcb31f1c11a37ae120e8707d1
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
2016-03-23 20:33:59 -07:00
Vikram Mulukutla
7507509915 mdss: mdp: Add support for the new scm_call2 API
The scm library has added support for a new secure world
interface that is more aligned to the ARMv8 SMC calling
convention. Use the new API while maintaining backward
compatibility.

Change-Id: I152cf98a9a434430ce7e615227b252c6bd9a12e8
Signed-off-by: Vikram Mulukutla <markivx@codeaurora.org>
2016-03-23 20:33:58 -07:00
Ping Li
0e2fd71526 msm: mdss: Upgrade and fix AD implementation
Clean up the ad lock and bl_lock to avoid potential deadlock, and
remove no longer needed code for assertive display, including extra
AD parameter setup triggered by backlight change, auto backlight mode
support. Also change the AD backlight linearization LUT from 8 bit to
12 bit values and upgrade the mapping from point to point mapping to
piecewise linear mapping.

Change-Id: Iac4e3de0f96f24ece4220dc740d781324265ffa8
Signed-off-by: Ping Li <quicpingli@codeaurora.org>
2016-03-23 20:33:57 -07:00
Siddhartha Agrawal
72d3010756 msm: mdss: Do not divide horizontal porches when fbc is enabled
MDP was dividing the porch values for Frame-Buffer Compression(FBC) by
the compression ratio incorrectly. Only the x-res needs to be divided.
This fixes the mismatch of timing values between DSI and MDP.

Change-Id: I8c57d807ac9d2b451031641da7971b4c33a66a36
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
2016-03-23 20:33:56 -07:00
Jayant Shekhar
f6c02f4c19 msm: mdss: Fix mem leak during WFD session
WFD Buffers are not getting freed as the WRITEBACK
TERMINATE ioctl is returning early. Remove early
return such that writeback terminate executes and
free the buffers.

Change-Id: I1d5b419ad2dcf863ade1be21c0fbe7d944317005
Signed-off-by: Jayant Shekhar <jshekhar@codeaurora.org>
2016-03-23 20:33:55 -07:00
Zohaib Alam
30a0116076 msm: mdss: Fix the issue of recovery from DCM state
In the QDCM tool, toggling from DCM state to DTM state fails
because system unblank doesn't happen successfully. The root
cause of the issue is at the DCM_BLANK, the overlay_off is called
before setting the panel_power_state to OFF, due to which
overlay_off doesn't suspend properly. Therefore, rearrange the
order to fix the problem.

Change-Id: I130fe711dc0d679d8205d22a9027d1c179ed49d5
Signed-off-by: Zohaib Alam <zalam@codeaurora.org>
2016-03-23 20:33:55 -07:00
Jeevan Shriram
d0966f5885 msm: mdss: update the clocks for slave controller
While updating refresh rate through dynamic fps node,
clock calculations are still needed for the slave controller
and enablement of clock for slave controller is not needed.
This change fixes clock updation of slave controller with
dynamic fps feature enabled.

Change-Id: Ibabe9bddba0633cc9a3441207f39a2f3fa7a8f71
Signed-off-by: Jeevan Shriram <jshriram@codeaurora.org>
2016-03-23 20:33:54 -07:00
Jeevan Shriram
a3888ae72d msm: mdss: update panel info node with dynamic fps parameters
Update the panel info node with dynamic fps feature parameters
for userspace to use. Also, expose minimum and maximum refresh
rate supported by the panel through panel info node.

Change-Id: I0f540faf8fabf951d03f2211e4fbbc9a7e71f457
Signed-off-by: Jeevan Shriram <jshriram@codeaurora.org>
2016-03-23 20:33:53 -07:00
Kuogee Hsieh
9013264c39 msm: mdss: return a more meaningful value for dsi dcs command tx/rx
Return positive value (number of bytes sent or received) and 0
for failed cases for DSI command Tx and Rx functions for
consistency reason. Also update the return values of the APIs
that are dependent on the tx/rx functions.

CRs-Fixed: 704825
Change-Id: I6e8862c6987ee581f3baa7dce40da4e701cfaa2e
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
2016-03-23 20:33:52 -07:00
Padmanabhan Komanduru
75742ecbe8 msm: mdss: avoid padding bytes during DSI commands rx
Currently, for long read response commands, we expect padding
bytes from the panel. However, there might be some panels which
do not support this. Hence, avoid padding bytes during DSI commands
rx and do honest request for reading bytes from the panel. Also due
to this issue, during multiple read requests (expected rlen > 10),
there is possibility that we end up reading same data byte multiple
times and storing it in the rx buffer. Add support to skip the
duplicates by updating the rx data buffer properly.

Change-Id: I2e482924f7275b63d023c947f4a4f27678522e5a
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
2016-03-23 20:33:51 -07:00
Padmanabhan Komanduru
f3263cd2d5 msm: mdss: handle DSI command rx for less than 8 bytes requested
Currently, for long read response commands with rlen less than
8, there are padding bytes being expected to be sent by the panel.
However, there might be some panels which do not support extra
padding bytes. Due to this, the read response might not be stored
in the first byte of the rx buffer.

The RDBK_DATA_CTRL register is available from DSI6G v1.1.0 and
above. Make use of this register to check the number of bytes
returned by the panel. Based on this, calculate the offset of
the first valid byte of the response in the rx buffer. For
targets which do not have this register, calculate the offset
based on the software state of the read length variable.

Change-Id: I94d3f6d7a453f925bdfd967cdb23cf6aab1ac3a8
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
2016-03-23 20:33:50 -07:00
Padmanabhan Komanduru
72454981c6 msm: mdss: avoid DSI read commands with rlen value of zero
The minimum value of parameter for Maximum Return Packet Size
command before DSI command rx should be 1. Avoid any DSI read
commands with rlen value of zero.

Change-Id: Ieaf8d3f478047e726888f29db2838dbb7196d57a
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
2016-03-23 20:33:49 -07:00
Padmanabhan Komanduru
b3cf731350 msm: mdss: update the programmable line value during VRR
Update the programmable fetch start line register during variable
refresh rate (VRR) operations. This is needed since the vertical
front porch value changes when there is a change in fps. Also, do
not perform fetch start configuration during boot up when
continuous splash screen is enabled. The feature will be enabled in
LK. This is needed for proper VRR operations until first suspend
resume.

Change-Id: I5c82bc520da53db958ad0fad4217f00d92a25cae
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
2016-03-23 20:33:48 -07:00
Veera Sundaram Sankaran
31873f1345 msm: mdss: extend debugfs support for dsi phy registers
Expose dsi phy registers as well, as part of the debugfs
interface in addition to the dsi controller registers.

Change-Id: I49c8723e9f650137990df31b099c67e3b08907a3
Signed-off-by: Veera Sundaram Sankaran <veeras@codeaurora.org>
2016-03-23 20:33:48 -07:00
Jayant Shekhar
11dd351931 msm: mdss: Fix potential stack corruption issue
Fix potential stack corruption issue which is possible
due to different datatype for arguments used in callee
and caller function.

Change-Id: I564f62af7574c8eaa3ac8f55de0f0732223cae42
Signed-off-by: Jayant Shekhar <jshekhar@codeaurora.org>
2016-03-23 20:33:47 -07:00
Ken Zhang
be5b986516 msm9x35: display: qpic: enable interrupt for sending command
Enable interrupt usage and use it by default. Redefine
command data structure to reduce call stack. SW mode
and panel read function have been added for debugging.

Change-Id: I5eb9e5ad2df8e1cd8af868f5aa9ededafb3307f1
Signed-off-by: Ken Zhang <kenz@codeaurora.org>
2016-03-23 20:33:46 -07:00
Siddhartha Agrawal
3555d62dbc msm: mdss: dsi: Fix current leakage issue for DSI PLL 1
DSI PLL 1 leaks current after a phy s/w reset. Add support
to re-program the PLL 1 registers and correctly turn it off.

Change-Id: I9184951d0d095b188ade13faff8d834fa9bd5010
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
2016-03-23 20:33:45 -07:00
Shivaraj Shetty
7fa4cb6451 msm: mdss: Fill irq information correctly for dsi 6G
For DSI 6G fill the irq information at correct place so as
to avoid the crash and also call irq disable soon after
requesting for irq.

Change-Id: Icbf6f24fc6d938f1943f124f3d7368187743b36d
Signed-off-by: Shivaraj Shetty <shivaraj@codeaurora.org>
2016-03-23 20:33:44 -07:00
Jeevan Shriram
261f51d15f msm: mdss: update mipi frame rate after new fps is set
With dynamic refresh feature enabled in immediate clock
update mode, update the mipi frame rate as well to the
new rate.

This is required for calculating sleep time for retire
fence count to be accurate.

Change-Id: I9fa9b420df8f1496d0bb4dab3d3ee50d35630394
Signed-off-by: Jeevan Shriram <jshriram@codeaurora.org>
2016-03-23 20:33:43 -07:00
Padmanabhan Komanduru
7d8519628f msm: mdss: add support for variable refresh rate for 8916/8939
Flush the MDP and DSI timing registers during variable refresh rate
operation for 8916/8939. Also, there is no need to wait for vsync
interrupt before programming the timing registers due to their
double buffer nature.

Change-Id: Ia349729069bd49f0c40ce41cccefdfb67cafe44c
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
[abhimany@codeaurora.org: minor confict resolution]
[abhimany@codeaurora.org: INIT_COMPLETION fixups]
Signed-off-by: Abhimanyu Kapur <abhimany@codeaurora.org>
2016-03-23 20:33:42 -07:00
Ajay Singh Parmar
076e7000c9 msm: mdss: hdmi: tear down audio at bootup if already started
Shutdown the audio session while booting up if already started
as part of continuous splash screen.

Change-Id: I0db7edba6dd3726721d827c0375574fb77809b93
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
2016-03-23 20:33:42 -07:00
Ajay Singh Parmar
2694dff22b msm: mdss: hdmi: correct continuous splash screen dt node name
Correct the cont-splash-enabled device tree node name as per
standards for dt compliance.

Change-Id: I05779770bea7186800556fa40a918e793d6bf528
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
2016-03-23 20:33:41 -07:00
Ajay Singh Parmar
4383d678b1 msm: mdss: hdmi: disable audio only if encryption enabled
Allow audio playback if secure content is not being played
regardless of HDCP status.

Change-Id: I3b651f95c4097fe187b15d1bb17fbbd2ee20254a
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
2016-03-23 20:33:40 -07:00
Jeevan Shriram
e6ff417951 msm: mdss: update the dynamic refresh registers only for PLL0
Currently, when changing the refresh rate dynamically, the same
DSI PLL0 registers get updated as we dont use the PLL1. This
change avoids programmaing of second controller.

Change-Id: I599787f25fe3f197c426e38c0a02fa367ec2732e
Signed-off-by: Jeevan Shriram <jshriram@codeaurora.org>
2016-03-23 20:33:39 -07:00
Ray Zhang
e2e79b5fe8 msm: mdss: remove unnecessary lock in checking DSI status
Since DSI status checking is purely DSI operation, it's not
necessary to acquire ov_lock in case of video mode, otherwise
this function could block other overlay functions, therefore
introducing extra delay.

CRs-fixed: 714531
Change-Id: I5051ff3495d516b405cd3bf5dc32ea712187975e
Signed-off-by: Ray Zhang <rayz@codeaurora.org>
2016-03-23 20:33:38 -07:00
Anusha Koduru
eca7092bac msm:mdss: Add MISR free run mode support
Add MDSS version check and enable MISR free run mode.

Change-Id: I8a07ff5926eb82f1ac27851d16400570c017485c
Signed-off-by: Anusha Koduru <kanusha@codeaurora.org>
2016-03-23 20:33:37 -07:00
Ajay Singh Parmar
d784a0d10f msm: mdss: hdmi: continuous splash screen for HDMI
Enable continuous splash screen for HDMI interface
when it is configured as primary. Enable the regulators, clocks
and gpios at probe to vote for them. If resolution change has
happened, power off the HDMI to clean the obsolete resolution
data and setting. If resolution has not changed, do not re-program
same settings for smoother display.

Change-Id: I45e76ffce8f0654673a8fb19b683c783a18e229b
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
2016-03-23 20:33:36 -07:00
Ingrid Gallardo
a83b3a245c msm: mdss: fix logic to flush timing engine
Fix logic to avoid timing engine flush in the first
commit when continuous splash is enabled.

Change-Id: I12b4969e9ec1ca421fa9b72cabbe9fee7d6061fb
Signed-off-by: Ingrid Gallardo <ingridg@codeaurora.org>
2016-03-23 20:33:36 -07:00
Ingrid Gallardo
649fad848a msm: mdss: always apply BW fudge factor when video mode present
If there is a video mode controller enabled and other
controllers non-video mode, current display driver apply
the bw fudge factor only to the controller that it is
video mode.
This change will apply the fudge factor to all the
controllers enabled if any of those is video mode to
fix some of the underruns observed in the video interfaces.

Change-Id: I0d01477dc45edbef2a25ccd540aa06b3c43073a4
Signed-off-by: Ingrid Gallardo <ingridg@codeaurora.org>
2016-03-23 20:33:35 -07:00
Jeevan Shriram
3cd94cabd9 mdss: mdp: reset init phase and phase step to default
reset the init phase and phase step registers to default
when the pixel extension are not calculated in userspace.

Change-Id: I876f1628fb46901a07deb1b97a4ab55f924612b0
Signed-off-by: Jeevan Shriram <jshriram@codeaurora.org>
Signed-off-by: Ujwal Patel <ujwalp@codeaurora.org>
2016-03-23 20:33:34 -07:00
Ajay Singh Parmar
2d8e778666 msm: mdss: controller cleanup on panel resolution change
Cleanup MDP controller and mixer setup in case panel resolution
has changed. The obsolete resolution settings need to be cleaned
and setup with new resolution data for proper display.

Change-Id: I8df3c19cb5e872e05a585ed0d4df2e5c4d0c9624
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
2016-03-23 20:33:33 -07:00
Dhaval Patel
333866a5c6 msm: mdss: support danger safe signal per pipe
MDPv1.5 and MDPv1.8 has danger safe LUTs and control setting
register under MDP register space. These LUTs and control
settings can be different for each pipe for MDPv1.7. It makes
"panic-ctrl-offsets" configuration also optional for VIG, RGB
and DMA pipes. This change handles the danger safe signal
programming for such MDP version.

Change-Id: Icf0e4a732d7372493d1166579b90a7c2df7ae126
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
2016-03-23 20:33:32 -07:00
Aravind Venkateswaran
f8e6cabbfc msm: mdss: enable runtime autosuspend for mdp device
With MDSS idle power collapse feature enabled, it is possible that
the runtime suspend callback for MDP device to be called when there are
no display updates. This results in MDSS GDSC to be turned off in idle
screen usecases, and would subsequently be turned back on upon the next
update. However, toggling GDSC can be an expensive operation and should
only be done when it is expected to be off for a substantial time. To
achieve this, enable the runtime autosuspend status for the mdp device.

Change-Id: I6e4127efe7b01d7e164b0763d34995c82c2e8be9
Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
2016-03-23 20:33:31 -07:00
Vikram Mulukutla
ef439517fe msm: mdss: hdmi: Add support for the new scm_call2 API
The scm library has added support for a new secure world
interface that is more aligned to the ARMv8 SMC calling
convention. Use the new API while maintaining backward
compatibility.

Change-Id: I9edb4fc11982dca2f7bdf76a3075a99f4cbe9990
Signed-off-by: Vikram Mulukutla <markivx@codeaurora.org>
2016-03-23 20:33:30 -07:00
Adrian Salido-Moreno
44f6d6b7b2 msm: mdss: configure panel split based on configuration
Current code assumes when Dual DSI configuration is used that width will
be twice the left panel resolution. This may not always be the case and
should instead look at the configuration to get this information.

Change-Id: I5c2ac608f46d7c0ce1acbffe002d69fca44afaf7
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
2016-03-23 20:33:29 -07:00
Ingrid Gallardo
8a3c8dd091 msm: mdss: fix underrun between splash screen and boot animation
When continuous splash is enabled, avoid timing
engine flush in the first commit.

Change-Id: I11e7f86c910aa4dcaea3fcd72ec24cbbea450db2
Signed-off-by: Ingrid Gallardo <ingridg@codeaurora.org>
2016-03-23 20:33:29 -07:00
Jeevan Shriram
1745ed0ed5 msm: mdss: Add support for dynamic refresh rate
Add support for dynamic refresh rate through
immediate clock update and dynamic refresh pll
register configuration.

Change-Id: I3ea8da3db100b6e5f21697a80f7b97543d4689f1
Signed-off-by: Jeevan Shriram <jshriram@codeaurora.org>
[abhimany@codeaurora.org: INIT_COMPLETION fixups]
Signed-off-by: Abhimanyu Kapur <abhimany@codeaurora.org>
2016-03-23 20:33:28 -07:00
Clarence Ip
eb5019c32c msm: mdss: Add support for separate irq line for DSI 6G
In ferrum DSI has an irq line which is different from mdp.
Add support for irq handling this case. It makes use of
utility functions provided by mdss.

Change-Id: Ia6dca1050957f4755b7547f4c1a08ace913c2ac7
Signed-off-by: Shivaraj Shetty <shivaraj@codeaurora.org>
[cip@codeaurora.org: Resolved merge conflict,
removed IRQF_DISABLED flag]
Signed-off-by: Clarence Ip <cip@codeaurora.org>
2016-03-23 20:33:27 -07:00
Shivaraj Shetty
29e5a92bb2 msm: mdss: Cleanup the interface given by mdss/mdp
Change irq interface provided by mdp from exporting symbols to
function pointers. This will help in making mdp3 work with dsi 6G.

Change-Id: I07a2acf56b75a2a6d83c0522d38efe3754bb8765
Signed-off-by: Shivaraj Shetty <shivaraj@codeaurora.org>
[cip@codeaurora.org: Moved mdss_util.c file location]
Signed-off-by: Clarence Ip <cip@codeaurora.org>
2016-03-23 20:33:26 -07:00
Vishnuvardhan Prodduturi
0e9966adb0 msm: mdss: Vote for bandwidth reference count for command transfer
Bandwidth vote needs to be enabled for DCS commands to be sent
during static screen on command mode panels.

Change-Id: I267c910dac9610b230f0138909c0dc8ca5797f11
Signed-off-by: Vishnuvardhan Prodduturi <vproddut@codeaurora.org>
2016-03-23 20:33:25 -07:00