Commit Graph

119 Commits

Author SHA1 Message Date
Wyes Karny
22004e3a95 msm: camera: reqmgr: Move skip frame log to rate limit for WQ congestion
In the case of workqueue congestion move the skip frame logs to
rate info limit.

CRs-Fixed: 2800932
Change-Id: I96988ff73ae182d55eb3f3d15de9b02f13c34b39
Signed-off-by: Wyes Karny <wkarny@codeaurora.org>
2020-10-29 15:38:13 +05:30
Camera Software Integration
dc33d7705c Merge "msm: camera: reqmgr: Add protection while destroying the link" into camera-kernel.lnx.4.0 2020-10-28 13:28:03 -07:00
Vikram Sharma
0bc1d52785 msm: camera: reqmgr: Add protection while destroying the link
This change handles a race while destroying session. Protecting the
session destroy with session lock.

CRs-Fixed: 2799907
Change-Id: Ia1f90a56f6bfed00439b8012e41bfae9e8f739a3
Signed-off-by: Vikram Sharma <vikramsa@codeaurora.org>
2020-10-27 12:27:11 +05:30
Jigarkumar Zala
96a10ecb42 msm: camera: common: Enable flash operation at EOF
Flash operation is currently being done at EPOCH timeframe. In order
to support flash operation at EPOCH extra frame needs to skip to avoid
partial lit on previous request. Moving flash operation to EOF saves
one frame and also give more stability to perform the operation with
higher stablility with removing partial lit. This change gives flash
hardware extra time to perform the operation for turn on/off the flash
hardware.

CRs-Fixed: 2795719
Change-Id: I08b82527006d8a9c81c5a5be0768705051cbd3f1
Signed-off-by: Jigarkumar Zala <jzala@codeaurora.org>
Signed-off-by: Depeng Shao <depengs@codeaurora.org>
2020-10-23 14:56:38 -07:00
Tejas Prajapati
4574450a12 msm: camera: common: Merge camera-kernel.3.1 changes in camera-kernel.4.0
msm: camera: cdm: Fix dangling pointer issue
msm: camera: cdm: change work record to atomic variable
msm: camera: utils: Adding device type to track device handles
msm: camera: tfe: Reduce stack footprint during bw vote
msm: camera: req_mgr: Thread switch delay detection mechanisms
msm: camera: cdm: Avoid submitting BL if FIFO is full
msm: camera: tfe: check cdm hang in the tfe config timeout
msm: camera: req_mgr: Delay detection mechanism
msm: camera: cdm: Debug info in case of cdm page fault
msm: camera: isp: Max context reduction for TFE in isp driver
msm: camera: ope: Maintain current clock value during acquire
msm: camera: req_mgr: Limit CAM_ERR log in case of no empty task
msm: camera: cdm: Decrement write-count only after Bl commit
msm: camera: isp: Added CSID recovery mechanism.

CRs-Fixed: 2792394
Change-Id: I1c7a903ae15b572acf3f6318cda7394cb6549c8d
Signed-off-by: Tejas Prajapati <tpraja@codeaurora.org>
2020-10-13 12:08:01 +05:30
Camera Software Integration
50f5e56dc3 Merge "msm: camera: reqmgr: Fix for apply stuck issue for pd 1 device" into camera-kernel.lnx.4.0 2020-10-07 12:46:06 -07:00
Camera Software Integration
36a18d2201 Merge "msm: camera: reqmgr: Reset the number of sync links" into camera-kernel.lnx.4.0 2020-10-06 12:28:31 -07:00
Camera Software Integration
315368fc57 Merge "msm: camera: memmgr: Add error handling get slot failure" into camera-kernel.lnx.4.0 2020-10-06 12:28:17 -07:00
Wyes Karny
49ea8fb393 msm: camera: reqmgr: Fix for apply stuck issue for pd 1 device
In a edge case if there are only pd 1 devices then avoid reset
slot if last buf done req if last applied req. If rd_idx is equal to
last bufdone index then reset previous slot. Based on max PD in the
link calculate max retry attempt before triggering recovery to UMD.
Also fill trigger information during notify error.

CRs-Fixed: 2776184
Change-Id: Ifabf660df7861b78e7801dc7eebe0c5e71908e74
Signed-off-by: Wyes Karny <wkarny@codeaurora.org>
2020-10-06 11:08:50 +05:30
Ravikishore Pampana
f5f9d74e97 msm: camera: core: Change the error logs to rate limited
In bubble cases and if not recovered, error logs causing
excessive logging issues. Change the error and warn logs to
rate limited in error bubble and apply failure cases.

CRs-Fixed: 2785070
Change-Id: Ia7268cfc7b672c24f3161cd65c53df5ee357e7ee
Signed-off-by: Ravikishore Pampana <rpampana@codeaurora.org>
2020-10-01 19:04:43 +05:30
Pavan Kumar Chilamkurthi
58588fb689 msm: camera: memmgr: Add error handling get slot failure
Not calling unmap_hw_va if get_slot() fails causes a stale
entry in smmu CB. since get_slot failed, memmgr table
returns error and memmgr, umd doesn't keep info about this
map entry though smmu CB still has this mapping - This
causes any further map calls on the same 'fd' as smmu
return MAP_EXISTS but CSL bookkeeping doesn't have it.

CRs-Fixed: 2788167
Change-Id: Ibb1450f089b9f175ccdbcfb4f5ecc245a5539bd1
Signed-off-by: Pavan Kumar Chilamkurthi <pchilamk@codeaurora.org>
2020-10-01 01:00:31 -07:00
Depeng Shao
6cd4af283f msm: camera: reqmgr: Reset the number of sync links
This change resets the number of sync links in
case unsync link fails due to any reason, which
will result in device crash, since the number of
sync links can be increased to an invalid value,
then we will get an invalid link.

CRs-Fixed: 2786144
Change-Id: I61bbac9849ce80c319de40ffae411f61c8deeaa9
Signed-off-by: Depeng Shao <depengs@codeaurora.org>
2020-09-28 16:23:31 +08:00
Camera Software Integration
64f7c57dce Merge "msm: camera: common: Handle epoch if bubble recovery is disabled" into camera-kernel.lnx.4.0 2020-09-18 13:51:27 -07:00
Depeng Shao
8e99e13a5a msm: camera: reqmgr: Add protection for workqueue congestion
When workqueue is congested, CRM may apply same
request to device which will trigger recovery
due to apply fails. This change prevent CRM
triggering recovery if the time interval of
continuous applying req less than 5ms.

CRs-Fixed: 2775372
Change-Id: I45c2ed76334b1bbf4547bbf21f90cf0a6c169323
Signed-off-by: Depeng Shao <depengs@codeaurora.org>
2020-09-16 10:06:16 +08:00
Karthik Anantha Ram
d9a20488d8 msm: camera: common: Handle epoch if bubble recovery is disabled
If bubble recovery is disabled, IFE driver should continue
to notify that epoch to CRM as opposed to dropping that frame
in IFE. In case of sHDR if bubble recovery is disabled and IFE
does not notify the epoch at which bubble was detected it will lead
to a trigger count mismatch in CRM.

CRs-Fixed: 2768309
Change-Id: I311ce80857a905496c633708a5f4ee2391679037
Signed-off-by: Karthik Anantha Ram <kartanan@codeaurora.org>
2020-09-15 13:43:04 -07:00
bohahuan
9d1e44a94f msm: camera: memmgr: increase max slot count into 2048
In case large memory slot usage scene like MFHDR, MFSR.
increase kernel slot count to avoid out of memory issue.

CRs-Fixed: 2718732
Change-Id: I49dd2d9bdda548d5f95fa49c290364ecb6d40f6e
Signed-off-by: bohahuan <bohahuan@codeaurora.org>
2020-09-08 19:56:32 -07:00
zhuo
334028442c msm: camera: memmgr: fix lack of condition lead to memory leak
When multi map fails, the first mapping does not unmap
due to lack of condition.

CRs-Fixed: 2768768
Change-Id: Ib61ce8f5a73e5c27b1b19bbd23d6649c62feb0da
Signed-off-by: zhuo <zhuo@codeaurora.org>
2020-09-03 16:01:24 +08:00
Camera Software Integration
992378c626 Merge "msm: camera: reqmgr: Workqueue congestion handling" into camera-kernel.lnx.4.0 2020-08-28 13:08:39 -07:00
Camera Software Integration
e475f14229 Merge "msm: camera: memmgr: reduce mutex lock duration" into camera-kernel.lnx.4.0 2020-08-28 13:07:20 -07:00
Depeng Shao
3de038d4a6 msm: camera: reqmgr: Workqueue congestion handling
When workqueue is congested, CRM may apply same
request to device which will trigger recovery
due to apply fails. This change prevent CRM
triggering recovery if the current idx is same
with last applied idx.

CRs-Fixed: 2761601
Change-Id: I6ccf44f050a18e8a2a35916f61513ad852e7bdee
Signed-off-by: Depeng Shao <depengs@codeaurora.org>
2020-08-26 23:07:26 +08:00
Alok Chauhan
23fc6a670c msm: camera: common: Define debugflag to allocate usecase info
Define debug flag to allocate usecase info for debug purpose.
This flag can be used to get usecase buffer index at issue
time.

CRs-Fixed: 2707314
Change-Id: Iffacdb48f77ec6907b8070d4c19eb1c56be30f14
Signed-off-by: Alok Chauhan <alokc@codeaurora.org>
2020-08-20 14:57:32 +05:30
Haritha Chintalapati
f91e158abf Merge "msm: camera: req_mgr: Support for 3 links in CRM" into camera-kernel.lnx.4.0 2020-07-27 13:39:06 -07:00
Ayush Kumar
bef2e958a1 msm: camera: req_mgr: Support for 3 links in CRM
Add third link to support 3 concurrent camera in
sync. This change contain support same max pipeline
delay and different max pipeline delay as well.

CRs-Fixed: 2723787
Change-Id: I25e50e8e9a19c4c306a01dd3b700f8a990f3eb66
Signed-off-by: Ayush Kumar <ayushkr@codeaurora.org>
2020-07-23 06:13:58 +05:30
Camera Software Integration
8c5f76e807 Merge "msm: camera: reqmgr: Defer probe when master is not ready" into camera-kernel.lnx.4.0 2020-07-22 15:36:34 -07:00
Mukund Madhusudan Atre
a7b73974d0 msm: camera: reqmgr: Defer probe when master is not ready
Some sensor drivers that are not slaves to CRM, can probe earlier
than the master bind call. Return EPROBE_DEFER when camera v4l2
root device is not ready.

CRs-Fixed: 2734061
Change-Id: I5a1162f38526fc7f95127b4163183aa66f213d8f
Signed-off-by: Mukund Madhusudan Atre <matre@codeaurora.org>
2020-07-21 09:37:13 -07:00
Karthik Anantha Ram
a358e14888 msm: camera: reqmgr: Allow requests to be submitted in IDLE state
Allow requests to be submitted by UMD and added by devices on
the link, irrespective of the link state.

CRs-Fixed: 2718108
Change-Id: Ie6a6f3576bc6aeb1657ee751dc72779cafec7ffe
Signed-off-by: Karthik Anantha Ram <kartanan@codeaurora.org>
2020-07-17 13:53:35 -07:00
Camera Software Integration
c8f19704d3 Merge "msm: camera: reqmgr: Update the dma_buf api usage" into camera-kernel.lnx.4.0 2020-07-16 13:26:41 -07:00
Jigarkumar Zala
093fcb7ceb msm: camera: reqmgr: Update the dma_buf api usage
dma_buf_kmap/kunmap is replaced with dma_buf_vmap/vunmap api, to
accommodate upstream driver.

CRs-Fixed: 2732008
Change-Id: Id6551d84ea09d91a18c64fbbca3a796f4eab0bb1
Signed-off-by: Jigarkumar Zala <jzala@codeaurora.org>
2020-07-14 11:23:00 -07:00
Depeng Shao
c782e8c3ab msm: camera: reqmgr: Add notify frame skip interface
This change adds support to notify frame skip when CRM
not ready to apply a normal setting. Sensor and custom
device also want to update the HW settings in some
conditions even if a frame is skipped.

CRs-Fixed: 2691642
Change-Id: Ibd2b22655d0f6b6c90663df75a0f5fad8565e918
Signed-off-by: Depeng Shao <depengs@codeaurora.org>
2020-07-14 18:45:30 +08:00
Jigarkumar Zala
402c0a500b msm: camera: req_mgr: Remove unwanted v4l2 operation
CCI hardware is no longer register as device node with v4l2 layer.
At time of notify message, there is missing check to read subdev
name, which cause the null pointer issue. This change removes
the sudbev node reading operation with devnode pointer as it is
not being use anywhere in functionality.

CRs-Fixed: 2702760, 2727771
Change-Id: Id362bd2edf4eea35f05115ae3a5b6c1d761bb437
Signed-off-by: Jigarkumar Zala <jzala@codeaurora.org>
2020-07-09 09:37:47 -07:00
Camera Software Integration
f4fbab5083 Merge "msm: camera: common: Return appropriate error code for cancelled requests" into camera-kernel.lnx.4.0 2020-07-08 12:20:07 -07:00
Haibin Liu
891c47b17e msm: camera: memmgr: reduce mutex lock duration
Allow concurrent calls to unmap buffer by reducing the
mutex lock duration, and allow same fd for mapping user iova,
use book keeping for user smmu.

CRs-Fixed: 2559879
Change-Id: Ic3c92d4fa0ca7d1c29e621172e0b058420e1501d
Signed-off-by: Haibin Liu <haibinl@codeaurora.org>
2020-07-08 16:47:27 +08:00
Camera Software Integration
fb8c7dbeb3 Merge "msm: camera: common: Enable debugfs compile check" into camera-kernel.lnx.4.0 2020-07-07 17:55:41 -07:00
Karthik Anantha Ram
cb24ba9b79 msm: camera: common: Return appropriate error code for cancelled requests
If a request is submitted post flush and the request ID of that
request is <= last flush req ID return an appropriate error code
to indicate the same.

CRs-Fixed: 2720555
Change-Id: Ic26c4fc5f0ba490ed277b3bb301cc02d1fa027d6
Signed-off-by: Karthik Anantha Ram <kartanan@codeaurora.org>
Signed-off-by: Mukund Madhusudan Atre <matre@codeaurora.org>
2020-07-02 10:54:15 -07:00
Karthik Jayakumar
7c8204a42d msm: camera: common: Enable debugfs compile check
Guards debugfs features in camera driver to only be compiled when
CONFIG_DEBUG_FS is enabled.

CRs-Fixed: 2717236
Change-Id: I0de77741301d259cbec64e8a2e27830981b2b69d
Signed-off-by: Karthik Jayakumar <kjayakum@codeaurora.org>
2020-07-01 10:59:24 -07:00
Karthik Anantha Ram
7a99d64ebf msm: camera: reqmgr: Skip wd timer update if there is no valid request
At a given point if there is no request to apply, carry forward
the same timeout value for the wd timer. Modify timer only in
cases where we apply a valid request.

CRs-Fixed: 2698225
Change-Id: I92a1f1c6d0154349e19fdc1582d9d8836a7db1f4
Signed-off-by: Karthik Anantha Ram <kartanan@codeaurora.org>
2020-06-26 10:23:22 -07:00
Camera Software Integration
8e44ef7540 Merge "msm: camera: req_mgr: Clean up debugfs entry" into camera-kernel.lnx.4.0 2020-06-22 13:30:43 -07:00
Camera Software Integration
f6347f6e3a Merge "msm: camera: sensor: Dump phy registers on error" into camera-kernel.lnx.4.0 2020-06-18 17:21:06 -07:00
Camera Software Integration
5d4113257c Merge "msm: camera: smmu: Enhance debug capability for camera memmgr" into camera-kernel.lnx.4.0 2020-06-18 17:19:03 -07:00
Camera Software Integration
ed2f9c224c Merge "msm: camera: mem_mgr: Cache invalidation optimization" into camera-kernel.lnx.4.0 2020-06-18 17:17:42 -07:00
Camera Software Integration
235a9117e6 Merge "msm: camera: reqmgr: Work queue names added" into camera-kernel.lnx.4.0 2020-06-18 17:17:27 -07:00
Jigarkumar Zala
5a5fb4e8f0 msm: camera: req_mgr: Clean up debugfs entry
At the time of unbind, all debugfs entry needs to be properly
clean up. This change adds debugfs directory removal alongwith
entries under debugfs root entry.

CRs-Fixed: 2675526
Change-Id: I3eba11db032dbafe5f7d444e8c5a823639ba0e74
Signed-off-by: Jigarkumar Zala <jzala@codeaurora.org>
2020-06-17 13:54:11 -07:00
Vishal Verma
1435a8a68b msm: camera: sensor: Dump phy registers on error
Dump csiphy registers on following fatal errors:
1. lane overflow error
2. unbounded frame error
3. SOT ans EOT reception error
4. stream underflow error
These errors irqs are set at csid end, Currently there is no
interface to send message from one subdevice to other if the subdev is
not a real time device. This change adds an interface to notify the
no real time subdev.

CRs-Fixed: 2696744
Change-Id: I522167d1639ac298bc739a8a5a380a01356f0776
Signed-off-by: Vishal Verma <vishverm@codeaurora.org>
Signed-off-by: Jigar Agrawal <jigar@codeaurora.org>
2020-06-12 12:24:12 -07:00
Chandan Kumar Jha
24e6de881c msm: camera: reqmgr: Modify SOF watchlog timer for INIT exposure
In case of long exposure shots, watchdog timer needs
to be modified for init exposure seeting also to avoid trigger.

CRs-Fixed: 2706105
Change-Id: Ife8b3ec32103aff71d281e11b68e0d48f4ef79e1
Signed-off-by: Chandan Kumar Jha <cjha@codeaurora.org>
2020-06-11 16:54:20 -07:00
Jigarkumar Zala
279dfebf8c msm: camera: common: Fixes the exit module code flow
Fixes exit call flow as a part of rmmod.

CRs-Fixed: 2675526
Change-Id: I47111a737cb06d9bb3d0a417a471c5c9fb545999
Signed-off-by: Jigarkumar Zala <jzala@codeaurora.org>
2020-06-09 12:08:22 -07:00
Karthik Anantha Ram
ec23ff584a msm: camera: smmu: Enhance debug capability for camera memmgr
Improve debugging infrastructure and logging for memory related
issues. There are scenarios where the fd returned after ion_alloc
exists in camera smmu table as being mapped [stale entry].
On such scenarios, this change will return a specific error code to
userspace. The change also propagates the mapped size back to
user space.

CRs-Fixed: 2663114
Change-Id: Ia797b65d1e8ded58dec5b01df07d73262c4cfa95
Signed-off-by: Karthik Anantha Ram <kartanan@codeaurora.org>
2020-06-08 10:42:33 -07:00
Karthik Jayakumar
a68684d77c msm: camera: mem_mgr: Cache invalidation optimization
During unmap these internal buffers will be freed immediately
afterwards, therefore there is no need to do cache operation.

CRs-Fixed: 2627074
Change-Id: Ica4ebb93eb212604268c3450a92d075197783537
Signed-off-by: Karthik Jayakumar <kjayakum@codeaurora.org>
2020-06-08 09:41:21 -07:00
Camera Software Integration
f65f27de96 Merge "msm: camera: reqmgr: Invoke custom device at every frame" into camera-kernel.lnx.4.0 2020-06-05 19:10:14 -07:00
Wyes Karny
7eb3653915 msm: camera: reqmgr: Work queue names added
Added wrapper functions for each workq to enable workq names
in log.

CRs-Fixed: 2684378
Change-Id: If5b3671fbf20777cc891cba4b27cad6ed3a0d146
Signed-off-by: Wyes Karny <wkarny@codeaurora.org>
2020-06-05 15:33:31 -07:00
Karthik Anantha Ram
f81a46003b msm: camera: reqmgr: Invoke custom device at every frame
If there is a valid request CRM will apply that request to the
custom device, in scenerios during which there is no setting to
be applied to a custom device at a given epoch CRM needs to invoke
the custom device to program default settings for the next frame.

CRs-Fixed: 2524308
Change-Id: I4701c602ab68b9f64266f03a9b200d15a808165e
Signed-off-by: Karthik Anantha Ram <kartanan@codeaurora.org>
2020-06-03 16:44:50 -07:00