Commit Graph

237 Commits

Author SHA1 Message Date
Suraj Dongre
0fe49d5aa7 msm: camera: common: fix map check failure for presil buffer send
Add correct way to check if buffer can be sent to hw in below cases.
1. buffer handle mapped twice, resulting into two entries in buf_q.
   One entry without smmu mapping and one with smmu mapping.
   fixed by checking if another entry with smmu map exists for i_no.
2. blob cmd buffer, packet buffer are shared only between umd and kmd.
   send_buffer_to_presil expected to be called and return success.

CRs-Fixed: 2932495
Change-Id: I2dd884b7dd16c5c45d3dfc25380d039b92199319
Signed-off-by: Suraj Dongre <sdongre@codeaurora.org>
2021-10-06 11:49:41 -07:00
Depeng Shao
c8ac17dee6 msm: camera: reqmgr: Fix request sync issues
Fix several request sync issues.

CRs-Fixed: 3029196
Change-Id: I92b4048b392fa19e2c9748a5ee0efd9ef0b4e680
Signed-off-by: Depeng Shao <depengs@codeaurora.org>
2021-09-20 13:04:31 +08:00
Camera Software Integration
0a2a2dca28 Merge "msm: camera: reqmgr: Correct masked value for pending devices" into camera-kernel.lnx.5.0 2021-09-17 16:37:37 -07:00
Camera Software Integration
cfa89c05e4 Merge changes Ifd1e0fdb,Icfb6dc1a into camera-kernel.lnx.5.0
* changes:
  msm: camera: common: Add buffer send and receive mechanism
  msm: camera: memmgr: Add presil memory API implementation
2021-09-10 18:09:09 -07:00
Camera Software Integration
207895b464 Merge "msm: camera: reqmgr: Notify devices of frame skip" into camera-kernel.lnx.5.0 2021-09-10 18:08:36 -07:00
Suraj Dongre
37de6613a8 msm: camera: memmgr: Add presil memory API implementation
Add code for dmabuf, fd conversion and copying all buffers
using presil framework APIs.

CRs-Fixed: 2932495
Change-Id: Icfb6dc1a3326ea8214a71fd39871a8583a6e902c
Signed-off-by: Suraj Dongre <sdongre@codeaurora.org>
Signed-off-by: Mukund Madhusudan Atre <matre@codeaurora.org>
2021-09-09 12:40:34 -07:00
Depeng Shao
b5d455f995 msm: camera: reqmgr: Change warn logs to rate limited
In notify trigger and if link state isn't ready, it may
print excessive log which causes watchdog bite.

CRs-Fixed: 3031599
Change-Id: I758dcb26d9d110b0ba080e31f87e1fcafc6fd0e8
Signed-off-by: Depeng Shao <depengs@codeaurora.org>
2021-09-08 18:50:42 +08:00
Karthik Anantha Ram
4f751b3daf msm: camera: reqmgr: Correct masked value for pending devices
When checking if a request is ready, for pending devices of a
given pipeline delay, update the request pending mask correctly.
This will ensure "Skip frame" log indicates the right devices
missing a request packet.

CRs-Fixed: 3031843
Change-Id: Ib2aff1d0c31cb9425616ff53cadd78a6130206e7
Signed-off-by: Karthik Anantha Ram <kartanan@codeaurora.org>
2021-09-07 23:45:51 -07:00
Depeng Shao
e73c1b91e1 msm: camera: reqmgr: Notify devices of frame skip
Notify devices of frame skip when CRM skip a frame,
this is needed by SW frame sync.

CRs-Fixed: 3030315
Change-Id: If99cd976c215fe85c8f9fc600af22a82bb972917
Signed-off-by: Depeng Shao <depengs@codeaurora.org>
2021-09-08 14:22:03 +08:00
Camera Software Integration
0794e0fa6b Merge "msm: camera: req_mgr: Apply lower pd request in sync" into camera-kernel.lnx.5.0 2021-09-03 14:30:20 -07:00
Camera Software Integration
cea86bb84b Merge "msm: camera: reqmgr: Fix pagefault in workqueue get task" into camera-kernel.lnx.5.0 2021-09-03 14:30:11 -07:00
Anand Ravi
22097757a8 msm: camera: reqmgr: Fix pagefault in workqueue get task
Protect taskpool memory free operation with workqueue lock to prevent
use after free issues.

CRs-Fixed: 3019429
Change-Id: I0282e01e093f80578c5058a41823036370f5a88a
Signed-off-by: Anand Ravi <ananravi@codeaurora.org>
2021-09-01 10:45:34 -07:00
Ayush Kumar
7b9703b0db msm: camera: req_mgr: Apply lower pd request in sync
This change help to aply request for lower pd device in sync mode
even if next open request is not avaiable at CRM.

CRs-Fixed: 3017979
Change-Id: Idfae0438d53e61f49c30f205357d5826dd943daa
Signed-off-by: Ayush Kumar <ayushkr@codeaurora.org>
2021-09-01 09:06:52 -07:00
sokchetra eung
b5bec7886f msm: camera: reqmgr: Prevent session deadlock
Releasing session lock before unlink and acquiring
it immediately after to allow workq to be done. Check
link state after acquiring session lock in process_
req to return if link is IDLE.

CRs-Fixed: 3003287
Change-Id: Ie7a8ffc4edcb123db290d6da047d748b3e99d68b
Signed-off-by: sokchetra eung <eung@codeaurora.org>
2021-08-31 13:52:27 -07:00
Camera Software Integration
918ec12e6f Merge "msm: camera: req_mgr: Table info dump removed" into camera-kernel.lnx.5.0 2021-08-27 17:59:39 -07:00
Savita Patted
09f1d471b3 Merge "msm: camera: common: Add camera minidump changes" into camera-kernel.lnx.5.0 2021-08-24 20:01:45 -07:00
Gaurav Jindal
d266ac8813 msm: camera: common: Add camera minidump changes
Based on targets, in case of device crash, in place
of complete memory dump, mini dump can be extracted.
This commit adds changes for basic framework
to interact with base kernel for mini dump.
This commit also adds changes for ISP, CRM, SMMU and
Memory Manager.

CRs-Fixed: 2993116
Change-Id: I02620bd79ee2f84847381509a5eb030ffb1ca9d4
Signed-off-by: Gaurav Jindal <gjindal@codeaurora.org>
2021-08-22 12:00:40 -07:00
Ayush Kumar
f428aed04a msm: camera: req_mgr: Handle apply failure
Handle apply failure in workqueue. Add recovery mechanism
to recovery in req_mgr to handle frame out of sync issue.

CRs-Fixed: 2997164
Change-Id: I0e04571b3a31d7a879a7aa579c1f0be51c233277
Signed-off-by: Ayush Kumar <ayushkr@codeaurora.org>
2021-08-19 07:54:50 -07:00
Savita Patted
b07d7da652 Merge "msm: camera: reqmgr: Fix trigger count out of bound issue" into camera-kernel.lnx.5.0 2021-08-18 00:18:51 -07:00
Savita Patted
05d72291f7 Merge "msm: camera: core: Add delay detection support" into camera-kernel.lnx.5.0 2021-08-18 00:18:33 -07:00
sokchetra eung
64ff6b3ffc msm: camera: req_mgr: Table info dump removed
Remove dump_tbl_info function and all of its
invocations in CRM to prevent dumping all the
handle info when holding the spin lock.

CRs-Fixed: 3014074, 3014073
Change-Id: Ie98bafb489fc0d1f2d75cf0f3f08efb48d9b4062
Signed-off-by: sokchetra eung <eung@codeaurora.org>
2021-08-17 20:58:29 -07:00
Camera Software Integration
7e00864138 Merge "msm: camera: jpeg: Add Support for JPEG retry mechanism" into camera-kernel.lnx.5.0 2021-08-16 21:02:55 -07:00
Jigar Agrawal
e8f91ce471 msm: camera: jpeg: Add Support for JPEG retry mechanism
Add support for JPEG Thumbnail retry mechanism. Restructure
the command buffer arrangement, add JPEG generic blob functionality
and add support to notify user when the JPEG Thumbnail encoder
size increases than the threshold size received through blob.

CRs-Fixed: 2999106
Change-Id: Ica74f934939b562a3a88af551bfb5de79399e247
Signed-off-by: Jigar Agrawal <jigar@codeaurora.org>
2021-08-12 18:14:36 -07:00
Ayush Kumar
8554f46816 msm: camera: core: Add delay detection support
This changes is to detect workqueue and tasklet
scheduling and execution delay.

CRs-Fixed: 2977775
Change-Id: Ia4b4845a067c22bd1f24bd63a971d103fcfc049c
Signed-off-by: Ayush Kumar <ayushkr@codeaurora.org>
2021-08-11 22:18:10 +05:30
Ayush Kumar
688f87e5e7 msm: camera: req_mgr: Increase one more request to apply in initial sync
For SW sync to work, CRM needs to apply the first 6 requests in
initial sync mode. This change is to increase the count of requests
to be applied in the initial sync mode.

CRs-Fixed: 3000684
Change-Id: Ic35d37ac727fc10ec113dd9f05074cec7a52e39a
Signed-off-by: Ayush Kumar <ayushkr@codeaurora.org>
2021-08-11 19:16:22 +05:30
Depeng Shao
75a0aff96f msm: camera: reqmgr: Fix trigger count out of bound issue
Since the CAM_TRIGGER_MAX_POINTS equal to CAM_TRIGGER_POINT_EOF,
so we need to use CAM_TRIGGER_MAX_POINTS + 1 to define the
trigger count.

CRs-Fixed: 3007296
Change-Id: Ia0cefd8381417a4b7ecd8636796bf25df705101d
Signed-off-by: Depeng Shao <depengs@codeaurora.org>
2021-08-05 15:27:01 +08:00
Haritha Chintalapati
854ef5bbec Merge "msm: camera: common: Append workq name in log" into camera-kernel.lnx.5.0 2021-07-27 22:12:54 -07:00
Haritha Chintalapati
2c70bb0fa0 Merge "msm: camera: reqmgr: Notify devices on link stall" into camera-kernel.lnx.5.0 2021-07-27 22:10:12 -07:00
Haritha Chintalapati
5971e01fa7 Merge "msm: camera: reqmgr: check link state before taking mutex" into camera-kernel.lnx.5.0 2021-07-27 22:09:31 -07:00
Sokchetra Eung
ba664cddff msm: camera: common: Append workq name in log
Append workq name in workq delay detect API to identify
which workq is scheduled late. Create workq name macros for
cci and cpas to pass to workq delay detect API.

CRs-Fixed: 2994927
Change-Id: Iebc14520b918272e92b59c900de5fe17f38a2406
Signed-off-by: Sokchetra Eung <eung@codeaurora.org>
2021-07-26 17:43:37 -07:00
Karthik Anantha Ram
4ebcff0692 msm: camera: reqmgr: Notify devices on link stall
Notify all the connected devices, when the link is stalled.

CRs-Fixed: 2841729
Change-Id: I08cbb587071f4bfd6e1cdefddffb66a83ba8c187
Signed-off-by: Karthik Anantha Ram <kartanan@codeaurora.org>
2021-07-26 09:35:25 -07:00
Tejas Prajapati
29e76ca7d2 msm: camera: reqmgr: check link state before taking mutex
In case if the destroy session is processed first it will
as a part of unlink try to drain the work queue. This will
schedule all the enqueued wq. Workqueue when scheduled
try to acquire same mutex destroy session has already acquried
this will lead to dead-lock. To avoid that, check the link
state first if it is in idle state then return from the
workqueue without trying to acquire mutex.

CRs-Fixed: 2976325
Change-Id: I57a53455c69e5f4f38c92413f9d1b7f2d06c9960
Signed-off-by: Tejas Prajapati <tpraja@codeaurora.org>
2021-07-24 07:55:00 -07:00
Karthik Anantha Ram
5f13fe864f msm: camera: reqmgr: Correct condition check
Flag warning only if the wait call returns 0.

CRs-Fixed: 2841729
Change-Id: I456da8a66ea69bcf671f55bd5f0459aab74476f5
Signed-off-by: Karthik Anantha Ram <kartanan@codeaurora.org>
2021-07-22 19:24:05 -07:00
Savita Patted
3dd2620d85 Merge "msm: camera: isp: Add support for flush in offline IFE" into camera-kernel.lnx.5.0 2021-07-21 22:29:05 -07:00
Camera Software Integration
5daf7da643 Merge "msm: camera: mem_mgr: Fix expanded memory allocations" into camera-kernel.lnx.5.0 2021-07-19 17:27:02 -07:00
Anand Ravi
25ee65107a msm: camera: isp: Add support for flush in offline IFE
Add flush device ioctl handler in ISP top state machine to translate
the flush command into equivalent CRM flush request command. Also add
support for flushing offline IFE workqueue.

CRs-Fixed: 2939523
Change-Id: I79a6b6bca241b954e06f78e8a05e55907f46aa59
Signed-off-by: Anand Ravi <ananravi@codeaurora.org>
2021-07-19 09:02:49 -07:00
Camera Software Integration
3ec4a1fd7e Merge "msm: camera: common: Append timestamp in INFO LOGS" into camera-kernel.lnx.5.0 2021-07-16 19:48:48 -07:00
Karthik Jayakumar
9122c82fe1 msm: camera: mem_mgr: Fix expanded memory allocations
Fixes expanded memory allocations to only happen for ICP context banks.
Re-maps the command buffers to shared region of ICP context bank.

CRs-Fixed: 2985358
Change-Id: I3c2d5866b0041489577f6c5c0ec113c886437107
Signed-off-by: Karthik Jayakumar <kjayakum@codeaurora.org>
2021-07-15 13:14:59 -07:00
Sokchetra Eung
5a11ba0725 msm: camera: common: Append timestamp in INFO LOGS
Use Kernel time to obtain the current time when IFE is acquired
/released and when sensor is streamed on/off. Convert the Ktime
to a timestamp format and log it in existing info prints. This
will help to co-relate timestamp between user-space and kernel
logs. The change also replaces the current usage of direct calls
to ktime_get_real_ts64 with macro across all drivers.

CRs-Fixed: 2987320
Change-Id: I87c4790164d222fc1ed6ff41ad00eeb1ed8c8867
Signed-off-by: Sokchetra Eung <eung@codeaurora.org>
2021-07-15 11:56:33 -07:00
Ayush Kumar
c834473607 msm: camera: req_mgr: Fix request mismatch on slave bubble
Correct number of apply to skip for master in case of slave bubble.
Add log to check and print time left to apply.

CRs-Fixed: 2968652
Change-Id: I7698b79a6d98637726e528f3e40dda4b68118d50
Signed-off-by: Ayush Kumar <ayushkr@codeaurora.org>
2021-07-14 21:35:36 -07:00
Camera Software Integration
3c599ca616 Merge "msm: camera: smmu: Use dmabuf inode num as unique identifier" into camera-kernel.lnx.5.0 2021-07-14 21:23:39 -07:00
Pavan Kumar Chilamkurthi
89d50926c5 msm: camera: smmu: Use dmabuf inode num as unique identifier
'fd' can be closed in user mode driver, though corresponding
dmabuf is still not freed if someone still holding a refCount
on that dmabuf, say camera smmu driver holding a refCOunt and
has that in its mapping info table. Then the same 'fd' can be
allotted for a different buffer in a new allocation. In such
cases, if we use 'fd' as identifier in camera smmu driver to
check if the buffer is already mapped based on mapping info
table, we mistakenly think the new buffer is already mapped
which is not the case. DMA buf's inode num is an unique
identifier that represents a buffer. Use this along with 'fd'
in camera smmu driver to see if the given buffer is already mapped.

CRs-Fixed: 2961136
Change-Id: I5baac99e3badaca3a376ecd724a7a7aa6da112a4
Signed-off-by: Pavan Kumar Chilamkurthi <pchilamk@codeaurora.org>
2021-07-12 14:01:19 -07:00
Gaurav Jindal
eab943de93 msm: camera: isp: Add mutex while disabling rx
Disbaling RX in CSID during flush is not inside mutex lock.
This can result in damaging the lists and variables causing
stability issues.
This commit moves this call inside mutex lock. Also, a warn log
is added to inform if the flush call times out.

CRs-Fixed: 2974631
Change-Id: I50082c03bebacc4a11f826bdb318c52dbf5400e7
Signed-off-by: Gaurav Jindal <gjindal@codeaurora.org>
2021-07-12 20:22:22 +05:30
Savita Patted
769d026c3a Merge "msm: camera: memmgr: Add support for non pix secure buffers" into camera-kernel.lnx.5.0 2021-07-08 18:59:30 -07:00
Savita Patted
a1e328751b Merge "msm: camera: core: v780 enhanced memory addresses" into camera-kernel.lnx.5.0 2021-07-08 13:23:13 -07:00
Savita Patted
44d4c40b5f Merge "msm: camera: req_mgr: Increase in_q rdx index in workqueue" into camera-kernel.lnx.5.0 2021-07-08 13:22:32 -07:00
Savita Patted
dba6c5e0f0 Merge "msm: camera: common: Change shutdown sequence for subdevices" into camera-kernel.lnx.5.0 2021-07-07 09:54:21 -07:00
Rishabh Jain
e2c7402dfd msm: camera: memmgr: Add support for non pix secure buffers
Add support to allocate such buffers which need to accessed
by non-pix VM.

CRs-Fixed: 2981372
Change-Id: Iac965a479e05d638c6323bfacd7c6a4d89f2a223
Signed-off-by: Rishabh Jain <risjai@codeaurora.org>
2021-07-06 11:31:00 +05:30
Ayush Kumar
f510695ed6 msm: camera: req_mgr: Increase in_q rdx index in workqueue
This change is to correct in_q rdx index logic. If rdx index is
increased in tasklet, then it is possible that due to delay in
workqueue scheduling crm send apply request for same request.
Also, it prevent concurrent access of in_q rdx index.

CRs-Fixed: 2980811
Change-Id: Iba7d3c0faf6abe845745acbcd810ca52a43e4d01
Signed-off-by: Ayush Kumar <ayushkr@codeaurora.org>
2021-07-05 17:56:46 +05:30
Savita Patted
9e5e021304 Merge "msm: camera: sensor: Add tpg driver support" into camera-kernel.lnx.5.0 2021-07-01 15:29:06 -07:00