Commit Graph

165 Commits

Author SHA1 Message Date
Anand Ravi
25ee65107a msm: camera: isp: Add support for flush in offline IFE
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>
2021-07-19 09:02:49 -07:00
Karthik Anantha Ram
5d5b3a5144 msm: camera: isp: Add support for AEB use-case
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>
2021-07-14 10:57:31 -07:00
Camera Software Integration
fbc548b838 Merge "msm: camera: isp: Add support for clk bw update on config" into camera-kernel.lnx.5.0 2021-07-09 18:53:56 -07:00
Savita Patted
44d4c40b5f Merge "msm: camera: req_mgr: Increase in_q rdx index in workqueue" into camera-kernel.lnx.5.0 2021-07-08 13:22:32 -07:00
Mukund Madhusudan Atre
fc00541bb9 msm: camera: isp: Add support for clk bw update on config
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>
2021-07-08 08:45:10 -07:00
Savita Patted
dba6c5e0f0 Merge "msm: camera: common: Change shutdown sequence for subdevices" into camera-kernel.lnx.5.0 2021-07-07 09:54:21 -07:00
Savita Patted
5000fbf826 Merge "msm: camera: isp: Reset sync object if signaled" into camera-kernel.lnx.5.0 2021-07-06 08:57:21 -07:00
Ayush Kumar
f510695ed6 msm: camera: req_mgr: Increase in_q rdx index in workqueue
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>
2021-07-05 17:56:46 +05:30
Karthik Anantha Ram
d785949196 msm: camera: common: Change shutdown sequence for subdevices
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>
2021-06-30 17:04:11 -07:00
Karthik Anantha Ram
3f4b6558c1 msm: camera: isp: Reset sync object if signaled
Reset sync obj in isp request structure to -1 if signaled.

CRs-Fixed: 2967520
Change-Id: Ie8e163785a88e9cd88f8423f2e7dad5c6f72c4de
Signed-off-by: Karthik Anantha Ram <kartanan@codeaurora.org>
2021-06-29 16:22:50 -07:00
Ayush Kumar
e8e814eda9 msm: camera: req_mgr: CRM Code refactoring
Due to major changes in CRM code, refactoring CRM
kernel driver code. Fix apply threshold calculation logic.

CRs-Fixed: 2783209
Change-Id: I08ba6c89b0d4f0e982c017bab4226a569327f861
Signed-off-by: Ayush Kumar <ayushkr@codeaurora.org>
2021-06-29 18:18:35 +05:30
Camera Software Integration
cc535dd8a1 Merge "msm: camera: isp: Add support of new out ports for VFE 780" into camera-kernel.lnx.5.0 2021-06-24 13:51:34 -07:00
Savita Patted
68de607556 Merge "msm: camera: req_mgr: Enhance camera v4l2 subdev shutdown sequence" into camera-kernel.lnx.5.0 2021-06-21 18:38:47 -07:00
Chandan Kumar Jha
fd65327ebd msm: camera: isp: Add support of new out ports for VFE 780
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>
2021-06-17 11:16:59 +05:30
Depeng Shao
2e7c5fcf1b msm: camera: isp: Fix the assignment of bubble_detected
Fix the assignment of bubble_detected.

CRs-Fixed: 2948932
Change-Id: Ie9a289f732d12a0238e643e81c8a5bbdcaca059a
Signed-off-by: Depeng Shao <depengs@codeaurora.org>
2021-06-16 01:53:04 -07:00
Camera Software Integration
b02e40ded7 Merge "msm: camera: isp: Mask process_bubble for SHDR usecase" into camera-kernel.lnx.5.0 2021-06-09 19:15:25 -07:00
Depeng Shao
1d69c55f63 msm: camera: isp: Mask process_bubble for SHDR usecase
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>
2021-06-06 21:34:17 -07:00
Ayush Kumar
566ac7abf8 msm: camera: common: Multiple fixes for crm redesign
This change help to resolve below issues :-
1. Update frame duration calculation
   Add frame duration calculation with the use of fps. In some cases
   where horizonal blanking is more, frame duration calculation based
   on sof epoch calculation is not accurate.
2. Corner case in bubble handling
   Add support to handle master link bubble even if ISP linked with
   slave link receive few buf done irq for bubble request before master
   sends slave link to bubble state.

CRs-Fixed: 2783209
Change-Id: Ibf35f31f5263be7b6a6be6cd095447a2910a6878
Signed-off-by: Ayush Kumar <ayushkr@codeaurora.org>
2021-06-05 00:16:43 +05:30
Ayush Kumar
0259331da4 msm: camera: req_mgr: Re-design CRM to support multi links in sync mode
This change is to support multi links in sync mode. Supports dynmanic
switching to select master link in rtb and sat use case in sync mode.
Supports sync logic for rtb and sat use case in sync mode. Apply
requests for all links is triggered only on master epoch. Supports
bubble recovery and sync logic for different pd links in sync mode.

CRs-Fixed: 2783209
Change-Id: I81d1d0d37aa0d6e18c19ca87eac51ef3f160abfb
Signed-off-by: Ayush Kumar <ayushkr@codeaurora.org>
2021-06-04 20:23:00 +05:30
Depeng Shao
abf580c09c msm: camera: isp: Update the reported_req_id correctly
The request id is updated to 0 when the substate is
BUBBLE, then the original request id can't be notified
to UMD, since the reported_req_id is already updated to
the original request id. This change updateds the
reported_req_id only when the final request id is
valid.

CRs-Fixed: 2932602
Change-Id: Ib30f849782283c647f784cfb0deb49bee3d04287
Signed-off-by: Depeng Shao <depengs@codeaurora.org>
2021-05-19 22:27:37 -07:00
Camera Software Integration
7ac644bba3 Merge "msm: camera: isp: Update substate prior to notifying CRM" into camera-kernel.lnx.5.0 2021-04-28 21:23:04 -07:00
Camera Software Integration
18e3dd6a8e Merge "msm: camera: reqmgr: Propagate hw failures to user" into camera-kernel.lnx.5.0 2021-04-28 21:22:50 -07:00
Camera Software Integration
5cf3a57890 Merge "msm: camera: reqmgr: add trace log for separating multi camera" into camera-kernel.lnx.5.0 2021-04-28 21:19:52 -07:00
Camera Software Integration
f857a1140c Merge "msm: camera: isp: Reapply bubble request in RDI path" into camera-kernel.lnx.5.0 2021-04-28 21:19:47 -07:00
Karthik Anantha Ram
671fbda8c2 msm: camera: isp: Update substate prior to notifying CRM
When a bubble is detected ISP notifies CRM either for recovery or
provides a trigger to apply next req. Due to scheduling issues,
it's possible that CRM triggers an apply prior to ISP substate update
leading to apply failures. This could prove fatal in case of
FS/sHDR use-cases. This change updates the substate prior to
notifying CRM.

CRs-Fixed: 2841729
Change-Id: I5ccc2b91f347ec29a5dcf6aafe71c063572a7ff7
Signed-off-by: Karthik Anantha Ram <kartanan@codeaurora.org>
2021-04-21 18:29:37 -07:00
Jigar Agrawal
76857940be msm: camera: reqmgr: Propagate hw failures to user
Propagate error code to user in order to let the
user know more about the failure.

CRs-Fixed: 2860306
Change-Id: Icf030aa9df32eac97371059c2d282cfb53257401
Signed-off-by: Jigar Agrawal <jigar@codeaurora.org>
2021-04-19 19:07:15 -07:00
Haibin Liu
693c6dfdae msm: camera: reqmgr: add trace log for separating multi camera
Based on link_hdl/sensor id, that can separate multi camera event
on reqmgr, apply request, bufdone, isp_active_irq.
Add log of link_hdl/sensor id in above trace event,
that systrace can show independent camera trace event.

CRs-Fixed: 2924042
Change-Id: I7088a8a489a05dae4e62dc131d1c0c45c72038e2
Signed-off-by: Haibin Liu <haibinl@codeaurora.org>
2021-04-19 21:51:51 +08:00
Alok Chauhan
2ebae4fabe msm: camera: req_mgr: Enhance camera v4l2 subdev shutdown sequence
when provider crash occurred, there was a CSID lane overflow
observed due to shutdown sequence from CRM(sensor, csid, csiphy).
To fix the issue need to change the shutdown sequence
(csid, sensor, csiphy).

This change will update the devices sequence in order while registering
and close the sequence accordingly.

CRs-Fixed: 2852076
Change-Id: Ia6d8022e995823bf031400c33528eb8544dc2e29
Signed-off-by: Alok Chauhan <alokc@codeaurora.org>
2021-04-14 05:20:37 -07:00
Haritha Chintalapati
729397c303 Merge "msm: camera: isp: Pause the CRM timer in case of hardware errors" into camera-kernel.lnx.5.0 2021-04-12 19:07:25 -07:00
Tejas Prajapati
7ccb837201 msm: camera: isp: Reapply bubble request in RDI path
For recovery of the bubble the request from active list
should be added back to pending request list.

CRs-Fixed: 2887188
Change-Id: I9bd14db82f96d2fda99bb542bd0df4c9c4a06745
Signed-off-by: Tejas Prajapati <tpraja@codeaurora.org>
2021-04-09 09:57:55 -07:00
Haritha Chintalapati
1a11831377 Merge "msm: camera: isp: Fix config of vfe out ports" into camera-kernel.lnx.5.0 2021-04-07 16:29:07 -07:00
Mukund Madhusudan Atre
9d9c632144 msm: camera: isp: Fix config of vfe out ports
Add support for programming Sparse PD output port in
vfe bus. Fix config of PDAF Data port.

CRs-Fixed: 2841729
Change-Id: I30f2adc8f2f4ef94b62ec0cbfc768d5f5b88e505
Signed-off-by: Mukund Madhusudan Atre <matre@codeaurora.org>
2021-04-05 11:43:22 -07:00
Chandan Kumar Jha
90cd14c1de msm: camera: isp: Pause the CRM timer in case of hardware errors
In the Case of CSID RX fetal errors, We disable rx path. Whenever
we get sof freeze after some time, we enable the path SOF
to do a health check of the sensor.
But we don’t get the SOFs and it gives the wrong impression that
the sensor is not streaming.

Notify crm driver to pause the timer in case of fatal hardware error
to not missled sof freez issue.

CRs-Fixed: 2890861
Change-Id: I73e750cad0193ea5537a25c8440a9863343c4ef7
Signed-off-by: Chandan Kumar Jha <cjha@codeaurora.org>
2021-04-05 14:48:52 +05:30
Depeng Shao
3042ddc21c msm: camera: isp: Get the first active req during bubble
Sometimes, UMD reports nonincrementing shutter request id
issue during monkey test on sHDR usecase, isp reports last
one req in active req list during bubble, so if the active
req count is 2, we will meet this issue.
This change gets the first active req during bubble in case
the active req count is 2.

CRs-Fixed: 2885087
Change-Id: I67d1ecfe9c88123e6d0887383961bfc676455a0d
Signed-off-by: Depeng Shao <depengs@codeaurora.org>
2021-04-05 13:13:53 +08:00
Savita Patted
49f6c24ee9 Merge "msm: camera: isp: Add new ports for TFE" into camera-kernel.lnx.5.0 2021-03-29 18:42:59 -07:00
Savita Patted
aeef497955 Merge "msm: camera: isp: Change warn logs to rate limited" into camera-kernel.lnx.5.0 2021-03-29 18:41:51 -07:00
Savita Patted
6c2a837117 Merge "msm: camera: isp: Check whether flush list is empty" into camera-kernel.lnx.5.0 2021-03-24 19:52:10 -07:00
Wyes Karny
dc1bf6d21b msm: camera: isp: Add new ports for TFE
Add support for new TFE ports.
New ports: DS4, DS16, AI, STATS RS, and independent PDAF.
Add new HW file. Remove older HW specific hard coding.

Depends-on: 3563428
CRs-Fixed: 2887030
Change-Id: I8ad7b0037652db39fe5a2e86af28028a3740f1f4
Signed-off-by: Wyes Karny <wkarny@codeaurora.org>
2021-03-23 04:22:42 -07:00
Depeng Shao
73ee140ad0 msm: camera: isp: Check whether flush list is empty
We will get invalid req from flush_list if the
flush list is empty when we get each req by
list API list_for_each_entry_safe. This change
checks whether flush list is empty before
accessing this list.

CRs-Fixed: 2885145
Change-Id: I9b2828b03706a0f7412828905cc0a9e28d15fd76
Signed-off-by: Depeng Shao <depengs@codeaurora.org>
2021-03-22 21:41:58 -07:00
Karthik Anantha Ram
1f9c10f9c8 msm: camera: isp: Assign max hw update entries based on stream type
In case of SFE/CSID cmd buffer update, more number of hw update entries
is needed. Assign and allocate this memory dynamically based
on stream type. Also the change makes cdm cmd memory allocation
based on the stream.

CRs-Fixed: 2841729
Change-Id: Iaaa3ce7152a103ace25b24d84776f5a665603994
Signed-off-by: Karthik Anantha Ram <kartanan@codeaurora.org>
2021-03-20 11:54:01 -07:00
Depeng Shao
a8fce31f3f msm: camera: reqmgr: Handle flash properly
Apply the flash at EOF and apply the other devices
at the EPOCH of next frame, then the flash can
cover all the exposure zone of current request.
Add the inject delay for SOF and EOF separate,
then we can use inject delay for more flexible
frame skip control.

CRs-Fixed: 2820683
Change-Id: Ic6a58327a0ae44c54190884ba42ea7926ec7c90e
Signed-off-by: Depeng Shao <depengs@codeaurora.org>
2021-03-18 15:30:48 +08:00
Savita Patted
0626095cbc Merge "msm: camera: isp: Re-assign WMs for UAPI port names" into camera-kernel.lnx.5.0 2021-03-16 17:42:58 -07:00
Depeng Shao
1edfd82801 msm: camera: reqmgr: Mask re-apply for SHDR usecase
SHDR case has two ISP instances, if one of them
apply req failed sometimes, but the other one is
good and the buf done has been handled successfully,
then we don't need to apply the req again for the
successful ISP.

CRs-Fixed: 2842495
Change-Id: I3dfbb455244daa0d155858dd59f4a661fd3b87cd
Signed-off-by: Depeng Shao <depengs@codeaurora.org>
2021-03-12 23:42:05 -08:00
Karthik Anantha Ram
5ce6aebaad msm: camera: isp: Re-assign WMs for UAPI port names
Switch WMs for current 2PD and 2PD_STATS ports. Rename
2PD_STATS to PREPROCESS_2PD inline with UMD notion.

CRs-Fixed: 2841729
Change-Id: I735ef397cfd6328aa2fef73970def0b64044fe2e
Signed-off-by: Karthik Anantha Ram <kartanan@codeaurora.org>
2021-03-11 15:52:10 -08:00
Savita Patted
90fb1ebc6c Merge "msm: camera: isp: Allocate max map entries based on the stream type" into camera-kernel.lnx.5.0 2021-03-10 16:10:01 -08:00
Savita Patted
1ee4bca76c Merge "msm: camera: ope: Handle OPE smmu fault with pid info" into camera-kernel.lnx.5.0 2021-03-09 20:18:26 -08:00
Ayush Kumar
92a753d37d msm: camera: isp: Change warn logs to rate limited
In apply failure due to congestion and if not recovered, warn logs
causing excessive logging issues. Change the warn logs to rate
limit in apply failure due to congestion.

CRs-Fixed: 2884313
Change-Id: Id46a0cbe6a248a9186a6267577374f4fbadcf64f
Signed-off-by: Ayush Kumar <ayushkr@codeaurora.org>
2021-03-08 10:10:50 -08:00
Karthik Anantha Ram
b15d7e1415 msm: camera: isp: Allocate max map entries based on the stream type
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>
2021-03-05 16:12:07 -08:00
Wyes Karny
1e3a1316ed msm: camera: isp: Reset num_deferred_acks when re-applying bubble req
When re-applying bubble request after 2 frames reset num_deferred_acks
also.

CRs-Fixed: 2824276
Change-Id: I57e7ac89da69a2d65546c6f9a7f1d3c9f2c7e58f
Signed-off-by: Wyes Karny <wkarny@codeaurora.org>
2021-03-03 20:37:54 -08:00
Vikram Sharma
57bff5aede msm: camera: ope: Handle OPE smmu fault with pid info
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>
2021-02-24 23:40:40 -08:00