Avoid programming RUP/AUP at CSID start for internal recovery.
The request being recovered will configure this appropriately via CDM.
Also avoid resetting epoch factor for IFE PIX resource at stream off
that is triggered internally, the UMD configured epoch factor is
needed to stream on again post recovery.
CRs-Fixed: 3045706
Change-Id: I865ad0c2c08330a29eacfea63b4e15892a84bd69
Signed-off-by: Karthik Anantha Ram <kartanan@codeaurora.org>
Make the context memory request for hw update entries,
in_map entries and the out_map entries per request, instead
of requesting the memory for all the requests at once in a
large blob. This will prevent the memory requests getting
denied in the situations like memory fragmentation.
CRs-Fixed: 3059124
Change-Id: I829407a6053ddddfe4bc9a07d3ae5724a57eb602
Signed-off-by: Jigar Agrawal <jigar@codeaurora.org>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>