Commit Graph

60 次程式碼提交

作者 SHA1 備註 提交日期
Jayaprakash
ef3a66389b disp: msm: sde: fix null dereference in drm_atomic_get_property
Add changes to fix the null dereference in
drm_atomic_get_property caused by connector->state
being NULL. This change allows the drm_mode_config_reset
operation to happen before drm_dev_register to avoid this.
In current scenario, connector->state->crtc is being
accessed due to call to drm_mode_getconnector ioctl with
the drm_mode_config_reset operation pending.

Change-Id: I374d9485819fad85100d1837f4ae22fc2a3ccc40
Signed-off-by: Jayaprakash <jmadiset@codeaurora.org>
2021-03-31 15:25:12 -07:00
qctecmdr
c215cee1e0 Merge "drm/msm: remove msm_gem_free_work" 2021-03-31 11:56:53 -07:00
Rob Clark
245ac819b6 drm/msm: remove msm_gem_free_work
Now that we don't need struct_mutex in the free path, we can get rid of
the asynchronous free all together.

Change-Id: I82406450e3a5d0d49d3fb753c621f55e8f4af088
Signed-off-by: Rob Clark <robdclark@chromium.org>
Git-commit: c951a9b284b907604759628d273901064c60d09f
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Signed-off-by: Samantha Tran <samtran@codeaurora.org>
2021-03-29 13:17:21 -07:00
Rob Clark
fd50a1ec69 drm/msm: Add priv->mm_lock to protect active/inactive lists
Rather than relying on the big dev->struct_mutex hammer, introduce a
more specific lock for protecting the bo lists.

Change-Id: I4c876a1c3ae51ff62372703a99a8daff0c4a7950
Signed-off-by: Rob Clark <robdclark@chromium.org>
Git-commit: d984457b31c4c53d2af374d5e78b3eb64debd483
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
[samtran@codeaurora.org: avoid changes related to debugfs and shrinker]
Signed-off-by: Samantha Tran <samtran@codeaurora.org>
2021-03-29 13:16:53 -07:00
Kristian H. Kristensen
a145e793b2 drm/msm: Implement .gem_free_object_unlocked
We use a llist and a worker to delay the object cleanup. This avoids
taking mmap_sem and struct mutex in the wrong order when calling
drm_gem_object_put-unlocked() from drm_gem_mmap().

Fixes lockdep problem with copy_from_user() in msm_ioctl_gem_submit().

Change-Id: Idfe54ae8108158b69f3835f26991642d1e21f8ee
Signed-off-by: Kristian H. Kristensen <hoegsberg@chromium.org>
Signed-off-by: Rob Clark <robdclark@chromium.org>
Git-commit: 48e7f18392c66f9b69ebac11c54f1a2e033ced54
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
[samtran@codeaurora.org: resolve trivial merge conflict]
Signed-off-by: Samantha Tran <samtran@codeaurora.org>
2021-03-29 10:47:03 -07:00
Christina Oliveira
70d6f23b26 drm: msm: Add mmrm api to display
This change adds mmrm api to display driver.

Change-Id: I51f310f8c762edc823930c05c001735056a2cbcd
Signed-off-by: Christina Oliveira <coliveir@codeaurora.org>
2021-03-24 11:37:42 -07:00
Tatenda Chipeperekwa
c6257272d4 disp: msm: fix compilation errors for dlkm compilation
Fix dlkm compilation errors that are due to the use of -Werror
flags used by the build system.

Change-Id: I5e1e9bc63c1361d73e4930aab123212717872ecb
Signed-off-by: Tatenda Chipeperekwa <tatendac@codeaurora.org>
2021-03-22 15:25:36 -07:00
Samantha Tran
ee58486c84 disp: msm: move vblank enable and disable to crtc hooks
Upstream now prefers to utilize vblank enable and disable
through crtc hooks rather than drm driver. Remove
calls from kms vblank enable/disbale.

Change-Id: Ic6911838f14f93a0d277b7bdc2c1968270ec25a2
Signed-off-by: Samantha Tran <samtran@codeaurora.org>
Signed-off-by: Nilaan Gunabalachandran <ngunabal@codeaurora.org>
2020-12-17 10:25:06 -05:00
Samantha Tran
790eda032e disp: msm: drmP.h removed, add new headers
Commit ("drm: delete drmP.h + drm_os_linux.h") removes the
drmP header file. This changes updates the msm driver
by adding the individually required header files.

Change-Id: I360aa028c2ce75317d33da988b36164041177014
Signed-off-by: Samantha Tran <samtran@codeaurora.org>
Signed-off-by: Nilaan Gunabalachandran <ngunabal@codeaurora.org>
2020-12-17 09:50:47 -05:00
Samantha Tran
bb6569b1ab disp: msm: gem_free_object removed from drm
Commit 1a9458aeb8eb ("drm: remove drm_driver::gem_free_object")
deprecates gem_free_object. This changes updates the msm driver
to call msm_gem_free_object from gem_free_object_unlocked.

Change-Id: If6bd6252232045975357e1bdfbeae6017b0f2ed5
Signed-off-by: Samantha Tran <samtran@codeaurora.org>
Signed-off-by: Nilaan Gunabalachandran <ngunabal@codeaurora.org>
2020-12-17 09:49:19 -05:00
Samantha Tran
6fa94ff382 disp: msm: rename drm_gem_object_put functions
Commit b5d250744ccc ("drm/gem: fold drm_gem_object_put_unlocked
and __drm_gem_object_put()"), commit eecd7fd8bf58 (drm/gem: add
_locked suffix to drm_gem_object_put", commit be6ee102341b ("drm:
remove _unlocked suffix in drm_object_put_unlocked") updates
the drm_gem_object_put call APIs. This change updates the relevant
changes to the msm driver.

Change-Id: I006b51b5f3d1f8b2e88ed7b4c73b5a98afcaf455
Signed-off-by: Samantha Tran <samtran@codeaurora.org>
Signed-off-by: Nilaan Gunabalachandran <ngunabal@codeaurora.org>
2020-12-17 09:49:19 -05:00
Samantha Tran
640ada10b5 disp: msm: updates to msm_drv
Commit c368ec194dd0 ("drm/client: Rename _force to _locked"),
commit 4bdc0d676a64 ("remove ioremap_nocache and devm_ioremap_nocache") and
commit 595abbaff5db ("y2038: remove ktime to/from timespec/timeval
conversion") renames modeset_commit_force, renames devm_ioremap_nocache and
removes the usage of timespec. This changes updates the msm driver with
the relevant changes.

Change-Id: Ib7372b8b4e51cdf75771e5069be189be76c32ed4
Signed-off-by: Samantha Tran <samtran@codeaurora.org>
Signed-off-by: Nilaan Gunabalachandran <ngunabal@codeaurora.org>
2020-12-16 17:28:03 -08:00
qctecmdr
a2a3c5e864 Merge "disp: msm: sde: cache encoder_mask for vblank_work" 2020-11-24 06:44:04 -08:00
Veera Sundaram Sankaran
e07097c244 disp: msm: sde: use drm mode set by user-mode in trusted-vm
Trusted-vm uses the cont-splash path to initialize the software
states by reading the hardware registers and populating the
SDE & DRM software states. But drm mode cannot be determined by
register reads, so rely on user-mode to get the mode which comes
as part of the first atomic_commit check phase which handles the
transition. The primary-vm user-mode passes the current mode to
trusted-vm through qrtr which is in-turn passed to driver to
set that particular mode.

Change-Id: I4fb86b40b8a0583c8edb539b0a51dcd33de731ff
Signed-off-by: Veera Sundaram Sankaran <veeras@codeaurora.org>
2020-11-18 17:32:58 -08:00
Steve Cohen
aa064ada86 disp: msm: sde: cache encoder_mask for vblank_work
There is a race between disable commit swap-state on display
thread and vblank work on event thread which may skip applying
the vblank vote if the encoder_mask has already been cleared.
To avoid the race, use a cached encoder_mask that is gauranteed
to be valid between the vblank_on and vblank_off calls.

Also, vblank queue work is initializing a variable that's never
used and msm_disable_outputs has 2 instances of pointers to old
CRTC state. Remove this dead code.

Change-Id: I5e4a482b8f067e272a2aef5afa08cc0e1ab89434
Signed-off-by: Steve Cohen <cohens@codeaurora.org>
2020-11-17 17:24:30 -05:00
Yashwanth
2683324973 disp: msm: register rotator platform driver after genpd init
Due to power-domain, if rotator driver is registered early,
probe might get deferred several times and get stuck
indefinitely. So, this change adds driver registration
after genpd init to handle such cases.

Change-Id: I8dcb640d0ab0cdf0818cbce1b1fb460c28d8b9e7
Signed-off-by: Yashwanth <yvulapu@codeaurora.org>
2020-09-25 21:16:42 +05:30
Ping Li
97a5b52ebd disp: msm: sde: add event to event_list after register is successful
Add event to event_list after msm_register_event is successful to avoid
use-after-free vulnerability.

Change-Id: I34fb39c99051978cbab64a852851964691a5ea9e
Signed-off-by: Ping Li <pingli@codeaurora.org>
2020-09-11 13:52:52 -07:00
Ping Li
76a1d81e9d Revert "disp: msm: sde: add event to event_list after register is successful"
This reverts commit 91fc51777c67ddc92d0ba1fcddf6cd149f7a0560.
The original fix missed to add the client to list in cases when count is
larger than zero and client doesn't need to be deleted from list if
msm_register_event fails as it was not added to list yet.
Revert this change to upload the correct fix.

Change-Id: I00923d65387753b05b6b03efec109c019826f5d5
Signed-off-by: Ping Li <pingli@codeaurora.org>
2020-09-11 13:52:05 -07:00
Ping Li
9450155b4f disp: msm: sde: add event to event_list after register is successful
Add event to event_list after msm_register_event is successful to avoid
use-after-free vulnerability.

Change-Id: I144ae82c657c1e2cf16608c0e8768b12a7d27974
Signed-off-by: Ping Li <pingli@codeaurora.org>
2020-08-31 16:23:27 -07:00
qctecmdr
2b8aaf8652 Merge "disp: msm: fix driver unload issues in gki config" 2020-07-24 11:17:20 -07:00
Orion Brody
66f04c4716 disp: msm: fix driver unload issues in gki config
Resolves segmentation fault during driver unload in GKI
configuration, caused by repeated debugfs destroy calls.
Also removes redundant unload calls.

Change-Id: I20a8efc1916b9a60766f9c7714a4b458aa518566
Signed-off-by: Orion Brody <obrody@codeaurora.org>
2020-07-15 12:26:08 -07:00
Lei Chen
eb679f5289 disp: msm: add support for display early wakeup
Display clocks and IRQs are disabled during idle state
on command mode for power saving, and will be enabled
when a new frame commits to display driver. But enable
display clocks and IRQs will cause some latency.
So add a new SDE custom IOCTL for user-space to early wake
up display before first frame commits to kernel.

Change-Id: I6ca0188d321c4964f29c46e588b64d06b9634c59
Signed-off-by: Lei Chen <chenlei@codeaurora.org>
2020-07-12 19:08:23 -07:00
Jeykumar Sankaran
99df0d5052 disp: msm: add support for vm event register framework
Besides SDE, other subdrivers may be interested in participating in
the VM switch. This change provides framework for display dependent
drivers like DSI, DP and RSCC to register for various VM switch
event hooks.

The following hooks to provided through msm_vm_ops:
post_hw_acquire: invoked before the first frame push after gaining
                 HW access.
pre_hw_release: invoked after the last frame commit before releasing
                the HW.
check:       check with vm clients for their readiness for HW
             releasing.

Change-Id: I616db04e979f78f76f6f97ee3b068dd348339ab6
Signed-off-by: Jeykumar Sankaran <jsanka@codeaurora.org>
2020-07-08 23:14:31 -07:00
qctecmdr
4fbdcba865 Merge "disp: msm: sde: wait for pending crtcs before lastclose commits" 2020-06-30 17:33:14 -07:00
Steve Cohen
f030fa4c2a disp: msm: sde: wait for pending crtcs before lastclose commits
If a SIG_TERM/SIG_KILL or other signal is sent to the final drm
client, the driver will be force-closed. A -ERESTARTSYS error is
occasionally seen from the interruptible wait in
msm_atomic_commit when this occurs, and causes the lastclose
cleanup to fail if any crtc is busy at that point. To prevent
this, wait for any pending crtcs to complete before calling
the lastclose cleanup commits.

Change-Id: Ib6a5e55a4b737213756cb9ed8364d5c34ab47c16
Signed-off-by: Steve Cohen <cohens@codeaurora.org>
2020-06-29 23:45:19 -04:00
qctecmdr
4d45309328 Merge "disp: msm: fix vram allocation when IOMMU is not present" 2020-06-28 04:32:57 -07:00
Dhaval Patel
44cde01fc7 disp: msm: sde: manage vblank refcount concurrency
Vblank refcount can reach out of sync with below case
 1. event_thread triggers the vblank_enable
 2. commit_thread triggers the modeset
   2.a modeset resets the vblank refcount with mode_set
 3. event_thread triggers the vblank_disable

Event 2.a resets the vblank refcount and vblank disable
request after 2.a is going to fail. This can be fixed
by avoiding concurrency between mode_set call and vblank
request.

Change-Id: Ibb810ec90e81d63feee443f1c37dd736d5cfac0d
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
2020-06-25 13:54:21 -07:00
Veera Sundaram Sankaran
88037da799 disp: msm: fix vram allocation when IOMMU is not present
Allocate DSI/LUTDMA buffers from VRAM when IOMMU is not
available. Add checks in msm_gem to avoid few operations
when aspace is not available due to no IOMMU. Parse the
VRAM size from device tree, when available.

Change-Id: Iedf5749b71c2e772ac5434048520a34705c54b45
Signed-off-by: Veera Sundaram Sankaran <veeras@codeaurora.org>
2020-06-24 16:20:38 -07:00
Amine Najahi
ed868466f5 disp: msm: dp: Extend mode filtering to support 8K
Currently DP driver determines if a mode is DSC capable
based on a DTSI entry and the required number of DSC
to support it. This approach does not scale when there
is an overlap in DSC requirement between DSI displays
and external DP display, thus causing one of the display to
report modes that cannot be supported.

This change compares the resources reserved for DP driver
calculated at initialization time and the currently available
ones to determine the correct number of resources that DP driver
can use. It also adds DSC and topology filtering logic and moves
DSC hardware specific from DP driver to SDE driver.

Change-Id: I8e601de33422b7c6d786826f7bfe152c4af8a6b5
Signed-off-by: Amine Najahi <anajahi@codeaurora.org>
2020-06-09 09:17:38 -04:00
Abhijit Kulkarni
c789d0fb8a disp: msm: check if kms is instantiated
This defensive check is now required since the allocation
of driver private data has moved from bind to probe phase.
There is a chance that device shutdown can be called before
bind phase and this can cause invalid memory access.

Change-Id: I2d471a4aff93ae03291e19f6f902f1e5c28dc50f
Signed-off-by: Abhijit Kulkarni <kabhijit@codeaurora.org>
2020-05-14 14:43:27 -07:00
Yashwanth
37d86a4d83 disp: msm: queue vblank work on disp thread during modeset
If vblank work is queued to event thread, during modeset,
there might be a case where vblank is enabled in between
resulting in vblank ref count mismatch. This change queues
vblank request to disp thread during modeset.

Change-Id: I98b87b4209e1f7f535980eef22a50df17c346c23
Signed-off-by: Yashwanth <yvulapu@codeaurora.org>
2020-05-06 13:18:14 -07:00
Abhijit Kulkarni
802b5e31eb disp: msm: fix probe deferral logic
msm_drv should be probe deferred until rsc driver
probe is done. OF_POPULATED flag only checks if platform
driver is registered and hence additional condition to
check if driver is attached to this device, is needed.

Change-Id: I070965cc8d3ba3984032ad3704ec86066680eef0
Signed-off-by: Abhijit Kulkarni <kabhijit@codeaurora.org>
2020-05-01 09:57:07 -07:00
Shashank Babu Chinta Venkata
8b8bfe0165 disp: msm: make msm_drm into single module
Make msm_drm into single module and all child driver
registers and unregisters are handled from parent's
register and unregister respectively.

Change-Id: I017513d1de3b6b25dd5543d7fa7741c0bac1740d
Signed-off-by: Shashank Babu Chinta Venkata <sbchin@codeaurora.org>
Signed-off-by: Narendra Muppalla <NarendraM@codeaurora.org>
Signed-off-by: Chandan Uddaraju <chandanu@codeaurora.org>
2020-04-28 15:52:39 -07:00
Chandan Uddaraju
eaa458b165 disp: msm: move MDSS resource voting to probe
sync_state driver disables any resources that
don't have any votes after driver probe is completed.
Move MDSS resource votes to probe so that any resources
that are needed for continuous splash are intact until
the bind of all the components is complete.

Change-Id: I0056bf1ec56bcd6a1b620a81143d4b49d7ea2921
Signed-off-by: Chandan Uddaraju <chandanu@codeaurora.org>
2020-04-28 12:09:13 -07:00
Dhaval Patel
d4566743e0 disp: msm: avoid msm_drv probe if sde_rsc is not probed yet
Msm_drv device node has dependency on sde_rsc device
node for power resource enable if sde_rsc device
device is enabled. This change moves the msm_drv device
to probe defer state during component addition if
sde_rsc device is not probed yet. It also removes
the master_drm device node access from sde_rsc device.

Change-Id: Ibb7457279b3376f45e82e5c9373aabd84a37ed36
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
2020-04-23 10:29:44 -07:00
Samantha Tran
22923230ef disp: msm: modify handling of debugfs initialization
Add support to allow creation of debugfs node only if
CONFIG_DEBUG_FS is enabled.

Change-Id: Iaeaf51b3654c9458cf8131a9756e6b905007c4ae
Signed-off-by: Krishna Manikandan <mkrishn@codeaurora.org>
Signed-off-by: Samantha Tran <samtran@codeaurora.org>
2020-04-16 23:55:48 -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
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
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
Abhijit Kulkarni
a752925112 disp: msm: sde: re-factor probe time initialization
This change moves the msm_driver power resource initialization from
bind time to probe time. This keeps the resource vote on until all the
devices are bound. This is required since the regulator and clock
sync_state driver will remove the proxy votes as soon as msm_driver
has probed.

Change-Id: Icb0e59e4ff0290ef0c1bd3914d6fdbf99bf5d9fa
Signed-off-by: Abhijit Kulkarni <kabhijit@codeaurora.org>
2020-03-23 12:07:40 -07:00
Satya Rama Aditya Pinapala
d97b665e1d disp: msm: move msm_drv probe to module level
With the introduction of sync state drivers, msm_drm probe can be
moved back to module level from late init.  It is now guaranteed
that the dependencies are probed before the actual driver is.

Change-Id: Ib7c3e0e3c3d32b37b7672b6119bcf5371783659d
Signed-off-by: Satya Rama Aditya Pinapala <psraditya30@codeaurora.org>
2020-03-02 11:38:00 -08:00
Abhinav Kumar
e3f23771ba disp: msm: add support for variable compression ratios
Currently the compression ratio is hard-coded to either 2:1 or
3:1 in several places. This is not sufficient for new compression
algorithms as they can support higher compression ratios.

Add support for calculating the compression ratios from the source
and target bpp thereby eliminating hard-coding.

Change-Id: I6383f3d0c781193d0a9ed74df5a95d8e856edb3d
Signed-off-by: Abhinav Kumar <abhinavk@codeaurora.org>
2020-01-29 13:46:57 -08:00
Linux Build Service Account
6ad6641d3a Merge changes I36a55b91,Icc225bd1 into display-kernel.lnx.1.0
* changes:
  disp: msm: sde: update shmbridge header file path
  disp: msm: delay msm_drv probe
2019-12-09 12:26:54 -08:00
Steve Cohen
ae2dceb0b6 disp: msm: sde: remove all preclose logic
The DRM framework only calls the driver's preclose callback
function if the LEGACY driver feature is enabled. Therefore
strip out this logic as it never gets executed since LEGACY
is not supported for msm_drm driver.

Change-Id: I95474cd5424423ef194faae12f1241698f3e467e
Signed-off-by: Steve Cohen <cohens@codeaurora.org>
2019-12-09 08:36:00 -08:00
Steve Cohen
ff5365a1e0 disp: msm: make kms a DRM client for lastclose logic
Since some APIs previously used during lastclose are no longer
exposed to drivers (__drm_atomic_helper_disable_plane, and
__drm_atomic_helper_set_config), make kms a DRM client and use
the drm_client_modeset_commit_force API to do lastclose cleanup.

Change-Id: I543392fe79558a3996e326a0f222793c56d71e4f
Signed-off-by: Steve Cohen <cohens@codeaurora.org>
2019-12-09 10:57:54 -05:00
Abhijit Kulkarni
29fecbebc7 disp: msm: delay msm_drv probe
This change delays the probe of msm_drv by changing the init call
order to ensure that all the dependent resource drivers are
probed and all resources are available for use by the msm_drv.

Change-Id: Icc225bd14052a8d83e9976fbaa9c83c17f5319aa
Signed-off-by: Abhijit Kulkarni <kabhijit@codeaurora.org>
2019-12-06 10:19:45 -08:00
Narendra Muppalla
d1d9ae8b19 Disp: Snapshot change for lahaina display driver
This snapshot change adds downstream support
for drm 5.x+(msm_lahaina branch) linux kernel.

Change-Id: Ia691c95da155a00e449c91a2f1a5b20a8e71aed4
Signed-off-by: Narendra Muppalla <NarendraM@codeaurora.org>
2019-11-24 12:30:51 -08:00
qctecmdr
1f35fd007a Merge "disp: msm: update topology based on clock requirement" 2019-09-21 03:22:17 -07:00
Tatenda Chipeperekwa
da892c0b91 disp: msm: update topology based on clock requirement
Update the topology allocation by considering the required
mode clock (vtotal x htotal x fps * fudge factor). Modes with
a clock that exceeds the maximum SDE clock will be denoted as
requiring a topology that uses two layer mixers.

Change-Id: I3c773598b0d79cb6fea9d3a0e04d89ff84d67e13
Signed-off-by: Tatenda Chipeperekwa <tatendac@codeaurora.org>
2019-09-20 14:39:54 -07:00
Jayaprakash
669557d6eb disp: msm: add changes for bengal target compilation
This change corrects the definitions of functions
invoked when their config keys are not enabled.

Change-Id: Iba4631b8019a5e5a6b95516c5c9f9e28942e60c9
Signed-off-by: Jayaprakash <jmadiset@codeaurora.org>
2019-09-18 19:32:32 +05:30