Commit Graph

88 Commits

Author SHA1 Message Date
Ravikishore Pampana
02f65e4927 msm: camera: tfe: Add support last consumed address for tfe
Tfe hardware support the last consumed buf address.
Request port buf done verified with last consumed buffer
Address. Buf done irq delays can be handled through
last consumed address verification.

CRs-Fixed: 2784348
Change-Id: I4d629da44cf6f1b7755c7785eac11f72384c78c7
Signed-off-by: Ravikishore Pampana <rpampana@codeaurora.org>
2020-09-24 12:51:01 +05:30
Shravya Samala
8b38e86abd msm: camera: isp: Max requests per context reduction in isp driver
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>
2020-09-21 07:12:45 -07:00
Karthik Anantha Ram
d9a20488d8 msm: camera: common: Handle epoch if bubble recovery is disabled
If bubble recovery is disabled, IFE driver should continue
to notify that epoch to CRM as opposed to dropping that frame
in IFE. In case of sHDR if bubble recovery is disabled and IFE
does not notify the epoch at which bubble was detected it will lead
to a trigger count mismatch in CRM.

CRs-Fixed: 2768309
Change-Id: I311ce80857a905496c633708a5f4ee2391679037
Signed-off-by: Karthik Anantha Ram <kartanan@codeaurora.org>
2020-09-15 13:43:04 -07:00
Fernando Pacheco
46812a7030 msm: camera: ife: Always send stop immediately when stopping hw
As the name implies, we stop the HW sooner, so prefer it over
"stop at frame boundary".

CRs-Fixed: 2724889
Change-Id: I7fa353c09dbe733e57f099893edc0e7f7fa18e7a
Signed-off-by: Fernando Pacheco <fpacheco@codeaurora.org>
2020-08-27 10:50:06 -07:00
Haritha Chintalapati
eedefac65c Merge "msm: camera: sync: Rearrange sync reason events" into camera-kernel.lnx.4.0 2020-08-25 16:43:57 -07:00
Haritha Chintalapati
38ba051707 Merge "msm: camera: isp: Update ife substate before apply setting" into camera-kernel.lnx.4.0 2020-08-25 16:43:14 -07:00
Alok Chauhan
baf2d520ed msm: camera: sync: Rearrange sync reason events
Rearrange sync error reason code for better code
readability.

CRs-Fixed: 2750553
Change-Id: Ia64694155921c074946167763815a87beb856b35
Signed-off-by: Alok Chauhan <alokc@codeaurora.org>
2020-08-24 13:48:40 +05:30
Camera Software Integration
73fd4e6bef Merge "msm: camera: core: Send event on smmu page fault" into camera-kernel.lnx.4.0 2020-08-21 14:07:01 -07:00
Ravikishore Pampana
b746c4f527 msm: camera: core: Send event on smmu page fault
Currently when page fault happen, iommu driver callers camera
handler with CB details and iova address which caused the page
fault. With iommu iova address cam smmu driver finds the
closest mapping address for that cb and call the
corresponding driver to find the which port caused page fault.
This has limitation has page fault address always not mapped.
New approach is get the page fault ids from iommu driver.
Based on the Pid and Mid values, get the HW id and port ids,
go through all context which has this hw id and port id and log
the data. Once context id is identified, log the acquire data and
last consumed client address details. Dump the hw register data
in the given buffer. Send the smmu page fault event through
v4l2 queue to user.

CRs-Fixed: 2750690
Change-Id: I87c809b3229992c7c95655a4f3c6c70ebc035ae8
Signed-off-by: Ravikishore Pampana <rpampana@codeaurora.org>
2020-08-19 14:16:38 +05:30
Alok Chauhan
1d1edb7030 msm: camera: sync: Add SYNC_V4L_EVENT_V2 support in sync driver
Add SYNC_V4L_EVENT_V2 support in sync driver. As part of this
change, added the reason code field as part of sync event header.
This failure reason code is filled by camera kernel driver and
propagate to userspace.

CRs-Fixed: 2750553
Change-Id: I206d0d51c38cfe4214814b89d241f51c1f50605b
Signed-off-by: Alok Chauhan <alokc@codeaurora.org>
2020-08-16 11:14:20 +05:30
Haritha Chintalapati
06a9ad0ba4 Merge "msm: camera: ife: Get consumed address info during hw_mgr init" into camera-kernel.lnx.4.0 2020-08-11 19:04:00 -07:00
Depeng Shao
494ace8da7 msm: camera: ife: Get consumed address info during hw_mgr init
This change checks whether the context supports last consumed
address during hw_mgr init.

CRs-Fixed: 2749254
Change-Id: I238893eb2d661014a2a51758bcf71c3e4d00f2d5
Signed-off-by: Depeng Shao <depengs@codeaurora.org>
2020-08-08 12:35:35 +08:00
Fernando Pacheco
0d784286a9 msm: camera: common: Avoid uninitialized accesses
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>
2020-08-06 13:41:05 -07:00
Depeng Shao
86f144a267 msm: camera: isp: Handling IRQ delays
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>
2020-08-04 12:00:00 +08:00
Depeng Shao
7ccae419d3 msm: camera: isp: Update ife substate before apply setting
Offline mode may receive the SOF and REG_UPD irq event
earlier than CMD processing return back, then the event
will be dropped. This change updates ife substate to
APPLIED state before apply setting and move the req
to wait list.

CRs-Fixed: 2736862
Change-Id: I052c618ef64aae0e30232609a209a0dc43b53f8c
Signed-off-by: Depeng Shao <depengs@codeaurora.org>
2020-07-30 19:24:37 -07:00
Camera Software Integration
ed39aa54a0 Merge "msm: camera: isp: Remove bubble re-apply recovery mechanism" into camera-kernel.lnx.4.0 2020-07-28 16:12:42 -07:00
Haritha Chintalapati
82c16fb39a Merge "msm: camera: ife: Optimize the IFE CDM Acquire" into camera-kernel.lnx.4.0 2020-07-27 13:37:12 -07:00
Karthik Anantha Ram
986223aab6 msm: camera: isp: Remove bubble re-apply recovery mechanism
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>
2020-07-24 14:01:12 -07:00
Jigar Agrawal
3f8fc789d9 msm: camera: ife: Optimize the IFE CDM Acquire
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>
2020-07-21 17:02:06 -07:00
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