Distinguish error notification to CRM for actual bubble &
other errors. This avoids conflict in internal recovery scheme.
Currently back to back bubble triggers an internal recovery, if
an error is notified for AEB back to back it will lead to two
different callflows for internal recovery. Distinguishing the
notifications will avoid different callflows.
CRs-Fixed: 3692264
Change-Id: Id4d928569fded732cef1782863ee494c66158c44
Signed-off-by: Karthik Anantha Ram <quic_kartanan@quicinc.com>
(cherry picked from commit a0a0290f13ddb1adb25eee5e55ee4f438524fbd9)
Detecting for internal recovery and flush execute in two
different thread contexts, and the critical section protecting
the lists is small to avoid locking overhead. It is possible that flush
was triggered, but bh in ISP detected an error condition and triggers
a internal recovery moving the request in question to pending list.
At this point it is possible, that the flush context has cleared
the pending list, and internal recovery's addition to the pending list
is agnostic to the flushing thread. When there is a flush all, a reset
is issued to the HW and all the bh's are flushed as well. Post this
clearing the pending request list ensures no stale request entity is
left behind as opposed to cleaning up the pending list prior to the
HW stop sequence.
CRs-Fixed: 3669530
Change-Id: I58f024ec51cbc9c391d8aab1199098f314317b8a
Signed-off-by: Karthik Anantha Ram <quic_kartanan@quicinc.com>
(cherry picked from commit 0d58af6cf25db3b3412bc6effc437474751bf700)
Query the context bus comp group information in legacy acquire
call.
CRs-Fixed: 3696470
Signed-off-by: Alok Chauhan <quic_alokc@quicinc.com>
Change-Id: Ib80858e6b81e1c7fce2e00597f58f0a98e12ff87
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>
For legacy SHDR, report bubble even if request is applied
after SOF so that both master and slave context goes to
bubble state in legacy SHDR or SHDR without SFE target.
CRs-Fixed: 3555900
Change-Id: I64e38d14ba3472fa1d298882d6b09a2f14e0d576
Signed-off-by: Ayush Kumar <quic_ayushkr@quicinc.com>
This change is added to support buffer alignment for TFE
WM in x and y axis. This change is required in SHDR usecase to
align short exposure frame with long exposure frame.
CRs-Fixed: 3538642
Change-Id: I9a3d35d0884bfbd6f62034b207e5784fdf2f7430
Signed-off-by: Ayush Kumar <quic_ayushkr@quicinc.com>
This commit adds support to disable acquired TFE WM clients if the client
is not configured.
CRs-Fixed: 3531808
Change-Id: Ie3be423dfd2ab35031677563d66fd811090148fe
Signed-off-by: Ayush Kumar <quic_ayushkr@quicinc.com>
This change add support to program dual tfe configurations in
SHDR to create sync between two TFEs. This change is required
if MUP bit is used in SHDR mode.
CRs-Fixed: 3508184
Change-Id: I270f7fd8e3cac1f1e50c5f16e7cba2c5e9c2b74f
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 add support for:
- PDAF HW support handling in CSID and TFE driver
- CSID PPP halt mode handling
- Add support for new TFE PD ports (LCR, PD_PREPROCESSED
PD_PARSED).
CRs-Fixed: 3387396
Change-Id: I56dc109138607fe7b342760a5c977e4126fe1676
Signed-off-by: Alok Chauhan <quic_alokc@quicinc.com>
Bus layer just read the consumed address from one port per group,
sometimes, this port isn't requested by userland, so it can't
match with any requested resources. This change reads consumed
address from other port which in same composite group if the buf
done event can't match any requested resources.
CRs-Fixed: 3590441
Change-Id: I1590e9a53ef7eff1df65682ae4ca77b011d1af39
Signed-off-by: Depeng Shao <quic_depengs@quicinc.com>
(cherry picked from commit 3ec040334581d347916871429de9374555656e4d)
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>
Adds checks to confirm CSID frequency greater than
CSIPHY frequency, TFE frequency greater than CSID
frequency. Also TFE frequency should be such that
it can accommodate PHY data rate .
CRs-Fixed: 2847155
Change-Id: I5d3dcc53a6f27129f4b82cba1254445f58f6d0cf
Signed-off-by: Shravya Samala <quic_shravyas@quicinc.com>
Signed-off-by: Shardul Bankar <quic_sharbank@quicinc.com>
Signed-off-by: Gaurav Jindal <quic_gjindal@quicinc.com>
Signed-off-by: Alok Chauhan <quic_alokc@quicinc.com>
This change add missing calls to put cpu buf in few scenarios.
CRs-Fixed: 3578162
Change-Id: Iab6aa0324b5072390b38df296c7acee00f5102a1
Signed-off-by: Vikram Sharma <quic_vikramsa@quicinc.com>
Enabling last consumed address support to handle delay in bufdones.
CRs-Fixed: 3273866
Change-Id: I25df0ac7a81b696188519db8df08c66a238e1644
Signed-off-by: Yash Upadhyay <quic_yupadhya@quicinc.com>
(cherry picked from commit 8bdd7e9d45f7ff51a893bca833343e0fce1efd65)
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)
Due to the scheduling delay, the top half was getting delayed for
buff-done events. 2 different requests buff-done is merged due to
top half delay and we incremented 2 times deferred ack due to merger
of buff-done events. This check will prevent duplicate deferred
ack increments.
CRs-Fixed: 3477436
Change-Id: If6bbd460a0a1025758f330f26eaf1099de2daa38
Signed-off-by: Chandan Kumar Jha <quic_cjha@quicinc.com>
Currently, in_interrupt() is used to determine task context.
in_interrupt() would return 0 if the execution is in task context;
a spin lock is obtained with bh disabled. Since the bh's are disabled,
the preempt count/soft_irq disable count would increase.
When we attempt to release the lock, the same in_interrupt() API
would now return non-zero, failing to release the lock.
The change uses appropriate preempt API to determine execution context.
CRs-Fixed: 3509317
Change-Id: I43f981bf3a2d4c238cebc4b29fa8a9aa0a8e0df3
Signed-off-by: Soumen Ghosh <quic_soumeng@quicinc.com>
For sHDR usecase, we may enter bubble applied substate, then
isp trigger bubble recovery again, we need isp to apply default
setting in this case. This change adds notify frame skip interface
for bubble applied substate to apply the default settings.
CRs-Fixed: 3533564
Change-Id: Ie82aa73786902328b21909ba958d0a225ed49916
Signed-off-by: Depeng Shao <quic_depengs@quicinc.com>
Add a goto label to fine-grain situations where
buffer tracker list is to be freed, and when it
doesn't, where the submitted packet request id
is less than or equal to request that was last
flushed, as this call will cause null pointer
access.
CRs-Fixed: 3507867
Change-Id: I1b909473baf7a227bbd649e4c883daa485602cd9
Signed-off-by: Li Sha Lim <quic_lishlim@quicinc.com>
The function cam_mem_mgr_release can unmap the buffers when in use.
This change prevents unmapping the buffers when in use.
CRs-Fixed: 3489559
Change-Id: I2e72e795d39ac15abfa56c19043c419a03686966
Signed-off-by: Shivakumar Malke <quic_smalke@quicinc.com>
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>
Fix isp log errs and format errs.
CRs-Fixed: 3499636
Change-Id: Ieb5b81b95dea440b1da17cb5bc9be86f75b7c4f6
Signed-off-by: Wang Kan <quic_wkan@quicinc.com>
in case of back-to-back bubble requests, We do internal recovery.
We don't have locks for list protection in the internal recovery flow.
From the core dump, we had seen that we were handling bubble in one core
but we had done list modification on another core during internal
recovery without list protection, which results in list corruption.
We are accessing the request queue during internal recovery without
any locks which are resulting in list corruption.
We need to use locks to prevent list corruption in the internal
recovery flow.
CRs-Fixed: 3444802
Change-Id: Id72077647795e51e112b030d4fb75d80299c1bed
Signed-off-by: Chandan Kumar Jha <quic_cjha@quicinc.com>
This change adds support to detect early
unmapping of buffers from UMD, and signal
when the error occurs by sending an error
code to UMD.
At present, buffers are allocated and/or mapped
by UMD, and the following sequence occurs.
KMD prepares packets sent during a config ioctl,
and these packets reside in the mapped buffers;
HW blocks then access these buffers, and may
write output to other mapped buffers(io buffers);
Once HW is done(upon a buf done), KMD signals
this event to UMD;
UMD may free/unmap these relevant buffers.
This change adds support to detect cases where a
free/unmap happens before/while HW is accessing
these buffers.
This feature is enabled by default, but a debugfs
variable disable_buf_tracking is added under smmu
which will enable the user to disable the feature.
Camera server needs to be restarted whenever this
variable is set/unset for changes to take place.
CRs-Fixed: 3382609
Change-Id: I39c3f0c373743c10bc2e6304ffbdc820e3c95970
Signed-off-by: Li Sha Lim <quic_lishlim@quicinc.com>
HWPD is associated with several modules, but only image size violation
displayed in the kernel when an error occur. Now we will pass the error
code of HWPD violation to UMD to help UMD to take necessary action and
dump relevant info.
CRs-Fixed: 3440015
Change-Id: I6483b228a8eeaac3bf54f5f83f8f8deab3da6250
Signed-off-by: Stark Lin <quic_starlin@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>
This change registers tfe on v980 as an mc_tfe device
for userspace to enumerate.
CRs-Fixed: 3321317
Change-Id: Ic7810dc198aece0d1d0fa50e547f69c72218d49a
Signed-off-by: Li Sha Lim <quic_lishlim@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>
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>
These changes fix some logic errors that were left in code, in
addition to fixing memory leak issues and removing unused
variables.
CRs-Fixed: 3394193
Change-Id: Ib257dcaf05d48913038718beca9e071730ac21c0
Signed-off-by: Atiya Kailany <quic_akailany@quicinc.com>
On flush specific request, update last flush request ID for
the link.
CRs-Fixed: 3404872
Change-Id: I05eade5792a891c78fa279895b8053ecb1ae9f95
Signed-off-by: Karthik Anantha Ram <quic_kartanan@quicinc.com>
Problem Description:
Missing context details in logs and mapping of
hw_mgr context id with isp context id during acquire.
Solution:
Add context id and link handle in ife_hw_mgr and isp_context
files. Add hw_id in csid, vfe top and vfe bus files. Also
add hw_mgr context id in isp_context file to map ISP context
with IFE hw mgr context during acquire, for better debuggability.
CRs-Fixed: 3354324
Change-Id: I455d5a6a5d6ec892899f6f84d73459faab0ceef2
Signed-off-by: Stuti Saxena <quic_stutsaxe@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>
If active/wait request lists are empty resume internal recovery
from the first request in the pending list.
CRs-Fixed: 3317349
Change-Id: Ib708d696065e2dc81deb1d27687d7afd191b0838
Signed-off-by: Karthik Anantha Ram <quic_kartanan@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>
Removes unnecessary rc assignments since they were not
being checked and there are already logs in the called
functions in case of error.
CRs-Fixed: 3322998
Change-Id: I3a087dea790b688956de34fd4a76911261293629
Signed-off-by: Joshua Florez <quic_jflorez@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>