Commit graph

567389 commits

Author SHA1 Message Date
Adrian Salido-Moreno
649c91d1cd msm: mdss: add support dynamic resolution switch
Provide support for panel drivers to expose multiple panel timings
supported and expose this through existing fb sysfs mode nodes.
When switching between resolutions allow seamless transition between the
modes.

CRs-fixed: 873962
Change-Id: Iad660a47ea0a63ca0d2332339727b8fcd005dac6
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
Signed-off-by: Chandan Uddaraju <chandanu@codeaurora.org>
[veeras@codeaurora.org: Resolve merge conflicts in few files]
Signed-off-by: Veera Sundaram Sankaran <veeras@codeaurora.org>
2016-03-23 20:45:05 -07:00
Adrian Salido-Moreno
3344a14fd2 msm: mdss: restructure tearcheck config
Since we have a separate function for tear check enable.
Tearcheck config with enable flag is not required, and
redundant. Remove enable flag and improper usage of
the function.

CRs-fixed: 873962
Change-Id: I0835f858cc63a41e01a669069677322da408f245
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
2016-03-23 20:45:04 -07:00
Siddhartha Agrawal
5705a14f1d msm: mdss: Power collapse mdss vbif before going to suspend
Correctly collapse the mdss vbif ports before going to suspend mode.
The vbif will be active only after the mdss gdsc is turned on.

Change-Id: Ic8c8898f603dc14400fe7aacd3c155523104b144
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
2016-03-23 20:45:03 -07:00
Dhaval Patel
f73a4100e4 msm: mdss: dump vbif debug bus information in ram
New test points in vbif debug bus floods the log buffer
with print messages. This overwrites the necessary logs from
ring  buffer. This change dumps vbif debug bus information only
in ram by default. User can update the setting from debugfs
if print messages are intended.

Change-Id: I745c8e9c67a946f73a012095cf080d1161e453e7
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
2016-03-23 20:45:02 -07:00
Dhaval Patel
4da05c3ace msm: mdss: update xin client test points for rt/nrt vbif
Update xin client test points on debug bus for rt and
nrt vbif based on updated programming recommendation.

Change-Id: I152b485d45bd610fe281c1c81a1efe73949abe5d
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
2016-03-23 20:45:01 -07:00
Ray Zhang
0fab446349 msm: mdss: remove duplicated aquiring of cmd_mutex
It is incorrect to acquire the same mutex twice in case of
ESD read check because this mutex will be acquired in nested
function, so remove it in order to avoid dead lock.

Change-Id: I48c18195e0ac30b271bfc041a99547049ee6b04a
Signed-off-by: Ray Zhang <rayz@codeaurora.org>
2016-03-23 20:45:00 -07:00
Clarence Ip
66fe527ab2 mdss: mdp: add debugfs node for danger/safe on mdss
Add debugfs node to get the danger/safe status of mdp
and source pipes on MDSS.

Change-Id: I0c93d42b144cda932d80ba18221ae814bed3d3d4
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:44:59 -07:00
Jeevan Shriram
9f9928018f msm: mdss: clear the pipe's dirty flag after sspp configuration
In the current implementation, pipe's dirty flag is not cleared when
there is pipe reuse. This change clears the pipe's dirty flag if the
pipe is being reused with no configuration changes but only buffer
handle.

CRs-Fixed: 884773
Change-Id: I8d62e944110cd887f341dd8b33a642a679473ff7
Signed-off-by: Jeevan Shriram <jshriram@codeaurora.org>
2016-03-23 20:44:59 -07:00
Ping Li
ed00b9f284 msm: mdss: Change PP loggings from warning to debug
Some of the post-processing features might not be available for
external displays. PP driver was printing them as pr_warn which
floods the kernel logs. This change updates these logs from
warning to debug to remove unnecessary logging.

Change-Id: Ic1dde42ccc84e13f06db33ddbf679a211726ff80
Signed-off-by: Ping Li <pingli@codeaurora.org>
2016-03-23 20:44:58 -07:00
Anusha Koduru
97746a102c msm: mdss: specify HFlip and VFlip per pipe BW limit
Apply per pipe BW limit check based on HFlip/VFlip. Some
targets have different limits for BW based on usecase.

Change-Id: Ie23dba396b47ffb3fb910e746e4a992fe6d78ab9
Signed-off-by: Anusha Koduru <kanusha@codeaurora.org>
2016-03-23 20:44:57 -07:00
Dhaval Patel
0bbece9015 msm: mdss: capture vbif dump with mdss dump when panic happen
Capture real time vbif and non-real time vbif dump with mdss
dump when mdp related fatal error occur.

Change-Id: Ia44402a0272938862569d1ed43871e6ecca17965
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
2016-03-23 20:44:56 -07:00
Jeevan Shriram
2a6a83e5be msm: mdss: fix the input layer and layer list array index
In the current implementation, wrong memory is being referenced while
copying to user. Correct the input layer and layer list array index
to avoid invalid memory access.

CRs-Fixed: 882379
Change-Id: I47790d1c5419c099ce32727c28e5e6e7e742f18f
Signed-off-by: Jeevan Shriram <jshriram@codeaurora.org>
2016-03-23 20:44:55 -07:00
Clarence Ip
07c71c6ce4 msm: mdss: use usleep_range instead of msleep in mdss util
msleep API runs in atomic context and can add extra delay
after sleep timeout. This can add extra delays for panel
regulator turn on/off sequence which affects device
suspend/resume timing. Moving to usleep_range enables the
delay backed by hrtimers.

Change-Id: Id9e50ab02c0166de41316eeb948e93cdce432e15
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
[cip@codeaurora.org: Resolved merge conflicts]
Signed-off-by: Clarence Ip <cip@codeaurora.org>
2016-03-23 20:44:54 -07:00
Jie Cheng
5214f4a020 msm: mdss: Add check for enabled regulators to avoid delays
If the regulator is already enabled, driver doesn't need to
wait till post on delay is complete. This change fixes to avoid
delays during regulator enable.

Change-Id: If7c7d1f2895abaa12b94e9f5c78ba61f28b87758
Signed-off-by: Jie Cheng <rockiec@codeaurora.org>
Signed-off-by: Jeevan Shriram <jshriram@codeaurora.org>
2016-03-23 20:44:53 -07:00
Murali Nalajala
8529082f3e qcom: msm: event-timer: Add eventimer migration framework
Currently, all the event timers are associated to CPU0. These event
timers are not bind to any of the IRQs and always handled(hrtimer)
by CPU0. This event timers framework make sure event timers are
bound to clients IRQs and when the IRQ affinity has changed event
timer framework will make sure to move associated event timer to
a new CPU based on IRQ affinity.

CRs-fixed: 719258
Change-Id: Idbce3d5195655f558f74c208216f75515d235b8e
Signed-off-by: Murali Nalajala <mnalajal@codeaurora.org>
[cip@codeaurora.org: Remove drivers/soc/qcom/event_timer.c changes]
Signed-off-by: Clarence Ip <cip@codeaurora.org>
2016-03-23 20:44:53 -07:00
Terence Hampson
9d031f920e msm: mdss: rotator: make work queue high priority
Janks in display are occurring due to delayed scheduling of rotator
work. Making it high priority would prevent such occurrences.

Change-Id: I85a7e4ca46596cfad56b29256ede30f1a13f0123
Signed-off-by: Terence Hampson <thampson@codeaurora.org>
Signed-off-by: Ujwal Patel <ujwalp@codeaurora.org>
2016-03-23 20:44:52 -07:00
Dhaval Patel
d255172b31 msm: mdss: add vbif debug bus support in xlog
VBIF debug bus test points provides the ARB/XIN
client status. These test points information is
required when MDSS core has requested some transaction
but they are not returning back. This change adds
the support for common code dump/log the test points
and adds the offset for msm8996 configuration.

Change-Id: I376a9e50aaaedb170bf4904551450206a85e4a1c
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
2016-03-23 20:44:51 -07:00
Adrian Salido-Moreno
f3e3ad8414 msm: mdss: fb: remove check for allocated during resolution switch
While switching resolution the fb memory requirement may increase and
the current memory may not be able to support the new resolution.
However since we can still go through overlay path, this requirement
shouldn't be mandatory. Allow it to go through, there are enough
checks during mmap to fail if trying to use this memory.

Change-Id: I76aafecd568763c456ea75234582b8a7aa9f83f4
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
2016-03-23 20:44:50 -07:00
Adrian Salido-Moreno
b6a3665201 msm: mdss: fix concurrency between add vsync handler and stop
If command mode interface is being stopped, adding vsync handler can
cause the clocks to go on and cause improper state after.
There are checks for panel off inside add_vsync_handler however, there
needs to be synchronization while the stop is in progress.

Change-Id: I99bfca53a18bc818eecc94007357abdf4a251e50
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
2016-03-23 20:44:49 -07:00
Benet Clark
f7b772197d msm: mdss: fix six zone saturation mask
The mask for setting the six zone LUT is incorrect. This
change fixes the mask to make sure all data is written to
the hardware.

Change-Id: Ic8cb82cbf9d34d857c71c03decc8b64f3a3e9699
Signed-off-by: Benet Clark <benetc@codeaurora.org>
2016-03-23 20:44:48 -07:00
Terence Hampson
f9a9be7536 msm: mdss: rotator: validate if output format is ubwc
Use the output format instead of the input format when validating X
and Y offset

Change-Id: I0a41c5f2d3f17b720da35cecb8d5c1def76b2d0c
Signed-off-by: Terence Hampson <thampson@codeaurora.org>
2016-03-23 20:44:47 -07:00
Benet Clark
ff7d7d67d9 msm: mdss: Prevent mixer GC programming if it is currently enabled
The layer mixer GC hardware is meant to be programmed and enabled only
once. In cases where we want to reprogram the values in the hardware,
there is the possibility of corruption. This change forces the mixer
setup to skip GC programming if it is currently enabled. The user
should disable the feature before enabling it with different values.

Change-Id: I3c049d87a230be6f65ffa354099a2f1f1096f78b
Signed-off-by: Benet Clark <benetc@codeaurora.org>
2016-03-23 20:44:47 -07:00
Ingrid Gallardo
e228b8d63c msm: mdss: dump mdp debug bus info
add support to dump debug bus information

Change-Id: I2a542592c1ee54f739f1ef383b005c8fc0beb762
Signed-off-by: Ingrid Gallardo <ingridg@codeaurora.org>
2016-03-23 20:44:46 -07:00
Shivaraj Shetty
0db2c5fa4f msm: mdss: protect iommu refcount with mutex for mdp3
On mdp3 targets iommu refcount is not properly protected
by mutex lock. This is causing iommu to be detached while
hardware is fetching the data from the iommu mapped
address leading to SNOC errors. Add mutex lock while
using the iommu refcounts to fix the issue.

Change-Id: Ife59791b08b123f6b60d3ffa6d8061839244934c
Signed-off-by: Shivaraj Shetty <shivaraj@codeaurora.org>
2016-03-23 20:44:45 -07:00
Jeevan Shriram
8c89959820 msm: mdss: add scaling error check on DMA and CURSOR pipes
Scaling is not supported on DMA and CURSOR pipes. This change fails layer
validation when there is a scaling on any of these pipes.

Change-Id: I54428a6bf5516fcb66b41825a1d156d8052c5d84
Signed-off-by: Jeevan Shriram <jshriram@codeaurora.org>
2016-03-23 20:44:44 -07:00
Ujwal Patel
e7e5bbf7cd msm: mdss: prevent slow path error during DSI underflow recovery
When DSI underflow is reported, ctl reset is preformed which requires
certain critical regions to be protected by mutex. However this reset
itself doesn't need to be protected by koff_lock spinlock and thus move
it out of spinlock to prevent mutex locking while holding spinlocks.

Change-Id: I9a5da66c3db5c3839fa45a25898a5d610134594e
Signed-off-by: Ujwal Patel <ujwalp@codeaurora.org>
2016-03-23 20:44:43 -07:00
Ingrid Gallardo
cc113de0a1 msm: mdss: fix crash when enabling autorefresh
Autorefresh feature does not need to issue a manual
flush in order to start processing the frames.
Remove the manual flush and make sure that we wait
for one vsync before suspend.

Change-Id: I557a1a67017d9f0171915c209479e22bd908db36
Signed-off-by: Ingrid Gallardo <ingridg@codeaurora.org>
2016-03-23 20:44:42 -07:00
Adrian Salido-Moreno
b10aa0dc5c msm: mdss: ad: detect changes in resolution within ad config
Whenever resolution switch happens, ad needs to be reconfigured with
new resolution. Detect these changes and program frame size
accordingly.

Change-Id: Iac4e36c19d55d56de99318e13fd7435bdfac3a84
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
2016-03-23 20:44:41 -07:00
Terence Hampson
a6710dea23 msm: mdss: rotator: configure pipe pixel extension
Prior to programming the pipe for rotation, rotator needs to
calculate valid pixel extension so that it is properly configured

Change-Id: Idd92905d46d79f8feddbaf2d03653668360b7c10
Signed-off-by: Terence Hampson <thampson@codeaurora.org>
2016-03-23 20:44:41 -07:00
Adrian Salido-Moreno
46a175fef2 msm: mdss: dsi: use right mask to confirm dma transfer done
When dma tx timeout happens, the internal check to verify state of
hardware is actually checking for DMA interrupt enabled bit instead of
the actual state of DMA done.

Change-Id: I2c03e3e405289c223358b82e37e49203d0d0978b
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
2016-03-23 20:44:40 -07:00
Dhaval Patel
0301384aa8 msm: mdss: fix solid fill programming on pipe
Format on pipe is changed to solid fill when it is
un-staged from mixer and put in cleanup list. This is
not required because HW is not going to pick up this pipe
when it is not present on any stage. This change removes
the unnecessary programming during cleanup and updates the
sw pixel extension configuration for solid fill pipe.

Change-Id: Idabd264dc9a3e93ef94e347e7f48fd6f88bd987b
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
[cip@codeaurora.org: Resolved merge conflicts]
Signed-off-by: Clarence Ip <cip@codeaurora.org>
2016-03-23 20:44:39 -07:00
Dhaval Patel
d4271cd15a mdss: mdp: fix pipe/mixer stage information during free
MDSS driver stages the pipe on certain mixer but does not
update the stage index to unused after un-stagging the pipe
from kickoff. It is better that pipe free api checks the
mixer stage before setting pipe mixer null. This helps
to catch the bugs where pipe is getting staged without
commit call.

This change tries to update the pipe free API with proper
error checks. It also avoids mixer free twice from ctl
destroy to avoid error messages at each suspend/resume.

Change-Id: I6facef86b0816378d79fd17737b0f335c59ebfa6
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
2016-03-23 20:44:38 -07:00
Terence Hampson
35d2cedadb msm: mdss: protect mdp registers from race condition
During the pipe configuration process it was possible for multiple
thread contexts to read and write common register data, resulting in
a race condition. In order to prevent a race condition, we are now
protecting access to common registers are with reg_lock mutex.

Change-Id: I724e7870e856b3303448edbdf00f334ad38483f6
Signed-off-by: Terence Hampson <thampson@codeaurora.org>
2016-03-23 20:44:37 -07:00
Kuogee Hsieh
dcf1c899c1 msm: mdss: serialize overlay_vsync_ctrl with ov_lock
There is a race condition between mdss_mdp_idle_pc_restore
and mdss_mdp_display_commit. Use ov_lock to serialize
execution of these two threads to fix race condition.

Change-Id: I6454e3d0edf2f3655e442d591fb3cac48f88a712
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
2016-03-23 20:44:36 -07:00
Padmanabhan Komanduru
c15bb828de msm: mdss: add support to override dual DSI properties in kernel
In the current implementation, the DSI h/w configuration and DSI
PLL source are configured based on the MDSS DSI DT properties.
These can be changed dynamically based on the panel that is being
configured in LK. Add support to override these properties based on
the display command line string that is passed from LK to kernel.

Change-Id: I7ba5a2d16b3527537c91c79e7977a55d8b2e23c3
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
2016-03-23 20:44:35 -07:00
Ingrid Gallardo
52d6080e7d msm: mdss: fix extra refcount in the mdp clock during clock gate
There is a race condition between kickoff and early
wakeup events; add mutex to protect the state of the
resources and prevent race condition.

Change-Id: Ibf3284f1d1fce26b88ea0a1f56f42a4682b16c77
Signed-off-by: Ingrid Gallardo <ingridg@codeaurora.org>
2016-03-23 20:44:34 -07:00
Benet Clark
6656edcc6c msm: mdss: Notify backlight events for AD and regular BL together
Postprocessing userspace is a client of backlight notifications from
driver. There are two notifications exposed, one for AD BL attenuation
and one for regular backlight updates. Previously, the notification
would be for one type or the other. This change makes the notifications
occur together if both notifications are needed.

Change-Id: Ia5bc520a183106e1f9a876583cb3a17435be08ed
Signed-off-by: Benet Clark <benetc@codeaurora.org>
2016-03-23 20:44:34 -07:00
Dhaval Patel
106c2d5246 msm: mdss: dsi: fix post clk off callback in clk manager
DSI clock manager is registering the post clk on twice
but does not register the post clk off. CORE/CTRL/PHY
power modules were never turned off because post clk
off callback is not registered.

Change-Id: I324e416241d9ec72e0aef8c4742849c14cffc37e
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
[cip@codeaurora.org: Resolved merge conflicts]
Signed-off-by: Clarence Ip <cip@codeaurora.org>
2016-03-23 20:44:33 -07:00
Dhaval Patel
0b4b3ff342 msm: mdss: add valid data checks in ctl restore
Idle power collapse API calls ctl restore for
each control which is powered on. This check will
pass for rotator ctls also. They have valid mixer
but mfd/panel_data null. Only mixer check is invalid
to call pp_resume for such ctls. It should check
the mfd/panel_data before restoring post processing
and compression block.

Change-Id: I09d599aae392e30d9ffae3cfd0e92bbda9aaa5e5
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
2016-03-23 20:44:32 -07:00
Terence Hampson
65272f009e msm: mdss: rotator: switch context between active-only and active+sleep
Modify the rotator bw vote to go to Active-Only in early stages when bw
is not needed, update the vote to Active+Sleep when bw must be
guaranteed.

Change-Id: I6a808831718426d93700fdf0c61b1eec1c0b2c1f
Signed-off-by: Terence Hampson <thampson@codeaurora.org>
2016-03-23 20:44:31 -07:00
Shivaraj Shetty
db74d3e4ab msm: mdss: fix backlight issue on blank-unblank
In charging mode if charging code is not updating
the backlight then backlight will be turned off in
blank call and will not be turned on again on unblank.
Same is seen during ESD recovery. Set the unset
backlight level to the current backlight level during
blank so that after unblank, on first commit the
backlight value is restored. Also initialize the
brightness level to half of the max brightness.

Change-Id: Iee29b00a5e0fbbd4fee9d2c0dae1a40222b43939
Signed-off-by: Shivaraj Shetty <shivaraj@codeaurora.org>
2016-03-23 20:44:30 -07:00
Siddhartha Agrawal
ac685c4538 msm: mdss: Tune the mdss event timer wakeup time
Adjust the mdss event timer to wakeup before the readpointer
to help with latency issues.

Crs-Fixed: 840497
Change-Id: I384d7e13af1e4893aa200240c6a057ebc2bf92c6
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
2016-03-23 20:44:29 -07:00
Terence Hampson
1e08f68d56 msm: mdss: rotator: Add debug logs to failed rotator request
When rotator fails on a request it would be helpful if information
about the request item was logged.

Change-Id: Ida8b3c9cd312a5142586323b1f9af613a44e40f3
Signed-off-by: Terence Hampson <thampson@codeaurora.org>
2016-03-23 20:44:28 -07:00
Vinu Deokaran
20eafef76e msm: mdss: mdp: adapt frame idle timeout to input events
Add input event handler logic for video mode panels. In case of an
event, the idle notification should be prevented in anticipation of a
frame update.

Change-Id: I28c7b142b3b14375937d45f00fb552679db8f109
Signed-off-by: Vinu Deokaran <vinud@codeaurora.org>
2016-03-23 20:44:28 -07:00
Kuogee Hsieh
564e8dcbff msm: mdss: ESD status check default to ESD_NONE
Currently, ESD status check is default to ESD_MAX which
utilizes DSI BTA to perform ESD check as long as ESD check
enabled. Add ESD_NONE as default.

Change-Id: I85713f98a994f71a0e6b7bebe672f1147bd9ac52
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
2016-03-23 20:44:27 -07:00
Ujwal Patel
50fff2d6ff msm: mdss: debug: fix typo in error checking
Fix a typo in error checking while creating bordercolor debugfs
directory.

Change-Id: I7477f41bdf31dfbd4f9763c3612ccc3f61c5657c
Signed-off-by: Ujwal Patel <ujwalp@codeaurora.org>
2016-03-23 20:44:26 -07:00
Ujwal Patel
351537d51f msm: mdss: enable different panel configuration modes
Add support to setup the layer mixer configuration
and select the number of DSC encoders in order to
support different panel configuration modes.

Change-Id: I36dbf8d9e325675bb3affa1794b2fc93ee6151b4
Signed-off-by: Ujwal Patel <ujwalp@codeaurora.org>
Signed-off-by: Ingrid Gallardo <ingridg@codeaurora.org>
[cip@codeaurora.org: Removed dsi .dtsi changes]
Signed-off-by: Clarence Ip <cip@codeaurora.org>
2016-03-23 20:44:25 -07:00
Gopikrishnaiah Anandan
75086d13ab mdss: mdp: ad calc worker cleanup
Assertive display block can be configured in auto trigger mode,
which removes the requirement of issuing a start calculation
command. Change updates the ad calc worker to remove the kick off
of AD for each vsync and auto trigger mode is made the default mode.

Change-Id: Ie898a595cc9d3c8e521fffc8b3cde240dcbdce0e
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
2016-03-23 20:44:24 -07:00
Sandeep Panda
c7f50b18a3 msm: mdss: do not fail probe if backlight control not defined
Panels like AMOLED and dsi2hdmi bridge chip does not need
backlight control specified by DSI host. So no need to
fail dsi probe if backlight control is not defined.

Change-Id: I6e192b2e354d6e9146fb0890d2918feab9c7a2ed
Signed-off-by: Sandeep Panda <spanda@codeaurora.org>
2016-03-23 20:44:23 -07:00
Vinu Deokaran
a0afc41b07 msm: mdss: dsi: vote for reg bus bw from clock manager
Votes for register bus bandwidth are made from dsi clock manager. Create
separate handles for each dsi controller for bandwidth votes. MDP driver
does not maintain reference counting for register bus bandwidth votes
from each client. Voting from dsi clock manager removes the dependency
on reference counting.

Change-Id: I370053b143b6bc27358844a3958041da59281e92
Signed-off-by: Vinu Deokaran <vinud@codeaurora.org>
2016-03-23 20:44:22 -07:00