커밋 그래프

87 커밋

작성자 SHA1 메시지 날짜
Jayaprakash Madisetty
f9578b89c9 disp: msm: sde: skip msm_lastclose if display is stuck in splash
This change skips msm_lastclose, when splash enabled builtin-displays
equals number of actual displays and are stuck in continuous splash.
It fixes the issue seen with change commit 548b17185e95
("disp: msm: send power_on event in dual display composer kill scenario").

Change-Id: I1f5417d8945db621dc20ab0a9cc0146eabae5e22
Signed-off-by: Jayaprakash Madisetty <quic_jmadiset@quicinc.com>
2022-08-17 14:25:40 -07:00
Jayaprakash Madisetty
182aac6040 disp: msm: cancel all delayed_works before triggering msm_lastclose
This patch cancels all the delayed_off_works if scheduled and flushes
the display threads for completion during msm_lastclose. The commit
from msm_lastclose client modeset to disable any crtcs if enabled is
always scheduled on primary crtc_commit thread. In the current issue,
delayed_off_work is scheduled on secondary display crtc_commit thread
and primary crtc_commit thread is scheduled to turn off active crtcs
from msm_lastclose leading to null dereference access of sde_enc's
cur_master. This race is avoided by serializing the operations in
msm_lastclose.

Change-Id: I30cc95b925c8134f0064816ebe2cfdb86a49fb36
Signed-off-by: Jayaprakash Madisetty <quic_jmadiset@quicinc.com>
2022-08-17 14:06:45 -07:00
Jayaprakash Madisetty
b837aa4c77 disp: msm: send power_on event in dual display composer kill scenario
On composer kill event, drm lastclose occurs during which suspend
commit gets triggered on primary. If secondary display is stuck in
continuous splash, then we do a early return without triggering
this suspend commit. On composer start, userspace waits for power on
event, but the drm_driver has never entered suspend state, so power
on event is never sent to userspace. This causes HWC deadlock side
effect and the current change triggers null_commit on secondary
display and then issues a suspend commit on both the displays to
avoid this deadlock issue.

Change-Id: I126f43ba3dd2c3bfa83346e8fd4678f35527893d
Signed-off-by: Jayaprakash Madisetty <quic_jmadiset@quicinc.com>
Signed-off-by: Veera Sundaram Sankaran <quic_veeras@quicinc.com>
2022-05-23 11:24:01 -07:00
GG Hou
dbf99b46c9 disp: msm: display error log signature alignment
Ensure SDE_ERROR error log print function name and line number.
Add a macro DISP_DEV_ERR as a wrapper of dev_err to ensure origin dev_err
will print function name and line number.
This would help with analysis of errors reported with automated testing.

Expected display error log format:
  [FUNCTION_NAME:line] ERROR_MESSAGE

Change-Id: I354f45b492059d5ba2bb110d56443fd338add7ad
Signed-off-by: GG Hou <quic_renjhou@quicinc.com>
2022-02-23 17:53:49 +08:00
Narendra Muppalla
daa511cb90 Merge remote-tracking branch 'quic/display-kernel.lnx.5.10' into display-kernel.lnx.5.15
* quic/display-kernel.lnx.5.10:
  disp: msm: sde: avoid error during fal10_veto override enablement
  disp: msm: update copyright description
  disp: msm: sde: configure dest_scaler op_mode for two independent displays
  disp: msm: dp: updated copyright set for 4nm target
  Revert "disp: msm: sde: consider max of actual and default prefill lines"
  disp: msm: sde: Reset backlight scale when HWC is stopped
  disp: msm: dp: avoid duplicate read of link status
  disp: msm: dsi: update vreg_ctrl settings for cape
  disp: msm: fail commit if drm_gem_obj was found attached to a sec CB
  disp: msm: dp: updated register values for 4nm target
  disp: msm: sde: update framedata event handling
  disp: msm: dsi: Add new phy comaptible string for cape
  disp: msm: sde: software override for fal10 in cwb enable
  disp: msm: update cleanup during bind failure in msm_drm_component_init
  disp: msm: sde: dump user input_fence info on spec fence timeout
  disp: msm: sde: add null pointer check for encoder current master
  disp: msm: dsi: enable DMA start window scheduling for broadcast commands
  disp: msm: sde: avoid alignment checks for linear formats
  disp: msm: reset thread priority work on every new run
  disp: msm: sde: send power on event for cont. splash
  disp: msm: sde: always set CTL_x_UIDLE_ACTIVE register to "1"
  disp: msm: use vzalloc for large allocations
  disp: msm: sde: Add support to limit DSC size to 10k
  disp: msm: sde: add tx wait during DMS for sim panel
  disp: msm: dsi: add check for any queued DSI CMDs before clock force update
  disp: msm: sde: correct pp block allocation during dcwb dither programming
  disp: msm: sde: avoid setting of max vblank count
  disp: msm: sde: add cached lut flag in sde plane
  disp: msm: sde: avoid use after free in msm_lastclose
  disp: msm: sde: update TEAR_SYNC_WRCOUNT register before vsync counter
  disp: msm: dsi: Support uncompressed rgb101010 format
  disp: msm: sde: update idle_pc_enabled flag for all encoders
  disp: msm: sde: flush esd work before disabling the encoder
  disp: msm: sde: allow qsync update along with modeset
  disp: msm: dp: avoid dp sw reset on disconnect path
  disp: msm: sde: consider max of actual and default prefill lines
  disp: msm: ensure vbif debugbus not in use is disabled
  disp: msm: sde: update cached encoder mask if required
  disp: msm: sde: while timing engine enabling poll for active region
  disp: msm: enable cache flag for dumb buffer
  disp: msm: sde: disable ot limit for cwb
  disp: msm: sde: avoid race condition at vm release
  disp: msm: dsi: set qsync min fps list length to zero
  disp: msm: sde: reset mixers in crtc when ctl datapath switches
  disp: msm: sde: update vm state atomic check for non-primary usecases
  disp: msm: sde: reset CTL_UIDLE_ACTIVE register only if uidle is disabled

Change-Id: If480e7f33743eb4788549f853ba05e744ecb38d3
Signed-off-by: Narendra Muppalla <quic_nmuppall@quicinc.com>
2022-02-08 16:38:13 -08:00
Yashwanth
107f473e54 disp: msm: update copyright description
This change updates copyright description with correct
license marking as per the guidelines.

Change-Id: Ia74b721e78afcc7f8e88bcbccfcf15430111ec37
Signed-off-by: Yashwanth <quic_yvulapu@quicinc.com>
2022-02-01 11:29:21 +05:30
Mahadevan
64ae0c58f0 disp: msm: update cleanup during bind failure in msm_drm_component_init
During msm_drm_bind if one of the sub components fails
to bind and defers the probe, it used to clear the device
platform device private structures which are created as
part of msm_pdev_probe. When sub devices try to bind as
part of probe sequence it will try to bringup master
msm_drm and accesses invalid address leading to crash.
This change updates the cleanup procedure which avoids
such crash.

Change-Id: I2d5c94cfafa3c5ec23b81bb0a080ad6e0e5b02ad
Signed-off-by: Mahadevan <quic_mahap@quicinc.com>
2022-01-17 09:36:14 +05:30
GG Hou
e29493c71d disp: msm: avoid using #ifdef for configurations
Use #if IS_ENABLED() instead of #ifdef for configurations as vendor module
guidelines.

Use #if IS_ENABLED(CONFIG_XXX) instead of #ifdef CONFIG_XXX to ensure that
the code inside the #if block continues to compile if the config changes
to a tristate config in the future.

The differences are as follows:
	1.#if IS_ENABLED(CONFIG_XXX) evaluates to true when CONFIG_XXX is set to
		module (=m) or built-in (=y).
	2.#ifdef CONFIG_XXX evaluates to true when CONFIG_XXX is set to
		built-in(=y) , but doesn't when CONFIG_XXX is set to module(=m).
		Use this only when you're certain you want to do the same thing
		when the config is set to module or is disabled.

Change-Id: Ia806b9b01ad8414d0e4de027a382cb68e7fb4a6a
Signed-off-by: GG Hou <quic_renjhou@quicinc.com>
2022-01-17 10:10:04 +08:00
GG Hou
079c9d79b5 disp: msm: avoid use macro as vendor module guideline
As google's vendor module guideline, don't use MODULE_SOFTDEP to order
device probes.
So avoid using the MODULE_SOFTDEP macro in display module.

Change-Id: Ife29b6185c3bcb001a581753d2a8d2aba5214f8a
Signed-off-by: GG Hou <quic_renjhou@quicinc.com>
2022-01-13 17:11:18 -08:00
Kalyan Thota
7bc6632eb6 disp: msm: reset thread priority work on every new run
Reinit thread priority work before queueing on multiple display
threads as the work stores the former worker thread. Also
flush work such the next init is serialized.

Change-Id: I51409d4d12d100be0cb30238f812a56ec064a339
Signed-off-by: Kalyan Thota <quic_kalyant@quicinc.com>
2022-01-09 20:52:06 -08:00
Veera Sundaram Sankaran
56862f8118 disp: msm: use pm_runtime_resume_and_get instead of pm_runtime_get_sync
pm_runtime_get_sync increases the usage_count refcount immaterial of
success/failure of the call, leading to invalid refcount on failures.
Use pm_runtime_resume_and_get instead, which takes care of reducing the
refcount on failure cases before returning from the function.

Change-Id: Ib96050d5d7ecbd717e58b8a0dde2d03312444e15
Signed-off-by: Veera Sundaram Sankaran <quic_veeras@quicinc.com>
2022-01-05 17:28:41 -08:00
Jayaprakash Madisetty
eea04d1a31 disp: msm: sde: avoid use after free in msm_lastclose
This change sets kms in msm_drm_private to NULL during
msm_drm_unbind as this can be accessed from msm_lastclose
during msm_pdev_shutdown concurrently.

Change-Id: Ic44f5cf88a96c970903f2c7d3c5b627e22b411fc
Signed-off-by: Jayaprakash Madisetty <quic_jmadiset@quicinc.com>
2021-12-21 13:32:16 +05:30
Jeykumar Sankaran
cf39b00660 Merge branch 'display-kernel.lnx.5.10' into display-kernel.lnx.1.0
Change-Id: I5d2b08380b6b0eb09492b950fb38cd9a0b3196c1
2021-12-08 12:37:35 -08:00
Bruce Hoo
e2a1b77afa disp: msm: adapt IRQ interface change for multiple SIs
Commit 45160ca ("disp: msm: use linux IRQ interfaces instead
of DRM helpers") update the msm layer to use linux IRQ interfaces
as DRM IRQ helpers are removed in 5.15 kernel.
This change uses macros to control the calling of correct irq interfaces
for kernel version 5.10 and version 5.15.

Change-Id: I367021df783c0aa02f729920b673e6f1f7397e65
Signed-off-by: Bruce Hoo <bingchua@codeaurora.org>
2021-11-30 11:23:55 +08:00
Bruce Hoo
87c65e29e4 disp: msm: adapt msm_gem ops and drm_drver callbacks for multiple SIs
Commit d1d1173 ("disp: msm: update msm_gem ops and remove unused
drm_driver callbacks") Update msm_gem and msm_drv to comply with
latest 5.15 kernel.Modify dma_buf_vmap() and dma-buf's vmap callback
to use truct dma_buf_map. Rename dma_resv_get_excl_rcu to _unlocked.
Remove deprecated GEM and PRIME callbacks.
This change adapts all the interface change for kernel version 5.10
and version 5.15..

Change-Id: Icb495dc4e5d20999f773ed5881eff233ff3a48bc
Signed-off-by: Bruce Hoo <bingchua@codeaurora.org>
2021-11-30 10:50:34 +08:00
Krishna Manikandan
45380adf38 disp: msm: sde: protect file private structure with mutex lock
Access file private data structures inside the
mutex lock only to avoid use-after-free issues.

Change-Id: If70731f517bcb47d4515f131fecafe702064cb45
Signed-off-by: Krishna Manikandan <mkrishn@codeaurora.org>
2021-10-21 14:28:42 -07:00
Bruce Hoo
45160ca04c disp: msm: use linux IRQ interfaces instead of DRM helpers
Update the msm layer to use linux IRQ interfaces as DRM IRQ helpers
are removed in 5.15 kernel.

Change-Id: I9f41032927cddabe8a5a48e5e9339acef6c6f67e
Signed-off-by: Bruce Hoo <bingchua@codeaurora.org>
Signed-off-by: Jeykumar Sankaran <jsanka@codeaurora.org>
2021-10-15 17:27:48 -07:00
Bruce Hoo
d1d11731f1 disp: msm: update msm_gem ops and remove unused drm_driver callbacks
Update msm_gem and msm_drv to comply with latest 5.15 kernel.
Modify dma_buf_vmap() and dma-buf's vmap callback to use
struct dma_buf_map. Rename dma_resv_get_excl_rcu to _unlocked.
Remove deprecated GEM and PRIME callbacks.

Change-Id: Ifdfc7f872c988d8455f465e7d17dfbcf212bb5f6
Signed-off-by: Bruce Hoo <bingchua@codeaurora.org>
Signed-off-by: Jeykumar Sankaran <jsanka@codeaurora.org>
2021-10-15 17:27:27 -07:00
Dhaval Patel
25c3b955c6 disp: msm: move thread priority call from component bind
Move thread priority call to kernel worker thread because
component bind API may run from vendor_modeprobe process
context when all drivers probe succeed. Thread priority
update is not allowed from vendor_modeprobe process
context.

Change-Id: Iafac97ce02942d6a2134495232f3c395ba4a362f
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
2021-10-13 15:00:40 -07:00
Shashank Babu Chinta Venkata
1263b4cabc disp: msm: dsi: reorder DSI registration
Reorder registration of various display drivers in the order of
dependency.

Change-Id: Idfa0616d3133f3b03c713e3c15a4fd3956ec2594
Signed-off-by: Shashank Babu Chinta Venkata <sbchin@codeaurora.org>
2021-09-27 11:22:08 -07:00
qctecmdr
bb36f9fd40 Merge "disp: msm: sde: add helper to check VM hw availability" 2021-08-18 16:48:48 -07:00
Krishna Manikandan
9f41ad11b3 disp: msm: sde: add null check for drm file in msm_release
Drm file is not set to NULL after freeing it from drm
release. This can result in use-after-free issues in
some scenarios. Add a mutex lock and other proper null
checks to prevent such issues.

Change-Id: Ic35b0a76166b0f47a354b1737e6f4c3ac1437ed4
Signed-off-by: Krishna Manikandan <mkrishn@codeaurora.org>
2021-08-16 06:31:40 -07:00
Steve Cohen
9690b545df disp: msm: sde: prevent custom ioctls from accessing unowned HW
Early wakeup ioctls from perf HAL driver can access display HW
registers and come as a sideband to atomic commits. Since the
atomic validate checks are not part of this code path it's
possible for HW access to occur during a trusted UI session.
Prevent this whenever the HW is not under this VM's ownership.
Also, move the VM ownership check for the register/deregister
event ioctl to cover both the CRTC and connector events since
new connector events are being added which can access HW.

Change-Id: I39660ae60e7e8f8a405e819c43ec42fbac3f492a
Signed-off-by: Steve Cohen <cohens@codeaurora.org>
2021-08-11 15:38:27 -04:00
Jayaprakash Madisetty
0e3d422520 disp: msm: sde: remove fb's attached to a drm_file in preclose
This change avoids upstream drm issuing drm_atomic_commit in
drm_fb_release which is leading to artifacts on screen or
atomic_check failures due to atomically unstaging each fb
from plane_state and committing remaining planes on hardware.

 a) This patch moves the state operations for setting crtc to
    connector state to a helper api.
 b) This patch clears any dim_layers present in the crtc_state
    as part of null commit.
 c) This patch removes any framebuffers attached to a drm_file
    in msm_preclose whose refcount is not managed by composer kill
    inadvertently and issues null flush to hardware in such cases.
 d) This patch handles msm_preclose as part of msm_release
    operation since legacy feature is not supported
    for msm_driver.

Change-Id: Ib2068d74d4b23b73b7c84544858c9f6bb6adfa67
Signed-off-by: Jayaprakash Madisetty <jmadiset@codeaurora.org>
Signed-off-by: Samantha Tran <samtran@codeaurora.org>
2021-07-08 10:24:32 -07:00
Jayaprakash Madisetty
2df01bf3aa Revert "disp: msm: sde: remove all preclose logic"
This change reverts commit ae2dceb0b6 ("disp: msm:
 sde: remove all preclose logic"). This change also
modifies the force disable plane logic since
__drm_atomic_helper_disable_plane is not exposed to
drivers.

Change-Id: I89e19dead9ade724798952b1934b45b5663e1a42
Signed-off-by: Jayaprakash Madisetty <jmadiset@codeaurora.org>
Signed-off-by: Samantha Tran <samtran@codeaurora.org>
2021-07-08 10:24:32 -07:00
Yu Wu
55340a43c3 disp: msm: add physical address info when dumping display registers
In dumping display registers, physical address will be appended after
each block name. This is to support register compare between kernel
and UEFI.

Change-Id: Ic20d3e2bd4c95aa7c71c4b646a149f7e83ad731a
Signed-off-by: Yu Wu <zwy@codeaurora.org>
2021-05-06 02:59:16 -07:00
Christina Oliveira
53a934668e drm: msm: move display mmrm enable config to platform config
This change moves mmrm enable flag to the display platform config files.
This allows to selectively enable mmrm in the display driver,
so other platforms not requiring mmrm in their build can compile
with their own config files.

Change-Id: I02415c6a22252dfc483a3da03b623351811ffc01
Signed-off-by: Christina Oliveira <coliveir@codeaurora.org>
2021-04-08 16:38:43 -07:00
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