Commit Graph

925 Commits

Author SHA1 Message Date
Steve Cohen
568d2b1529 disp: msm: fix data bus bandwidth vote units
Bandwidth vote values were being applied as Bytes-per-second but
the interconnect framework uses Kilobytes-per-second units. Fix
the error by using unit conversion macros provided by the
interconnect interface.

Change-Id: I8bdce2d35afb8d97f200ce40fc1defa8a3be1b75
Signed-off-by: Steve Cohen <cohens@codeaurora.org>
2020-04-05 21:34:07 -04:00
qctecmdr
3fd4d644db Merge "drm: msm: sde: reserve DSC in pairs for 4DSC topologies" 2020-04-03 19:23:57 -07:00
qctecmdr
74ad57500f Merge "disp: msm: sde: add pm_qos support for high frame rate display" 2020-04-03 15:40:45 -07:00
qctecmdr
121d6356e2 Merge "disp: msm: add split-vote support with interconnect" 2020-04-03 13:58:26 -07:00
Narendra Muppalla
690deaec8e disp: msm: sde: add pm_qos support for high frame rate display
Add/remove pm_qos request during sde encoder resource
controller enable/disable for high frame rate and command mode display.

Change-Id: I95fab92de8399d8b892751d654e7913166856cf3
Signed-off-by: Narendra Muppalla <NarendraM@codeaurora.org>
2020-04-03 09:52:02 -07:00
qctecmdr
a4d36867eb Merge "disp: msm: sde: ensure string buffer is properly terminated" 2020-04-03 05:36:11 -07:00
qctecmdr
7e1ca767cf Merge "disp: msm: remap dmabuf attach during secure transitions" 2020-04-03 03:59:17 -07:00
qctecmdr
1cb8cc4490 Merge "disp: msm: enable debugbus support for MDSS 7.x derivatives" 2020-04-03 02:41:54 -07:00
qctecmdr
4ac0b88638 Merge "disp: msm: sde: add encoder helper to get kms" 2020-04-02 00:11:24 -07:00
qctecmdr
2942529106 Merge "drm: msm: fix active pipe index" 2020-04-02 00:11:24 -07:00
Abhijit Kulkarni
b96cd591ed disp: msm: sde: add encoder helper to get kms
This change adds helper to retrieve the kms from
the drm_enc structure and provides additional error
checking which can be avoided in the callers.

Change-Id: Id8ba07a2d48a605dd4ce846e5d61f302e5861b4d
Signed-off-by: Abhijit Kulkarni <kabhijit@codeaurora.org>
2020-04-01 22:33:06 -07:00
Abhijit Kulkarni
70595d8eda disp: msm: sde: move dsc configuration into helper
This change moves the dsc configration programming into
a helper to improve the readability of the code and reduce
the cyclomatic complexity.

Change-Id: I6706e2036fa9208e6c930be97a875b89db689108
Signed-off-by: Abhijit Kulkarni <kabhijit@codeaurora.org>
2020-04-01 22:08:08 -07:00
Gopikrishnaiah Anandan
33404efc1c drm: msm: fix active pipe index
Active pipe index will be incremented when free entry is found with the
current implementation. All the indexes will not be used and there is need
to have special handling for last index with current implementation.
Change adds a break in the loop and simplifies the handling.

Change-Id: Ic74ad2aef791ba9c81acb19e85f44edf4d59e434
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
2020-04-01 18:18:31 -07:00
qctecmdr
76d89c1e24 Merge "disp: msm: add support for no blend planes" 2020-04-01 17:45:16 -07:00
Steve Cohen
85c0c75dd7 disp: msm: add split-vote support with interconnect
Add support for parsing ebi and llcc data busses for split vote
support as only the mnoc interconnect data bus was getting
parsed correctly.

Change-Id: I331bbcb0c61b341d935882f5560702f6317fc2a7
Signed-off-by: Steve Cohen <cohens@codeaurora.org>
2020-04-01 19:50:19 -04:00
qctecmdr
6b664b94bc Merge "Revert "disp: msm: sde: cache vbif QoS parameters"" 2020-04-01 13:29:29 -07:00
qctecmdr
e6bbb3c104 Merge "disp: msm: sde: enable pu checks only if main feature is set" 2020-04-01 13:29:29 -07:00
qctecmdr
3a94095a86 Merge "disp: msm: sde: update uidle wd timer load value" 2020-04-01 13:29:29 -07:00
qctecmdr
b44c7803a0 Merge "disp: msm: sde: avoid solver mode if autorefresh is enabled" 2020-04-01 04:44:47 -07:00
Gopikrishnaiah Anandan
078d42797b disp: msm: add support for no blend planes
Some of the features in the DPU hardware needs planes to be staged but
it should not be blended in the layer mixer. Change adds support for drm
driver client to set the blend type on the plane and updates driver code
to skip staging the plane.

Change-Id: I1e8c7f6ce5617820ea8b24419e0d4d27b481819b
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
2020-03-31 14:07:49 -07:00
Gopikrishnaiah Anandan
a337e44c28 msm: sde: demura support for register dma
Demura block of dpu will use the register dma path for programming.
Change updates the register dma frame-work to allow programming of the
demura block.

Change-Id: Ie5a64df1b2fffcb84d9554e5211249892ed2d96d
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
2020-03-31 14:05:24 -07:00
Steve Cohen
1b7e54c362 disp: msm: sde: ensure string buffer is properly terminated
Give snprintf the max size posssible to store in buffer or
copy_to_user instead of just truncating in order to ensure
the output string is properly terminated.

Change-Id: Id387e99cd035e39530b2c7de9484c0288efff605
Signed-off-by: Steve Cohen <cohens@codeaurora.org>
2020-03-31 10:36:51 -07:00
Thomas Dedinsky
80acdaa9f8 drm: msm: sde: reserve DSC in pairs for 4DSC topologies
Reserve DSC in the sequence of primary-peer and then
primary-peer again until all required DSC are reserved.

Searching sequence will not change for single/dual DSC
reservation. For single DSC reservation it will return
right after the first primary DSC is found. For dual DSC
reservation it will return after the first primary-peer
pair is found.

The logic can also work for triple/quad or any number
of DSC reservetion and make sure that all the reserved
DSCs are in pairs except the last one if total DSC number
is odd.

Change-Id: I5b90d54822ce16ef829e7c657c1b14e7a484c65a
Signed-off-by: Thomas Dedinsky <tdedinsk@codeaurora.org>
2020-03-31 11:32:46 -04:00
Steve Cohen
f26ab4d5c4 disp: msm: enable debugbus support for MDSS 7.x derivatives
Change the version checks to only consider the major revision
so debug bus support trickles down from premium tier targets.

Change-Id: I882957c043c9de7cebf595d719bfd35f2c18f447
Signed-off-by: Steve Cohen <cohens@codeaurora.org>
2020-03-30 23:27:42 -04:00
Gopikrishnaiah Anandan
a8371c6a52 disp: msm: Add support for demura properties
Based on the hardware catalog if dpu supports demura, driver will
install the drm properties specific to the feature. Change added support
for creating demura properties and exposing via drm frame-work.

Change-Id: I58f5b12ca660d826e6e0b7e1f212bdf3c5e41905
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
2020-03-30 17:43:28 -07:00
Gopikrishnaiah Anandan
df7e6040f8 drm: add uapi support for demura feature
DPU hardware supports demura feature, which needs to be controlled by
the user-space client.Change adds demura uapi structure for driver clients.

Change-Id: Ifa8c68b7f6a123af6451c110d53b3bc15240d45a
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
2020-03-30 17:42:45 -07:00
Gopikrishnaiah Anandan
718e224640 disp: msm: Install demura properties on connector
If DPU hardware supports demura feature, install the connector
properties related to demura feature.

Change-Id: Ieaddfc695e9f57e3c45e2bc0bd2c2e103f895ba8
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
2020-03-30 17:41:51 -07:00
Narendra Muppalla
d6141f8472 disp: msm: fix kw issues in sde driver
This change addresses out of range and null checks in
sde driver.

Change-Id: I905d795edf6715aa990dd7bbaf061734e95ddea6
Signed-off-by: Narendra Muppalla <NarendraM@codeaurora.org>
2020-03-30 15:22:34 -07:00
Prabhanjan Kandula
eed1c6df2c disp: msm: sde: enable pu checks only if main feature is set
This change fixes feature specific partial update checks in
atomic check by enabling partial update specific features only if
respective core feature is enabled.

Change-Id: If3678a52fa0f8d9e1d714a662601e5628e1637d2
Signed-off-by: Prabhanjan Kandula <pkandula@codeaurora.org>
2020-03-30 10:30:49 -07:00
Jayaprakash
e32095527a disp: msm: sde: avoid solver mode if autorefresh is enabled
In dual display with continuous splash, when autorefresh gets
disabled in primary on first commit, solver mode gets enabled
and mdp_clock is gated whenever primary enters idle. The
secondary data path will get gated during that time and not advance
anymore. Asynchronous gating of the mdp_clock during operation
can also hang the secondary path. This change avoids entering
the solver mode which fixes the timeout in the autorefresh
disable sequence in the secondary.

Change-Id: I7562ce2ad72d3bb8e8b6b8f356fab6def0caaf92
Signed-off-by: Jayaprakash <jmadiset@codeaurora.org>
2020-03-30 09:15:24 -07:00
Yashwanth
d1965c6ca8 disp: msm: sde: add cb func check before enabling irq
Acquiring mutex lock after enabling irq might lead to
deadlock if irq is dispatched immediately in some cases.
This change moves callback func check for irq prior to
enabling the irq line.

Change-Id: Ie1622e1ade268e41e97bf6d7683fa0bd972bcb7c
Signed-off-by: Yashwanth <yvulapu@codeaurora.org>
2020-03-30 09:15:15 -07:00
Yashwanth
18fe66c89e disp: msm: sde: reset crtc core perf while entering idle state
After coming out of idle state, bus vote is governed only
if there any change in perf compared to before entering idle
state. If the perf is same before and after the idle state,
bus update request is not considered and min bus votes are
voted. This change resets crtc core perf while entering
idle state always in command mode.

Change-Id: If172207422adc25fcee497aebe23aad1ac6ce7cc
Signed-off-by: Yashwanth <yvulapu@codeaurora.org>
2020-03-30 09:15:02 -07:00
Yashwanth
9d7c72743d disp: msm: remap dmabuf attach during secure transitions
During secure cb detach, gem objects stored in the aspace
active list are not cleaned up properly leading to crash
when secure cb attaches again. This change remaps dma
buffer for those gem objects.

Change-Id: I7626e87ab60a61261c802a7e7763982546c4c2e7
Signed-off-by: Yashwanth <yvulapu@codeaurora.org>
2020-03-29 19:25:27 -07:00
Dhaval Patel
f97e75d7ab disp: msm: sde: flush crtc event thread before idle notification
Flush sde crtc event thread before idle notification
to make sure that pending frame count is zero. This
allows sde encoder module to trigger power collapse
during pm_suspend scenario.

Bug: 146848315
Change-Id: Ic65a76273417c567c330e970c97183e5c0f4ad17
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
2020-03-29 19:25:20 -07:00
Dhaval Patel
141afabada dips: msm: configure sde and vbif dbg name
Configure sde and vbif debug bus name when
it is registered instead of while registering
the debugfs node.

Change-Id: I41afeede0b3d725a3b6d164e1c0f22e05f7320ec
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
2020-03-29 19:25:04 -07:00
Dhaval Patel
e7123aec1c disp: msm: sde: update autorefresh disable seq-2
Update autorefresh disable sequence-2 by avoiding
tearcheck enable configuration. Updated sequence
will trigger the frame by resetting the write
line count with tearcheck start position.

Change-Id: I984251c0cb23475f20cd5ea62122a167324d6670
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
2020-03-29 19:24:54 -07:00
Dhaval Patel
1a9e3bae54 disp: msm: sde: update autorefresh disable sequence
Autorefresh might be still in enabled state after
write_ptr reached to display height. This patch
checks the autorefresh status bit and keeps polling
the bit till autorefresh sequence is in enabled
state. It times out after 1 second if autorefresh
is still in enabled state.

Change-Id: I5d4f4cb35e5cc8c680c1878f52cee385f709d764
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
2020-03-29 19:24:42 -07:00
Samantha Tran
bf06be4737 disp: msm: queue vblank work on event thread
This change queues vblank work to event thread rather than
the display thread. This allows vblank events to be processed
without potentially being delayed by crtc commit being processed.

Change-Id: I9cbf9b3de646716e4698af9f338a7140346b65fd
Signed-off-by: Samantha Tran <samtran@codeaurora.org>
2020-03-29 19:24:15 -07:00
Samantha Tran
0064a0227b drm/msm/sde: fix race condition in vblank control interrupts
In Dual display concurrencies there are certain cases where
irq_idx and vblank_refcount state mismatch can occur.
To avoid it, during setup of irq_hw_idx, reset the vblank_refcount
and unregister read ptr irq if not yet done by then along with
maintaining global mutex lock for vblank_refcount.
Also, if register IRQ fails, correct vblank_refcount so
that IRQ registration can be tried again.

Change-Id: I06bcbf71c6a43bd161ff61093d9f6063a292d6bc
Signed-off-by: Raviteja Tamatam <travitej@codeaurora.org>
Signed-off-by: Samantha Tran <samtran@codeaurora.org>
2020-03-29 16:54:43 -07:00
Samantha Tran
83ff89732a disp: msm: sde: remove check comparing encoder's crtc and crtc
This change removes the check comparing encoder's crtc to the
crtc passed in. This check was required up until commit 70486d209c
("disp: msm: sde: remove vblank cache logic"). Now that iteration
is only happening over encoders in the encoder mask, there is no
need to check for a matching crtc to ensure it is valid.

Change-Id: I4ee08061e6c8679fe03f42cf2f889704c99526e5
Signed-off-by: Samantha Tran <samtran@codeaurora.org>
2020-03-29 16:54:10 -07:00
Nilaan Gunabalachandran
eddae0d758 disp: msm: increase delay times while waiting to turn off rscc clocks
RSC is timing out while checking for power control register,
increasing wait times only after a poms, removes this issue.

Change-Id: I4a324eb3c87e7dfb84d9a8b0a11597327d206a74
Signed-off-by: Nilaan Gunabalachandran <ngunabal@codeaurora.org>
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
2020-03-29 16:53:47 -07:00
Lakshmi Narayana Kalavala
1f331b536f drm: msm: sde: handle event disable failure
If unregister event fails to succeed due to invalid params
or due to inappropriate hardware configuration, The callback function
is not deleted from the irq table. This leads to list corruption
issues in the subsequent calls to event enable and disable.

Change-Id: I549bd15b07b9a3b04c0f0a239bd85748acf7d473
Signed-off-by: Lakshmi Narayana Kalavala <lkalaval@codeaurora.org>
2020-03-29 16:53:35 -07:00
Yashwanth
51e45dfa59 disp: rotator: update iommu domain info during rotator probe
In 4.19 kernel, smmu driver will attach context bank soon
after device is probed. This change fixes display driver to
treat smmu context bank as pre attached.

Change-Id: Ib95abeb3c853903efb9bed3e04552278576a572a
Signed-off-by: Yashwanth <yvulapu@codeaurora.org>
2020-03-29 16:53:26 -07:00
Jayaprakash
8fa5ad6a2b disp: msm: sde: fix input_handler operations for various usecases
Input event handler can be unregistered without being
registered in the case where DMS or DYN_CLK flags
are enabled on first commit, add changes to handle
this sequence.

Change-Id: Idf4f9f310b5d56df396bfa5c6477e94d4fae7a9f
Signed-off-by: Jayaprakash <jmadiset@codeaurora.org>
2020-03-29 16:53:16 -07:00
Nilaan Gunabalachandran
5bd891e4e2 disp: msm: sde: fix failure in perf mode clk update through debugfs
Setting perf tuning mode through debugfs during suspend can
result in underflow. Ensure that we are able to set rates,
or reset values and return to remain in normal mode.

Change-Id: Ib88de888690086d982b023b017083fee4e4d2091
Signed-off-by: Nilaan Gunabalachandran <ngunabal@codeaurora.org>
2020-03-29 16:53:06 -07:00
Gopikrishnaiah Anandan
c4f345dd75 msm: sde: notify driver client of resource allocation failure
Events can be registered by the driver clients using the custom event
registration ioctl.If display is not powered on when custom ioctl is
called, registration fails.Currently driver notifies user-space client
invalid error,instead it should notify that resources are not allocated
for display so that user-space client can retry.

Change-Id: Ia6e35c8c32bf00dbe2ef51b13092edf7bf5f41f7
Signed-off-by: Xu Yang <yangxu@codeaurora.org>
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
2020-03-29 16:52:56 -07:00
Samantha Tran
78ff60d33a disp: msm: sde: add encoder null check in prepare commit
Add a null check for encoder before accessing ops.

Change-Id: I7b80f4aded89d6c6fe68a0d016f64e14f04f2e58
Signed-off-by: Samantha Tran <samtran@codeaurora.org>
2020-03-29 16:52:47 -07:00
Nilaan Gunabalachandran
7ebf621320 disp: msm: sde: check new connector state for secure context
During wb use case, if any of the input buffers are secure,
the output buffer must also be in secure. In order to
successfully check if output buffer is secure context,
kernel needs to access new connector state.

Change-Id: Ia0124418eac35cf6d3301603e39ed45b971e2665
Signed-off-by: Nilaan Gunabalachandran <ngunabal@codeaurora.org>
2020-03-29 16:52:36 -07:00
Nilaan Gunabalachandran
868fb9cb24 disp: msm: sde: fix frame event signal for cwb
Submit a cwb frame event signal to notify the crtc that cwb
is completed. Currently cwb also uses the same frame done
event as primary. When a single cwb commit is completed, because
cwb is on a slower path there is a race condition in which the
subsequent frame done event for primary clears the refcount.
This fix isolates the events and removes this situation.

Change-Id: Ic3e18302eb8a497cbd7a00f271de2ab320576c83
Signed-off-by: Nilaan Gunabalachandran <ngunabal@codeaurora.org>
2020-03-29 16:52:27 -07:00
Renchao Liu
b3cb4343b1 disp: msm: Fix byte alignment problem on 32bits OS
There is potential byte alignment problem on 32bits OS which will
cause incorrect histogram blob id getting from the user space.
This change fixes byte alignment problem on 32bits OS by keeping
the struct members in one complete struct as the user space using.

In previous code start address of 'info' would align to multiple of 8,
so there would be 4 bytes padding between member 'event' and 'info'
on 32 bits OS. It is affected by member 'base'. But user space just
uses struct drm_msm_event_resp only, not affected by member 'base'.
Driver code intends to send drm_msm_event_resp, but actually send
unpacked members.

Change-Id: I5410f5b1626387707a57cbcef9c651aa11914d9d
Signed-off-by: Renchao Liu <rencliu@codeaurora.org>
2020-03-29 16:52:16 -07:00