Allocate context map entries based on the chipset and also
the underlying HW acquired for the given context.
CRs-Fixed: 2841729
Change-Id: Ieeb442c74bd3b6c9c32fbe47b59f40a8485963b3
Signed-off-by: Karthik Anantha Ram <kartanan@codeaurora.org>
Kernel apis provide information fault caused pid and mid data.
Handle the OPE smmu fault using pid and mid data. Based on the
mid data, dump only corresponding port info which caused the
fault. Pid and mid values are target dependent, these values
will be updated on the ope node dt entries.
CRs-Fixed: 2857868
Change-Id: I909f1787e71e67e5ed1d3464dfeb506418d151e4
Signed-off-by: Vikram Sharma <vikramsa@codeaurora.org>
If CRM skips applying settings on a given frame, in case of sHDR
program scratch buffers along with RUP/AUP to ensure
continuity with respect to sensor frames.
CRs-Fixed: 2841729
Change-Id: I296dbc713f49db54681043415b6ad1499dc13de4
Signed-off-by: Karthik Anantha Ram <kartanan@codeaurora.org>
Kernel 5.5+ changed debugfs API's for creating simple dentry variables.
There is now no return value for those API's.
CRs-Fixed: 2835738
Change-Id: Ic5eea63f2e94451e5dfb211cb2b4aa80ce47073a
Signed-off-by: Karthik Jayakumar <kjayakum@codeaurora.org>
In Waipio, the sequence of the RUP and SOF interrupts is reversed as
compared to previous generations. RUP is observed before SOF.
This requires handling of RUP in applied state, which is missing in the
RDI only state machine leading to the state machine looping to the
bubble state repeatedly.
By adding the transition from applied to epoch state on RUP, looping
over the bubble state is no longer observed.
CRs-Fixed: 2846451
Change-Id: Ib298695ae2aad248b76a6e05c6a9b4d84793717b
Signed-off-by: Anand Ravi <ananravi@codeaurora.org>
In current implementation, cam_ctx_req has a array of
hw_update_entries, in_map_entries and out_map_entries. Each
context has array of N requests. Memory for all contexts is
allocated during probe. This causes a huge memory remaining
unutilized.
This commit moves the memory allocation to context acquire time
and freeing this memory during context release. In place
of using array, now dynamic allocation is used.
A top level calculation shows a memory reduction of around 2M-
2.5M with this change including all the camera drivers.
CRs-Fixed: 2830502
Change-Id: Id63cf2a52272e2a419704dc95100694e384330c3
Signed-off-by: Gaurav Jindal <gjindal@codeaurora.org>
If there is a use-case where lite can be used to support PIX resources,
as a part of acquire, a hint will be sent to indicate that lite can
be acquired. This hint is used to acquire the lite csid based on the
use-case.
CRs-Fixed: 2830502
Change-Id: Ib0a005ed64cd7ffec579195948f0fcb8b24ea837
Signed-off-by: Gaurav Jindal <gjindal@codeaurora.org>
This change prevents excessive logging. WARN_ON() prints
call stack which cause excessive logging in tasklet.
Removes WARN_ON() in error case where buf done irq for
a request exceeds actual number of out port.
CRs-Fixed: 2828453
Change-Id: I020cc74b73841e9599c4d1570829c6b086e768ec
Signed-off-by: Chandan Kumar Jha <cjha@codeaurora.org>
In case of any error IRQs encountered during stop, there is
no need to notify them to UMD since the entire pipeline
would be reset prior to next session start. With this change
we transition to HALT state and then issue stop.
CRs-Fixed: 2825121
Change-Id: I9535439d1a29e3b6f8da968b60e5b2b5bc32c1bf
Signed-off-by: Karthik Anantha Ram <kartanan@codeaurora.org>
If buf done error come for same applied request id then log
only once. Change the bufdone deferred logs to debug logs.
CRs-Fixed: 2824276
Change-Id: I870708bfb0c4f0ad0a1fade3a7e334551d055c73
Signed-off-by: Ravikishore Pampana <rpampana@codeaurora.org>
In cases where we see a buf done without request being in
active_list, there could be a possibility that the request
is applied just before SOF, RUP but the context state is
not moved to Applied state, at this time the request is in
wait_list. In such cases RUP event doesn't move the request
into active_list. Also if the BUF_DONE on a port is happening
before EPOCH, we simply drop that BUF_DONE and then the request
will eventually be tagged as BUBBLE at the time of EPOCH. But
since BUF_DONE is dropped, the request will never come out of
BUBBLE. To handle such cases and to come out of BUBBLE,
check if BUF_DONE matches with the request in wait_list by
checking last_consumed address and if so, mark it as deferred
buf_done and handle once the request is moved to active_list.
CRs-Fixed: 2814346
Change-Id: I778a6a684076d5327d536f319a23206ccc0c25b6
Signed-off-by: Pavan Kumar Chilamkurthi <pchilamk@codeaurora.org>
Re-apply bubble request if buf done has not come for 2 bubble frames.
Also before re-submitting the request to CDM check if CDM callback for that
request has come or not, if CDM callback is received then wait for buf
done else reset CDM and re-submit the request to CDM.
CRs-Fixed: 2807378
Change-Id: I1fd209482e14d58aa48d12194084d0a2ab943e31
Signed-off-by: Wyes Karny <wkarny@codeaurora.org>
When we do flash operation in SHDR usecase, the
trigger count will mismatch if we don't pass
trigger id to CRM.
CRs-Fixed: 2813321
Change-Id: Ic557f1122f8698f987d249fe1d15e35b90326e1d
Signed-off-by: Depeng Shao <depengs@codeaurora.org>
1. Add more triggers to save cpas state info. IFE EOF, ReqBufDone
2. Save camnoc fill levels in each cpas log state
3. Print camnoc QoS settings in cpas state dump for debug
purpose. Though these are static settings, printing will
help in making sure correct settings are applied.
CRs-Fixed: 2814346
Change-Id: Ic3018c5f7fdeaac3a123c6d046eb5e6a34a675e7
Signed-off-by: Pavan Kumar Chilamkurthi <pchilamk@codeaurora.org>
This change adds support for Waipio bus hardware. It also
changes the bus private structure to be pointer based so
that most of the information is filled from hardware
specific headers.
CRs-Fixed: 2794540
Change-Id: Ie9d30442246a896f372512b62bd54be32c4921ad
Signed-off-by: Venkat Chinta <vchinta@codeaurora.org>
Signed-off-by: Mukund Madhusudan Atre <matre@codeaurora.org>
In order to reduce the traffic on the v4l2 queue, avoid
posting qtimer shutter for bubbled frames.
CRs-Fixed: 2799794
Change-Id: Id752605e7aff89246edfeec9337612bb7c9b4790
Signed-off-by: Karthik Anantha Ram <kartanan@codeaurora.org>
msm: camera: cdm: Fix dangling pointer issue
msm: camera: cdm: change work record to atomic variable
msm: camera: utils: Adding device type to track device handles
msm: camera: tfe: Reduce stack footprint during bw vote
msm: camera: req_mgr: Thread switch delay detection mechanisms
msm: camera: cdm: Avoid submitting BL if FIFO is full
msm: camera: tfe: check cdm hang in the tfe config timeout
msm: camera: req_mgr: Delay detection mechanism
msm: camera: cdm: Debug info in case of cdm page fault
msm: camera: isp: Max context reduction for TFE in isp driver
msm: camera: ope: Maintain current clock value during acquire
msm: camera: req_mgr: Limit CAM_ERR log in case of no empty task
msm: camera: cdm: Decrement write-count only after Bl commit
msm: camera: isp: Added CSID recovery mechanism.
CRs-Fixed: 2792394
Change-Id: I1c7a903ae15b572acf3f6318cda7394cb6549c8d
Signed-off-by: Tejas Prajapati <tpraja@codeaurora.org>
Print the context id in the error statement when release_hw is
called in top state with no hw resources acquired.
CRs-Fixed: 2709537
Change-Id: Ic153cc7f92cfc15a56e7989b0337a4e051af4c43
Signed-off-by: Anand Ravi <ananravi@codeaurora.org>
Add support to dump the cdm core debug registers and CDM hang detect
support for better debugging purpose in case of cdm timeout at config
ife. Add a debugfs for CDM command buffer dump for cdm hang events.
Fix the possible NULL derefernce while dumping the cdm registers.
Turn on debugfs using following command in adb shell:
echo 1 >> /sys/kernel/debug/camera_isp_ctx/enable_cdm_cmd_buffer_dump.
CRs-Fixed: 2748715, 2782720, 2770565
Change-Id: Ibb9aa1d232d742ca1b6e64c16e9718bfc0bc8624
Signed-off-by: Jigar Agrawal <jigar@codeaurora.org>
In bubble cases and if not recovered, error logs causing
excessive logging issues. Change the error and warn logs to
rate limited in error bubble and apply failure cases.
CRs-Fixed: 2785070
Change-Id: Ia7268cfc7b672c24f3161cd65c53df5ee357e7ee
Signed-off-by: Ravikishore Pampana <rpampana@codeaurora.org>
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>
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>
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>
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>
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>
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>
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>
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>
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>