Commit graph

566736 commits

Author SHA1 Message Date
Aravind Venkateswaran
1df1a1a1fd msm: mdss: always request for dsi gpios when cont splash is enabled
When continuous splash screen feature is enabled, the panel is left
turned on by the bootloader. In such cases, we need to request all
the GPIOs used by the DSI driver at probe time. In the current
implementation, the GPIOs are not requested if certain panel specific
flags are set. This results in a bug when an attempt is made to free
these GPIOs when the device is suspended. Fix this by ensuring that
the GPIOs are requested unconditionally.

Change-Id: If0bea80aab819aeafdaaedf81451d5fa64d4e76d
CRs-Fixed: 684253
Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
2016-03-23 20:31:21 -07:00
Krishna Chaitanya Parimi
fcedb98b47 msm: mdss: Allocate correct space for hist bin count in 64 bit
Histogram bin count variable was being allocated insufficient
space in compat ioctl for histogram read.
Correcting the space being allocated to the member variable
bin_cnt in histogram read.

Change-Id: I91111037ee5c73f8090d867b4924d3dc59b91d97
Signed-off-by: Krishna Chaitanya Parimi <cparimi@codeaurora.org>
2016-03-23 20:31:21 -07:00
Benet Clark
dabc1a3ddd msm: mdss: Change notify_update ioctl copy size to match ioctl definition
The MSMFB_NOTIFY_UPDATE ioctl is defined based on sizeof(unsigned int).
However, we use the incorrect size when copying to and from userspace.
The sizes for copying have been fixed to match the ioctl definition.

Change-Id: I0f63228e5b4ad936d89c5f2bcbd84204037a0edf
Signed-off-by: Benet Clark <benetc@codeaurora.org>
2016-03-23 20:31:20 -07:00
Ping Li
8ec45733aa msm: mdss: Fix the AD backlight attenuation implementation
Fix the AD backlight attenuation implementation by sending the
attenuation backlight to both panel and AD HW block, to achieve power
saving.

Change-Id: I64c79d7aa439a8d9e722b4b098c0b163fd115699
Signed-off-by: Ping Li <quicpingli@codeaurora.org>
2016-03-23 20:31:19 -07:00
Sandeep Panda
504bf92d7e msm: mdss: Wait for one vsync after turn off TG
TG control register is double buffered register. When
disable, it will only take effect once vsync has come.
So wait for at least once vsync to ensure TG is off.

Change-Id: I35d8c8be4bc72ababd2a04bb7718688404d775eb
Signed-off-by: Sandeep Panda <spanda@codeaurora.org>
2016-03-23 20:31:18 -07:00
Jeevan Shriram
285ad26ae9 mdss: mdp: Fix for generating proper trace points
Clean up trace points to generate proper pingpong and
post processing trace points in display commit.

Change-Id: I7fe696515482f77ee90f0fec88e5778868399896
Signed-off-by: Jeevan Shriram <jshriram@codeaurora.org>
2016-03-23 20:31:17 -07:00
Jeevan Shriram
314a19ad92 mdss: mdp: wait for pingpong done for second control
In the current implementation, we are waiting for ping pong
interrupt only for the first control. There is a possibility
that the second control takes more time than the first. As the
commit call is asynchronous next kickoff could get triggered.
This causes dsi fifo to underflow and eventually pingpong timeout
are observed.

This change fixes the issue by waiting for second control's
pingpong done interrupt, to ensure that the tx to dsi
controller is complete before the next commit is triggered.

Change-Id: Ie8caf36744b3f5860962ad30d19d61d0a6de2763
Signed-off-by: Jeevan Shriram <jshriram@codeaurora.org>
2016-03-23 20:31:16 -07:00
Casey Piper
1f4617c257 msm: mdss: hdmi: update clockrate for 480p resolution
Correct the 480p clockrate to ensure HDMI pll
locks when connected to a 480p sink.

Change-Id: I93b49390c534966b86cb73bf02bdf25f5b12890e
Signed-off-by: Casey Piper <cpiper@codeaurora.org>
2016-03-23 20:31:15 -07:00
Xiaoming Zhou
f05732e085 msm: mdss: distinguish between mdp and dsi bus votes
For DSI read or write commands, they will also go through
axi bus.  Earlier, we were only voting for the mdp bus bandwidth.
In the case where the mdp bus bandwidth vote is 0 and there is
a DSI transaction, it will result in DSI hang.

Change-Id: Iafd9e06ae2050665392c6c74fece8f20cb6d44b1
Signed-off-by: Xiaoming Zhou <zhoux@codeaurora.org>
2016-03-23 20:31:14 -07:00
Jayant Shekhar
882651e495 msm: mdss: Check ctl power on status before BTA status check
Control path power on status should be checked before BTA status
check else command sending failure and IOMMU page faults during
bootup can be observed if ESD is enabled for device. Currently
IOMMU is not powered on when commands are being sent.

Change-Id: Ice66f38e79755eb14843fc63afe058e4bab2f0e2
Signed-off-by: Jayant Shekhar <jshekhar@codeaurora.org>
2016-03-23 20:31:14 -07:00
Radhika Ranjan Soni
24efc080e1 mdss: Fix 8994 MISR register offset
Add 8994 MDP version check for MISR offset

Change-Id: Idd1c8d902cd72684dad2bd1acabb8f9a5391ab76
Signed-off-by: Radhika Ranjan Soni <rrsoni@codeaurora.org>
2016-03-23 20:31:13 -07:00
Radhika Ranjan Soni
cf29d0ba28 msm: mdss: handle WB2 irq changes for MDSS 1.8.0 for WFD case
In MDSS 1.8.0 WB2 intr status and intr enable bits has changed.
Handle this case only for WFD scenario as code path is common
for both WFD and rotator and it is affecting rotator use cases.

Change-Id: Id366bb2f3a7ac7b4195193c71d5823eeb152a315
Signed-off-by: Radhika Ranjan Soni <rrsoni@codeaurora.org>
2016-03-23 20:31:12 -07:00
Ujwal Patel
404cccbd98 msm: mdss: update mdss_mdp_clk ctrl for obsolete input parameter
Starting patch I0328e156d5c0b42822f0f81aa0a8195159a1eeb7,
"mdss: display: add dynamic mdp clock control for smart panel", 2nd
argument of mdss_mdp_clk_ctrl is not used. Update implementation to
avoid passing obsolete input parameter.

Change-Id: Id9626b8a3e030e787085b257c618fd7e41d5b35a
Signed-off-by: Ujwal Patel <ujwalp@codeaurora.org>
2016-03-23 20:31:11 -07:00
Laura Abbott
216fe2b01c msm: mdss: Fix stub functions
One stub function was missing a return code and
another stub function was missing completely. Add these.

Change-Id: Ie09d51227230facc571fd0e17cc9765da94b7db1
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
2016-03-23 20:31:10 -07:00
Aravind Venkateswaran
7503cdffec msm: mdss: dsi: enable idle power collapse without DSI ULPS
It is possible to power collaps MDSS without configuring the DSI
lanes in Ultra Low Power State (ULPS). Add support for this by
configuring DSI clamps irrespective of whether ULPS feature is
enabled or not.

Change-Id: I0564216737cc6e98c1e8658862cf7af5dabd363c
Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
2016-03-23 20:31:09 -07:00
Sree Sesha Aravind Vadrevu
e2b32b069d msm: mdss: add additional blending stages for the layer mixers
msm8994 can support three additional blending stages in the layer
mixer bringing the total to 8 layers including the base stage.
Modify layer mixer programming to support additional blend stages.

Change-Id: Iff812ec2cf08e4234dc13c5630fe66ba07462b87
Signed-off-by: Sree Sesha Aravind Vadrevu <svadrevu@codeaurora.org>
2016-03-23 20:31:08 -07:00
Krishna Chaitanya Parimi
5c61eb08eb msm: mdss: Minimize cases of BL lock in update backlight
Calling backlight lock on every commit iteration was adding
overhead. Altering the conditions to allow locking only for
case when unset backlight level is not zero.

Change-Id: I023dccfa584cf641d042565b7ad2cb32c0724c55
Signed-off-by: Krishna Chaitanya Parimi <cparimi@codeaurora.org>
2016-03-23 20:31:07 -07:00
Sandeep Panda
37a9966982 msm: mdss: Add support to read DSI clamp offset from DT
Since the DSI ULPS clamping registers offset varies
from chipset to chipset, so read the offset values from
chipset specific mdss dtsi file.

Change-Id: I0dcdf8cf0d0f3f1851337e05add833fbdac0632c
Signed-off-by: Sandeep Panda <spanda@codeaurora.org>
2016-03-23 20:31:07 -07:00
Chandan Uddaraju
d924defccd msm: mdss: dsi: fix backlight control configuration
Fix the current pwm backlight control implementation
to configure pwm channel only when it is defined
in devicetree.

Change-Id: I8613fa5564f98d3693455f35cf9912b03acf31ce
Signed-off-by: Chandan Uddaraju <chandanu@codeaurora.org>
2016-03-23 20:31:06 -07:00
Vineet Bajaj
6c77f430e6 msm: mdss: fix race condition of DSI off and status check.
fb_event_callback cancels the work queue when it receives
the power down event. However, this event occurs after the
panel & DSI have been turned off. So if the check_status
function was being called right when the panel is being
turned off, we have a race conditon. Hence add offlock
mutex to ensure that bta status check is done when dsi
is being turned off.

Change-Id: Ie341c002c4544376bda2940fa65c6eb13997ae17
Signed-off-by: Vineet Bajaj <vbajaj@codeaurora.org>
2016-03-23 20:31:05 -07:00
Chandan Uddaraju
3c59706458 mdss: dsi: Add support to control bias voltage regulator
The bias voltage regulator is controlled by wled driver
for the sharp panel on 8994. Add support to control this
regulator to fix suspend/resume issues.

Add optional "qcom,dsi-panel-bias-vreg" property to
support this on specific platforms.

Change-Id: Ifb02a0467dc190e673781490a918c12293d41d58
Signed-off-by: Chandan Uddaraju <chandanu@codeaurora.org>
2016-03-23 20:31:04 -07:00
Ramkumar Radhakrishnan
332fef7869 msm: mdss: use one dma pipe during block mode transaction
Use one dma pipe during block mode transaction instead of two pipes
for the buffer resolution greater than max mixer width

Change-Id: I2a9f1bba95bfb66d1c0168aa9b99b8b9de57cd6a
Signed-off-by: Ramkumar Radhakrishnan <ramkumar@codeaurora.org>
2016-03-23 20:31:03 -07:00
Siddhartha Agrawal
b5cb5ca270 msm: mdss: Fix synchronization issue for dual dsi dynamic fps
Add additional checks in dual dsi with dynamic fps(dfps) enabled.
This change fixes synchronization issues during mismatch of dfps
settings between the dsi controllers.

Change-Id: Ib98b779bec15b5b60cbba337724a0b1d093bda46
Signed-off-by: Jeevan Shriram <jshriram@codeaurora.org>
2016-03-23 20:31:02 -07:00
Nirmal Abraham
ebcec19f5b msm: mdss: validate input args of mdss_overlay_compat_ioctl
check if ovlist32 arg is valid before dereferencing it to
avoid NULL ptr or an invalid address access.

Change-Id: Ice0845ad0afdb20d7e101f114fc0a443d6aff19a
Signed-off-by: Nirmal Abraham <nabrah@codeaurora.org>
Signed-off-by: Raghavendra Ambadas <rambad@codeaurora.org>
2016-03-23 20:31:01 -07:00
Kuogee Hsieh
0402704a16 mdss: display: always send both column and page to panel
At partial update, When broadcast mode enabled, dsi1 is used
to trigger dcs command to be sent to both panel. Therefore
set_col_page dcs command of dsi1 can not be skipped even its
roi has not changed.

CRs-Fixed: 679218
Change-Id: Id979433fc3993dfb5e6aee4b9779c2cde42617f1
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
2016-03-23 20:31:00 -07:00
Radhika Ranjan Soni
83ab5ee696 msm: mdss: avoid danger/safe signal disabling for NRT clients
NRT clients need not to enable or disable danger/safe signalling.
So pipe used by non real time clients (e.g. writeback path) need
not enable or disable danger/safe signalling explicitly. Hence
add a check to ensure danger/safe signalling enabled only for
real time client at pipe_init and disabled at pipe_free.

Change-Id: I69b8b57620eb0c27193671632f9a97cccab073f3
Signed-off-by: Radhika Ranjan Soni <rrsoni@codeaurora.org>
2016-03-23 20:31:00 -07:00
Jayant Shekhar
7826f9cc6c msm: mdss: Cleanup iommu ref count implementation
With current iommu ref count implementation, iommu is
attached at points when only needed and detached once
finished. Iommu reference count in overlay pan display
path is currently missing hence add it. Also remove
code repetitions and unnecessary error checks while
decreasing iommu ref counts in overlay and writeback
path.

Change-Id: If1aed768e5d704dd6c9d4bfd17c1ec368c8d8711
Signed-off-by: Jayant Shekhar <jshekhar@codeaurora.org>
2016-03-23 20:30:59 -07:00
Ujwal Patel
91c50a7555 msm: mdss: fix single layer calculation during PREPARE IOCTL
BW calculations of display controller depends on how many pipes are
staged on a given layer mixer (LM). Currently BW calculations are done
twice, once during PREPARE IOCTL to check if BW is within system defined
limits and other during commit IOCTL. During both calculations, we need
to find out how many pipes are staged on a give LM. When these
calculations are done during frame (n)'s PREPARE IOCTL, frame (n-1)'s
pipe stage information is used rather than frame (n)'s. This can lead to
false BW checks in PREPARE IOCTL and allows display controller with
configuration beyond its BW limits. Fix this by propagating frame (n)'s
intended number of staged pipes to BW calculation function.

Change-Id: I7561f6b020dc46ca356efac3f690bda1eb810ca4
Signed-off-by: Ujwal Patel <ujwalp@codeaurora.org>
Signed-off-by: Ingrid Gallardo <ingridg@codeaurora.org>
2016-03-23 20:30:58 -07:00
Kuogee Hsieh
8c30e33e10 mdss: display: extend mutex coverage inside cmdlist_put
At Current implementation mutex is released after dcs
commands had been added to queue and before cmdlist_commit
called to tx commands. This is created a possibility to allow
other thread do take over command queue and call cmdlist_commit
to tx commands which not added by it. Extend mutex coverage to
including both cmdlsit_put and cmdlist_commit to fix the problem.

CRs-Fixed: 669136
Change-Id: I317adae2b39505d96afe1edd27f1a1ab813b343d
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
2016-03-23 20:30:57 -07:00
Radhika Ranjan Soni
11dde437a3 msm: mdss: add MDP hw revision check for msm8939 panic/robust feature
Add MDP hw revision check to support panic/robust signalling
feature for msm8939. This feature enables MDP hardware to send
panic/robust signal to bimc based on fill level for all pipes
connected to realtime interfaces.

Change-Id: Idf8908eb6e4d2827d02f929161e43b58ca56757a
Signed-off-by: Radhika Ranjan Soni <rrsoni@codeaurora.org>
2016-03-23 20:30:56 -07:00
Sandeep Panda
12b5ffacd8 msm: mdss: Fix overriding of rgb swap parameter
Fix overriding of rgb_swap parameter in dsi driver,
as this should be read and set from panel dtsi file.

Change-Id: I1ed35f0dc4ce623ebcf3bc8e563a9d10d34a4a70
Signed-off-by: Sandeep Panda <spanda@codeaurora.org>
2016-03-23 20:30:55 -07:00
Shivaraj Shetty
403ec58117 msm: mdss: Add support for dynamic mode switch on mdp3
Add support to dynamically switch between dsi video
mode and command mode for MDP3 driver. For a panel which
is configured in video mode and can support command mode,
it would be power efficient to dynamically switch to
command mode on need basis.

Change-Id: Iefb3c8aa453a8be4396fd04b65dcc462d01e26fb
Signed-off-by: Shivaraj Shetty <shivaraj@codeaurora.org>
2016-03-23 20:30:54 -07:00
Shivaraj Shetty
0f38e4eaeb msm: mdss: Avoid mutex lockup in dynamic switching
Calling blank/unblank after locking the backlight mutex will result
in mutex lockup as blank/unblank would again try to aquire the same
lock. Avoid this situation in Dynamic Switching.

Change-Id: I7ddb2afec605f236071976420e0d6bd0c707e4d0
Signed-off-by: Shivaraj Shetty <shivaraj@codeaurora.org>
2016-03-23 20:30:54 -07:00
Stepan Moskovchenko
d46bb668a7 drivers: msm: Fix a handful of compiler warnings
Compiling the kernel with the -O2 GCC flag reveals a number
of warnings relating to potentially uninitialized variables
and other edge cases.

Change-Id: I3758dbe1af276d79f55188b9f2db850c730acb80
Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
2016-03-23 20:30:53 -07:00
Sree Sesha Aravind Vadrevu
5a63e87dd8 msm: mdss: Flush Interface timing registers only once
MDSS interface timing engine registers need to be flushed
only once during the first commit to the respective panel.

Change-Id: I7a619f2eeeb57baf5429346a11eb41eedac252f3
Signed-off-by: Sree Sesha Aravind Vadrevu <svadrevu@codeaurora.org>
2016-03-23 20:30:52 -07:00
Xiaoming Zhou
98fe6af447 msm: mdss: synchronize recovery handler access
The recovery handler is used in the dsi event thread, and
the recovery handler variable was configured from a different
thread.  Earlier, there is no synchronization between the two
threads when accessing the recovery handler, causing kernel
panics.

Change-Id: Iee990276fdabd65e2e1f2e3c21ad574fc0d8a7bc
Signed-off-by: Xiaoming Zhou <zhoux@codeaurora.org>
2016-03-23 20:30:51 -07:00
Jeevan Shriram
4503db18f5 mdss: fb: ensure that shared memory is available during probe
Populate shared memory length during probe for availability
to userspace through FSCREENINFO ioctl. Also, ensure that fb
length is always available.

Change-Id: I94d3f83098fbfd81a7aa20f6fc1f19e756aebc4e
Signed-off-by: Jeevan Shriram <jshriram@codeaurora.org>
2016-03-23 20:30:50 -07:00
Jayant Shekhar
c2e9e4027a msm: mdss: IOMMU ref count implementation
Currently MDP is attaching/detaching iommu based on
bus bandwidth requests. This can lead to performance
issues, so implement ref count on iommu such that
iommu is attached where needed.

Change-Id: Ic4d35e2dc7f83291d1ab93d3e0109a2d69c98844
Signed-off-by: Jayant Shekhar <jshekhar@codeaurora.org>
2016-03-23 20:30:49 -07:00
Chandan Uddaraju
9f12ae978b clk: qcom: mdss: add mdss 20nm pll clock driver support
Add support for new 20nm PLL clock driver to handle
different DSI panel resolutions. Add seperate files
to support this new 20nm PHY PLL block.

Change-Id: I4ee5309449f317daddba7106cb8e1829fd6e76cf
Signed-off-by: Chandan Uddaraju <chandanu@codeaurora.org>
2016-03-23 20:30:48 -07:00
Benet Clark
a6794d3715 msm: mdss: Use correct error checking for mdss bus scale register
Previously, we were checking the error value for mdss bus_scale_register
incorrectly. Now we check the error value for null rather than a negative
value.

Change-Id: If7fda0584df82d6c007829f2e63af9b735cafb7e
Signed-off-by: Benet Clark <benetc@codeaurora.org>
2016-03-23 20:30:47 -07:00
Benet Clark
4b9ced0958 msm: mdss: Move msm register bus setup outside of postproc
The msm register bus is currently configured by postprocessing. If the
mdss driver wants to modify the msm register bus bandwidth at any point
in the future, then the bus should be configured in a more central
location of the mdss driver.

Change-Id: I4ae65f4448f0b2be1371446d08bd4ab55c830d19
Signed-off-by: Benet Clark <benetc@codeaurora.org>
2016-03-23 20:30:47 -07:00
Jeykumar Sankaran
2a8882907f msm: mdss: Parse fixed MMB's for VIG pipes
Similar to RGB fixed MMB's, msm8994 reserves fixed MMB's for VIG pipes too.
Parse fixed MMB allocation for VIG pipes from device tree and update
MMB alloc map.

Change-Id: Ie7c7dea77fe8a2afc6bfeffdb5d7f69c48b802cd
Signed-off-by: Jeykumar Sankaran <jsanka@codeaurora.org>
2016-03-23 20:30:46 -07:00
Sree Sesha Aravind Vadrevu
be8c9d99f2 msm: mdss: Flush interface registers
The timing engine flush registers for display interfaces need to be
programmed before enabling their respective timing generators.

Change-Id: I6144233e9dbad5ce5699652fac4834f0744fe2e0
Signed-off-by: Sree Sesha Aravind Vadrevu <svadrevu@codeaurora.org>
2016-03-23 20:30:45 -07:00
Ujwal Patel
02507ce644 msm: mdss: fix quality issues when source split is disabled
When source split is disabled on split display panels, a layer can be
split un-evenly into two pipes. When in this condition along with
vertical decimation specified by user-space, it is possible that driver
infuse extra decimation if per pipe BW is exceeded. Now when we do this,
it is possible that both halves of the same layer get different decimation
and can lead to quality difference between two panels. Fix this by not
allowing extra decimation when split display is enabled.

Change-Id: Ib47953fd94400b01d02ee07059bf008310abbc84
Signed-off-by: Ujwal Patel <ujwalp@codeaurora.org>
2016-03-23 20:30:44 -07:00
Benet Clark
c0b5e65734 msm: mdss: Change DSI backlight pwm_config to use nanoseconds
The DSI panel backlight is now configured using nanosecond duty cycle
and period for pwm. A nanosecond duty cycle is needed in order to satisfy
the granularity needed for 255 backlight levels and the DSI period. If the
pwm_period is very large, then a microsecond configuration is used.

Change-Id: I9551f52360f9d5da47ab7e2da6e039ad6f2695fb
Signed-off-by: Benet Clark <benetc@codeaurora.org>
2016-03-23 20:30:43 -07:00
Zohaib Alam
7d9accc738 msm: mdss: Allow display commit in DCM state for CMD panels
Allow display-commit in DCM state for command mode panels. QDCM
tool requires explicit display kickoff during the calibration
stage in which the panel power is turned off.

Change-Id: Id6c7a0becf488ad2bfe9652b05d781384109f5c4
Signed-off-by: Zohaib Alam <zalam@codeaurora.org>
2016-03-23 20:30:42 -07:00
Ken Zhang
8865394e27 msm: display: kickoff lock release centralization
Centralize kickoff lock releasing, use notify event to trigger
in display commit thread.

Change-Id: I06fbe0660917a0c570b1337953f7334f3706ce8e
Signed-off-by: Ken Zhang <kenz@codeaurora.org>
2016-03-23 20:30:41 -07:00
Jayant Shekhar
b1fae38077 msm: mdss: Add debug message to profile rotator times
Add debug message which calculates time taken by rotator
to process a frame.

Change-Id: Iffc79477c8b72230bc916631303b31bf0be9a494
Signed-off-by: Jayant Shekhar <jshekhar@codeaurora.org>
2016-03-23 20:30:41 -07:00
Jeevan Shriram
b792fb7ee3 msm: wb: Ensure iommu reference is available in wb terminate
In static screen case on command mode, when wifi display is
disconnected, buffers don't get free as there is a probability
that iommu is not attached. Ensure that iommu is attached when
wifi display terminate is called.

Change-Id: I3cd92072cc44074b31766a5542a9b59e1a2bdad1
Signed-off-by: Jeevan Shriram <jshriram@codeaurora.org>
2016-03-23 20:30:40 -07:00
Jayant Shekhar
62f641db34 msm: mdss: Add traffic shaper for rotator path
Rotator is a non real time client. Traffic shaper helps
spread out rotator bandwidth request so that this non
real-time client won't compete with other real time
read clients.

Change-Id: I07dbc0a6287e31d33084e27a8e1f3e9ea365d3ab
Signed-off-by: Jayant Shekhar <jshekhar@codeaurora.org>
2016-03-23 20:30:39 -07:00