Improve the error-handling code paths to prevent accesses to
uninitialized variables. This is done by either picking a sane
default for the variable or skipping accesses altogether after
an unsuccessful attempt to initialize.
CRs-Fixed: 2748220
Change-Id: Ibe383e56ec4e3f45f76f619c7d6b62c3d7dfcadb
Signed-off-by: Fernando Pacheco <fpacheco@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>
CSID is not able to recover from the fatal errors like lane
overflows, continuous unbound frames or ESD errors. To recover
from such errors, it is necessary to restart the sensor as
just starting the ISP hw do not make any change as the sensor
can still be in bad state.
This commit implements tasklet based CSID recovery mechanism.
On detecting an error in CSID interrupt, tasklet is scheduled
which in turn will call the ISP hw manager to notify the ISP
context, from here a notification is sent to CRM to send a
message to trigger full recovery. This full recovery includes
the sensor release and start.
This feature is debugfs based. Based on need this can be turned
on.
CRs-Fixed: 2642216
Change-Id: Iecf9916d3672d71a1367886cc934b5a2b148f918
Signed-off-by: Gaurav Jindal <gjindal@codeaurora.org>
Signed-off-by: Vishalsingh Hajeri <vhajeri@codeaurora.org>
Signed-off-by: Mukund Madhusudan Atre <matre@codeaurora.org>
When we wait on Bufdone for Bubble Request in Bubble state,
We don't know whether the CDM is hung or Bufdone is delayed.
This change prints more information for bubble request to
ascertain CDM is in good state.
CRs-Fixed: 2705745
Change-Id: I98215904b5665281808e775c97c6747a38eb1081
Signed-off-by: Vishalsingh Hajeri <vhajeri@codeaurora.org>
Add HW index in Release, Acquire, Flush and confiqure
IFE Logs to Improve the debugging.
CRs-Fixed: 2709537
Change-Id: Ia540f1498d889f1e744e6ab20e07d17e27b07731
Signed-off-by: Jigar Agrawal <jigar@codeaurora.org>
Guards debugfs features in camera driver to only be compiled when
CONFIG_DEBUG_FS is enabled.
CRs-Fixed: 2717236
Change-Id: I0de77741301d259cbec64e8a2e27830981b2b69d
Signed-off-by: Karthik Jayakumar <kjayakum@codeaurora.org>
This change resets the offline context flag,
otherwise the packet may be applied to HW immediately
if this context is offline context last time.
CRs-Fixed: 2696977
Change-Id: I2fc836f7ba2889ec62273c3b12cc4050736f587b
Signed-off-by: zhuo <zhuo@codeaurora.org>
Fixes exit call flow as a part of rmmod.
CRs-Fixed: 2675526
Change-Id: I47111a737cb06d9bb3d0a417a471c5c9fb545999
Signed-off-by: Jigarkumar Zala <jzala@codeaurora.org>
Added wrapper functions for each workq to enable workq names
in log.
CRs-Fixed: 2684378
Change-Id: If5b3671fbf20777cc891cba4b27cad6ed3a0d146
Signed-off-by: Wyes Karny <wkarny@codeaurora.org>
When there is a delay in offline ife workqueue scheduling
it is possible that two requests are applied back to back.
This could lead to requests lost. Therefore we must check
for epoch flag before applying any request.
CRs-Fixed: 2686281
Change-Id: I323710a61301d79e78db22dc1f66a6a0f141389a
Signed-off-by: Venkat Chinta <vchinta@codeaurora.org>
num_cfg_new temp variable should be assigned the value of
num_hw_entries from new isp request instead of old isp request.
CRs-Fixed: 2673657
Change-Id: Ie4d29949e2c992560b6635f7e0b5db88c2dafd48
Signed-off-by: Vishalsingh Hajeri <vhajeri@codeaurora.org>
The last reported request ID indicates the request ID for which
the shutter was sent last. Only update this field for requests
that have not bubbled in a given IFE ctx.
CRs-Fixed: 2680502
Change-Id: I9ee4b479fe95800efa40ea1ff8d840fc79ef6528
Signed-off-by: Karthik Anantha Ram <kartanan@codeaurora.org>
This change removes valid request ID from sof notification
when bubble is detected. The sof notification for this request
will be sent after the state machine moves out of bubble applied
state. This is to avoid duplication of timestamps in case of
bubble due to IRQ delays.
CRs-Fixed: 2671273
Change-Id: I5334fab41ae5bce8a42e421747b35f9bfd32aff3
Signed-off-by: Venkat Chinta <vchinta@codeaurora.org>
New usecase for flash driver requires to be trigger at EOF.
This change adds the new operation code support in flash
driver along with EOF enable support in crm and across
other drivers. Also to improve the performance, this change
adds the logic to dynamically update the subscribe event to
CRM, so that CRM can enqueue EOF events when Flash or any other
device add the request for EOF.
CRs-Fixed: 2633194
Change-Id: I2f68ac7fc6a4699debd39b64319728cdf17bbcfa
Signed-off-by: Jigarkumar Zala <jzala@codeaurora.org>
Add trace events for IRQ's on IFE top side and IFE
BUS side in top half. These traces when enabled
will help to gather relative timing information of
the IRQ's with systrace.
CRs-Fixed: 2538876
Change-Id: I856a9df1978f90e260da7c62cadf02fa2fe53202
Signed-off-by: Vishalsingh Hajeri <vhajeri@codeaurora.org>
Signed-off-by: Pavan Kumar Chilamkurthi <pchilamk@codeaurora.org>
crm applied both sensor and isp packets,sensor packet failed to
apply due to CCI timeout error. In the meantime ISP packet applied
and that request of ISP moved to free_list.In the next epoch crm
trying to reapply both the packets of sensor and isp again.In this
case ISP always reporting an apply failure because its pending queue
doesn’t have that request.To handle this we are skipping to re-apply
the ISP successful buf_done request and trying to apply only sensor
packet in this scenario.
CRs-Fixed: 2599186
Change-Id: Id7e72fc016a75782b57f05558c615b069b416ffe
Signed-off-by: Mangalaram ARCHANA <mangar@codeaurora.org>
Currently CRM waits for a single trigger to apply settings
for all the devices on a given link. This change provides
provision for CRM to wait on two triggers prior to applying
a given setting.
CRs-Fixed: 2627065
Change-Id: If6e4c9281cfd1bf1a8ffa369daee060d79f3c39e
Signed-off-by: Karthik Anantha Ram <kartanan@codeaurora.org>
Currently requests for offline IFE are applied from tasklet
context or from an ioctl thread within a critical section
protected by a spinlock. In both of these cases, preemtion is
disabled but CDM requires mutex locks during this operation.
Therefore a work queue is added in this change to handle
apply request for offline IFE.
CRs-Fixed: 2606911
Change-Id: Ie893a626bc274d026fb878f1f19830e990be6dc6
Signed-off-by: Venkat Chinta <vchinta@codeaurora.org>
In cases where IRQ delays or overlap happens, the IRQ
we get for the resource may belong to the 2nd request
in the queue. If the IRQ resource is not found in top
request, look into the second request as well.
CRs-Fixed: 2600457
Change-Id: Ida2665a00169463e2f146de1cfa6be076d8c7d72
Signed-off-by: Pavan Kumar Chilamkurthi <pchilamk@codeaurora.org>
This change adds new IRQ state machine and updates the acquire
logic to enable offline IFE. This change also adds the fixes
necessary to enable bus read for various buffer formats and
append go command at the end of each packet for offline
context.
CRs-Fixed: 2513939
Change-Id: Ie068670ed11aa6713e8f0cb817e4b5d4c209e696
Signed-off-by: Venkat Chinta <vchinta@codeaurora.org>
In use-cases that involve custom HW retrieve the timestamp
for shutter from frame header as opposed to csid registers.
CRs-Fixed: 2524308
Change-Id: I5de789cf939546affbfe6d537d8090982f39189d
Signed-off-by: Karthik Anantha Ram <kartanan@codeaurora.org>
When user space detects an error or does not receive
response for a request, Lets do a reset(LDAR) is triggered.
Before LDAR, user space sends flush command to the
kernel space.
In order to debug the cause for this situation and to dump
the information, user space sends a dump command to
kernel space before sending flush.
As a part of this command, it passes the culprit request id
and the buffer into which the information can be dumped.
Kernel space traverses across the drivers and find the culprit hw
and dumps the relevant information in the buffer.
This data is written to a file for offline processing.
This commit dumps the IFE, CSID registers, LUT tables and context
information, cmd buffers, timestamps information for
submit, apply, RUP, epoch and buffdones of the last 20
requests.
CRs-Fixed: 2612116
Change-Id: If83db59458c1e5ad778f3fa90cbc730122491c54
Signed-off-by: Gaurav Jindal <gjindal@codeaurora.org>
This change captures the frame index as part of the IFE top
register space at every epoch event. The index is then notified
to userspace as part of shutter notification.
CRs-Fixed: 2524308
Change-Id: Iac510c452f9ceda86e9f7d69528f22f81e614974
Signed-off-by: Karthik Anantha Ram <kartanan@codeaurora.org>
While processing the user space submitted isp packet,
isp context need to know the packet opcode.
Get the opcode from the hw manager than the direct accessing the
opcode from packet.
Ife umd sends different opcodes then tfe umd. Both ife and tfe kernel
packet opcodes are same. So hw manager can consume this differences.
CRs-Fixed: 2585713
Change-Id: I54813af233cd8bfa640f2688c1334510a5b85f1c
Signed-off-by: Ravikishore Pampana <rpampana@codeaurora.org>
First request id not getting dump if early pcr is on.
If early pcr is on need to store the parsed register dump descriptor
for first request id which comes as init packet.
CRs-Fixed: 2595702
Change-Id: Icbf94d65b5c35cdf47044d770c7db7093001d506
Signed-off-by: Ravikishore Pampana <rpampana@codeaurora.org>
Signed-off-by: Mukund Madhusudan Atre <matre@codeaurora.org>
The EPOCH at which bubble is detected no setting is applied
to any device. This change will trigger applying the bubbled
setting to the device with highest pipeline delay.
CRs-Fixed: 2564669
Change-Id: I180b4a1d2d29267f330546b8860a099baf1688e9
Signed-off-by: Karthik Anantha Ram <kartanan@codeaurora.org>
Reset the slot with the valid request on receiving
the buf_done which is reported on next EPOCH.
In case of back to back irqs slot is marked as skip idx
it will apply the request and try to reset a slot based
on MAX_PD + 1 calculation which might have the request
for which we have got a bubble. To make sure this does not
happen, reset a slot only on the buf_done for valid request.
If STOP ioctl is called from UMD for ISP, it will flush all
the lists. But this is not notified to CRM which might have
a stale entry of the half applied request, so on STOP ioctl
clear all the slots.
In case of SAT mode if one of the link has generated bubble,
while the sync_link has the sync_request slot reset sync_link
will not let the link recover of the bubble. To make sure the
recovery sync_mode is set to 0 for two consecutive slots of
the link.
CRs-Fixed: 2551701
Change-Id: If4b6f8a4a831ffddcef2cae6292d066778c18b04
Signed-off-by: Tejas Prajapati <tpraja@codeaurora.org>
TFE is thin front end hardware that capture and process the
real time image. Support is added to enable the TFE
hardware.
CRs-Fixed: 2594541
Change-Id: I0ab2eff7924e9e01f6a0fcec772d3a7dda229b37
Signed-off-by: Ravikishore Pampana <rpampana@codeaurora.org>
Signed-off-by: Trishansh Bhardwaj <tbhardwa@codeaurora.org>
Adding CRM interface to stop SOF timer from isp during flush.
During flush hardware is getting stop and will not send SOF
notification to CRM so need to pause SOF timer. Whenever SOF
timer will get expire,do not need to send error to UMD during
pause time.
CRs-Fixed: 2564389
Change-Id: I6d85f2c658c30dbe211f0ec9d83bca323a5c265b
Signed-off-by: Chandan Kumar Jha <cjha@codeaurora.org>
Improve sp substate logging to print state string
instead of value. Add handler for reg_update in
bubble state to print a warning log indicate the
event.
CRs-Fixed: 2523062
Change-Id: I95c6f16733a177cbf33099775d8ef7eb049a62b4
Signed-off-by: Pavan Kumar Chilamkurthi <pchilamk@codeaurora.org>
This change limits SOF in early PCR log to the first
frame for that context. This log is needed to catch
unexpected reg updates on first frame after stream on.
CRs-Fixed: 2553728
Change-Id: Icad85aeab2b095a6b95889c933a2de34acebed80
Signed-off-by: Venkat Chinta <vchinta@codeaurora.org>
Signed-off-by: Vishalsingh Hajeri <vhajeri@codeaurora.org>
Signed-off-by: Pavan Kumar Chilamkurthi <pchilamk@codeaurora.org>
This commit changes the isp context state to flushed state
immediately in order to ignore any further IRQs from the HW.
CRs-Fixed: 2546941
Change-Id: I47f4999a3f51b581697e8dbfd07ef1539b478766
Signed-off-by: Venkat Chinta <vchinta@codeaurora.org>