Commit Graph

195 Commits

Author SHA1 Message Date
Camera Software Integration
272bbd9200 Merge "msm: camera: common: Fix kernel code and add checks" into camera-kernel.lnx.5.0 2021-10-18 16:43:42 -07:00
Jigar Agrawal
890c319fc8 msm: camera: common: Fix kernel code and add checks
Fix Kernel code and add security checks to avoid
possible out of bound array access variables.

CRs-fixed: 3038735
Change-Id: Idaf0889026dbf138d0cb94a0f88e5b6941ff21e2
Signed-off-by: Jigar Agrawal <jigar@codeaurora.org>
2021-10-14 11:11:42 -07:00
Karthik Anantha Ram
1da4fb571f msm: camera: isp: Add recovery support for custom AEB use-case
Add support to detect error scenarios, propagate the error
appropriately, halt IFE and recover on such error scenarios.
The change is to only handle such cases for custom AEB
use-case.

CRs-Fixed: 3045706
Change-Id: Iba4744e524523d131555e4a44f6ce7acc97633b5
Signed-off-by: Karthik Anantha Ram <kartanan@codeaurora.org>
2021-10-14 09:23:54 -07:00
Karthik Anantha Ram
66b3f46f58 msm: camera: isp: Update reapply field in config args
Currently reapply field in config args signifies applying
only IO buffers. Update that field as an enum providing
the provision to reapply IQ or IO accordingly.

CRs-Fixed: 3045706
Change-Id: Id10ee846a6de093e5a79858689802e421628ce56
Signed-off-by: Karthik Anantha Ram <kartanan@codeaurora.org>
2021-10-13 11:42:21 -07:00
Karthik Anantha Ram
b48f4da577 msm: camera: isp: Add common utility functions
Add common utility functions to be used across isp
context. Util functions added to notify trigger points,
notify errors, pause CRM SOF timer and trigger register dumps.
The change also modifies certain pointer validations to
accomplish this.

CRs-Fixed: 3045706
Change-Id: I3cb19e9a24ffb82ff25e7c278b31a8bf0e854eed
Signed-off-by: Karthik Anantha Ram <kartanan@codeaurora.org>
2021-10-13 11:42:08 -07:00
Karthik Anantha Ram
498012e556 msm: camera: isp: Apply scratch only on SOF trigger
It's possible that CRM triggers frame skip call at SOF
and EOF. For IFE ignore the call on EOF. Only use
SOF trigger to apply default settings [scratch buffers],
for fetch engine use-cases.

CRs-Fixed: 3055035
Change-Id: Ic0b59e5beb6dff70bb1b515117f0b641d8e09308
Signed-off-by: Karthik Anantha Ram <kartanan@codeaurora.org>
2021-10-13 11:40:17 -07:00
Camera Software Integration
ce1580456e Merge "msm: camera: isp: Update last applied MUP for scratch" into camera-kernel.lnx.5.0 2021-10-06 17:40:24 -07:00
Camera Software Integration
4c38664b95 Merge "msm: camera: isp: Reduce traffic for shutter notification" into camera-kernel.lnx.5.0 2021-10-04 17:32:47 -07:00
Camera Software Integration
81e99709c3 Merge "msm: camera: isp: Add support of PDAF parsed outport" into camera-kernel.lnx.5.0 2021-10-01 19:50:07 -07:00
Pranav Sanwal
0ddfe2d482 msm: camera: isp: Reduce traffic for shutter notification
To reduce traffic for shutter notification, sof and boot
sof timestamps are sent in a unified v4l2 event.
Thereby, reducing the event notification traffic by 50%.

CRs-Fixed: 3040374
Change-Id: Ib4580e0a4df7c3d1cb892fdf3254272d3134d4cb
Signed-off-by: Pranav Sanwal <psanwal@codeaurora.org>
2021-09-30 18:05:29 +05:30
Camera Software Integration
a6d54a3219 Merge "msm: camera: req_mgr: Allow request cancellation if not applied to IFE" into camera-kernel.lnx.5.0 2021-09-29 15:57:59 -07:00
Karthik Anantha Ram
54f158a4fe msm: camera: isp: Update last applied MUP for scratch
In case of sHDR dynamic switch, for a frame on which we are
configuring scratch buffer, use MUP from the last applied
valid request as opposed to global reference of MUP held
by the CSID driver. The global reference could have been
updated by a future request, it would be incorrect to use
that when that request has not even been applied.

CRs-Fixed: 3038703
Change-Id: I9369dba80fa258925ab4ae573b33931352318334
Signed-off-by: Karthik Anantha Ram <kartanan@codeaurora.org>
2021-09-28 20:21:04 -07:00
Camera Software Integration
fbced33fa6 Merge "msm: camera: isp: Add fixes for buf done in presil" into camera-kernel.lnx.5.0 2021-09-27 15:36:42 -07:00
Anand Ravi
0417e88967 msm: camera: req_mgr: Allow request cancellation if not applied to IFE
Since we don't wait for requests to be ready on lower pd devices before
applying request on higher pd devices, add provision to cancel request
if it has not been applied on IFE.

CRs-Fixed: 3014942
Change-Id: I8850b0dfe3f88e04b86f7bb6b597657ad7e0a4f9
Signed-off-by: Anand Ravi <ananravi@codeaurora.org>
2021-09-27 14:41:03 -07:00
Chandan Kumar Jha
738df632cc msm: camera: isp: Add support of PDAF parsed outport
Add support of new PDAF Parsed data outport for VFE 780.

CRs-Fixed: 2948116
Change-Id: Icd88e3947f6c1461c49ef6912985836931a1c62b
Signed-off-by: Chandan Kumar Jha <cjha@codeaurora.org>
2021-09-24 15:52:49 +05:30
Anand Ravi
d7eb296004 msm: camera: isp: Reset fence after signalling success
If fence is signalled successfully, reset it to -1 to prevent it from
getting signalled again incorrectly.

CRs-Fixed: 3042511
Change-Id: I87f465508e9e626ad700f592478f253f179e9fe9
Signed-off-by: Anand Ravi <ananravi@codeaurora.org>
2021-09-22 15:05:54 -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
Mukund Madhusudan Atre
ead982b872 msm: camera: isp: Add fixes for buf done in presil
Currently, during verification of consumed address, we are not
taking into account the exapanded memory address that newer
targets have. Also, we are using wrong index for fence map
table, leading to supplying same resource handle for copying
buffer of different fence map entry, leading to empty frame.
Add correct comparision for consumed address and supply correct
index for fence map entry.

CRs-Fixed: 2932495
Change-Id: I1743d894ce47a51f2d93dc185865bb47b7655c05
Signed-off-by: Mukund Madhusudan Atre <matre@codeaurora.org>
2021-09-16 20:02:34 -07:00
Mukund Madhusudan Atre
5dba22d1fc msm: camera: common: Add buffer send and receive mechanism
Add packet based buffer send and retrieve mechanism for
presil testing.

CRs-Fixed: 2932495
Change-Id: Ifd1e0fdb8b12feabb884e02a07a3813db01a3899
Signed-off-by: Mukund Madhusudan Atre <matre@codeaurora.org>
2021-09-09 12:41:00 -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
605c8a002d Merge "msm: camera: isp: Protect recovery callback from stop ioctl using mutex" into camera-kernel.lnx.5.0 2021-08-13 18:20:13 -07:00
Sokchetra Eung
2a1deb94b0 msm: camera: isp: Check for NULL ptr
Validate the pointer for NULL prior to
dereferencing it in ISP driver.

CRs-Fixed: 2995152
Change-Id: I838ab1685ff7d270c9c28b0ec12177a25f33c144
Signed-off-by: Sokchetra Eung <eung@codeaurora.org>
2021-08-11 10:35:30 -07:00
Anand Ravi
b811f12335 msm: camera: isp: Protect recovery callback from stop ioctl using mutex
Since recovery callback happens in workqueue context, it can run in
parallel with stop dev ioctl. This leads to many possible race
conditions. Instead, protect the recovery callback with the same context
mutex as ioctls to prevent parallel execution.

CRs-Fixed: 3003703
Change-Id: I92a635cfaeee4cf09047672a5cb925cf262cd816
Signed-off-by: Anand Ravi <ananravi@codeaurora.org>
2021-08-09 11:49:02 -07:00
Camera Software Integration
7d06d880aa Merge "msm: camera: isp: Handle processing RUP_DONE prior to SOF" into camera-kernel.lnx.5.0 2021-07-30 17:36:10 -07:00
Camera Software Integration
4a203b01d7 Merge "msm: camera: isp: Logging improvements to ISP context" into camera-kernel.lnx.5.0 2021-07-28 20:37:43 -07:00
Karthik Anantha Ram
1736e27905 msm: camera: isp: Improve isp context debug capability
Update SFE output ports in buf done failure dumps.
Currently reg dump on error is triggered only on HW
error. Extending this to scenarios where the pipeline
is stalled possibly due to congestion.

CRs-Fixed: 2841729
Change-Id: I423bbac19efd5dd57d998b7017d9bfcff23392d0
Signed-off-by: Karthik Anantha Ram <kartanan@codeaurora.org>
2021-07-26 18:22:51 -07:00
Karthik Anantha Ram
5de7b3b61c msm: camera: isp: Handle processing RUP_DONE prior to SOF
For RDI state machine add provision to post shutter for requests
that receive RUP_DONE prior to SOF. If the RUP_DONE is serviced
and acknowledged before SOF by the state machine, we need to
handle posting the shutter for that request at SOF otherwise
we would result in completely missing that shutter.

CRs-Fixed: 2971285
Change-Id: I6303520166c445fa7872dcffbd23a0a75d497387
Signed-off-by: Karthik Anantha Ram <kartanan@codeaurora.org>
2021-07-21 19:14:30 -07:00
Anand Ravi
ff11552d04 msm: camera: isp: Logging improvements to ISP context
Reduce number of logs printed by ISP and custom contexts for each
packet. Also move sync related error logs to debug logs.

CRs-Fixed: 2977145
Change-Id: Icf22eefdf0ae1d6ef006272f95352ae65cbf3b34
Signed-off-by: Anand Ravi <ananravi@codeaurora.org>
2021-07-19 11:38:22 -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
Karthik Anantha Ram
5d5b3a5144 msm: camera: isp: Add support for AEB use-case
Add support to ensure epoch is programmed post second
exposure frame. Validate this, if this check fails
flag an error. The % factor of frame height to be configured
for epoch is obtained from userspace. This % factor will
depend on how the frame is spread for IFE to process.

CRs-Fixed: 2986303
Change-Id: I2d7d34ccdfde0192ebb73bbd920a4c738bbf9ca2
Signed-off-by: Karthik Anantha Ram <kartanan@codeaurora.org>
2021-07-14 10:57:31 -07:00
Camera Software Integration
fbc548b838 Merge "msm: camera: isp: Add support for clk bw update on config" into camera-kernel.lnx.5.0 2021-07-09 18:53:56 -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
Mukund Madhusudan Atre
fc00541bb9 msm: camera: isp: Add support for clk bw update on config
Move clock update call from prepare to config. Add delay
in clock reduction and enable src clock update only when blob
is received. Optimize bw update and combine application of
clock and bw in ife and sfe. Finish update will be common for
clock and bw update, and will be called once per acquired hw.

CRs-Fixed: 2841729
Change-Id: Ideb8e8cfe6838bb9d5c861fb6b7cbc5e499ebee5
Signed-off-by: Mukund Madhusudan Atre <matre@codeaurora.org>
2021-07-08 08:45:10 -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
Savita Patted
5000fbf826 Merge "msm: camera: isp: Reset sync object if signaled" into camera-kernel.lnx.5.0 2021-07-06 08:57:21 -07:00
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
Karthik Anantha Ram
d785949196 msm: camera: common: Change shutdown sequence for subdevices
In subdev close call if CRM is still active wait for shutdown
from CRM [media device]. Remove subdevice check for active
handles, shutdown to happen irrespective of any active context.

If CRM is not active, subdevice shutdown should ensure there is
no access to kernel allocated buffers since at this point
memmgr is de-initialized.

As part of ICP close, remove usage of HFI queues, trigger PIL
to transfer FW memory ownership back to HLOS and power off ICP.

CRs-Fixed: 2976107
Change-Id: Ib05b3fbdcc33f4072da7ef77cf0118a807860e8c
Signed-off-by: Karthik Anantha Ram <kartanan@codeaurora.org>
2021-06-30 17:04:11 -07:00
Karthik Anantha Ram
3f4b6558c1 msm: camera: isp: Reset sync object if signaled
Reset sync obj in isp request structure to -1 if signaled.

CRs-Fixed: 2967520
Change-Id: Ie8e163785a88e9cd88f8423f2e7dad5c6f72c4de
Signed-off-by: Karthik Anantha Ram <kartanan@codeaurora.org>
2021-06-29 16:22:50 -07:00
Ayush Kumar
e8e814eda9 msm: camera: req_mgr: CRM Code refactoring
Due to major changes in CRM code, refactoring CRM
kernel driver code. Fix apply threshold calculation logic.

CRs-Fixed: 2783209
Change-Id: I08ba6c89b0d4f0e982c017bab4226a569327f861
Signed-off-by: Ayush Kumar <ayushkr@codeaurora.org>
2021-06-29 18:18:35 +05:30
Camera Software Integration
cc535dd8a1 Merge "msm: camera: isp: Add support of new out ports for VFE 780" into camera-kernel.lnx.5.0 2021-06-24 13:51:34 -07:00
Savita Patted
68de607556 Merge "msm: camera: req_mgr: Enhance camera v4l2 subdev shutdown sequence" into camera-kernel.lnx.5.0 2021-06-21 18:38:47 -07:00
Chandan Kumar Jha
fd65327ebd msm: camera: isp: Add support of new out ports for VFE 780
Add support of new stats out ports in vfe driver for VFE 780.

CRs-Fixed: 2948116
Change-Id: I2d0a13fe90f49b66839ea90b5d9882fd7c6528be
Signed-off-by: Chandan Kumar Jha <cjha@codeaurora.org>
2021-06-17 11:16:59 +05:30
Depeng Shao
2e7c5fcf1b msm: camera: isp: Fix the assignment of bubble_detected
Fix the assignment of bubble_detected.

CRs-Fixed: 2948932
Change-Id: Ie9a289f732d12a0238e643e81c8a5bbdcaca059a
Signed-off-by: Depeng Shao <depengs@codeaurora.org>
2021-06-16 01:53:04 -07:00
Camera Software Integration
b02e40ded7 Merge "msm: camera: isp: Mask process_bubble for SHDR usecase" into camera-kernel.lnx.5.0 2021-06-09 19:15:25 -07:00
Depeng Shao
1d69c55f63 msm: camera: isp: Mask process_bubble for SHDR usecase
SHDR usecase doesn't report bubble to CRM, but we still
need to know whether it is processing bubble during
applying request, since we may haven't received the
reg update of the previous applied request, then
we have a chance to apply a new req to HW, this may
result in overflow issue. This change masks the
process_bubble for SHDR case during epoch in applied
sub state.

CRs-Fixed: 2948932
Change-Id: I699a2f59ea874693b78a918895db98727b95c634
Signed-off-by: Depeng Shao <depengs@codeaurora.org>
2021-06-06 21:34:17 -07:00
Ayush Kumar
566ac7abf8 msm: camera: common: Multiple fixes for crm redesign
This change help to resolve below issues :-
1. Update frame duration calculation
   Add frame duration calculation with the use of fps. In some cases
   where horizonal blanking is more, frame duration calculation based
   on sof epoch calculation is not accurate.
2. Corner case in bubble handling
   Add support to handle master link bubble even if ISP linked with
   slave link receive few buf done irq for bubble request before master
   sends slave link to bubble state.

CRs-Fixed: 2783209
Change-Id: Ibf35f31f5263be7b6a6be6cd095447a2910a6878
Signed-off-by: Ayush Kumar <ayushkr@codeaurora.org>
2021-06-05 00:16:43 +05:30
Ayush Kumar
0259331da4 msm: camera: req_mgr: Re-design CRM to support multi links in sync mode
This change is to support multi links in sync mode. Supports dynmanic
switching to select master link in rtb and sat use case in sync mode.
Supports sync logic for rtb and sat use case in sync mode. Apply
requests for all links is triggered only on master epoch. Supports
bubble recovery and sync logic for different pd links in sync mode.

CRs-Fixed: 2783209
Change-Id: I81d1d0d37aa0d6e18c19ca87eac51ef3f160abfb
Signed-off-by: Ayush Kumar <ayushkr@codeaurora.org>
2021-06-04 20:23:00 +05:30
Depeng Shao
abf580c09c msm: camera: isp: Update the reported_req_id correctly
The request id is updated to 0 when the substate is
BUBBLE, then the original request id can't be notified
to UMD, since the reported_req_id is already updated to
the original request id. This change updateds the
reported_req_id only when the final request id is
valid.

CRs-Fixed: 2932602
Change-Id: Ib30f849782283c647f784cfb0deb49bee3d04287
Signed-off-by: Depeng Shao <depengs@codeaurora.org>
2021-05-19 22:27:37 -07:00