Commit Graph

69 Commits

Author SHA1 Message Date
Gaurav Jindal
5f7b7386cf msm: camera: isp: Added CSID recovery mechanism
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>
2020-07-20 18:02:12 -07:00
Vishalsingh Hajeri
3adf5ea68e msm: camera: isp: Add handle function for RUP in bubble
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>
2020-07-10 14:08:39 -07:00
Camera Software Integration
c29fcea3e2 Merge "msm: camera: ife: Improve IFE logs for better debugging" into camera-kernel.lnx.4.0 2020-07-07 17:56:02 -07:00
Jigar Agrawal
f3435b0efd msm: camera: ife: Improve IFE logs for better debugging
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>
2020-07-01 14:08:10 -07:00
Karthik Jayakumar
7c8204a42d msm: camera: common: Enable debugfs compile check
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>
2020-07-01 10:59:24 -07:00
zhuo
124ac14bf9 msm: camera: isp: Reset offline context flag
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>
2020-06-23 12:04:49 -07:00
Camera Software Integration
235a9117e6 Merge "msm: camera: reqmgr: Work queue names added" into camera-kernel.lnx.4.0 2020-06-18 17:17:27 -07:00
Jigarkumar Zala
279dfebf8c msm: camera: common: Fixes the exit module code flow
Fixes exit call flow as a part of rmmod.

CRs-Fixed: 2675526
Change-Id: I47111a737cb06d9bb3d0a417a471c5c9fb545999
Signed-off-by: Jigarkumar Zala <jzala@codeaurora.org>
2020-06-09 12:08:22 -07:00
Camera Software Integration
9d3794440c Merge "msm: camera: isp: Check for epoch before applying" into camera-kernel.lnx.4.0 2020-06-05 19:09:40 -07:00
Wyes Karny
7eb3653915 msm: camera: reqmgr: Work queue names added
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>
2020-06-05 15:33:31 -07:00
Venkat Chinta
4544e11ed9 msm: camera: isp: Check for epoch before applying
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>
2020-06-01 10:19:08 -07:00
Vishalsingh Hajeri
68846d2555 msm: camera: isp: Fix num_entries value assigned to variable
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>
2020-05-29 14:47:55 -07:00
Camera Software Integration
efaf7facfb Merge "msm: camera: sync: Add SYNC_CANCEL support in sync driver" into camera-kernel.lnx.4.0 2020-05-26 13:13:46 -07:00
Pavan Kumar Chilamkurthi
74410fea6b msm: camera: sync: Add SYNC_CANCEL support in sync driver
Add SYNC_CANCEL definition and signal CANCEL instead of
ERROR in flush cases.

CRs-Fixed: 2673810
Change-Id: I1bd83e382f9b38f5f020a5af3b883083e211e3d2
Signed-off-by: Pavan Kumar Chilamkurthi <pchilamk@codeaurora.org>
2020-05-20 12:48:36 -07:00
Karthik Anantha Ram
26ef750076 msm: camera: isp: Update last reported request ID correctly
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>
2020-05-15 12:50:29 -07:00
Venkat Chinta
758e751074 msm: camera: isp: Remove request ID in bubble sof notification
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>
2020-04-23 15:45:53 -07:00
Camera Software Integration
0819ac8dba Merge "msm: camera: isp: Add trace events across ISP" into camera-kernel.lnx.4.0 2020-04-17 19:37:44 -07:00
Camera Software Integration
43e77a1892 Merge "msm: camera: cdm: Enable internal CDM" into camera-kernel.lnx.4.0 2020-03-27 18:22:54 -07:00
Vishalsingh Hajeri
ca48923671 msm: camera: cdm: Enable internal CDM
Add support to acquire IFE CDM instead of CPAS
CDM.

CRs-Fixed: 2571273
Change-Id: Iea3bcf236d00d39bf19e0997e6d21efcd5406a61
Signed-off-by: Jigar Agrawal <jigar@codeaurora.org>
Signed-off-by: Vishalsingh Hajeri <vhajeri@codeaurora.org>
2020-03-23 07:16:15 -07:00
Jigarkumar Zala
438fc6a877 msm: camera: common: Enabling EOF support for flash
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>
2020-03-20 11:02:03 -07:00
Vishalsingh Hajeri
a913f342a0 msm: camera: isp: Add trace events across ISP
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>
2020-03-18 10:35:11 -07:00
Camera Software Integration
52222ca8b2 Merge "msm: camera: reqmgr: skip re_apply of ISP for buf_done request" into camera-kernel.lnx.4.0 2020-03-16 16:38:41 -07:00
Mangalaram ARCHANA
1f40c7a467 msm: camera: reqmgr: skip re_apply of ISP for buf_done request
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>
2020-03-12 11:23:26 -07:00
Karthik Anantha Ram
b7a494a130 msm: camera: reqmgr: Add support for dual trigger
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>
2020-03-11 15:47:07 -07:00
Venkat Chinta
32eade687a msm: camera: isp: Config hardware in work queue
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>
2020-02-19 17:56:44 -08:00
Pavan Kumar Chilamkurthi
a44cb8d722 msm: camera: ife: Look into next request if res not found
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>
2020-02-13 10:59:21 -08:00
Venkat Chinta
8e79606ada msm: camera: isp: Add support for offline IFE
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>
2020-02-10 15:50:56 -08:00
Karthik Anantha Ram
381bb12c68 msm: camera: isp: Obtain timestamp as part of frame header
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>
2020-02-10 14:56:25 -08:00
Gaurav Jindal
e3f5738e43 msm: camera: isp: LDAR Dump ISP information
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>
2020-02-10 14:39:46 -08:00
Karthik Anantha Ram
5ddf0a5cfb msm: camera: isp: Add support to obtain frame index
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>
2020-02-08 00:15:28 -08:00
Camera Software Integration
0894c95dda Merge "msm: camera: isp: Get packet opcode from hw manager" into camera-kernel.lnx.4.0 2020-02-07 15:14:33 -08:00
Ravikishore Pampana
4f1ba0f292 msm: camera: isp: Get packet opcode from hw manager
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>
2020-02-06 15:13:05 -08:00
Ravikishore Pampana
05378eff25 msm: camera: isp: Register dump for first request id
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>
2020-02-06 13:01:12 -08:00
Camera Software Integration
d9c3665f6b Merge "msm: camera: reqmgr: Reduce delay by one frame during bubble recovery" into camera-kernel.lnx.4.0 2020-02-03 14:10:09 -08:00
Karthik Anantha Ram
fbfa512811 msm: camera: reqmgr: Reduce delay by one frame during bubble recovery
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>
2020-01-30 10:53:46 -08:00
Tejas Prajapati
96390653c5 msm: camera: reqmgr: reset the slot on buf_done
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>
2020-01-30 03:34:07 -08:00
Trishansh Bhardwaj
cb2e8943da msm: camera: tfe: Add support to TFE driver
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>
2020-01-16 17:45:42 +05:30
Chandan Kumar Jha
fc8ddd752d msm: camera: isp: Notify CRM to pause SOF timer after flush
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>
2019-11-14 08:06:56 -08:00
Pavan Kumar Chilamkurthi
09e2bdc6bf msm: camera: isp: Improve isp substate logging
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>
2019-10-28 13:31:25 -07:00
Venkat Chinta
c23b668890 msm: camera: isp: Limit sof_in_epoch log to first frame
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>
2019-10-28 11:39:27 -07:00
Venkat Chinta
04cf1dd4ae msm: camera: isp: Change state immediately in flush
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>
2019-10-23 15:50:23 -07:00
Vishalsingh Hajeri
efffa6d11a msm: camera: isp: Dump isp req for cdm timeout
Print out CDM command buffers to check for invalid
command entry.

CRs-Fixed: 2549972
Change-Id: I5998e62e4ba72fa67394ddf92a4680bc1c909597
Signed-off-by: Vishalsingh Hajeri <vhajeri@codeaurora.org>
2019-10-23 15:48:50 -07:00
Venkat Chinta
80560aa938 msm: camera: isp: Add log for first SOF in EPCR
This change adds a log for first SOF in early PCR.

CRs-Fixed: 2546941
Change-Id: Iaca8695f0886fecba84e40b06798818b3f864c35
Signed-off-by: Venkat Chinta <vchinta@codeaurora.org>
2019-10-21 16:34:38 -07:00
Trishansh Bhardwaj
35bead08c3 msm: camera: common: Fix compilation issues for 32-bit arch
Fix improper use of divide and modulo operator on 64 bit numbers.
Fix variable type to work with both 32/64 bit arch.

CRs-Fixed: 2543730
Change-Id: Ifa52d46dece3434d41308d284982a0cd8e17cd1b
Signed-off-by: Trishansh Bhardwaj <tbhardwa@codeaurora.org>
2019-10-21 15:46:03 -07:00
Venkat Chinta
064d662a3c msm: camera: isp: Update last applied request ID
This change updates last applied request ID when init packets
are applied and when stop ioctls are invoked.

CRs-Fixed: 2539888
Change-Id: I113b7897740d6577a4757ce41f9fcb1fff8c56e9
Signed-off-by: Venkat Chinta <vchinta@codeaurora.org>
2019-10-17 14:52:41 -07:00
Venkat Chinta
11e7f21754 msm: camera: isp: Set error type to fatal
This change sets error type to fatal by default when hardware
errors occur.

CRs-Fixed: 2545140
Change-Id: Ic530fe460e67b6d5ec26a6d9d5735f4c8b34affc
Signed-off-by: Venkat Chinta <vchinta@codeaurora.org>
2019-10-16 14:38:06 -07:00
Venkat Chinta
f8c6095719 msm: camera: isp: Add log in flush
This change adds a log in flush to indicate stop/restart HW complete.

CRs-Fixed: 2545140
Change-Id: I0068f239c5efeb536d60a9de27577d46bdc66edd
Signed-off-by: Venkat Chinta <vchinta@codeaurora.org>
2019-10-16 14:32:49 -07:00
Vishalsingh Hajeri
1aadfe80e8 msm: camera: isp: Remove redundant use of spin lock
Interrupts in activated state machine are already
protected with spin_lock for context. No need to
reuse the spin_lock in interrupt handling routine.

CRs-Fixed: 2538876
Change-Id: Id86e7dc3419861cb8bce143c56923126a3dc3d3e
Signed-off-by: Vishalsingh Hajeri <vhajeri@codeaurora.org>
2019-10-14 17:40:28 -07:00
Vishalsingh Hajeri
5c2bb43241 msm: camera: isp: Re-apply Bubble request
In certain scenario Buf_done failures are observed
for the request which is in bubble state. Since we
never get bufdone we inadvertently are stuck
in Bubble state. This change will wait for a period
of two frames to receive bufdone and recover from bubble
state. If any bufdone IRQ is never generated within this
time period, we remove the request from active list and
add it back to pending request list.

CRs-Fixed: 2506159
Change-Id: Ibcce21a1a87d0a64e49c6454391ca139fc7d1fa7
Signed-off-by: Vishalsingh Hajeri <vhajeri@codeaurora.org>
2019-10-04 11:58:16 -07:00
Venkat Chinta
8c91109b74 msm: camera: core: Change return type
Return different error number when new requests and update
packets are rejected due to bad request ID. This allows
userspace to differentiate this specific reason for failure.

CRs-Fixed: 2518451
Change-Id: I0400c6f2b2e0baf99bee4b4a3736bb1eab646627
Signed-off-by: Venkat Chinta <vchinta@codeaurora.org>
2019-10-04 11:55:34 -07:00