Commit Graph

958 Commits

Author SHA1 Message Date
Linux Build Service Account
07ea738c41 Merge "msm: mdss: dsi: fix slab-out-of-bounds issue" 2018-11-25 23:07:21 -08:00
Narender Ankam
12569bbbe6 msm: mdss: dsi: fix slab-out-of-bounds issue
While handling dsi_gen_read_status, status buffer
was xlogging without checking for its max size.
Add proper conditional check to xlog status buffer.

Change-Id: Ia5a1fe18de123d2911c31ae79492b96f67e1273d
Signed-off-by: Narender Ankam <nankam@codeaurora.org>
2018-11-25 17:48:20 -08:00
Ch Ganesh Kumar
3b1e904fd4 msm: mdss: Fix Gamma LUT bounds condition
Validate the Gamma correction feature with all bound condition.
This change corrects the Gamma LUT block bound condition.

Change-Id: I3fc460b6a6e2e76f7c07b649e1db1e01ce208476
Signed-off-by: Ch Ganesh Kumar <chganesh@codeaurora.org>
2018-09-30 23:26:02 -07:00
Nirmal Abraham
4985459559 msm: mdss: use uaccess routines to access user space buffers
Use routines defined in uaccess.h (like put_user, get_user)
while accessing user space buffers. Otherwise this leads to
userspace access violation when PAN is enabled.

Change-Id: Iea16e347ee71f0845711a21b6b9b01e16a6ab619
Signed-off-by: Nirmal Abraham <nabrah@codeaurora.org>
2018-08-08 20:13:33 -07:00
Linux Build Service Account
a63934ee76 Merge "msm: mdss: Fix out of bound access of array indexes" 2018-06-23 16:40:23 -07:00
Linux Build Service Account
39ae4ef980 Merge "msm: mdss: Fix race condition during mdp dump" 2018-06-23 16:40:13 -07:00
Linux Build Service Account
1c18b3a741 Merge "fbdev: msm: Increment commit count in case of ESD recovery" 2018-06-23 16:40:09 -07:00
Arun kumar
805afd04dd msm: mdss: Add check for SPI client
Add check for spi client while using
ion_import_dma_fd during mdp3_get_img.

Change-Id: Ibd882725eb191454612397c2f2d6e5b28a712043
Signed-off-by: Arun kumar <akanak@codeaurora.org>
2018-06-21 21:54:03 -07:00
Jayant Shekhar
3c10bd20eb msm: mdss: Fix race condition during mdp dump
In mdp debugfs, pipe, mixer, buffers and ctl information
is dumped. While dumping pipe buffer information using
pipe's buffer list, acquire list lock mutex.

Change-Id: Ibd26cc1484fb08ae7d0852f405100f6bbfa707de
Signed-off-by: Jayant Shekhar <jshekhar@codeaurora.org>
2018-06-21 17:41:16 +05:30
Krishna Chaitanya Devarakonda
b8f7c8a2f1 msm: mdss: apply bus throughput factor for high downscale cases
For downscaling a 32 BPP surface with scale ratio greater than
or equal to 3.5, it is recommended to increase the mdp core clock
by 10%. This is to avoid any stalls on the bus during high concurreny
scenarios.

Change-Id: I77c8c25c73e4232271a93397e52798a6d5d74cf3
Signed-off-by: Krishna Chaitanya Devarakonda <kdevarak@codeaurora.org>
2018-06-21 17:40:16 +05:30
Animesh Kishore
40b48d0546 msm: mdss: Add cursor validation for hflip
Hflip is not supported on cursor pipes as there
is no flip buffer in the hardware. Invalidate
any commit request for cursor hflip.

Change-Id: I4b0ad28caffb75a4bd5a928a90daa6aa59f51848
Signed-off-by: Animesh Kishore <animeshk@codeaurora.org>
2018-06-21 17:39:17 +05:30
Krishna Manikandan
96624d42f7 fbdev: msm: Reserve mixers with dspp for primary display
Avoid allocating mixers LM0 and LM1 to external display and
writeback as they are allocated to primary display first.

Change-Id: I343a70dca2e664e5c9765fa2f0b933714b747b4a
Signed-off-by: Krishna Manikandan <mkrishn@codeaurora.org>
2018-06-21 17:38:08 +05:30
Harsh Sahu
ba6859756e msm: mdss: handle vsync properly during dynamic resolution switch
During resolution switch, the vsync is disabled just before the switch
as part of ctrl stop, but it is not enabled back after the switch. This
change keeps track of vsync before the switch and handles it
appropriately after the switch.

Change-Id: I3eed93d7f7635217bac3c19c61f68154cacef56e
Signed-off-by: Harsh Sahu <hsahu@codeaurora.org>
2018-06-21 17:37:07 +05:30
Xu Yang
6ffafbf3a0 msm: mdss: Avoid vysnc wait when PCC and DDIC update backlight
Remove wait for vsync in display commit if both PCC and DDIC
need to update for external backlight feature.

Change-Id: I57aeb48acba24e0ca3fff21b1117e48fe452028b
Signed-off-by: Xu Yang <yangxu@codeaurora.org>
Signed-off-by: Abhijith Desai <desaia@codeaurora.org>
2018-06-21 17:35:36 +05:30
Benjamin Chan
56c1b25493 msm: mdss: Correct MDSS display wakeup time calculation
With DSC enabled in the panel interface, the horizontal resolution is
smaller than the panel width due to the compression. Correcting the
time_of_line and total_line calculation by calling the proper macro.

CRs-Fixed: 2048339
Change-Id: I36c1b9d30d5a440dfef4b4638f4f3ebf807782c8
Signed-off-by: Benjamin Chan <bkchan@codeaurora.org>
2018-06-21 17:34:01 +05:30
Benjamin Chan
ff12bfec27 msm: mdss: Use 64-bit math for bandwidth calculation
For larger panel with longer vertical resolution, it is possible that
bandwidth requirement is much higher during downscaling usecase. Current
bandwidth calculation for compression ratio adjustment only use 32-bit
and it is shown that overflow can happen, and is required to change to
use 64-bit variable as input and output.

CRs-Fixed: 2045602
Change-Id: I817e9d55fb6e24e686513327d00f7efd08ac717f
Signed-off-by: Benjamin Chan <bkchan@codeaurora.org>
2018-06-21 17:32:29 +05:30
Jayant Shekhar
47384ca673 msm: mdss: Avoid dfps update till unblank is complete
There can be cases where MDP is resuming at default fps
and in between dfps update comes before unblank is completed.
This might result in mismatch in fps and blanking
settings in MDP and DSI. Hence avoid any fps update until
unblank is finished.

Change-Id: If4fed28b1d706f38c39fba06fa786eac6d9ed8c8
Signed-off-by: Jayant Shekhar <jshekhar@codeaurora.org>
2018-06-21 17:31:26 +05:30
Raviteja Tamatam
893b5d2ad8 msm: mdss: add additional debug code for timeout issues
Added debug code to analyze vbif and display data path
for debugging pingpong timeout issues.

Change-Id: Ice4b9dbeab96edeb90f665747479243dad55351a
Signed-off-by: Raviteja Tamatam <travitej@codeaurora.org>
Signed-off-by: Abhijith Desai <desaia@codeaurora.org>
2018-06-21 17:30:18 +05:30
Jayant Shekhar
97e3b829e1 msm: mdss: Initialize buf array elements
In bandwidth limit read function, 'buf' array
elements might be used uninitialized. Ensure
the array elements are initialized.

Change-Id: I210c73b14327436296a844fc5ebd47ccc02bf5fb
Signed-off-by: Jayant Shekhar <jshekhar@codeaurora.org>
2018-06-21 17:29:15 +05:30
zhaoyuan
4ec6a58c0d msm: mdss: reset cdm block after used
After cdm has been used, need to reset cdm block,
or the next HDMI device will be affected by the
cdm config.

Change-Id: I4eb879202cc3547d9149b3352377c3395ebfe6b3
Signed-off-by: zhaoyuan <yzhao@codeaurora.org>
2018-06-21 17:28:18 +05:30
Raviteja Tamatam
5baed0b2e0 msm: mdss: add mdss smmu fault handler for sdm660
Add support to register smmu fault handler for MDSS
context banks to dump necessary debug information.

Change-Id: I955b4a33dbce0e66adee199e0a1272b25aa4392d
Signed-off-by: Raviteja Tamatam <travitej@codeaurora.org>
2018-06-21 17:27:12 +05:30
Krishna Manikandan
f5bf72b073 msm: mdss: Fix out of bound access of array indexes
Add checks before accessing the array to fix potential
issues such as array index out of bounds error.

Change-Id: I42d0f8e72f8848de6ca2f143f115f39256144ec0
Signed-off-by: Krishna Manikandan <mkrishn@codeaurora.org>
2018-06-20 22:29:24 -07:00
Rajkumar Subbiah
93a2064229 msm: mdss: wait for pp done when switching from ON to LP1
If a low power mode switch is initiated while a kickoff is
in progress, the panel could be turned off before the
current frame transfer is completed causing a display hang.
This change recognizes this case and waits for the current
frame to finish before initiating the power state switch.

Change-Id: Ieea32acd67c56a7ed8a83ff92c3b49ad76d70086
Signed-off-by: Rajkumar Subbiah <rsubbia@codeaurora.org>
2018-06-20 18:12:52 +05:30
Xu Yang
49104578b9 msm: mdss: initialize external BL level when fb probe
Initialize external backlight level to -1 when fb probe.
This is to make sure the external backlight level is
invalid the first time overlay kickoff.

CRs-Fixed: 2021142

Change-Id: I973b184903cdb5b378326b23ca5c958e4b868c76
Signed-off-by: Xu Yang <yangxu@codeaurora.org>
2018-06-20 18:11:51 +05:30
Rajkumar Subbiah
0c6d51c5ea msm: mdss: Perform splash cleanup on slave control
During continuous splash handoff on video mode panels, the
cleanup is currently performed only on the master control. This
causes occasional memory fault in dual control configurations.
This change calls cleanup on both master and slave controls
if applicable.

Change-Id: If0bcad0686efd5f2aba0efa6992e1d348aca213f
Signed-off-by: Rajkumar Subbiah <rsubbia@codeaurora.org>
2018-06-20 18:10:49 +05:30
Veera Sundaram Sankaran
1cd1eea7b5 msm: mdss: add checks to fail solid fill with scaling
Scaling is not allowed for layers with solid-fill.
Add checks in validate call to fail such cases.

Change-Id: I02cb2d129d27c6173429fd02b5ff84702936d98e
Signed-off-by: Veera Sundaram Sankaran <veeras@codeaurora.org>
2018-06-20 18:09:44 +05:30
Raviteja Tamatam
246787affc msm: mdss: disable programmable fetch when not in use
During the resolution switch use case where the active resolution
needs prefetch but the new resolution doesnot require it, currently
programmable fetch blocks are not disabled if not in use.

Change-Id: Ib5ea8ef75308132f5530aaf35aaea53858ea94a2
Signed-off-by: Raviteja Tamatam <travitej@codeaurora.org>
2018-06-20 18:08:19 +05:30
Abhijit Kulkarni
4592f1d8fb msm: mdss: fix secure buffer ref counting
Fix ref counting of the secure buffers. This change releases
the ref count on the secure buffers during the free operation.
This allows the buffers to be ref counted until hw has done
fetching from the buffers.

CRs-Fixed: 2012323
Change-Id: Ic24c39e75d502ed73453d0c6d78fd76448737697
Signed-off-by: Abhijit Kulkarni <kabhijit@codeaurora.org>
2018-06-20 18:07:17 +05:30
Xu Yang
2057d11622 msm: mdss: Add support to update backlight when display commit
1. Add support to update backlight when display commit. Backlight
level is sent from userspace. And sync to set PP config, kickoff,
and set backlight in the same vsync period.

2. Add support to get current backlight level through sysfs node.

Change-Id: Icf264299ecf8edd3831938745a471c2655c23542
Signed-off-by: Xu Yang <yangxu@codeaurora.org>
Signed-off-by: Abhijith Desai <desaia@codeaurora.org>
2018-06-20 17:51:10 +05:30
Rajkumar Subbiah
b1af79581f msm: mdss: flush timing after splash done for video panel
During continuous splash handoff the pipes are unstaged and the
timing engine is being turned off. But this change is not
being flushed. Right after that we release the splash memory
and this sometimes causes a memory fault. This change adds
the necessary flush.

Change-Id: Ia78359fd8159a7217ffc4f0192788f295ac3504c
Signed-off-by: Rajkumar Subbiah <rsubbia@codeaurora.org>
2018-06-20 15:42:11 +05:30
Jayant Shekhar
b533147dd1 msm: mdss: Correct prefill bandwidth calculations
vbp_min is calculated as 0 because variable is incorrectly
compared. Fix this to correct prefill bw calculation.

Change-Id: I80c3db2898111b5e8acdccc35af745dde30c0509
Signed-off-by: Jayant Shekhar <jshekhar@codeaurora.org>
2018-06-20 15:39:18 +05:30
Benjamin Chan
a6c064d60d msm: mdss: Fix clocks disable sequence
When disabling the clocks that MDP depends on during an ON to OFF
transition, it is necessary to reverse the clock enabling sequence.
Otherwise, the MDSS AHB clock will stuck in a halt state and cannot
be turned off.

CRs-Fixed: 2004996
Change-Id: I0da7df14e2084701c95fd08585b9a41e0a8cb653
Signed-off-by: Benjamin Chan <bkchan@codeaurora.org>
2018-06-20 15:38:00 +05:30
Abhijit Kulkarni
c8c7eec2ed msm: mdss: idle power collapse notify
This fix adds notification of idle power collapse to user space
for cmd mode panels. Without this fix user space has no
knowledge of reprogramming the QSEED3 LUTs after idle power
collapse, this needs to be done with the user space knowledge
to keep it's LUT bank offset in sync with the HW used LUT bank
offset.

Change-Id: Ia1fbd07da8c8c854a74cf5dad62f5ec2d1fc962e
Signed-off-by: Abhijit Kulkarni <kabhijit@codeaurora.org>
2018-06-20 15:36:24 +05:30
Ingrid Gallardo
cc99b7838f msm: mdss: fix autorefresh during kickoff
When autorefresh is enabled, any kickoff that
gets processed needs to wait to make sure the
transfer is on-going before continuing
the commit; current driver only waits for
autorefresh interrupt but this doesn't
guarantee that transfer is already on-going.
This change waits for the write pointer,
to make sure a transfer is on-going.

Change-Id: I247b3aad8f2f6ea8954d54f34492e293f80f99d4
Signed-off-by: Ingrid Gallardo <ingridg@codeaurora.org>
2018-06-20 15:33:44 +05:30
Ingrid Gallardo
0670ca4327 msm: mdss: fix mdp vbif qos priorities
Current driver read if any nrt vbif is present
and if it is not, the number of qos priority
levels gets wiped out, causing the driver
not to program the vbif qos priority levels for
the rt client. Fix this problem by making sure
that if a vbif nrt does not exist in the platform,
driver only ignore the nrt settings, but keeps
programming the vbif rt.

Change-Id: I2fe5eea5a2ff852b22a59cdb0139b17f3dd7c494
Signed-off-by: Ingrid Gallardo <ingridg@codeaurora.org>
2018-06-20 15:32:21 +05:30
Naseer Ahmed
da5b9d06df msm: mdss: Handle ping pong split configuration in splash done
After continuous splash reconfiguration, when turning off the
clocks ping pong split configuration is not handled properly.
Pingpong split uses single controller and dual context, so
the second context of the same controller should be used
instead of the slave controller.

Change-Id: Ibafdfd0aba4e0f02f141d60cb8866f353137a3ce
Signed-off-by: Naseer Ahmed <naseer@codeaurora.org>
Signed-off-by: Abhijith Desai <desaia@codeaurora.org>
2018-06-20 15:19:58 +05:30
Abhijit Kulkarni
7c0450d87a msm: mdss: fix use of uninitialized local variable
This change fixes unitilized local variable being used and
checks for the valid format in concurrent writeback case before
using the format parameters.

CRs-Fixed: 1110015
Change-Id: I61a3e20af1d0a4db7a7db454ae35b810639744ae
Signed-off-by: Abhijit Kulkarni <kabhijit@codeaurora.org>
2018-06-20 15:06:20 +05:30
Ingrid Gallardo
b2b3802886 msm: mdss: fix tearcheck when enter low power mode
During transition from ultra low power mode to
low power mode, tear check is not reconfigured,
which can cause problems during the doze mode
use case. Fix this problem by making sure
that tearcheck gets reconfigured.

Change-Id: I5dc0dd78d98c768ef70c795ac974bb4574c55a0f
Signed-off-by: Ingrid Gallardo <ingridg@codeaurora.org>
2018-06-20 15:05:14 +05:30
Naseer Ahmed
ba00d5b598 msm: mdss: Choose the correct PPB for right only update in non-DSC mode
When performing right-only update on a dual LM single display mode with
3D Mux enabled, the right mixer's ping pong buffer should be used.

Change-Id: Ib530d7503ca46a01198cc88de5312635bd84a6fb
Signed-off-by: Naseer Ahmed <naseer@codeaurora.org>
2018-06-20 15:04:01 +05:30
Abhijit Kulkarni
c6a19e219c msm: mdss: fix secure session validation
During secure to non secure transition the commit contains
only non-secure layers and there is no null commit in between.
This change correctly validates such commit and allows non secure layers
only and the driver then performs the functionality to transition to
non-secure state.

CRs-Fixed: 1110585
Change-Id: Ic1d32f0d04d8ee860844f59fd99707dbdb78838f
Signed-off-by: Abhijit Kulkarni <kabhijit@codeaurora.org>
2018-06-20 15:02:42 +05:30
Ingrid Gallardo
12254a733b msm: mdss: fix autorefresh disable sequence
Sequence to disable autorefresh when handoff is
done to the kernel is missing to wait for the
previous transaction to finish. This change
makes sure any previous on-going transaction
finishes before disabling autorefresh.

Change-Id: I547aea5cc82989d03963b2153e2561092fd7b36c
Signed-off-by: Ingrid Gallardo <ingridg@codeaurora.org>
2018-06-20 14:52:10 +05:30
Krishna Chaitanya Devarakonda
6f6f50a282 msm: mdss: Fix panel orientation handling for split displays
For split display panels, when panel has 180 flip or HFLIP,
the source layers needs to be swapped instead of the mixers.
SDM will take care of the source swap and rectangle
recalculations.
This change is to remove the mixer swap, and to expose the panel
flip property through sysfs, so that SDM can flip the source
layers to maintain pipe priority.

Change-Id: I47a7dd38dc1e45dd3f7edbd189c9403900b74eea
Signed-off-by: Krishna Chaitanya Devarakonda <kdevarak@codeaurora.org>
2018-06-20 14:51:05 +05:30
Harsh Sahu
c061ae43f8 msm: mdss: Fix ctl flush bits reset by dspp programming
If MDP fence timeout happens, then to handle it gracefully
we stage border fill. In this regard as the mixer config has
now changed, then ctl flush has to be set.

Starting for Ia510fc6377c5b328cb4225a4725275d86b72dbff, ctl
flush bits were getting reset. Fix this in case mixer is
setup again with borderfill.

Change-Id: I12f60472e8f0f5630e239fb4b4026fda0d2f7cba
Signed-off-by: Jayant Shekhar <jshekhar@codeaurora.org>
Signed-off-by: Harsh Sahu <hsahu@codeaurora.org>
2018-06-20 14:50:28 +05:30
Krishna Manikandan
6156e7d8ff msm: mdss: check for split display enable in multiple displays
Considers DSI0 and DSI1 as separate displays even if
split display is enabled. So the number of displays
are calculated as 2 whereas the driver considers this
as a single display. This causes MDP clocks to remain
ON. This change corrects number of displays calculated
by checking for split display.

Change-Id: Ie0d3dbbcb93cc86b88a8b903fd1f7ccd89a8a871
Signed-off-by: Krishna Srinivas <krisrini@codeaurora.org>
Signed-off-by: Krishna Manikandan <mkrishn@codeaurora.org>
Signed-off-by: Abhijith Desai <desaia@codeaurora.org>
2018-06-20 14:45:53 +05:30
Naseer Ahmed
1f9bf6a1a7 msm: mdss: Avoid overwriting dsc reconfiguration flag
While switching between panel resolutions with DSC on/off
the variable that is used to flag the reconfiguration
can be overwritten if the roi_changed flag is not true.

Change-Id: I2e3041c848aafbc7a348fca7ce450a4fadd0e8d7
Signed-off-by: Naseer Ahmed <naseer@codeaurora.org>
2018-06-20 14:44:17 +05:30
Krishna Manikandan
8120dfcaca msm: mdss: Fix null pointer dereference and unintialisation of variables
Add NULL checks before accessing potential null pointers. Also, fix
uninitialised variables in MDP driver as they can be accessed with
incorrect values.

Change-Id: Id8a551fd3bc147c800ee1c98c2bc2b6f3bf6d380
Signed-off-by: Krishna Manikandan <mkrishn@codeaurora.org>
2018-06-20 14:42:04 +05:30
Ingrid Gallardo
ddb6d98f57 msm: mdss: add support to set mdp clock rate before enable
Current clock driver requires that before enabling
the core clock after power collapse, the set rate
must be called. Ensure this sequence by always calling
the set rate for the mdp core clock before enable.

Change-Id: I872f18235b0b1685dfdee3de99827d031077a012
Signed-off-by: Ingrid Gallardo <ingridg@codeaurora.org>
2018-06-20 14:08:54 +05:30
Naseer Ahmed
8f6e443569 msm: mdss: fix incorrect mutex unlocking during NOTIFY_UPDATE_STOP
When servicing NOTIFY_UPDATE_STOP command, if the notify object
was uninitialized then mutex lock is obtained on one object but
unlock is done on a different object. This change fixes it.

CRs-Fixed: 1088059
Change-Id: I66cbe48b7f4910228a6af57610a8427fea7fd1f2
Signed-off-by: Naseer Ahmed <naseer@codeaurora.org>
2018-06-20 14:07:28 +05:30
Ingrid Gallardo
b1c57ccedd msm: mdss: move warnings and errors out of mdss spinlock
Current display driver prints warnings and errors within
the mdss spinlock. This causes in random cases to hold the
spinlock for long time when multiple errors are printed;
Fix this by moving the print of warning and error messages
outside of the spinlock.

Change-Id: I09359b528b4742f72a76690930f3d0ed90bb2caa
Signed-off-by: Ingrid Gallardo <ingridg@codeaurora.org>
2018-06-20 14:06:24 +05:30
Rajesh Yadav
1cdaa130c8 msm: mdss: Add systrace for readptr_done
Add systrace for readptr_done interrupt
for cmd mode panel.

Change-Id: I3694952289c76394af8d40cd89fd2175f49ac127
Signed-off-by: Rajesh Yadav <ryadav@codeaurora.org>
2018-06-20 14:04:49 +05:30