提交線圖

169 次程式碼提交

作者 SHA1 備註 日期
Haritha Chintalapati
facbe0251d Merge "msm: camera: reqmgr: Only do self-correction at SOF" into camera-kernel.lnx.5.0 2021-04-30 17:31:05 -07:00
Camera Software Integration
18e3dd6a8e Merge "msm: camera: reqmgr: Propagate hw failures to user" into camera-kernel.lnx.5.0 2021-04-28 21:22:50 -07:00
Camera Software Integration
639f9c82b4 Merge "msm: camera: reqmgr: Remove debug flags when creating timer slab" into camera-kernel.lnx.5.0 2021-04-28 21:22:46 -07:00
Depeng Shao
924246efa3 msm: camera: reqmgr: Only do self-correction at SOF
Since the SOF timestamp is only updated at SOF,
so we can't do self-correction at EOF. When the
frames already in sync, but the req is a EOF
triggered req, then the req can't be applied at
SOF, but it will fail to pass self-correction
checking at EOF. Then we will loop this progress,
the req can't be applied anymore.

CRs-Fixed: 2930497
Change-Id: I079cbd3cb9ac9541f049c5369baeee831f7444a2
Signed-off-by: Depeng Shao <depengs@codeaurora.org>
2021-04-26 18:27:25 -07:00
Jigar Agrawal
76857940be msm: camera: reqmgr: Propagate hw failures to user
Propagate error code to user in order to let the
user know more about the failure.

CRs-Fixed: 2860306
Change-Id: Icf030aa9df32eac97371059c2d282cfb53257401
Signed-off-by: Jigar Agrawal <jigar@codeaurora.org>
2021-04-19 19:07:15 -07:00
Jigar Agrawal
5992dd4885 msm: camera: common: Fix NULL pointer dereference
Set the debugfs root entry pointer to null after
recursive remove at unbinding to prevent null pointer
dereference by kernel followed by kernel panic. Also,
add checks to avoid null pointer dereference.

CRs-Fixed: 2920490
Change-Id: I5a4f44f3d8f533f3a51e108472d5ccf93c261a98
Signed-off-by: Jigar Agrawal <jigar@codeaurora.org>
2021-04-19 11:25:07 -07:00
Haritha Chintalapati
d62972c20f Merge "msm: camera: common: Use the appropriate header for spinlock" into camera-kernel.lnx.5.0 2021-04-14 19:20:47 -07:00
Karthik Anantha Ram
18485ef697 msm: camera: reqmgr: Remove debug flags when creating timer slab
Remove all the debug flags in cache create call. The change
also adds the destroy call during unbind for consistency.

CRs-Fixed: 2841729
Change-Id: I2e0a0e4f2ec9191a3159d77892ff292a0a3cc131
Signed-off-by: Karthik Anantha Ram <kartanan@codeaurora.org>
2021-04-14 14:30:17 -07:00
Haritha Chintalapati
29eebb1ebf Merge "msm: camera: common: NULL pointer and array fixes" into camera-kernel.lnx.5.0 2021-04-13 19:29:45 -07:00
Karthik Anantha Ram
9f4f8e114c msm: camera: common: Use the appropriate header for spinlock
With the allow list tightened, use the right header for spinlock
usage. Change replaces usage of linux/spinlock.h to
linux/spinlock_types.h.

CRs-Fixed: 2841729
Change-Id: I0247501b765436099f75c9725e9f614f0873c888
Signed-off-by: Karthik Anantha Ram <kartanan@codeaurora.org>
2021-04-12 14:42:58 -07:00
Depeng Shao
5e48beb98b msm: camera: reqmgr: Reset the status for next req if bubble
If req#N in slot idx, and this req meets bubble issue,
then the req#(N+1) in slot (idx+1) may also be applied,
and its status is APPLIED. If req#(N+1) applies failed
after finishing bubble recovery due to some reasons,
but we still can move to next slot since the status of
slot (idx+1) is already APPLIED. This change resets
the status of slot (idx+1) to ADDED if it is APPLIED
during processing error.

CRs-Fixed: 2902809
Change-Id: I32f318569ad8f24fdf0f324603f4ea0036867e98
Signed-off-by: Depeng Shao <depengs@codeaurora.org>
2021-04-05 12:26:09 +08:00
Karthik Jayakumar
67707a7305 msm: camera: common: NULL pointer and array fixes
Fix NULL pointer checks in cam_mem dma_buf functions.
Fix local array bounds check for cam_vfe_top_set_axi_bw_vote.

CRs-Fixed: 2906570
Change-Id: Ib41223ad56cbb5618d73e8aa6907907dd6f8f4fb
Signed-off-by: Karthik Jayakumar <kjayakum@codeaurora.org>
2021-03-31 20:49:27 -07:00
Savita Patted
5e47b695d8 Merge "msm: camera: memmgr: Add support for secure allocations" into camera-kernel.lnx.5.0 2021-03-29 18:41:03 -07:00
Pavan Kumar Chilamkurthi
4def5ba7ab msm: camera: memmgr: Add support for secure allocations
Add secure allocation support with dma buf heaps.

CRs-Fixed: 2904440
Change-Id: Ide01e228d2ca4c7cde85eea5a6eef565c3c7d183
Signed-off-by: Pavan Kumar Chilamkurthi <pchilamk@codeaurora.org>
2021-03-21 00:09:15 -07:00
Depeng Shao
a8fce31f3f msm: camera: reqmgr: Handle flash properly
Apply the flash at EOF and apply the other devices
at the EPOCH of next frame, then the flash can
cover all the exposure zone of current request.
Add the inject delay for SOF and EOF separate,
then we can use inject delay for more flexible
frame skip control.

CRs-Fixed: 2820683
Change-Id: Ic6a58327a0ae44c54190884ba42ea7926ec7c90e
Signed-off-by: Depeng Shao <depengs@codeaurora.org>
2021-03-18 15:30:48 +08:00
Savita Patted
0bb300ac41 Merge "msm: camera: reqmgr: Mask re-apply for SHDR usecase" into camera-kernel.lnx.5.0 2021-03-16 17:40:26 -07:00
Depeng Shao
b4d2d77fb9 msm: camera: reqmgr: Reset the trigger cnt when trigger cnt mismatch
In sHDR case, the trigger cnt may be different when one of the IFE
meet bubble or irq delay issue, then reset the trigger cnt when
we find the trigger cnt is different.

CRs-Fixed: 2857614
Change-Id: Ie02fd7204bebd16d32d7a277ac1f2e45f8357dd9
Signed-off-by: Depeng Shao <depengs@codeaurora.org>
2021-03-12 23:42:28 -08:00
Depeng Shao
1edfd82801 msm: camera: reqmgr: Mask re-apply for SHDR usecase
SHDR case has two ISP instances, if one of them
apply req failed sometimes, but the other one is
good and the buf done has been handled successfully,
then we don't need to apply the req again for the
successful ISP.

CRs-Fixed: 2842495
Change-Id: I3dfbb455244daa0d155858dd59f4a661fd3b87cd
Signed-off-by: Depeng Shao <depengs@codeaurora.org>
2021-03-12 23:42:05 -08:00
Savita Patted
9700a809d3 Merge "msm: camera: reqmgr: check validity of last_applied_idx" into camera-kernel.lnx.5.0 2021-03-09 20:17:04 -08:00
Savita Patted
31f9a65293 Merge "msm: camera: common: Add appropriate camera initialization log" into camera-kernel.lnx.5.0 2021-03-09 01:32:24 -08:00
Savita Patted
72d6f26c7a Merge "msm: camera: common: Add common wait and poll interface" into camera-kernel.lnx.5.0 2021-03-09 01:29:50 -08:00
Mukund Madhusudan Atre
fa19532b36 msm: camera: common: Add appropriate camera initialization log
Currently, the camera initialization log only points to the
camera initcalls execution. The camera driver is initailized when
all components are bound succussfully in CRM master bind. Add
appropriate log to convey correct info.

CRs-Fixed: 2841729
Change-Id: I5a52ad9fdf84d79d66763d47c92d2a63bb8d0e21
Signed-off-by: Mukund Madhusudan Atre <matre@codeaurora.org>
2021-03-05 10:35:04 -08:00
Gaurav Jindal
bc400e47fa msm: camera: common: Add common wait and poll interface
In current implementation, each driver call wait_for_completion_timeout
and readl_poll_timeout with own timeout values.
In case of slow environments like presil, lot of hacks are needed to
change the timeouts for each driver. It needs multiple code changes
and compilations, thus consuming time.
This commit implements a common interface to call
wait_for_completion_timeout and readl_poll_timeout.
Debug variable is also introduced to
change the timeout value. This will help to change the timeout
without compilations and changes at multiple places.

Change-Id: Iba51e0805a49ed325147a12688c2fe6619bb68e6
CRs-Fixed: 2830502
Signed-off-by: Gaurav Jindal <gjindal@codeaurora.org>
2021-03-02 14:17:09 +05:30
Karthik Anantha Ram
66fa513e7b msm: camera: common: Program scratch buffers for sHDR
In case of sHDR to have a continuous flow of frames,
program scratch buffer even if there are no pending
requests to apply.

CRs-Fixed: 2841729
Change-Id: I8015a3a184751b2a772db55c35b02de380f04491
Signed-off-by: Karthik Anantha Ram <kartanan@codeaurora.org>
2021-03-01 16:38:48 -08:00
Tejas Prajapati
f2e4175ff2 msm: camera: reqmgr: check validity of last_applied_idx
last_applied_idx is updated on every successful applied
request and the buf_done. After buf_done last_applied_idx
is set to -1. While accessing last applied req the same
index is used, if the last_applied_idx is -1 accessing
last applied request will result in slab out of bound
error, so check last_applied_idx before accessing
last applied request.

CRs-Fixed: 2840329
Change-Id: I8f49b9df097859cde20e651149167db7316976bb
Signed-off-by: Tejas Prajapati <tpraja@codeaurora.org>
2021-02-24 22:37:59 -08:00
Depeng Shao
4591949a37 msm: camera: reqmgr: Pause the timer before sensor stream on
Sometimes, the cpu load is very high, then the devcies
stream on will be delayed, but the CRM watchdog is already
enabled before streaming on, then we will have a chance to
notify SOF freeze issue.
This change pauses the CRM watchdog timer before streaming
on sensor and after stopping ife, when we can detect the
stream on and stream off delay, but don't notify error,
also can detect the real SOF freeze issue.

CRs-Fixed: 2804587
Change-Id: Iccaee837930ea22290b109eff45b05300d844312
Signed-off-by: Depeng Shao <depengs@codeaurora.org>
2021-02-23 11:01:43 -08:00
Haritha Chintalapati
893431ebc3 Merge "msm: camera: req_mgr: Debugfs API update" into camera-kernel.lnx.5.0 2021-01-25 14:14:09 -08:00
Haritha Chintalapati
e22c0e60b4 Merge "msm: camera: req_mgr: Update V4L2 enum names for Waipio" into camera-kernel.lnx.5.0 2021-01-25 14:12:57 -08:00
Karthik Jayakumar
8615106476 msm: camera: req_mgr: Update V4L2 enum names for Waipio
V4L2 driver macro VFL_TYPE_GRABBER has been renamed to VFL_TYPE_VIDEO
in linux kernel 5.8+.

CRs-Fixed: 2835738
Change-Id: Iaddec45b3532094a110e386c6462f08c36a5fd21
Signed-off-by: Karthik Jayakumar <kjayakum@codeaurora.org>
Signed-off-by: Jeyaprakash Soundrapandian <jsoundra@codeaurora.org>
Signed-off-by: Karthik Jayakumar <kjayakum@codeaurora.org>
2021-01-22 10:22:38 -08:00
Pavan Kumar Chilamkurthi
fa9be8c725 msm: camera: icp: Add fw uncached region support in icp smmu
Use fw_uncached region instead of secondary heap region. Pass
this region information to FW through CSR registers.
Allocate Qtlb, cmd_q, msg_q, dbg_q from fw_uncached region
instead of shared mem region. Allocate Sec heap also from
fw uncached region instead of its own dedicated region.

CRs-Fixed: 2722486
Change-Id: Ib88b2202ca1b610946c712fcca936b72d4eecd15
Signed-off-by: Pavan Kumar Chilamkurthi <pchilamk@codeaurora.org>
Signed-off-by: Karthik Anantha Ram <kartanan@codeaurora.org>
2021-01-20 17:13:30 -08:00
Pavan Kumar Chilamkurthi
6f4df6ad50 msm: camera: memmgr: Add 4K padding for shared buffers
Due LX7 cache requirement, buffers need 4K padding at the
end. Allocate accordingly, this is hidden from user mode
driver and umd never uses this extra 4K memory.

CRs-Fixed: 2722486
Change-Id: I3b327ab3615eee30d17c95e23703024ff7446648
Signed-off-by: Pavan Kumar Chilamkurthi <pchilamk@codeaurora.org>
Signed-off-by: Karthik Anantha Ram <kartanan@codeaurora.org>
2021-01-20 17:12:14 -08:00
Karthik Jayakumar
e34f0768f2 msm: camera: req_mgr: Debugfs API update
Kernel 5.5+ changed debugfs API's for creating simple dentry variables.
There is now no return value for those API's.

CRs-Fixed: 2835738
Change-Id: Ic5eea63f2e94451e5dfb211cb2b4aa80ce47073a
Signed-off-by: Karthik Jayakumar <kjayakum@codeaurora.org>
2021-01-20 11:32:25 -08:00
Pavan Kumar Chilamkurthi
68eda98831 msm: camera: memmgr: Add dma-buf-heaps usage in camera
Use dma-buf-heaps for allocating buffers. Keep ion usage
to support kernels without dma-buf-heaps support.

CRs-Fixed: 2852327
Change-Id: I3ebcb591827d9b8e5366f716efd08e4cd6f1070a
Signed-off-by: Pavan Kumar Chilamkurthi <pchilamk@codeaurora.org>
2021-01-13 01:06:14 -08:00
Pavan Kumar Chilamkurthi
7f497cf736 msm: camera: memmgr: Re-structure ion alloc usage
Consolidate ion usage functions and bring all ion related
usage into one single function. This helps to easily
write a different allocation wrapper in case a new allocator
need to be used in future.

CRs-Fixed: 2852327
Change-Id: I717ee5a976ae0f148dcdd5a050204514566c823d
Signed-off-by: Pavan Kumar Chilamkurthi <pchilamk@codeaurora.org>
2021-01-11 20:28:01 -08:00
Camera Software Integration
0a3df107d1 Merge "msm: camera: smmu: Add support to force all CACHED" into camera-kernel.lnx.4.0 2020-12-10 11:02:22 -08:00
Haritha Chintalapati
2d6e45797c Merge "msm: camera: reqmgr: check applied req id for sync mode" into camera-kernel.lnx.4.0 2020-12-02 19:09:10 -08:00
Haritha Chintalapati
56434293e9 Merge "msm: camera: common: Improve IFE and CRM Logging" into camera-kernel.lnx.4.0 2020-12-02 19:08:56 -08:00
Haritha Chintalapati
010a1e1426 Merge "msm: camera: reqmgr: Rate limit workq delay warning" into camera-kernel.lnx.4.0 2020-11-23 16:54:22 -08:00
Haritha Chintalapati
cf0971359d Merge "msm: camera: reqmgr: update timer even after skip frame" into camera-kernel.lnx.4.0 2020-11-23 16:54:03 -08:00
Haritha Chintalapati
35c58f9297 Merge "msm: camera: reqmgr: Add checks before reporting the error" into camera-kernel.lnx.4.0 2020-11-20 14:15:03 -08:00
Karthik Anantha Ram
b1c38c6f5a msm: camera: reqmgr: Rate limit workq delay warning
Rate limit log that indicates workq delay to reduce logging
impact.

CRs-Fixed: 2823945
Change-Id: I5954d5d08250955455003937e6490e4499a67378
Signed-off-by: Karthik Anantha Ram <kartanan@codeaurora.org>
2020-11-20 10:38:52 -08:00
Tejas Prajapati
b3673cb6b9 msm: camera: reqmgr: update timer even after skip frame
If Nth request has additional exposure timeout, after
applying sensor settings for Nth request; CRM watchdog
timer should be updated with the Nth requests additional
timeout on next frame irrespective of skip frame to
avoid sof freeze.

CRs-Fixed: 2802634
Change-Id: Iae70df66f0a1c22c2410e4826aea964ffd6d887b
Signed-off-by: Tejas Prajapati <tpraja@codeaurora.org>
2020-11-18 20:54:02 -08:00
Ravikishore Pampana
e9fb6cfda6 msm: camera: reqmgr: Add checks before reporting the error
Add the null check for dev parameter before reporting the error on
link. Certain corner scenario for flash, send request return native
value in that case dev parameter could be null.

CRs-Fixed: 2814597
Change-Id: Ibe08f12c2f2c1864c46b17b0ae0f8df5c5648d35
Signed-off-by: Ravikishore Pampana <rpampana@codeaurora.org>
2020-11-17 06:06:25 -08:00
Shravya Samala
99eaacc2c2 msm: camera: utils: Rate limit error log in case of invalid handles
Rate limit errors logs in case of incoming invalid handles
from userspace.

CRs-Fixed: 2807712
Change-Id: I3f8765be2f07f869149b9315ab38b7d02ae71a58
Signed-off-by: Shravya Samala <shravyas@codeaurora.org>
2020-11-16 02:33:52 -08:00
chengxue
69fbe4cf55 msm: camera: reqmgr: check applied req id for sync mode
While links out of sync, one link faster than another.
the early link reset its slot while receive trigger from
isp, and the slow link will check ready always fail
on sync link, and stuck happens.

CRs-Fixed: 2800759
Change-Id: If615828304947d79ecbb2c87f03af29824598be0
Signed-off-by: chengxue <chengxue@codeaurora.org>
2020-11-10 23:05:00 -08:00
Jigar Agrawal
05abdc71b0 msm: camera: common: Improve IFE and CRM Logging
Improve IFE acquire logging and CRM SOF Freeze logging
for better debugging.

CRs-Fixed: 2812910
Change-Id: Ice9638872c9cf540b8721cd07f3d0c6b1f4b3bd4
Signed-off-by: Karthik Anantha Ram <kartanan@codeaurora.org>
Signed-off-by: Jigar Agrawal <jigar@codeaurora.org>
2020-11-10 16:56:07 -08:00
Pavan Kumar Chilamkurthi
a702cc226a msm: camera: smmu: Add support to force all CACHED
Add implementation to allow forcing all camera buffer allocations
to be CACHED and mapped as CACHED while iommu_map. This
is enabled based on DT property. Force this only if
io-coherency is enabled. Validations are added to make sure
a correct combination of "force_cache" and "io-coherency"
properties are mentioned in DT.

CRs-Fixed: 2814719
Change-Id: I0d291ce199f523d67e8cd0105386cc63a671806e
Signed-off-by: Pavan Kumar Chilamkurthi <pchilamk@codeaurora.org>
2020-11-08 14:07:43 -08:00
Karthik Anantha Ram
de3c732e6c msm: camera: reqmgr: Remove idx check when detecting congestion
Remove last applied idx check when detecting workq delays.

CRs-Fixed: 2801863
Change-Id: I85fe5aa9af446b25a3dd139a75cf1ed6b2a1253c
Signed-off-by: Karthik Anantha Ram <kartanan@codeaurora.org>
2020-11-06 10:10:24 -08:00
Haritha Chintalapati
792be0d9c4 Merge "msm: camera: reqmgr: Fix timing issue while destroying the session" into camera-kernel.lnx.4.0 2020-11-05 14:02:08 -08:00
zhuo
ee8e8ee884 msm: camera: reqmgr: Fix timing issue while destroying the session
During destroying the session, sof freeze timeout happens
after destroying workqueue. Then sof freeze timeout callback
will access workqueue causing use after free memory issue.
This change invokes destroying timer prior to workqueue.

CRs-Fixed: 2807936
Change-Id: I1f0dcb7a03fbf802f4ec872727e3b627a78f56f8
Signed-off-by: zhuo <zhuo@codeaurora.org>
2020-10-30 15:39:24 +08:00