Commit Graph

52 Commits

Author SHA1 Message Date
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
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
Nilaan Gunabalachandran
2c320baeaf Revert "disp: msm: sde: update smmu fault handler to print debug info"
This reverts commit 0623a02a84. It leads to
panic during smmu faults because we do not have any recovery. Reverting
this will give the control to the client to dump if necessary.

Change-Id: I85982e129cabc73b041e25c35e965117d60f3bfa
Signed-off-by: Nilaan Gunabalachandran <ngunabal@codeaurora.org>
2021-07-13 17:43:37 -04:00
qctecmdr
72fb431a00 Merge "disp: msm: sde: update smmu fault handler to print debug info" 2021-04-02 18:50:47 -07:00
Prabhanjan Kandula
81ecb37301 disp: msm: add qcom dma mapping header for dma attributes
Refactoring of iommu headers is moving few downstream attributes
defines to new header from dma-mapping.h. This change includes
the qcom header for downstream attribute defines.

Change-Id: Ia1f9f40f2cb8090dc7b7e3cbe0b632449c44c3b0
Signed-off-by: Prabhanjan Kandula <pkandula@codeaurora.org>
2021-04-02 11:24:55 -07:00
Nilaan Gunabalachandran
0623a02a84 disp: msm: sde: update smmu fault handler to print debug info
This change updates the smmu fault handlers in the display driver
to return -ENOSYS. This will print out useful debug information
from smmu driver.

Change-Id: I427982286abe4d592f270477c8ad2e2be74700c9
Signed-off-by: Nilaan Gunabalachandran <ngunabal@codeaurora.org>
2021-03-23 08:17:18 -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
orion brody
a076fe6f5c disp: rotator: Add msm_rtb.h header for no_log support
rtb driver is moved to tracepoint method as of 5.10, and there is no proper
support for no_log variants of read/write operations. Add dummy no_log apis
to msm_rtb.h file as temporary solution, and include msm_rtb.h in rotator
for no_log support.

Change-Id: I3f833fdfb741039a30a7d23aee2b20b9f62e14e1
Signed-off-by: orion brody <obrody@codeaurora.org>
2021-01-26 13:10:24 -08:00
Samantha Tran
13bb35435c disp: add changes to generate display dlkm in android
Add Android make files and Kbuild files to support dlkm
for display driver. Also resolve header and config issues
to allow successful compilation of display driver.

Change-Id: I04d6233864ea54c0a808b295fbdccb83058f1fd2
Signed-off-by: Samantha Tran <samtran@codeaurora.org>
Signed-off-by: Chandan Uddaraju <chandanu@codeaurora.org>
Signed-off-by: Prabhanjan Kandula <pkandula@codeaurora.org>
2021-01-15 00:32:42 -08:00
Samantha Tran
df3f51f9c4 disp: msm: replace PTR_RET with PTR_ERR_OR_ZERO
Commit fad7c9020948 ("err.h: remove deprecated PTR_RET for good")
deprecated PTR_RET. This change updates the msm driver by
replacing it with PTR_ERR_OR_ZERO.

Change-Id: Ibe8cefd7b9ce27dc63886eb3861aab5fc8ba268a
Signed-off-by: Samantha Tran <samtran@codeaurora.org>
Signed-off-by: Nilaan Gunabalachandran <ngunabal@codeaurora.org>
2020-12-17 09:58:38 -05:00
Samantha Tran
e199ecbfb8 disp: msm: remove debugfs_create_u32 return value
Commit 2b07021a940c ("debugfs: remove return value
of debugfs_create_u32()") removes the return value
from debugfs_create_u32. This change updates the msm
driver to remove cehcks on this return and corrects
for unnecessary line wraps.

Change-Id: I8d50dd7168921edfb2d5edad13941f91117d3c30
Signed-off-by: Samantha Tran <samtran@codeaurora.org>
Signed-off-by: Nilaan Gunabalachandran <ngunabal@codeaurora.org>
2020-12-17 09:58:38 -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
qctecmdr
2cff4ac8e7 Merge "disp: msm: register rotator platform driver after genpd init" 2020-09-28 04:39:41 -07: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
Yashwanth
af9841fa44 disp: msm: enable SDE rotator driver configs for GKI
This change enables and exports configs to support SDE
offline rotator in GKI. It also removes unused ioctls
for rotator compilation with GKI config.

Change-Id: I7f67aec394f644478173dcfe9e3ff52fe9129615
Signed-off-by: Yashwanth <yvulapu@codeaurora.org>
2020-09-25 14:32:24 +05:30
Raviteja Tamatam
74dd4682cd disp: msm: sde rotator driver configs for probe only
Added code for dummy probe defined under
CONFIG_SDE_ROTATOR_INIT_ONLY to address cases where
rotator device node is defined but driver needs to be
disabled. This is stop gap arrangement until v4l2
configs are available in GKI.

Change-Id: I069b37f818d2e4401b3992f1f1e308858a7e29e6
Signed-off-by: Raviteja Tamatam <travitej@codeaurora.org>
2020-09-25 13:49:23 +05:30
Zhao, Yuan
d9c2a8d3a6 disp: msm: disable regulator load after the regulator was disabled
Setting a lower load can make the regulator enter into LPM. Now the
lower load was set before the regulator disable, there's a risk here.
The regulator has been LPM, while it was not disable, if the cosumer
has a higher current needed than LPM at this time, that will lead OCP
on this regulator. The right operation for a regulator enable/disable
should be:
 1. regulator_set_voltage(vreg, active_min_uV, active_max_uV) and
    regulator_set_load(vreg, active_load_uA); in either order
 2. regulator_enable()
 3. regulator_disable()
 4. regulator_set_voltage(vreg, inactive_min_uV, inactive_max_uV)
    and regulator_set_load(vreg, inactive_load_uA); in either order

Change-Id: Ibe4f888a5675baf2691e479daa163d8867902e69
Signed-off-by: Zhao, Yuan <yzhao@codeaurora.org>
2020-09-22 00:45:36 -07:00
qctecmdr
6d59f959d3 Merge "disp: rotator: modify the args for sid switch call" 2020-09-10 03:35:50 -07:00
qctecmdr
32c625dba0 Merge "disp: rotator: add ubwc plane atomic check in rotator" 2020-09-09 02:29:19 -07:00
Mahadevan
6987497452 disp: rotator: set ib, ab bandwidth votes in KBps for interconnect
icc_set_bw api requires ib, ab votes to be in KBps.
The votes received from the userspace will be in the order
of Bps. This change makes the conversion from Bytes to
KiloBytes before applying vote on interconnect path.

Change-Id: I1c02e91be91bda7dcbfe058f3681034a12aedbc5
Signed-off-by: Mahadevan <mahap@codeaurora.org>
2020-09-08 16:01:45 +05:30
Yashwanth
f4ce8b66ce disp: rotator: add ubwc plane atomic check in rotator
In some targets with offline rotator, ubwc might not be
supported. For those cases, this change adds ubwc
verification for plane during atomic check to prevent
crash.

Change-Id: Ie24a7ba823773204062993996746aa08171fe90f
Signed-off-by: Yashwanth <yvulapu@codeaurora.org>
2020-09-08 13:56:55 +05:30
Yashwanth
d71039da0a disp: rotator: modify the args for sid switch call
Modify the size of SID's passed as an argument during
scm call as per client requirement.

Change-Id: I84bbd1e034ba6dcd8ded1ddf3913a735a2139663
Signed-off-by: Yashwanth <yvulapu@codeaurora.org>
2020-09-07 22:54:31 +05:30
Raviteja Tamatam
4e007479a6 disp: msm: update uapi and device_caps change in rotator
Added uapi and device_caps changes to enable rotator
compilation and address video device registration failure.
Device_caps field is must for video device registration
unless it is sub device.

Change-Id: I7e2f517e5eb3fc5ec6306bd7cee5972dbbaff3d1
Signed-off-by: Raviteja Tamatam <travitej@codeaurora.org>
2020-07-29 19:59:55 +05:30
qctecmdr
5cd8505102 Merge "disp: remove kernel mapping of writeback framebuffer" 2020-07-24 02:22:42 -07:00
qctecmdr
7c4ab87985 Merge "disp: msm: make rotator in msm_drm module" 2020-07-20 22:06:27 -07:00
qctecmdr
202cacbbc6 Merge "msm: disp: rotator: changes to enable rotator on 5.4 kernel" 2020-07-20 22:06:26 -07:00
Raviteja Tamatam
0a0acb4162 msm: disp: rotator: changes to enable rotator on 5.4 kernel
Few v4l2_ioctl_ops are deprecated on kernel upgrade. Made
changes to use the new simulated ops. Addressed compilation
issues on enabling rotator on 5.4 kernel.

Change-Id: I37add012306da433c4d7f8aaada3089b6ecdd819
Signed-off-by: Raviteja Tamatam <travitej@codeaurora.org>
2020-07-13 13:33:53 +05:30
Krishna Manikandan
8303bc2669 disp: rotator: add rev checks for rotator for holi target
Add revision checks required for rotator for holi
target.

Change-Id: Ie35d888d7681c97d681e2b2d6b564e0a7e1f11f2
Signed-off-by: Krishna Manikandan <mkrishn@codeaurora.org>
2020-07-13 11:23:45 +05:30
Raviteja Tamatam
a36cdf6368 disp: msm: make rotator in msm_drm module
Make msm_drm into single module where rotator
is not separately compiled as different object.

Change-Id: I534cc19e6762c8584b6b87c2246b07beb85f84f4
Signed-off-by: Raviteja Tamatam <travitej@codeaurora.org>
2020-07-10 14:49:26 +05:30
Narendra Muppalla
472784dfdd disp: remove kernel mapping of writeback framebuffer
This change removes the fb_kmap debugfs node along with kernel
mapping of writeback framebuffer. It also replaces dma_buf_kmap
calls with dma_buf_vmap.

Change-Id: I2fbee7fa5922071f6805d8e6df540ce87056bc0b
Signed-off-by: Narendra Muppalla <NarendraM@codeaurora.org>
2020-07-07 14:22:14 -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
Samantha Tran
50c2183779 display: fix compilation when CONFIG_DEBUG_FS is disabled
Fix compilation error when CONFIG_DEBUG_FS is disabled in
kona-perf_defconfig.

Change-Id: I7f6e942e4af9fab1e3cb9fe053401a241597a81f
Signed-off-by: Prateek Sood <prsood@codeaurora.org>
Signed-off-by: Samantha Tran <samtran@codeaurora.org>
2020-04-20 10:14: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
Yashwanth
f4dc9fb0dc disp: rotator: remove setting secure domain attribute at probe
This change removes setting attribute call at probe since it gets
pre-initialized from smmu.

Change-Id: I8c434e9d88ecf36e0cf033798c52613e14e2faba
Signed-off-by: Yashwanth <yvulapu@codeaurora.org>
2020-03-29 09:55:20 -07:00
Kalyan Thota
0380f4bd90 msm:disp:rotator: setup irq during first rotator commit
Move the rotator irq registration from probe to first commit, as the
irq is available only after bind on the mdss master device.
The late bind is causing rotator driver to get defered multiple times
and on some occasions rotator probe is not called as its stuck in
the deferred probe list.

Change-Id: Ieff99b31c42d2c9cbc0a4097de7afc9f1b29df77
Signed-off-by: Kalyan Thota <kalyant@codeaurora.org>
2020-03-29 09:50:47 -07:00
Jayaprakash
975f864784 disp: rotator: update ot limits for kona family
Update rotator ot limits as per QOS recommendation.

Change-Id: I852155902149dc2518b78144658b96f9ee8b4b4d
Signed-off-by: Jayaprakash <jmadiset@codeaurora.org>
2020-03-28 23:06:21 -07:00
Steve Cohen
7fe084620e disp: msm: sde: use devm_kzalloc for debug dumps
Upstream has added an "enhancement" to the DMA allocator to
reject coherent allocations less than a a full page, so allocate
device managed memory instead of artificially inflating the
buffer sizes. This has the added benefit of having this memory
automatically freed when the module is unloaded, avoiding
possible leaks.

Change-Id: I653f2cd1f06f1a352cd61e36ea8baaf7c30efd98
Signed-off-by: Steve Cohen <cohens@codeaurora.org>
2020-03-16 19:56:33 -04:00
Prasad Sodagudi
91721d8d2f disp: Update secure world communication from display
As scm_call2 is deprecated, update the secure world
communication.

Change-Id: Id971b2b71af9203340eab892d6a3398dbb943370
Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
Signed-off-by: Abhijit Kulkarni <kabhijit@codeaurora.org>
2019-12-16 22:13:00 -08:00
Linux Build Service Account
8e2dde8420 Merge changes If37ec780,Ia691c95d into display-kernel.lnx.1.0
* changes:
  disp: msm: sde: remove sde wrapper for clock set flags
  Disp: Snapshot change for lahaina display driver
2019-12-04 17:27:51 -08:00
Yuan Zhao
f3553ab628 disp: msm: rotator: migrated the new BUS driver for rotator on lahaina
Migrate to icb framework API in drm and rotator driver. The change also
removes msm_bus custom API usage from both drivers.

Change-Id: I15de82986204a12e4cc124f51793328c3d403256
Signed-off-by: Yuan Zhao <yzhao@codeaurora.org>
2019-12-03 18:46:57 -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
Yashwanth
62c9902935 disp: add rev checks for bengal target
Add revision checks to support bengal target
for dpu and rotation driver.

Change-Id: I7eb8bd2943b94ab246889b1f74cd9613aeee2b2f
Signed-off-by: Yashwanth <yvulapu@codeaurora.org>
2019-11-12 16:15:28 +05:30
Ravikanth Tuniki
1e60728ab8 disp: msm: sde: Fix 32-bit compilation issues
1.Typecast to avoid distinct pointer type comparison
2.Keep DMA mask aligned with api definition.
3.Add Suffix for literals
4.Remove multfrac func to avoid uncompatible division.
5.64-bit division( operator "/") on 32-bit platforms is not supported.
  Using platform independent API's here

Change-Id: I0e7305418e53876bd1adf00c1963f85cbdf980cc
Signed-off-by: Ravikanth Tuniki <rtunik@codeaurora.org>
2019-10-24 14:48:40 +05:30
Nilaan Gunabalachandran
65816e932b disp: msm: Decouple techpack components
Decouple each subcomponent by checking config flags during
compilation.
Add handling inside rotator debug to decouple event logging.

Change-Id: I3ac60444f9d18e20c28232324023e561a7aa4f96
Signed-off-by: Nilaan Gunabalachandran <ngunabal@codeaurora.org>
2019-07-29 09:57:06 -07:00
qctecmdr
ea1ed2c7fc Merge "msm/sde/rotator: Initialise rotator module after MDP module init" 2019-06-28 22:04:04 -07:00
Shubhashree Dhar
2179aedbdc msm/sde/rotator: Remove deprecated SMMU api's in rotator driver.
Remove deprecated smmu api's and add support for new api's
in rotator driver.

Change-Id: Ib7a3f48fe22867725e1224caf3489bf47044e37b
Signed-off-by: Shubhashree Dhar <dhar@codeaurora.org>
2019-06-27 14:21:21 +05:30
Shubhashree Dhar
944b545245 msm/sde/rotator: Initialise rotator module after MDP module init
Doing late initialization of rotator module since it depends
upon providers which are initialized during msm bind time.
Hence, calling rotator module init only after msm module
init is complete.

Change-Id: I15ea08251c639cf121e9bed1d7bd579ade78cd12
Signed-off-by: Shubhashree Dhar <dhar@codeaurora.org>
2019-06-20 13:07:26 +05:30
Samantha Tran
d025293ae2 disp: correct secure id to hold vaddr
This change corrects the secure id to hold vaddr
instead of paddr.

Change-Id: I021f5c0c7708eb2a0b166fe3a6c13b11aaf33419
Signed-off-by: Samantha Tran <samtran@codeaurora.org>
2019-05-28 10:46:31 -07:00
qctecmdr
3cc8b0cd16 Merge "disp: snapshot of offline rotator" 2019-05-10 18:52:56 -07:00
Samantha Tran
e2e554bc4d disp: snapshot of offline rotator
This snapshot includes updates to offline rotator and supporting
files. Snapshot was taken from msm-4.14 as of commit 0f8fb25421ff
("cnss2: Add device version to SOC info structure").

Change-Id: I58674ba880de3d8722ed9119bfc2bee34b444917
Signed-off-by: Samantha Tran <samtran@codeaurora.org>
2019-04-22 14:04:59 -07:00