CRM pd tbl dev mask need to be updated on mode switch in Auto SHDR,
so that the mode switch request and subsequent requests or slot should
be in ready state if request is submitted by all expected device
in a link. Also enabled error bit related to shdr mode switch in tfe.
Query dev info from CRM to ISP again on activate link call to know if
usecase is SHDR and to identify master and slave context.
CRs-Fixed: 3555900
Change-Id: Ie3ce093a453cda4bb5a9d8ddd31b4c8d2b2a69ed
Signed-off-by: Ayush Kumar <quic_ayushkr@quicinc.com>
This change add support for activate and deactivate ISP device in the
link when dual trigger mode in the link is set.
CRs-Fixed: 3374385
Change-Id: Ib6d25ab295d613fa5cd3edf1780362476920d74d
Signed-off-by: Ayush Kumar <quic_ayushkr@quicinc.com>
This change adds shutter notification event in event record too
which can be dumped at the time of recovery.
CRs-Fixed: 3616617
Change-Id: I4eb57da6faf7ed3dc0a0a4a407fb669078db2a25
Signed-off-by: Vikram Sharma <quic_vikramsa@quicinc.com>
This change parses FCG configurations from UMD, handles it
in its corresponding blob handler, then writes exact FCG configs
to the hardware.
During the prepare stage, all FCG update values will be temporarily
stored in req_isp and then utilized by the config function later.
At the end of the blob handler with FCG prepared, a dummy hw update
entry is created for further usage and the size of such entry is based
on the number of reg val pairs and the size of cdm reg random header.
During applying the req in activated state, an algorithm is implemented
to pick exact FCG prediction to be used in SFE/IFE/TFE usecases.
During the config stage, based on the number of skipped frames before,
the exact FCG configurations are passed to SFE/VFE top and then
written into kmd_buf and picked by the CDM. If the number of skipped
frames reaches the maximum that FCG supports or no recorded skipped
frames before, current configuration will be used instead and FCG
entry will be skipped. If the hardware supports multi context like TFE,
wr_sel will be programmed right before the FCG config of each context.
In order to retrieve cpu address of FCG related hw update entry,
a slight change is made in packet parser to pass those addresses
when adding hw update entries.
CRs-Fixed: 3487116
Change-Id: I1db957885933edcbfabc6ce90d72902f4c518118
Signed-off-by: Haochen Yang <quic_haocyang@quicinc.com>
(cherry picked from commit 55213f81a4bd9a847692c00e657e722c1d4ed903)
Now isp state monitor is moved into dbg_monitors, but some function
is still using isp state monitor in struct cam_isp_context. we should
use isp state monitor in dbg_monitors and need to remove isp state
monitor from struct cam_isp_context.
CRs-Fixed: 3514701
Change-Id: Ib993f25234654ad5be74617d6ddb82355ece33bc
Signed-off-by: mingpan <quic_mingpan@quicinc.com>
IFE cpas state monitor enhancement by printing ctx id,
hw index, frame id, event id and request id.
CRs-Fixed: 3368290
Change-Id: I41a01382ec2bc6f0c7b9f89c8bb20da42774a65c
Signed-off-by: Wang Kan <quic_wkan@quicinc.com>
Monitor frame events driving the state machine.
To better understand what led to the state machine stalling update
debug info that is logged on errors.
CRs-Fixed: 3309151
Change-Id: Iccf0efd82069b342e5d4b1731292604d37263b0b
Signed-off-by: Karthik Anantha Ram <quic_kartanan@quicinc.com>
Currently the maximum length of tag is 64, but in some
cases, the tag length we need is lager than 64, in
this case some information will be lost, which leads
to the failure to properly parse out the required
information. We need to make sure that all the tags
are the same length so that the parsing script can
parse them correctly. We also need to make sure that
the last character in tag is ":" in order for the
parsing script to get the full tag string correctly.
CRs-Fixed: 3467258
Change-Id: Ie8107ffd902d70d88026632a2c9fadaca0c276d8
Signed-off-by: mingpan <quic_mingpan@quicinc.com>
Get CDM callback done timestamp for LDAR to know
if CDM write delay. And enlarge event monitor
numbers to make sure dump 10+ frames info.
CRs-Fixed: 3430787
Change-Id: If5a1bd925d5d82d1856d880ccb1f4ed9effc5251
Signed-off-by: Wang Kan <quic_wkan@quicinc.com>
This change modifies CAM_ISP_CONTEXT_AEB_ERROR_CNT_MAX to 6.
CRs-Fixed: 3431394
Change-Id: Icb4c737255efc0f9b1eca2626cff5d72ae062775
Signed-off-by: Haochen Yang <quic_haocyang@quicinc.com>
Modify the timestamp format of ISP state monitor. We need to use the
dump info from CRM and ISP to draw a timing diagram for debugging,
so we need to keep their timestamp format same.
CRs-Fixed: 3413642
Change-Id: Icc397a04f18fe1fd41c2c78e228730c245f8ef49
Signed-off-by: mingpan <quic_mingpan@quicinc.com>
Mode switch delay is an inherent property of a sensor.
Similarly IFE has a static switch delay of 1. For sensors
with switch delay > 1 need special handling on certain
occasions. It is possible that switch settings was applied
to sensor, and on the next frame if there is a flash inject
delay or a packet delay, sensor & IFE are bound to go out of sync.
To address such cases, IFE will decide if it needs to apply
MUP on a dropped frame or not, along with any corresponding
IQ settings.
CRs-Fixed: 3320774
Change-Id: I355fa0f8b767d44bd3fb87c91b3cbf56fb9c3933
Signed-off-by: Karthik Anantha Ram <quic_kartanan@quicinc.com>
If there is a genuine bubble followed by an out of sync,
handle bubble once. If the out of sync continues to happen,
try for internal recovery.
CRs-Fixed: 3336466
Change-Id: Ib697ac1b8907459d06313a9f301cb00a480bd858
Signed-off-by: Karthik Anantha Ram <quic_kartanan@quicinc.com>
Signed-off-by: Depeng Shao <quic_depengs@quicinc.com>
Move the read of consumed addr to bus top half, as the tasklet
may delay and cannot readout the consumed addr in time.
CRs-Fixed: 3362499
Change-Id: I9742b117f433df6275ae5058d62e77ffce1f9a3f
Signed-off-by: chengxue <quic_chengxue@quicinc.com>
This commit prints the event record at the time of
LDAR. This commit gives information about the
last 8 events of request Submit, Apply, Epoch,
Reg Update and Buf Done.
CRs-Fixed: 3321317
Change-Id: I8d83f2b1ea0ccabc615a679489816e52ac6f00a4
Signed-off-by: Gaurav Jindal <quic_gjindal@quicinc.com>
We may apply req in between SOF and EPOCH due to workqueue delay,
then we will apply default setting in same frame, it will cause
the buf done of the following frame is delayed one frame in SHDR
usecase. This change avoids to report bubble for that case.
CRs-Fixed: 3325004
Change-Id: I1a3ae198466fde6390245a55f0f695649741bd62
Signed-off-by: Depeng Shao <quic_depengs@quicinc.com>
Address enabling CSID IRQs on SOF freeze. Enable the input
IRQ events when state machine encounters congestion as well.
CRs-Fixed: 3309151
Change-Id: Ib7611167444a795dd14339cb689a0e116e30b5fd
Signed-off-by: Karthik Anantha Ram <quic_kartanan@quicinc.com>
Add bit mask to control internal recovery for different
scenarios independently.
CRs-Fixed: 3300310
Change-Id: Ie55a1517c5dd9c503152368d9a921132eeab7a76
Signed-off-by: Karthik Anantha Ram <quic_kartanan@quicinc.com>
Update from error injection framework to event injection framework to
support PF event inducement and node event. Different set of user
input parameters are required dependent on which event to injection.
ICP and ISP support error event and page fault event injection. JPEG
supports node event and page fault event injection. However, buf done
error injection is only supported for JPEG and ICP.
Create a query API to check whether PF is fatal for a context bank.
Using the API, if PF is fatal, page fault event injection is not
supported for the device that owns the context bank.
Make change to JPEG context event callback handling to account for
various events including Event Injection event.
CRs-Fixed: 3210139
Change-Id: I582ee0bda8dbf631ece2522a5a8145f38ec71928
Signed-off-by: Sokchetra Eung <quic_eung@quicinc.com>
Variable fps usecase needs to get valid req with init packet
flag after flush, this change adds a flag to detect if we
get a valid req before resuming HW. This change also stops
the sensors during flush if useland already request to stop
dev.
CRs-Fixed: 3256139
Change-Id: Ieabd327a3b5cf380ca60548c85714c96635a272d
Signed-off-by: Depeng Shao <quic_depengs@quicinc.com>
This change adds supoort for variable fps feature, this
feature needs to stream off the sensor at EOF. So, this
change sends an EOF event to sensor to do the streamimg
off. Since sensor only outputs one frame every round, so
we need to apply the IFE packet to HW immediately, then
the every frame will be valid frame.
CRs-Fixed: 3178221
Change-Id: Ifc57987aac11c9655edd979734e5568c19262571
Signed-off-by: Wang Kan <quic_wkan@quicinc.com>
Signed-off-by: Depeng Shao <quic_depengs@quicinc.com>
Add and implement sysfs parameters to inject errors to
camera HW on demand through UMD for IFE,ICP and JPEG.
CRs-Fixed: 3115857
Change-Id: I4376fe31016cd81ad7e6f04cbc55e8ce010a6154
Signed-off-by: Pranav Sanwal <quic_psanwal@quicinc.com>
Extension of Lets do a reset (LDAR) to include more information
in dump with more dump output enhancements.
CRs-Fixed: 3068971
Change-Id: I6b61bcf546e32c096e45c511faf64514ff391e62
Signed-off-by: Joshua Florez <quic_jflorez@quicinc.com>
In case SOF interrupt is not received by the camera driver, we can
recover the missing SOF timestamp for the frame at epoch using the
previous and current SOF timestamps from CSID.
CRs-Fixed: 3067696
Change-Id: I25c8596132b99829d04ea38dbd3d904fc2a302c2
Signed-off-by: Anand Ravi <ananravi@codeaurora.org>
When internal recovery is in progress skip notifying
SOF trigger to CRM. Also for AEB add a threshold check when
slave RDIs SOF is seen post IFE epoch, flag as fatal error
only on hitting this scenario on threshold number of
consecutive occasions.
CRs-Fixed: 3064736
Change-Id: Ibda10d3c42cff6ce128197221da298d2e88cb286
Signed-off-by: Karthik Anantha Ram <kartanan@codeaurora.org>
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>
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>
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>
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>
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>
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>
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>
when provider crash occurred, there was a CSID lane overflow
observed due to shutdown sequence from CRM(sensor, csid, csiphy).
To fix the issue need to change the shutdown sequence
(csid, sensor, csiphy).
This change will update the devices sequence in order while registering
and close the sequence accordingly.
CRs-Fixed: 2852076
Change-Id: Ia6d8022e995823bf031400c33528eb8544dc2e29
Signed-off-by: Alok Chauhan <alokc@codeaurora.org>
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>
If CRM skips applying settings on a given frame, in case of sHDR
program scratch buffers along with RUP/AUP to ensure
continuity with respect to sensor frames.
CRs-Fixed: 2841729
Change-Id: I296dbc713f49db54681043415b6ad1499dc13de4
Signed-off-by: Karthik Anantha Ram <kartanan@codeaurora.org>
In current implementation, cam_ctx_req has a array of
hw_update_entries, in_map_entries and out_map_entries. Each
context has array of N requests. Memory for all contexts is
allocated during probe. This causes a huge memory remaining
unutilized.
This commit moves the memory allocation to context acquire time
and freeing this memory during context release. In place
of using array, now dynamic allocation is used.
A top level calculation shows a memory reduction of around 2M-
2.5M with this change including all the camera drivers.
CRs-Fixed: 2830502
Change-Id: Id63cf2a52272e2a419704dc95100694e384330c3
Signed-off-by: Gaurav Jindal <gjindal@codeaurora.org>
If buf done error come for same applied request id then log
only once. Change the bufdone deferred logs to debug logs.
CRs-Fixed: 2824276
Change-Id: I870708bfb0c4f0ad0a1fade3a7e334551d055c73
Signed-off-by: Ravikishore Pampana <rpampana@codeaurora.org>
In cases where we see a buf done without request being in
active_list, there could be a possibility that the request
is applied just before SOF, RUP but the context state is
not moved to Applied state, at this time the request is in
wait_list. In such cases RUP event doesn't move the request
into active_list. Also if the BUF_DONE on a port is happening
before EPOCH, we simply drop that BUF_DONE and then the request
will eventually be tagged as BUBBLE at the time of EPOCH. But
since BUF_DONE is dropped, the request will never come out of
BUBBLE. To handle such cases and to come out of BUBBLE,
check if BUF_DONE matches with the request in wait_list by
checking last_consumed address and if so, mark it as deferred
buf_done and handle once the request is moved to active_list.
CRs-Fixed: 2814346
Change-Id: I778a6a684076d5327d536f319a23206ccc0c25b6
Signed-off-by: Pavan Kumar Chilamkurthi <pchilamk@codeaurora.org>
Re-apply bubble request if buf done has not come for 2 bubble frames.
Also before re-submitting the request to CDM check if CDM callback for that
request has come or not, if CDM callback is received then wait for buf
done else reset CDM and re-submit the request to CDM.
CRs-Fixed: 2807378
Change-Id: I1fd209482e14d58aa48d12194084d0a2ab943e31
Signed-off-by: Wyes Karny <wkarny@codeaurora.org>
Add support to dump the cdm core debug registers and CDM hang detect
support for better debugging purpose in case of cdm timeout at config
ife. Add a debugfs for CDM command buffer dump for cdm hang events.
Fix the possible NULL derefernce while dumping the cdm registers.
Turn on debugfs using following command in adb shell:
echo 1 >> /sys/kernel/debug/camera_isp_ctx/enable_cdm_cmd_buffer_dump.
CRs-Fixed: 2748715, 2782720, 2770565
Change-Id: Ibb9aa1d232d742ca1b6e64c16e9718bfc0bc8624
Signed-off-by: Jigar Agrawal <jigar@codeaurora.org>
Reduced maximum no of requests per context from 20 to 8
in isp driver.
CRs-Fixed: 2720238
Change-Id: If557b190fe94af72cc6fb28f36c3e1f6189218a5
Signed-off-by: Shravya Samala <shravyas@codeaurora.org>
Checking the BUS write client last consumed
address, if it matches with next request port
io buffer address, then irq delay detected.
We can signal port fence for both active request.
CRs-Fixed: 2684890
Change-Id: I8265c06a2284897d43e9a24511ad2c13c9690186
Signed-off-by: Depeng Shao <depengs@codeaurora.org>
If a request has been applied the buffer addresses have been
configured, and if a frame bubbles buf done is expected on
the same frame or in the worse case on the next frame.
SW should not try adding a bubbled request back to pending
list without a buf done for that request.
CRs-Fixed: 2729789
Change-Id: I9a2f45c58d39b659cd7a12747dc738c43cf5e0ad
Signed-off-by: Karthik Anantha Ram <kartanan@codeaurora.org>
Optimize IFE configuration process by making
IFE hw update entries independent of the hw type
(IFE or SFE). Use CPAS-CDM for dualIFE configuration.
CRs-Fixed: 2704472
Change-Id: I1ecba0312c83f0ab1b88c158430650bb9e28666c
Signed-off-by: Jigar Agrawal <jigar@codeaurora.org>