Commit Graph

3143 Commits

Author SHA1 Message Date
Ayush Kumar
65c99f19c8 msm: camera: isp: Update stride of PDAF Clients
For PDAF Clients, userspace can allocate a bigger buffer than
the WM Client configuration, in this case stride of the Client
should be updated properly to get proper data from WM Client.

CRs-Fixed: 3555900
Change-Id: Ie2b369b59a14f19100932d912167537cab266e0d
Signed-off-by: Ayush Kumar <quic_ayushkr@quicinc.com>
2023-12-19 01:53:38 -08:00
Ayush Kumar
8c722daea7 msm: camera: isp: Do report bubble if req applied after SOF
For legacy SHDR, report bubble even if request is applied
after SOF so that both master and slave context goes to
bubble state in legacy SHDR or SHDR without SFE target.

CRs-Fixed: 3555900
Change-Id: I64e38d14ba3472fa1d298882d6b09a2f14e0d576
Signed-off-by: Ayush Kumar <quic_ayushkr@quicinc.com>
2023-12-19 01:53:28 -08:00
Alok Chauhan
5891dc325a msm: camera: tfe: Handle acquire pdaf resources in PDAF type3 usecase
In Type3 usecase, PDAF ports can come as part of IPP config. This will
cause failure during out pdaf acquire resources.

Handle PDAF ports acquire during this usecase as pdlib resource.

CRs-Fixed: 3546181
Change-Id: I9d42e499c87961f5ceec995245e6b599d6015de7
Signed-off-by: Alok Chauhan <quic_alokc@quicinc.com>
2023-12-19 01:53:19 -08:00
Ayush Kumar
c5dae62d39 msm: camera: isp: Support TFE WM configuration update
This chages is to support blob to update TFE WM dimensions.
This is required as 3A lib allocates max buffer for pdaf ports
but per request dimension can differ from buffer dimension.

CRs-Fixed: 3546181
Change-Id: I98bffa9ef00a7fa2bb543cb0c89f7920ed6780c5
Signed-off-by: Ayush Kumar <quic_ayushkr@quicinc.com>
2023-12-19 01:52:58 -08:00
Ayush Kumar
bfbfc5d3d4 msm: camera: isp: Buffer alignment support for TFE WM
This change is added to support buffer alignment for TFE
WM in x and y axis. This change is required in SHDR usecase to
align short exposure frame with long exposure frame.

CRs-Fixed: 3538642
Change-Id: I9a3d35d0884bfbd6f62034b207e5784fdf2f7430
Signed-off-by: Ayush Kumar <quic_ayushkr@quicinc.com>
2023-12-19 01:52:40 -08:00
Pranav Sanwal
fe4bd2e6a1 msm: camera: tfe: Handle overflow internal recovery
Handle internal recovery in case of csid and bus overflow.
Handle frame size error detection for pixel and line count
mismatch as fatal errors.
Fixed csid side error reproting to hw_mgr layer.

CRs-Fixed: 3532076
Change-Id: Id4f572caf6774797396d70d7a20a4f54fc1b9ea9
Signed-off-by: Pranav Sanwal <quic_psanwal@quicinc.com>
2023-12-19 01:52:13 -08:00
Ayush Kumar
428c68409d msm: camera: isp: Disable TFE WM clients dynamically
This commit adds support to disable acquired TFE WM clients if the client
is not configured.

CRs-Fixed: 3531808
Change-Id: Ie3be423dfd2ab35031677563d66fd811090148fe
Signed-off-by: Ayush Kumar <quic_ayushkr@quicinc.com>
2023-12-18 20:29:08 +05:30
Camera Software Integration
3e9d2a6729 Merge "msm: camera: sensor: Add threaded irq support for cci" into camera-kernel.lnx.7.0 2023-12-18 06:53:09 -08:00
Camera Software Integration
080692e6ef Merge "msm: camera: sensor: Reg settings missed while lookahead on qup" into camera-kernel.lnx.7.0 2023-12-18 06:53:04 -08:00
Camera Software Integration
c37b6e662c Merge "msm: camera: isp: Add correct plain16_10 format for AI port" into camera-kernel.lnx.7.0 2023-12-18 06:53:00 -08:00
Camera Software Integration
5d3025540c Merge "msm: camera: cre: Fix out-of-bounds access in cre driver" into camera-kernel.lnx.7.0 2023-12-18 06:52:47 -08:00
Camera Software Integration
0b8bffd664 Merge "msm: camera: csid: Add fuse support for MP limit" into camera-kernel.lnx.7.0 2023-12-18 06:52:37 -08:00
Camera Software Integration
9e54b47f3b Merge "msm: camera: isp: Increase number of TFE contexts" into camera-kernel.lnx.7.0 2023-12-18 06:52:26 -08:00
Camera Software Integration
17e219436e Merge "msm: camera: common: rate limit error log and enable few warning logs" into camera-kernel.lnx.7.0 2023-12-18 06:52:14 -08:00
Camera Software Integration
79d50d59a6 Merge "msm: camera: cpas: Add support for Raveline Camera" into camera-kernel.lnx.7.0 2023-12-18 06:52:02 -08:00
Ayush Kumar
f31de7d3d0 msm: camera: isp: Program dual tfe settings in shdr
This change add support to program dual tfe configurations in
SHDR to create sync between two TFEs. This change is required
if MUP bit is used in SHDR mode.

CRs-Fixed: 3508184
Change-Id: I270f7fd8e3cac1f1e50c5f16e7cba2c5e9c2b74f
Signed-off-by: Ayush Kumar <quic_ayushkr@quicinc.com>
2023-12-18 04:00:58 -08:00
Ayush Kumar
fa6d50974b msm: camera: isp: Add support for error inject framework in TFE
This change is to add support for error inducement in TFE HW.

CRs-Fixed: 3426117
Change-Id: I19a5e095bc84fa88c308640a1d490162698bb45f
Signed-off-by: Ayush Kumar <quic_ayushkr@quicinc.com>
2023-12-18 04:00:24 -08:00
Ayush Kumar
1b91ba1b2f msm: camera: tfe: Add support for epoch blob in TFE HW
In overlap SHDR, epoch irq from TFE need to configure in such
a way that request should be apply at epoch of shorter exposure frame
before start of the next frame of long exposure to make sure that
new settings should apply properly in time.

CRs-Fixed: 3396382
Change-Id: I1ddc3ce95c6d404a3f76a27cc58083e11b03bace
Signed-off-by: Ayush Kumar <quic_ayushkr@quicinc.com>
2023-12-18 03:59:56 -08:00
Ayush Kumar
6e2c1b9671 msm: camera: tfe: Add support for auto SHDR
This change add support for activate and deactivate ISP device in the
link when dual trigger mode in the link is set.

CRs-Fixed: 3374385
Change-Id: Ib6d25ab295d613fa5cd3edf1780362476920d74d
Signed-off-by: Ayush Kumar <quic_ayushkr@quicinc.com>
2023-12-18 17:08:13 +05:30
Shravan Nevatia
e309d6fc30 msm: camera: sensor: Duplicate sensor changes
Add support to skip HW operations (power/CCI) for
sensor nodes with "hw-no-ops" property. These nodes are
dummy entries since CSID reads data from a different sensor.

CRs-Fixed: 3150840
Change-Id: I6ceb3f9d2ea4f16abb9d5d2a6b89d5cb1d95c614
Signed-off-by: Shravan Nevatia <quic_snevatia@quicinc.com>
(cherry picked from commit 3deec40a9a58296f6f43d3cfe15b092e5a16c28b)
2023-12-14 16:58:54 +05:30
Nirmal Abraham
cbf5607d03 msm: camera: tfe: fixes for OOB and null ptr issues
Add validation checks in CRE, ICP and TFE drivers
to avoid OOB and null ptr access issues.

CRs-Fixed: 3248380
Change-Id: Ic2c6bd41e34605a3291e6f50fe0fe94a0ab30523
Signed-off-by: Nirmal Abraham <quic_c_nabrah@quicinc.com>
(cherry picked from commit a63bcb668392e1271ab0d2f53a54736a54325828)
2023-12-13 17:22:05 +05:30
Camera Software Integration
a90b42d899 Merge "msm: camera: sensor: Add Trace logs for CCI BURST WRITE" into camera-kernel.lnx.7.0 2023-12-13 02:01:14 -08:00
chengxue
5aa6302ba5 msm: camera: sensor: Reg settings missed while lookahead on qup
While we lookahead and merge the continuous reg settings to
burst, the packed setting len with uint8 data type may happen
overflow if the continuous reg setting count is larger than 255,
then some reg settings missed and lead to some sensor issues,
so modify the data type of len to avoid it.

CRs-Fixed: 3678429
Change-Id: I51a153d2340b84dd874ecd7bef6b3df1356611b0
Signed-off-by: chengxue <quic_chengxue@quicinc.com>
(cherry picked from commit aadcb5e66d37f556c570621e3b15e834601f074b)
2023-12-13 01:58:42 -08:00
Lokesh Kumar Aakulu
8dc1b0cd65 msm: camera: sensor: Add threaded irq support for cci
When CCI drains its payload cmds in QUEUE because
of CPU scheduling delays from SW Driver side then
next successive transaction will endup in NACK ERROR.
To Fix this issue, Updating payload cmds to CCI QUEUE
is moved to Threaded irq so that Scheduling delays can
be minimized and avoid NACK Error.

CRs-Fixed: 3562709
Change-Id: I577a6531d692a4f202651e2dd5d4cf0684259b75
Signed-off-by: Lokesh Kumar Aakulu <quic_lkumar@quicinc.com>
(cherry picked from commit bcdafbc3c3afcbed75c2c469f26d8c483d0430d1)
2023-12-13 01:58:01 -08:00
Dharmender Sharma
1e193cd952 msm: camera: csid: Add fuse support for MP limit
This change limit the resolution for the single camera based on fuse.
Acquire will fail in case width is greater than the supported width.

CRs-Fixed: 3679491
Change-Id: I4f3e8dfdbe80aee994ca66f12bbbcdc7cda77676
Signed-off-by: Dharmender Sharma <quic_dharshar@quicinc.com>
2023-12-12 20:09:20 +05:30
Camera Software Integration
7cdb3df0f5 Merge "msm: camera: sensor: Add CCI BURST WRITE Support" into camera-kernel.lnx.7.0 2023-12-11 09:08:15 -08:00
Camera Software Integration
7afb256737 Merge "msm: camera: isp: fix prevent issues" into camera-kernel.lnx.7.0 2023-12-11 09:08:12 -08:00
Camera Software Integration
192fbd4d41 Merge "msm: camera: csiphy: Update PHY secure CP register for Crow" into camera-kernel.lnx.7.0 2023-12-11 09:07:44 -08:00
Camera Software Integration
85469b7344 Merge "msm: camera: csiphy: Update PHY secure CP register" into camera-kernel.lnx.7.0 2023-12-11 09:07:28 -08:00
Lokesh Kumar Aakulu
8bc2eafe25 msm: camera: sensor: Add Trace logs for CCI BURST WRITE
Add Trace logs for each threshold irq and corresponding
Error cases for BURST WRITE usecases.

CRs-Fixed: 3562709
Change-Id: I9e91fc0b9ae0eda20063c8150c8c4694b583355f
Signed-off-by: Lokesh Kumar Aakulu <quic_lkumar@quicinc.com>
(cherry picked from commit 9326d397a2ec90696ce37a5d5966cdc671d657e3)
2023-12-10 06:19:49 -08:00
Camera Software Integration
92aed74949 Merge "Revert "msm: camera: isp: Fix value of min hbi in CSID path"" into camera-kernel.lnx.7.0 2023-12-07 22:45:52 -08:00
Sridhar Gujje
c019fc5e03 Revert "msm: camera: isp: Fix value of min hbi in CSID path"
This reverts commit 5fdbdc7281.

Change-Id: Ib5770144046564b0e33aad78695f6f899906c5cc
Signed-off-by: Sridhar Gujje <quic_sgujje@quicinc.com>
2023-12-07 22:36:34 -08:00
Camera Software Integration
46c3009877 Merge "msm: camera: isp: fix KMD prevent issues like OOB" into camera-kernel.lnx.7.0 2023-12-07 21:18:05 -08:00
Camera Software Integration
c5f0f907fd Merge "msm: camera: isp: fix potential out of bounds" into camera-kernel.lnx.7.0 2023-12-07 21:17:58 -08:00
Camera Software Integration
0183615dc2 Merge "msm: camera: ife: Adding sanity check at the time of buf done" into camera-kernel.lnx.7.0 2023-12-07 21:17:48 -08:00
Camera Software Integration
c9d8fed32d Merge "msm: camera: ife: Fix to enable FCG configurations in Cliffs" into camera-kernel.lnx.7.0 2023-12-07 21:17:42 -08:00
Lokesh Kumar Aakulu
3efecb742f msm: camera: sensor: Add CCI BURST WRITE Support
Introduce Threshold IRQ and compose dynamically
allocated buffer with CCI BURST WRITE Commands
and finally write to the CCI HW register and
manage Threshold Interrupts in optimized way. So,
that SW Driver latencies will not affect the I2C
BURST WRITE functionality.

CRs-Fixed: 3562709
Change-Id: I5749ba3b61e28d8f2c1075f46f470f5a9c5bd6b5
Signed-off-by: Lokesh Kumar Aakulu <quic_lkumar@quicinc.com>
(cherry picked from commit 1e4f481db9076c766b7300bb65364a13a61247c1)
2023-12-06 08:10:04 -08:00
Vikram Sharma
f220a81b54 msm: camera: isp: fix prevent issues
This change fix uninitialized local variable issue
in sfe driver.

CRs-Fixed: 3665080
Change-Id: I7b781f51cdf6ecc8842f44df3b841ea9a9984a6b
Signed-off-by: Vikram Sharma <quic_vikramsa@quicinc.com>
(cherry picked from commit 505bbbc5c6f1817d9a097a0bfc99d83a3e91f7b9)
2023-12-06 08:09:21 -08:00
Alok Chauhan
bdcbaa0573 msm: camera: enable TFE compilation on Lanai
Enable bezel tfe compilation on Lanai target and fixed
compilation.

CRs-Fixed: 3671077
Signed-off-by: Alok Chauhan <quic_alokc@quicinc.com>
Change-Id: Ibaa618498a05f16f9544e6fcaa6ceecd6549271c
2023-12-06 10:35:23 +05:30
Pranav Sanwal
df1fca554b msm: camera: cpas: Add support for Raveline Camera
Add changes for cpas for raveline camera .
Create target specific header files for raveline.

CRs-Fixed: 3318758
Change-Id: Ib1bd54975a97bc4b09293cf8a82a1c3bbbeecb31
Signed-off-by: Pranav Sanwal <quic_psanwal@quicinc.com>
(cherry picked from commit fc03d26be204900d7e19054915b52fbd3353444f)
2023-12-05 14:36:58 +05:30
Shivakumar Malke
9a45cdd009 msm: camera: isp: fix KMD prevent issues like OOB
Integer pointer passed as a parameter to function
cam_irq_controller_register_dependent is used as an
array iterating over num_registers. This might corrupt
or misinterpret adjacent memory locations causing out
of bound access issues.

This change fixes this issue by passing an array of
size num_registers as a parameter to
cam_irq_controller_register_dependent. Also, initializes
struct dma_buf_map to 0.

CRs-Fixed: 3658797
Change-Id: I18260c9be4df77716f00c3f5980aeb506e35dcdc
Signed-off-by: Shivakumar Malke <quic_smalke@quicinc.com>
2023-12-04 20:59:02 -08:00
Camera Software Integration
7bc34c139c Merge "msm: camera: sensor: Remove mutex sensitive call in interrupt context" into camera-kernel.lnx.7.0 2023-12-03 19:50:55 -08:00
Camera Software Integration
a6195c5d0e Merge "msm: camera: cre: Fix concurrency issue for multi-context CRE use cases" into camera-kernel.lnx.7.0 2023-12-03 19:49:22 -08:00
Camera Software Integration
ddb486586c Merge "msm: camera: isp: Fix value of min hbi in CSID path" into camera-kernel.lnx.7.0 2023-12-03 19:48:46 -08:00
Camera Software Integration
de9479755d Merge "msm: camera: isp: Correct path data type for TFE lite" into camera-kernel.lnx.7.0 2023-12-03 19:48:38 -08:00
Camera Software Integration
f84ad2b1ad Merge "msm: camera: icp: Add missing mutex unlock" into camera-kernel.lnx.7.0 2023-12-03 19:48:31 -08:00
Yash Upadhyay
1dbcbf1d04 msm: camera: ife: Adding sanity check at the time of buf done
In case of null pointing addresses in payload at bufdone irq handling,
will lead to crash. This change will do proper sanity to avoid null
pointer access.

CRs-Fixed: 3634649
Change-Id: I4b988101001dfafdd4250eb75377d03a3a8474c2
Signed-off-by: Yash Upadhyay <quic_yupadhya@quicinc.com>
(cherry picked from commit 75ef1aef5d3b740a15eef8f5b60a453568ca5721)
2023-11-30 23:45:06 -08:00
Vikram Sharma
5d36106df2 msm: camera: isp: fix potential out of bounds
This change fix multiple prevent issues.
fix over bound array access, add NULL checks,
fix format specifier and fix typecasting.

CRs-Fixed: 3643117
Change-Id: I16b4405c52ae9a6c53f6ff954dc32735719a99ad
Signed-off-by: Vikram Sharma <quic_vikramsa@quicinc.com>
2023-12-01 11:07:59 +05:30
Dharmender Sharma
4614811d85 msm: camera: ife: Fix to enable FCG configurations in Cliffs
In Mix SHDR use case, Camera switch to video mode is failing.
Reason is FCG configurations support not enabled for Cliffs.
So to fix this issue enabled FCG configuration for Cliffs.

CRs-Fixed: 3672728
Change-Id: I6cbc5db1d02c07bb4df422c4b07d6b7eca1df3c6
Signed-off-by: Dharmender Sharma <quic_dharshar@quicinc.com>
2023-11-28 15:05:40 +05:30
Shadul Shaikh
24376453b3 msm: camera: csiphy: Update PHY secure CP register for Crow
Update secure CP register bitmask for Crow csiphy-v2.1.2.

CRs-Fixed: 3542076

Change-Id: I02cbb9528661767f0c275b6ad110002ce372591e
Signed-off-by: Shadul Shaikh <quic_shaduls@quicinc.com>
(cherry picked from commit 42c8aa11f18a71c6acd272574e8149d58a5dfd52)
2023-11-28 10:40:37 +05:30
Camera Software Integration
7d82a270a3 Merge "msm: camera: tfe: Multiple fixes for TFE Lite" into camera-kernel.lnx.7.0 2023-11-27 02:18:01 -08:00
Camera Software Integration
b2565f210d Merge "msm: camera: tfe: TFE and CSID probe based on fuse" into camera-kernel.lnx.7.0 2023-11-27 02:17:42 -08:00
Camera Software Integration
5de13d5f6d Merge "msm: camera: isp: Don't enable TFE WM at Start HW" into camera-kernel.lnx.7.0 2023-11-27 02:15:51 -08:00
Camera Software Integration
1805af21ee Merge "msm: camera: tfe: initialise the flush and error dump id to max value" into camera-kernel.lnx.7.0 2023-11-27 02:14:14 -08:00
Camera Software Integration
7b0cf83ff8 Merge "msm: camera: tfe: correct wm configuration for LCR PD port" into camera-kernel.lnx.7.0 2023-11-27 02:12:24 -08:00
Alok Chauhan
5d7887b24d msm: camera: cpas: Update QOS value for camera
Updating correct QOS values for Camera, based on HW
recommendation.

CRs-Fixed: 3509972
Change-Id: I10d8e6126fa0d82efbcff0daf927adaea1deb32b
Signed-off-by: Alok Chauhan <quic_alokc@quicinc.com>
2023-11-27 02:10:33 -08:00
Camera Software Integration
3aa1230bdc Merge "msm: camera: cpas: Add support for Crow Camera" into camera-kernel.lnx.7.0 2023-11-27 02:09:14 -08:00
Haochen Yang
786833cd4e msm: camera: icp: Add missing mutex unlock
This change adds missing mutex unlock when the command descriptor
is not valid during configuring stream settings.

CRs-Fixed: 3663869
Change-Id: I891699141f8c1c1b6cdbafb0068d5c8117dacdf8
Signed-off-by: Haochen Yang <quic_haocyang@quicinc.com>
(cherry picked from commit 3a6161b01d7c7c5540d7019b70903dc60e9a84bc)
2023-11-27 01:53:32 -08:00
Ayush Kumar
fc6c82e618 msm: camera: isp: Fix logic to get correct mid on page fault
This commit add change to get correct port id or resource outport
for page fault if mid value is same for two or more ports.

CRs-Fixed: 3593650
Change-Id: If09a515ea37c5b89787945c9d0d8f1e3903bca55
Signed-off-by: Ayush Kumar <quic_ayushkr@quicinc.com>
(cherry picked from commit 8f675ac9d2534e09b7f0a4b8d82dbb1dc2df6feb)
2023-11-23 01:24:07 -08:00
Abhilash Kumar
66e737396c msm: camera: cre: Fix out-of-bounds access in cre driver
This change fixes possible out-of-bounds access while updating
cre_bus_rd by adding check if the port index is proper.

CRs-Fixed: 3595684
Change-Id: I10f2f7174f9df75118dbb1efed60e870ac2ac97f
Signed-off-by: Abhilash Kumar <quic_krabhi@quicinc.com>
(cherry picked from commit 410038d0ec8a80e7ed2d04ed9bd98f60a0d5de12)
2023-11-23 01:23:48 -08:00
Alok Chauhan
1f4d0deb5a msm: camera: isp: Add correct plain16_10 format for AI port
Currently format defined for AI port is not proper. Correct
the format for AI port.

CRs-Fixed: 3640786
Signed-off-by: Alok Chauhan <quic_alokc@quicinc.com>
Change-Id: If7b3323a9732a6834434fe2226da841d8383b6f3
(cherry picked from commit 7c1e2d4468835b55ada86932120e9a2fea3b999e)
2023-11-23 01:06:37 -08:00
Shadul Shaikh
a6fbca726b msm: camera: sensor: Remove mutex sensitive call in interrupt context
Remove the function call, is getting clock rates with mutex locked
in interrupt context.

CRs-Fixed: 3615675

Change-Id: I838fbd0b211e454de812b7631a1bb8072072ec75
Signed-off-by: Shadul Shaikh <quic_shaduls@quicinc.com>
(cherry picked from commit a42bed83fbfd0dff1940ce7b221ee3370f1e917e)
2023-11-23 14:20:26 +05:30
Ayush Kumar
5fdbdc7281 msm: camera: isp: Fix value of min hbi in CSID path
This change is to fix the value of min hbi in csid
path cfg1 register.

CRs-Fixed: 3184294
Change-Id: I2db440d8edf29844ee87067f79465089b81c205e
Signed-off-by: Ayush Kumar <quic_ayushkr@quicinc.com>
(cherry picked from commit 9784b390cdcd1c518fe1ce85af12bd02390149e7)
2023-11-22 09:46:07 -08:00
Shadul Shaikh
9bd3915e24 msm: camera: cci: Check if cci_info structure pointer is NULL
Though cci_ctrl is not NULL its content is handled by user,
who could set cci_info to NULL. A NULL pointer check is placed
before accessing it to avoid any null pointer derefernce.

CRs-Fixed: 3095084

Change-Id: I6f50d4ba38efd9b5c0eb0d14e3d958ff94c11554
Signed-off-by: Rajat Goel <quic_rajgoe@quicinc.com>
Signed-off-by: Shadul Shaikh <quic_shaduls@quicinc.com>
(cherry picked from commit 81c7a070db15aea8a2d7835a68840ac31f4586fb)
2023-11-22 09:29:04 -08:00
Shadul Shaikh
0ab2c977a1 msm: camera: csiphy: Update PHY secure CP register
Update PHY secure CP register bitmask logic for CSIPHY
1.2.3.

CRs-Fixed: 3176306
Change-Id: Ie15767f3bd5d162ba544080e25de8c41c57d4ad4
Signed-off-by: shiwgupt <quic_shiwgupt@quicinc.com>
Signed-off-by: Shadul Shaikh <quic_shaduls@quicinc.com>
(cherry picked from commit e35411f0ea905b01cf45ee6b7ffe74e1a7781df0)
2023-11-22 09:26:42 -08:00
Nirmal Abraham
e240a5a52a msm: camera: common: rate limit error log and enable few warning logs
Rate limit the error log which is printed while SOF/EOF notification
to CRM fails to avoid excessive logging. Change few failure log
prints from CAM_DBG to CAM_WARN_RATE_LIMIT to identify the exact
cause of the error.

CRs-Fixed: 3467116
Change-Id: I4257ae17adc1e8a82f1ef39c2473089412193f52
Signed-off-by: Nirmal Abraham <quic_c_nabrah@quicinc.com>
(cherry picked from commit 6f7c3ec4cfd4483bdea78bb666a05fa2d61c07d7)
2023-11-22 08:39:41 -08:00
Alok Chauhan
1d421a5dc0 msm: camera: isp: Correct path data type for TFE lite
Correct path data type incase if voting from TFE lite
during cpas start.

CRs-Fixed: 3509972
Change-Id: If2a0949f09a3ca6bd5afdca1f4b6c9202adf6334
Signed-off-by: Alok Chauhan <quic_alokc@quicinc.com>
(cherry picked from commit 5df6eed6590a1355dabe8b676aca6b67c033d239)
2023-11-22 08:22:15 -08:00
Ayush Kumar
52c7ce7ef9 msm: camera: cre: Fix concurrency issue for multi-context CRE use cases
Add list to track request while configuring and processing in
multi-context environment. This will avoid looping over wrong
context and accessing invalid request list.

CRs-Fixed: 3426117
Change-Id: I987abc7685a11a596cd3d2ba14ff2b141358d618
Signed-off-by: Ayush Kumar <quic_ayushkr@quicinc.com>
(cherry picked from commit 9e3f7d8a57c6ead740bb1261f461a38ae35bd57a)
2023-11-22 08:21:55 -08:00
Shivakumar Malke
cfdde7b938 msm: camera: isp: Increase number of TFE contexts
Currently the max TFE contexts supported is 4.
To support AUX session, 6 contexts are required.

This change increases max TFE contexts to 6.

CRs-Fixed: 3526893
Change-Id: Ia0b8cf4394bdfc70f4cf8d55315516daa4c991d8
Signed-off-by: Shivakumar Malke <quic_smalke@quicinc.com>
(cherry picked from commit 5395a795408973adb997a1486922800d5ace89bf)
2023-11-22 08:21:49 -08:00
Camera Software Integration
e383234b62 Merge "msm: camera: icp: fix out of range for devcount" into camera-kernel.lnx.7.0 2023-11-21 23:12:34 -08:00
jinguiw
efd58b1e1b msm: camera: icp: fix out of range for devcount
Fix loop range to hw_dev_cnt-1 to deal with out of range issue.

CRs-Fixed: 3660771
Change-Id: I5d8b76e44af04207ed4b68208474620fa9cb1b86
Signed-off-by: jinguiw <quic_jinguiw@quicinc.com>
(cherry picked from commit ead659d4bf783c37ff17af1bb4bc87edb4e64938)
2023-11-21 23:11:01 -08:00
Shravan Nevatia
5e66e1bf36 msm: camera: csiphy: Add support for dummy PHY settings
Add the CSIPHY_DNP_PARAMS macro to specify dummy PHY
settings. These settings will not be applied to HW
and can be used to pad the settings arrays.

CRs-Fixed: 3642100
Change-Id: I42859598996d6190b23111e8ac655bb34e174238
Signed-off-by: Shravan Nevatia <quic_snevatia@quicinc.com>
(cherry picked from commit b78027078dd6654f96f6d0472ebab09c6e1b088b)
2023-11-21 23:10:55 -08:00
Camera Software Integration
395c2c88e4 Merge changes I841105b4,I4a971058,I4697bb54 into camera-kernel.lnx.7.0
* changes:
  msm: camera: isp: Correct sync mode of HW in Dual TFE usecase
  msm: camera: isp: Fix crash if PPI hw is not present
  cam: tfe: Correct master select and halt mode
2023-11-21 23:06:52 -08:00
Camera Software Integration
669b0698c8 Merge "msm: camera: isp: Program PPP path core config from acquire data" into camera-kernel.lnx.7.0 2023-11-21 23:05:40 -08:00
Camera Software Integration
b68af30718 Merge "msm: camera: tfe: Add support RT CDM in TFE" into camera-kernel.lnx.7.0 2023-11-21 23:05:31 -08:00
Camera Software Integration
9c3ade469b Merge "msm: camera: tfe: Fixes for CSIM issues" into camera-kernel.lnx.7.0 2023-11-21 23:05:12 -08:00
Camera Software Integration
ff07076ebe Merge changes Ifd44dc75,Ieb6f1245,I16d53737,I34c5227b,I56dc1091, ... into camera-kernel.lnx.7.0
* changes:
  msm: camera: tfe: Add out of sync error handling
  msm: camera: tfe: Add PDAF support in tfe 770 header
  msm: camera: common: update msm-mmrm dependency to camera-kernel
  msm: camera: tfe: Add TFE and TFE LITE header file for 770 HW
  msm: camera: isp: Add support for PDAF HW
  msm: camera: tfe: Remove hardcoding of shift values
  msm: camera: isp: Add support for CSID 770
  msm: camera: tfe: Add support for TFE LITE HW
  msm: camera: tfe: Add MUP support for TFE HW
2023-11-21 00:28:50 -08:00
Camera Software Integration
224cae6a96 Merge "msm: camera: cpas: update the QOS setting" into camera-kernel.lnx.7.0 2023-11-21 00:26:52 -08:00
Ayush Kumar
aeef5b37db msm: camera: cpas: Add support for Crow Camera
This change adds camnoc interface changes and CPAS version
change for Crow camera.

CRs-Fixed: 3426117
Change-Id: I8735dc87ccd0ebcde98a53f6d695167fedb4cc35
Signed-off-by: Ayush Kumar <quic_ayushkr@quicinc.com>
2023-11-20 21:35:13 -08:00
Ayush Kumar
ed703b3236 msm: camera: tfe: Multiple fixes for TFE Lite
Increase count of maximum number of TFE HW supported and
corrected WM composite group number.

CRs-Fixed: 3426117
Change-Id: I4cf91bb92772c5be5a56783228c694fedf6c5ec7
Signed-off-by: Ayush Kumar <quic_ayushkr@quicinc.com>
2023-11-20 15:57:39 +05:30
Alok Chauhan
3e0200a7c2 msm: camera: tfe: TFE and CSID probe based on fuse
Some ISP hardware id instances are disabled on some target skus.
Cpas driver has fuse information based on the dtsi entries.
ISP hw driver queries the cpas driver whether hw instance is
supported or not. If ISP hardware is supported on the target then
continue the isp hardware probe.

CRs-Fixed: 3509972
Change-Id: I4c57407e510c2dfcb764069b736a91a36523c3b3
Signed-off-by: Alok Chauhan <quic_alokc@quicinc.com>
2023-11-17 06:35:34 -08:00
Ayush Kumar
d010119b5d msm: camera: isp: Don't enable TFE WM at Start HW
This commit takes care of enabling Wm configurations for each
client only if io buffers are allocated.

CRs-Fixed: 3508184
Change-Id: I3af729742475a7ef5428fcda6c936e0c8799fdf9
Signed-off-by: Ayush Kumar <quic_ayushkr@quicinc.com>
2023-11-17 06:35:07 -08:00
Pranav Sanwal
b75f2bf506 msm: camera: tfe: initialise the flush and error dump id to max value
In case of error reported on req 0, regdump not triggering since
last dump err req id default value is 0.
Hence initialising with max value of uint64_t.

CRs-Fixed: 3503342
Change-Id: If370da47d824efbf881e6560cea27efa9d6a6c0d
Signed-off-by: Pranav Sanwal <quic_psanwal@quicinc.com>
2023-11-17 06:34:44 -08:00
Alok Chauhan
21fd48f502 msm: camera: tfe: correct wm configuration for LCR PD port
LCR PD port is configured wrongly to line based mode instead
of frame based mode. Correct the configuration for LCR PD port
to set right mode.

CRs-Fixed: 3478317
Change-Id: I336782ccd4aaca48fafd173e71819c159d1bf509
Signed-off-by: Alok Chauhan <quic_alokc@quicinc.com>
2023-11-17 06:34:20 -08:00
Ayush Kumar
c78e634e0c msm: camera: isp: Correct sync mode of HW in Dual TFE usecase
Sync mode is always master if any resource is acquire from
previously acquired HW. This change is to set correct value of
sync mode depend upon the usecase and acquired hw index.

CRs-Fixed: 3426117
Change-Id: I841105b4c14af6b8da589a7d74a5532ce6244e81
Signed-off-by: Ayush Kumar <quic_ayushkr@quicinc.com>
2023-11-17 06:33:57 -08:00
Alok Chauhan
3c3897ff1a msm: camera: isp: Fix crash if PPI hw is not present
Fix crash during CSID init/deinit sequence due to accessing
invalid ppi hw interface pointer incase if PPI hw is not
present in device.

CRs-Fixed: 3478317
Change-Id: I4a97105800d07407ecddd6611c10f4e481c133d7
Signed-off-by: Alok Chauhan <quic_alokc@quicinc.com>
2023-11-17 06:33:30 -08:00
Alok Chauhan
6edf576314 cam: tfe: Correct master select and halt mode
Correct master select and halt mode for single TFE in
IPP and PPP path.

CRs-Fixed: 3478317
Change-Id: I4697bb54b106b2459049d884303234315fd48fa7
Signed-off-by: Alok Chauhan <quic_alokc@quicinc.com>
2023-11-17 20:02:42 +05:30
Ayush Kumar
4690de76a8 msm: camera: isp: Program PPP path core config from acquire data
Program the PPP path based on core config value which is coming
from user space at acquire Hw.

CRs-Fixed: 3426117
Change-Id: I606dae35acb12a00fc835b00713a2610eb10ff01
Signed-off-by: Ayush Kumar <quic_ayushkr@quicinc.com>
2023-11-15 02:20:42 -08:00
Ayush Kumar
a0f8bde336 msm: camera: tfe: Add support RT CDM in TFE
This change adds support for RT CDM in TFE driver. For RT CDM,
mem base should be with respect to the base address of the TFE
wrapper. The first address the RT CDM can access is the base
address of TFE wrapper.

CRs-Fixed: 3426117
Change-Id: Ic5ca099e737b23fb2061678af5e7a85b65836763
Signed-off-by: Ayush Kumar <quic_ayushkr@quicinc.com>
2023-11-15 02:20:21 -08:00
Ayush Kumar
12099a7e27 msm: camera: tfe: Fixes for CSIM issues
This change adds fixes for all tfe issues faced during CSIM
validation. Adds required shift values in TFE header files.
Correct format for pdaf ports.

CRs-Fixed: 3426117
Change-Id: I3bf9c44e1ce108aa6247fea867d2b5161705b6bb
Signed-off-by: Ayush Kumar <quic_ayushkr@quicinc.com>
2023-11-15 02:19:44 -08:00
Pranav Sanwal
c2ad5cd913 msm: camera: tfe: Add out of sync error handling
problem:
Need to handle continuous out_of_sync_frame error that
may come due to mup/VC mismatch.

solution:
Handle the scenario by counting error occurences for a fixed
threshold since HW dosent generate SOF when this error comes
and triggering recovery.
Reset the count after the subsequent SOF is received.

CRs-Fixed: 3419224
Change-Id: Ifd44dc753385ae8cb8ce4b4cb283cd07aa8b2a44
Signed-off-by: Pranav Sanwal <quic_psanwal@quicinc.com>
2023-11-14 19:54:36 +05:30
Alok Chauhan
37ff9bad4d msm: camera: tfe: Add PDAF support in tfe 770 header
Add pdaf support in tfe header file for 770 target.

CRs-Fixed: 3387396
Change-Id: Ieb6f1245bd9ec7037fc6399bd3a8c081c96375a9
Signed-off-by: Alok Chauhan <quic_alokc@quicinc.com>
2023-11-14 19:51:55 +05:30
Ayush Kumar
ff740eb678 msm: camera: tfe: Add TFE and TFE LITE header file for 770 HW
This commit adds TFE and TFE LITE header file for titan
version 770 hardware.

CRs-Fixed: 3374385
Change-Id: I34c5227bc51e7911f584e219f5608af3dfcab9f8
Signed-off-by: Ayush Kumar <quic_ayushkr@quicinc.com>
2023-11-14 19:47:49 +05:30
Alok Chauhan
b5d8386049 msm: camera: isp: Add support for PDAF HW
This change add support for:
 - PDAF HW support handling in CSID and TFE driver
 - CSID PPP halt mode handling
 - Add support for new TFE PD ports (LCR, PD_PREPROCESSED
   PD_PARSED).

CRs-Fixed: 3387396
Change-Id: I56dc109138607fe7b342760a5c977e4126fe1676
Signed-off-by: Alok Chauhan <quic_alokc@quicinc.com>
2023-11-14 19:45:24 +05:30
Stuti Saxena
28aee302b2 msm: camera: tfe: Remove hardcoding of shift values
Problem Description:
Hardcoded shift values may vary with targets.

Solution:
Add support for reading shift values from target specific
header file to avoid hardcoding in tfe_bus and tfe_core files .

CRs-Fixed: 3390902
Change-Id: I7960e72f6b15c13c07cacc28a83fc27e7f452d8d
Signed-off-by: Stuti Saxena <quic_stutsaxe@quicinc.com>
2023-11-14 19:43:54 +05:30
Alok Chauhan
877008e9d6 msm: camera: isp: Add support for CSID 770
This change add support for
 - new CSID 770 HW
 - PDAF resource structure addition in header file.

CRs-Fixed: 3387396
Change-Id: I85ce8a05039657bb7da251e9141e94c9d5d6843f
Signed-off-by: Alok Chauhan <quic_alokc@quicinc.com>
2023-11-14 19:41:56 +05:30
Ayush Kumar
1d652f18cd msm: camera: tfe: Add support for TFE LITE HW
This commit adds support for TFE LITE HW.

CRs-Fixed: 3374385
Change-Id: I4a7eb792243fba07467060cb242f98638658d0ad
Signed-off-by: Ayush Kumar <quic_ayushkr@quicinc.com>
2023-11-14 19:37:21 +05:30
Ayush Kumar
7a9cd0d210 msm: camera: tfe: Add MUP support for TFE HW
This change add support for MUP in TFE HW. Also enable
interrupt if case of mup mismatch and add error bit in
header file to remove hardcoded values.

CRs-Fixed: 3350436
Change-Id: I5556fa3f8ab47fea16fe92007303eb68a5b80943
Signed-off-by: Ayush Kumar <quic_ayushkr@quicinc.com>
2023-11-14 19:33:17 +05:30
Dharmender Sharma
cbdb663a03 msm: camera: cpas: update the QOS setting
NRT2, NRT6 and NRT7 do not support urgency value 0x1003. So updating
urgency QOS setting to 0x1030 based on the SPT recommendation.

CRs-Fixed: 3660302
Change-Id: I245884672e26fe439eaf289d717bc1bfe845c7d0
Signed-off-by: Dharmender Sharma <quic_dharshar@quicinc.com>
2023-11-08 21:55:34 -08:00
Depeng Shao
56bb12e64b msm: camera: isp: Read last consumed addr again if no matching res
Bus layer just read the consumed address from one port per group,
sometimes, this port isn't requested by userland, so it can't
match with any requested resources. This change reads consumed
address from other port which in same composite group if the buf
done event can't match any requested resources.

CRs-Fixed: 3590441
Change-Id: I1590e9a53ef7eff1df65682ae4ca77b011d1af39
Signed-off-by: Depeng Shao <quic_depengs@quicinc.com>
(cherry picked from commit 3ec040334581d347916871429de9374555656e4d)
2023-11-07 23:56:23 +05:30
Ayush Kumar
e01a63cc4f msm: camera: isp: Add TPG mux select logic in CPAS
Add TPG mux select logic in CPAS. To select form which TPG CSID should
get the data, TPG_MUX_SEL register has to be programmed. This change
adds the logic to write this register on CPAS driver.

CRs-Fixed: 3081144
Change-Id: I86560f802a04e88ceca4efa276e853029d8417d3
Signed-off-by: Ayush Kumar <quic_ayushkr@quicinc.com>
(cherry picked from commit 323f7225a0e814b2be33cd89109ae6b3ac8c3490)
2023-11-07 23:54:46 +05:30
Stark Lin
314f7dce36 msm: camera: utils: Restructure register address validation
On current scheme, we put validation inside IO function, it's hard
to block subsequent accessing when facing invalid address and may
increase the number of cycles to do the register accessing as well.
This change limits the validation to only for the reg dump, we can
take following up operations when accessing wrong address for read
rather than printing uncertain logs.

CRs-Fixed: 3589725
Change-Id: I7d38a3ddb6c3f8e2915070f3c24629754abf76d7
Signed-off-by: Stark Lin <quic_starlin@quicinc.com>
(cherry picked from commit 159f8889a51178a92186e66e24e39bfdb01e87ee)
2023-11-07 23:53:36 +05:30
Camera Software Integration
832696032c Merge "msm: camera: isp: Update event record for shutter notification" into camera-kernel.lnx.7.0 2023-11-05 06:43:07 -08:00
Camera Software Integration
42107a1433 Merge "msm: camera: isp: Update the resource reserve logic" into camera-kernel.lnx.7.0 2023-11-05 06:42:25 -08:00
Depeng Shao
83c35b72f0 msm: camera: isp: Update the resource reserve logic
Based on HW team's recommendation, we should restrict to 1:1
mapping in between IFE and SFE hw index. This change makes
sure IFE acquire resource from the hw idx what SFE has
acquired.

CRs-Fixed: 3618217
Change-Id: I493f3519887a3a214e23cf8e70d2a1550213ee84
Signed-off-by: Depeng Shao <quic_depengs@quicinc.com>
2023-10-30 16:14:28 +05:30
Vikram Sharma
cec32ac0ce msm: camera: isp: Update event record for shutter notification
This change adds shutter notification event in event record too
which can be dumped at the time of recovery.

CRs-Fixed: 3616617
Change-Id: I4eb57da6faf7ed3dc0a0a4a407fb669078db2a25
Signed-off-by: Vikram Sharma <quic_vikramsa@quicinc.com>
2023-10-30 11:23:44 +05:30
Dharmender Sharma
d6f2cc2a00 msm: camera: cpas: Fix cpas dump state monitor array info
Even if smart Qos is enabled disabled smart_qos_info is accessed which
causes the kernel panic. This change add few check before accessing the
smart_qos_info.

CRs-Fixed: 3650729
Change-Id: Idb8cd892f47aec60290ab3d6c7853a60558840a0
Signed-off-by: Dharmender Sharma <quic_dharshar@quicinc.com>
2023-10-29 00:28:37 -07:00
Dharmender Sharma
ac33a9b0cf msm: camera: cre: calling cpas stop during release
CRE is not calling cpas stop during release causing
cpas handle to not release. it leads to next time acquire
failure.
Handling release properly with this fix.

CRs-Fixed: 3081144
Change-Id: I40cc22ac86934bc53171f19652a0fee381ee5d67
Signed-off-by: Dharmender Sharma <quic_dharshar@quicinc.com>
2023-10-18 12:27:39 -07:00
Camera Software Integration
765156f4f3 Merge "msm: camera: common: Added missing NULL Checks" into camera-kernel.lnx.7.0 2023-10-18 02:45:49 -07:00
Sourabh Soni
eeb2706049 msm: camera: common: Added missing NULL Checks
This change is returning error for the cases
when platform device misses some data for
device or sub device. Adding Null pointer
checks resolves this issue.

CRs-Fixed: 3608850
Change-Id: If8fc3fc7c93bb2b95087674165dca8c1c13d54f6
Signed-off-by: Sourabh Soni <quic_soursoni@quicinc.com>
2023-10-14 17:54:09 +05:30
Pranav Sanwal
c565be83b1 Camera: Bring over TFE specific changes
Following gerrits combined:

msm: camera: tfe: update debug data for overflow
msm: camera: isp: Handling IRQ delay from CDM in tfe
msm: camera: isp: Handling excessive logging in cdm callback
msm: camera: tfe: Fix compilation issue
msm: camera: uapi: Add new HW ports definition for TFE
msm: camera: tfe: Add LDAR dump utility in TFE.

CRs-Fixed: 3623803
Change-Id: I31e7b8d7cff654fd292ce431b790e0e287d6845e
Signed-off-by: Pranav Sanwal <quic_psanwal@quicinc.com>
2023-10-14 17:42:59 +05:30
Gaurav Jindal
050d6d7a8a msm: camera: isp: Maintain clock rate relation between CSIPHY, CSID and TFE
Adds checks to confirm CSID frequency greater than
CSIPHY frequency, TFE frequency greater than CSID
frequency. Also TFE frequency should be such that
it can accommodate PHY data rate .

CRs-Fixed: 2847155
Change-Id: I5d3dcc53a6f27129f4b82cba1254445f58f6d0cf
Signed-off-by: Shravya Samala <quic_shravyas@quicinc.com>
Signed-off-by: Shardul Bankar <quic_sharbank@quicinc.com>
Signed-off-by: Gaurav Jindal <quic_gjindal@quicinc.com>
Signed-off-by: Alok Chauhan <quic_alokc@quicinc.com>
2023-10-14 17:41:52 +05:30
Pranav Sanwal
e9530314ea msm: camera: tfe: dump csid clock and path data at overflow
On overflow dump the AB and IB votes, tfe clock,
CSID clock and respective bus path data for acquire
time and addr_status registers.

CRs-Fixed: 3118430
Change-Id: Ia38eb4350e8e38562b6d22769b38637480da0b9d
Signed-off-by: Pranav Sanwal <quic_psanwal@quicinc.com>
2023-10-14 17:38:24 +05:30
Camera Software Integration
4299de278a Merge "msm: camera: isp: validation of cmd_buf support" into camera-kernel.lnx.7.0 2023-10-09 21:59:54 -07:00
Camera Software Integration
82b35d0b31 Merge "msm: camera: csiphy: Remove the references to a unused header" into camera-kernel.lnx.7.0 2023-10-09 21:58:34 -07:00
Camera Software Integration
7c764ef6eb Merge "msm: camera: common: Fix possible OOB reads and writes operation" into camera-kernel.lnx.7.0 2023-10-06 02:58:24 -07:00
mingpan
0c04a30b66 msm: camera: common: Fix possible OOB reads and writes operation
We need to check if the packet is valid before using it.

CRs-Fixed: 3605421
Change-Id: Ide4e005ba46690c1cac02cb77a2d9aaa497b15df
Signed-off-by: mingpan <quic_mingpan@quicinc.com>
(cherry picked from commit 0156c0475a4c6c042eb84fcfbc14b3e837e0cb4c)
2023-10-06 15:26:34 +05:30
Camera Software Integration
527bd7e7bd Merge "msm: camera: isp: Fix to map correct bus port to MID" into camera-kernel.lnx.7.0 2023-10-06 02:56:32 -07:00
Camera Software Integration
6c0e1c6d17 Merge "msm: camera: isp: Fix logic to get correct bus port on page fault" into camera-kernel.lnx.7.0 2023-10-06 02:56:18 -07:00
Shravan Nevatia
6bbdc6d2ec msm: camera: sensor: Add subdev data ptr NULL checks
Add NULL checks for the private device data ptr
returned by v4l2_get_subdevdata for sensor/CCI/PHY/flash
subdevs.

CRs-Fixed: 3605325
Change-Id: I146857a944988655f75327046bebd9b87154939b
Signed-off-by: Shravan Nevatia <quic_snevatia@quicinc.com>
(cherry picked from commit 8eaa13f96deb4d940c25cb6043a06f0b7235966a)
2023-10-06 15:25:29 +05:30
Vijay Kumar Tumati
887026f2b5 msm: camera: csiphy: Remove the references to a unused header
The file is supposed to be included only from the userspace
drivers and not from the kernel space drivers. The other
files included in the camera drivers are sufficient for
referencing the necessary symbols.

CRs-Fixed: 3562596
Change-Id: I7261e4b9af2984fd78d5dc43bfbec6c090ad647b
Signed-off-by: Vijay Kumar Tumati <quic_vtumati@quicinc.com>
(cherry picked from commit b0009248708dfe13cb0fea22b43c542520db446f)
2023-10-04 14:30:40 -07:00
Camera Software Integration
19ca7a73f9 Merge "msm: camera: memmgr: Add missing calls of put buf to avoid leak" into camera-kernel.lnx.7.0 2023-10-04 03:06:41 -07:00
Camera Software Integration
195a33bc2e Merge "msm: camera: cre: Enable CRE module" into camera-kernel.lnx.7.0 2023-10-04 00:56:58 -07:00
Camera Software Integration
9e992f8c38 Merge "msm: camera: cpas: Add support for Cliffs Camera" into camera-kernel.lnx.7.0 2023-10-04 00:56:38 -07:00
Atiya Kailany
589a14ed9a msm: camera: utils: Add support for cesta hw client voting through mmrm
Currently, CESTA hw clients vote directly in util layer using clk crm
api, this change will enable CESTA hw clients to vote using mmrm api when
appropriate. This change affects setting the clk rate as well as
registering and unregistering a hw client with mmrm interface.

CRs-Fixed: 3385745
Change-Id: I5a9ad0e515e153dbbb937cab3a951d05677c817b
Signed-off-by: Atiya Kailany <quic_akailany@quicinc.com>
(cherry picked from commit 61b72dfada00da024e0bfe7449a4c6d845b492d2)
2023-10-04 13:25:01 +05:30
Camera Software Integration
2dcc195072 Merge "msm: camera: csiphy: Remove the references to a unused header" into camera-kernel.lnx.7.0 2023-10-04 00:51:38 -07:00
Camera Software Integration
754860d132 Merge "msm: camera: isp: Logging improvement" into camera-kernel.lnx.7.0 2023-10-04 00:50:48 -07:00
Camera Software Integration
083ac0c2f4 Merge "msm: camera: sensor: Add PHY support for cliffs" into camera-kernel.lnx.7.0 2023-10-04 00:50:06 -07:00
Camera Software Integration
862a5636b3 Merge "msm: camera: cpas: Add support for dynamic FD port config" into camera-kernel.lnx.7.0 2023-10-04 00:49:58 -07:00
Karthik Dillibabu
97c4721bae msm: camera: isp: validation of cmd_buf support
This change validates cmd_buf in IFE/TFE before submitting
BL to CDM when debugfs(enable_invalid_cmd_check) is enabled.

CRs-Fixed: 3616889
Change-Id: I5418661ff092fb15d04ab7dda6f3b59742a232a8
Signed-off-by: Karthik Dillibabu <quic_kard@quicinc.com>
(cherry picked from commit 7528980860a33e0d800915c64005965862b80982)
2023-10-03 01:17:11 -07:00
Dharmender Sharma
4ae0511777 msm: camera: isp: Fix to map correct bus port to MID
Bus port to MID mapping is wrong so updating correct MID mapping to the
respective bus ports.

CRs-Fixed: 3609762
Change-Id: I1d369319d3d5688e21ffb4873643d3cb5ac1467c
Signed-off-by: Dharmender Sharma <quic_dharshar@quicinc.com>
2023-09-28 03:31:10 -07:00
Dharmender Sharma
f927893bdb msm: camera: isp: Fix logic to get correct bus port on page fault
This commit add change to get correct resource outport
for page fault if mid value is same for two or more ports.

CRs-Fixed: 3609762
Change-Id: Ic48e71d1d3956b04240c136507c868f971ec1ad6
Signed-off-by: Dharmender Sharma <quic_dharshar@quicinc.com>
2023-09-27 11:46:24 +05:30
Depeng Shao
c0c785043e msm: camera: cci: Remove some dead code
This change removes some dead checking code for
lock function.

CRs-Fixed: 3612969
Change-Id: I8f43ab6021ed6122d37d14b06f4dac1f7e48e6c8
Signed-off-by: Depeng Shao <quic_depengs@quicinc.com>
(cherry picked from commit eea20d5fb340d847ec8ec50554b4334cd964ce47)
2023-09-26 23:54:57 +05:30
Shravan Nevatia
0101ba0568 msm: camera: sensor: Always stream-off at flush in standby mode
Issue:
- In standby mode, aux sensor is streamed-off at flush only if
stream-off command has already been received.
- If flush happens before stream-off command, the sensor is never
streamed off. This causes the next config command to fail.

Fix:
In standby mode, stream off sensor at flush regardless of the
stream-off status.

CRs-Fixed: 3537642
Change-Id: I15956d51dae4a30cdcabbe9d0ed59857c028218e
Signed-off-by: Shravan Nevatia <quic_snevatia@quicinc.com>
(cherry picked from commit d5c922710cea5c19a9bcabda946842ba47d920a5)
2023-09-26 23:54:25 +05:30
Vikram Sharma
ec8012559c msm: camera: memmgr: Add missing calls of put buf to avoid leak
This change add missing calls to put cpu buf in few scenarios.

CRs-Fixed: 3578162
Change-Id: Iab6aa0324b5072390b38df296c7acee00f5102a1
Signed-off-by: Vikram Sharma <quic_vikramsa@quicinc.com>
2023-09-26 05:49:27 -07:00
Vijay Kumar Tumati
0c0096b72e msm: camera: cpas: Add support for dynamic FD port config
Configure IFE FD OUT port to secure or non-secure
based on whether the user space wants to use
hardware FD or software FD for secure camera
use cases.

CRs-Fixed: 3572316
Change-Id: I8f5f1506a01ba2aaf9c533edbdc64c5c6250cb2f
Signed-off-by: Vijay Kumar Tumati <quic_vtumati@quicinc.com>
(cherry picked from commit db520c5c3fb5e585eceb1d4bc4d58a0b799b2c08)
2023-09-22 09:34:43 -07:00
Dharmender Sharma
d5e504c12c msm: camera: cre: Enable CRE module
This change is to enable CRE driver and fix compilation issues due to
undefined variables. Also added bazzal support for cre.

CRs-Fixed: 3609762
Change-Id: Ife0910d27535f97d792991ad192f896dc1927c71
Signed-off-by: Dharmender Sharma <quic_dharshar@quicinc.com>
2023-09-22 15:59:25 +05:30
Shravan Nevatia
855f371ebb msm: camera: sensor: Add PHY support for cliffs
Add PHY driver support for cliffs (PHY version 2.2.1).

CRs-Fixed: 3618770
Change-Id: I0cec1b62e827a6c0413ec9f79612507eaaa62724
Signed-off-by: Shravan Nevatia <quic_snevatia@quicinc.com>
2023-09-22 01:42:51 -07:00
Vijay Kumar Tumati
262502722c msm: camera: csiphy: Remove the references to a unused header
The file is supposed to be included only from the userspace
drivers and not from the kernel space drivers. The other
files included in the camera drivers are sufficient for
referencing the necessary symbols.

CRs-Fixed: 3562596
Change-Id: Ie8f54d07767b1c12b36f381c0f951b15953d9e7c
Signed-off-by: Vijay Kumar Tumati <quic_vtumati@quicinc.com>
(cherry picked from commit 8f51e330a824ec89b32d60ae501ac3edaba7ed2c)
2023-09-21 12:05:11 -07:00
Stark Lin
8a04130f3b msm: camera: isp: Dump imp CSID regs during timeout
This change dumps important csid registers and clock info
during sw reset timeout.

CRs-Fixed: 3583444
Change-Id: Iac8f45343058766012c19b8d61fa9e541e8a2b76
Signed-off-by: Stark Lin <quic_starlin@quicinc.com>
2023-09-22 00:00:32 +05:30
Ayush Kumar
17b595a936 msm: camera: isp: Logging improvement
This commit add change to print vcrop register during
illegal programming error.

CRs-Fixed: 3595942
Change-Id: If09d8c1240556618dbc6c40e1e22938e187618ff
Signed-off-by: Ayush Kumar <quic_ayushkr@quicinc.com>
2023-09-20 04:42:48 -07:00
Shravan Nevatia
ed308a3020 msm: camera: sensor: Fix mutex handling in TPG driver
Issue:
TPG driver doesn't release the device mutex when the stop/
configure commands fail.

Fix:
Release the mutex everytime it's acquired in TPG driver.

Change-Id: I8414c73b89e1e69b60682d860ec1d97d6a7a8dbc
CRs-Fixed: 3594995
Signed-off-by: Shravan Nevatia <quic_snevatia@quicinc.com>
(cherry picked from commit 7b9602e996781f36a79c514780d1f776f5dfda8a)
2023-09-18 09:30:52 +05:30
mingpan
87406c4947 msm: camera: reqmgr: Pause watch dog before internal recovery
Need to pause watch dog before internal recovery because the recover
may take a long time. if don't pause watch dog here, SOF freeze may
be triggered. After recovery, need to start watch dog again.

CRs-Fixed: 3588849
Change-Id: I5209cbc1b71c7f9a68dd3ee6097da1eb6facbb40
Signed-off-by: mingpan <quic_mingpan@quicinc.com>
(cherry picked from commit b02ec3ea0706ea6b578162ec58af432d61be9cda)
2023-09-18 09:30:32 +05:30
Depeng Shao
f1ba516e2f msm: camera: isp: Add input core to hw idx for sfe2
This change adds input core type to hw idx support
for sfe2, ife hw manager needs the hw idx to notify
sfe2 of the overflow event.

CRs-Fixed: 3602081
Change-Id: I94f43e80ddad1689508c1709b1c134fedbcb034b
Signed-off-by: Depeng Shao <quic_depengs@quicinc.com>
(cherry picked from commit 8dde5b8efdd0ee5f12347762c2e90f2c05bdd41f)
2023-09-18 09:30:10 +05:30
Depeng Shao
133370a30c msm: camera: cci: Don't validate queue for lock and unlock cmd
We already reserve the space for unlock cmd during loading the
data to CCI queue, so we don't need to validate the queue before
loading unlock cmd to the queue.

CRs-Fixed: 3603432
Change-Id: Ie1acee0c09446d5a60a0f80e1393800600306412
Signed-off-by: Depeng Shao <quic_depengs@quicinc.com>
(cherry picked from commit f9ca5a4b9a0b5a6dfec4d8881d0e183068596bf9)
2023-09-18 09:29:52 +05:30
Dharmender Sharma
c6b1ce8455 msm: camera: cpas: Add support for Cliffs Camera
This change adds camnoc interface changes and CPAS version change for
Cliffs camera. It also add support for ife, csid and sfe.

CRs-Fixed: 3609762
Change-Id: Icddfd38330022b8ebc7f785ba3c97cc055e70d74
Signed-off-by: Dharmender Sharma <quic_dharshar@quicinc.com>
2023-09-12 23:45:46 -07:00
Yash Upadhyay
560a401558 msm: camera: isp: Enabling last consumed address support in tfe
Enabling last consumed address support to handle delay in bufdones.

CRs-Fixed: 3273866
Change-Id: I25df0ac7a81b696188519db8df08c66a238e1644
Signed-off-by: Yash Upadhyay <quic_yupadhya@quicinc.com>
(cherry picked from commit 8bdd7e9d45f7ff51a893bca833343e0fce1efd65)
2023-09-11 22:37:20 +05:30
Yulei Yao
0b8ef446fb msm: camera: sensor: Fix delay pass issue in I2C sequential write
When I2C sequential write is applied, first register's delay parameter
is used instead of the last one in the sequential queue.

CRs-Fixed: 3566036
External Impact: No.

Change-Id: I0aa6480d7b577fdb697bc28b61aed428d5cae8fb
Signed-off-by: Yulei Yao <quic_yuleiy@quicinc.com>
(cherry picked from commit e2ebd508d879607b2dadb1d223c1ad7338989bf2)
2023-09-11 22:35:32 +05:30
Haochen Yang
4722b4c478 msm: camera: isp: Add support for handling FCG configurations
This change parses FCG configurations from UMD, handles it
in its corresponding blob handler, then writes exact FCG configs
to the hardware.

During the prepare stage, all FCG update values will be temporarily
stored in req_isp and then utilized by the config function later.
At the end of the blob handler with FCG prepared, a dummy hw update
entry is created for further usage and the size of such entry is based
on the number of reg val pairs and the size of cdm reg random header.

During applying the req in activated state, an algorithm is implemented
to pick exact FCG prediction to be used in SFE/IFE/TFE usecases.

During the config stage, based on the number of skipped frames before,
the exact FCG configurations are passed to SFE/VFE top and then
written into kmd_buf and picked by the CDM. If the number of skipped
frames reaches the maximum that FCG supports or no recorded skipped
frames before, current configuration will be used instead and FCG
entry will be skipped. If the hardware supports multi context like TFE,
wr_sel will be programmed right before the FCG config of each context.

In order to retrieve cpu address of FCG related hw update entry,
a slight change is made in packet parser to pass those addresses
when adding hw update entries.

CRs-Fixed: 3487116
Change-Id: I1db957885933edcbfabc6ce90d72902f4c518118
Signed-off-by: Haochen Yang <quic_haocyang@quicinc.com>
(cherry picked from commit 55213f81a4bd9a847692c00e657e722c1d4ed903)
2023-09-06 00:17:45 +05:30
Depeng Shao
38a96f694c msm: camera: cci: Fix some cci stability issues
This change moves the set parameter under lock
context to make sure all the cmds are atomic.
This change also move the unlock at the end
of writing data, then we don't need to get
inflight word count and write back to execute
word count to fix underflow issue.

CRs-Fixed: 3589051
Change-Id: I1c16a204e41e6af22a23e9249c82f541e7e6e21a
Signed-off-by: Depeng Shao <quic_depengs@quicinc.com>
(cherry picked from commit dda071b3e2e76a2d698a40c8829da0627bd80da2)
2023-08-26 02:58:12 -07:00
Camera Software Integration
573c73d3df Merge "msm: camera: isp: Apply MUP at streamon correctly" into camera-kernel.lnx.7.0 2023-08-25 04:40:00 -07:00
Camera Software Integration
b3d7948f33 Merge "msm: camera: reqmgr: Correct the logic of sync_link_sof_skip determination" into camera-kernel.lnx.7.0 2023-08-25 04:39:30 -07:00
Camera Software Integration
0d46010408 Merge "msm: camera: isp: Update acquired HW id for SFE2" into camera-kernel.lnx.7.0 2023-08-25 04:38:48 -07:00
Karthik Anantha Ram
5d40c5a2ef msm: camera: isp: Apply MUP at streamon correctly
With MUP update moved to per request structure, at streamon
when we issue the MUP using AHB we end up using an incorrect
MUP value.

CRs-Fixed: 3584759
Change-Id: I75d1c81c8f74731cc17a45d0363979bd8cd2d77b
Signed-off-by: Karthik Anantha Ram <quic_kartanan@quicinc.com>
(cherry picked from commit 015f2d278a93012bc98a3f22a2e25a5cb8f5a851)
2023-08-23 02:45:49 -07:00
mingpan
47456e549f msm: camera: reqmgr: Correct the logic of sync_link_sof_skip determination
When SOF timestmp of sync link is later than link, the value of
link->sof_timestamp - sync_link->sof_timestamp would be negative,
but sync_frame_duration is always positive. In this situation, the
value of sync_link_sof_skip would be incorrectly set to true.

CRs-Fixed: 3576909
Change-Id: I9bf26d217e0e9c317ca27d592cec148f075681bc
Signed-off-by: mingpan <quic_mingpan@quicinc.com>
(cherry picked from commit 85dcf379b53e89452cddbce67ff9fb62e895ea38)
2023-08-23 02:41:03 -07:00
Depeng Shao
6aa27c964f msm: camera: isp: Update acquired HW id for SFE2
This change adds sfe hw id 2 as valid hw id, then
sfe 2 info can be returned to userspace correctly.

CRs-Fixed: 3587713
Change-Id: I01825040837be4e1df204d7fe1c27887af3900e5
Signed-off-by: Depeng Shao <quic_depengs@quicinc.com>
(cherry picked from commit 9668c0f7a7963d6a6a43a6bb2352aa5b76201a83)
2023-08-23 02:40:11 -07:00
Karthik Anantha Ram
51846a0b77 msm: camera: isp: Fix reset sequence for dual case
There is no need to explicitly reset the slave CSID,
issuing a reset to master (both HW & SW) will be propagated
to the slave CSID. This avoids the handling of additional
reset_ack irq from slave, and any associated handling.

CRs-Fixed: 3580847
Change-Id: I9f787619c8322b7c3f96430762f4197af19e51fd
Signed-off-by: Karthik Anantha Ram <quic_kartanan@quicinc.com>
(cherry picked from commit 7356076769c8f381f6980f26e7a12f06a66af268)
2023-08-23 02:38:57 -07:00
Karthik Anantha Ram
594b59a2df msm: camera: memmgr: Add provision for heap selection
Currently, userland can only choose whether to allocate memory as
cached/uncached if it's a protected buffer, ubwc_p buffer, etc.
This change provides some more granularity in terms of heap selection.
One could now force an allocation from the system heap or
try a dedicated heap. The change also provides heap capability info
to userland as part of the query caps call.

CRs-Fixed: 3584481
Change-Id: Id4c92fd64d975f761e7dd4cecca8453dd09b039f
Signed-off-by: Karthik Anantha Ram <quic_kartanan@quicinc.com>
2023-08-14 13:33:05 -07:00
Li Sha Lim
11bda3b669 msm: camera: isp: Update SOF timestamps in top-half
Currently, SOF timestamps are collected in bottom-half
routines. This may lead to a problem if bottom-half
execution is delayed, as it will then print frame N+1's
SOF timestamp instead of frame N; this will lead to two
duplicate SOF timestamps.

To fix this, SOF timestamps are read in top-half.

Some refactoring is done to enable SOF timestamps
to be read from vfe top half routine, as SOF timestamp
register values belong to CSID register space.

CRs-Fixed: 3485788
Change-Id: Ie13cf97072ab3f0688b835a4973e2ff27969e7ad
Signed-off-by: Li Sha Lim <quic_lishlim@quicinc.com>
2023-08-10 17:13:34 -07:00
Stark Lin
56429494cb msm: camera: utils: Add address validation for io operation
Kernel panic might be caused by improper register offset which
is not memory aligned during write or read operation, this change
adds a validation for the offset to avoid accessing invalid address.

CRs-Fixed: 3542219
Change-Id: I8761c8d416890bd4571be8a64118036c0173d303
Signed-off-by: Stark Lin <quic_starlin@quicinc.com>
2023-08-10 17:13:32 -07:00
Ridhi Mukesh shah
277c1f983b msm: camera: sensor: Remove delay in camera sensor driver
Removed the 20ms delay in the camera sensor driver during sensor probe.

Change-Id: I9a51c3d0b15d6c77196d00b9bfbf6a8dc76d63be
CRs-Fixed: 3244380
Signed-off-by: ridhshah <quic_ridhshah@quicinc.com>
2023-08-10 17:13:26 -07:00
Stark Lin
8ac893d982 msm: camera: isp: Fix some kw issues
This change fixes kw issues such as possible memory leak
and value is never used after assignment.

CRs-Fixed: 3574742
Change-Id: I757e055dbeeb308e4c115727774f183f8aae41be
Signed-off-by: Stark Lin <quic_starlin@quicinc.com>
2023-08-10 17:13:21 -07:00
Yash Upadhyay
42466f8068 msm: camera: isp: Number of valid vc dt check
Added num_valid_vc_dt check before first cid get call.

CRs-Fixed: 3248380
Change-Id: I02605adead5e2fd98db952e7c41ea2d56af38591
Signed-off-by: Yash Upadhyay <quic_yupadhya@quicinc.com>
2023-08-10 17:13:21 -07:00
Chandan Jha
f1cb553de2 msm: camera: tfe: Add support to Recover missed SOF timestamp
In case SOF interrupt is not received by the camera driver, we can
recover the missing SOF timestamp for the frame at epoch using the
previous and current SOF timestamp from CSID.

CRs-Fixed: 3232845
Change-Id: Id41860e125c26f2175c5180713c9b3c41741491b
Signed-off-by: Chandan Kumar Jha <quic_cjha@quicinc.com>
Signed-off-by: Pranav Sanwal <quic_psanwal@quicinc.com>
2023-08-10 17:13:21 -07:00
Alok Chauhan
b3c95f32d6 msm: camera: tfe: Print HBI and VBI info
Add format measure info to print HBI and VBI from csid.

CRs-Fixed: 3235284
Change-Id: I55148143624c492d2e220cf2e34012ba03f80630
Signed-off-by: Alok Chauhan <quic_alokc@quicinc.com>
2023-08-10 17:13:21 -07:00
Ayush Kumar
c64744b09d msm: camera: isp: Update clock value during init based on blob
Take the clock blob value into consideration during tfe init phase.
Set default clock in absence of clock blob from UMD.

CRs-Fixed: 3247771
Change-Id: I6d5b17b69066fa42293bcb8192c833cb57be0206
Signed-off-by: Ayush Kumar <quic_ayushkr@quicinc.com>
2023-08-10 17:13:21 -07:00
Alok Chauhan
1b002763fa msm: camera: isp: Add multiple MIDs support for per port
Add multiple MIDs support for TFE. This will help to parse
request dump during PF issue.

CRs-Fixed: 3206699
Change-Id: I0f6f82a1c217fde9a4f5628913bf8f5b43e4c2ee
Signed-off-by: Alok Chauhan <quic_alokc@quicinc.com>
2023-08-10 17:13:21 -07:00
Alok Chauhan
4ffc32da32 msm: camera: isp: Correct packer format for RS stats
Correct the packet format for RS stats configuration
during acquire time.

CRs-Fixed: 3206699
Change-Id: Ibcc615416603d427da0c41e8a2c2d519664367c8
Signed-off-by: Alok Chauhan <quic_alokc@quicinc.com>
2023-08-10 17:13:21 -07:00
Alok Chauhan
741818ee75 msm: camera: tfe: Take ceiling value while calculating width for wm
Take ceiling value while calculating width for PD10 format.

CRs-Fixed: 3201748
Change-Id: Ib2b722a5e7637b9eb247fba14b512f5338a79836
Signed-off-by: Alok Chauhan <quic_alokc@quicinc.com>
2023-08-10 17:13:21 -07:00
Wasim Khan
cc411dc671 Merge "msm: camera: common: changes to handle err in bazel build" into camera-kernel.lnx.7.0 2023-08-10 17:06:48 -07:00
Wasim Khan
ba313f4ee7 Merge "msm: camera: common: removing spectra custom config" into camera-kernel.lnx.7.0 2023-08-10 17:06:46 -07:00
Abhijit Trivedi
00d121a3ad Merge "msm: camera: csiphy: Add support for SM8750" into camera-kernel.lnx.7.0 2023-08-09 15:02:47 -07:00
Soumen Ghosh
24a496388f msm: camera: common: changes to handle err in bazel build
Currently, the 'mm/slab.h' header is used to access a private kernel
structure. With Bazel, private headers are not available.
Refactor the code to avoid the use of the private header.

CRs-Fixed: 3535645
Change-Id: I3b442f0a7b2b70fbf638d3f505c47de88b14c5e6
Signed-off-by: Soumen Ghosh <quic_soumeng@quicinc.com>
2023-08-03 16:50:00 -07:00
Soumen Ghosh
9e0b27fa09 msm: camera: common: removing spectra custom config
Removing CONFIG_SPECTRA_CUSTOM config. Which is not
required for mainline build.

CRs-Fixed: 3535645
Change-Id: I6952370f223ac628eef8e35fe3992e81e48e9fdd
Signed-off-by: Soumen Ghosh <quic_soumeng@quicinc.com>
2023-08-03 16:49:59 -07:00
Haochen Yang
84f44ecf86 msm: camera: icp: Add support for fw pas id
This change retrieves CAM_FW_PAS_ID from ICP node in
DTSI instead of hardcoding by macros when loading firmware.
It provides forward compatibility for 2 ICP instances
with their own fw pas id.

CRs-Fixed: 3550697
Change-Id: I0bff4d01edebcf028e48dba25d65378adbd42ad6
Signed-off-by: Haochen Yang <quic_haocyang@quicinc.com>
2023-07-31 18:01:08 -07:00
Pranav Sanwal
ef6d34e2a6 msm: camera: tfe: Read last consumed address in top half
Move the read of consumed addr to bus top half, as the tasklet
may delay and cannot readout the consumed addr in time.

CRs-Fixed: 3543220
Change-Id: I89a00ce0596747b79f3b5e0f66c72e760711829b
Signed-off-by: Pranav Sanwal <quic_psanwal@quicinc.com>
2023-07-31 18:01:06 -07:00
Atiya Kailany
44f7e67c65 msm: camera: isp: removing dead code
This change removes an unused variable and its declaration.

CRs-Fixed: 3394193
Change-Id: I45561570fd501ba0314e5b43dfe4a6f138fe641f
Signed-off-by: Atiya Kailany <quic_akailany@quicinc.com>
2023-07-31 18:01:04 -07:00
Chengxue Shen
f4216475b9 msm: camera: isp: Don't add buffer tracker ref count for input buffer
While release sHDR RDI buffer, the ref count of buffer tracker still
larger than 1 lead to page fault, we needn't add buffer tracker ref
count for RDI input io config, only add buffer tracker ref count for
output buffer.

CRs-Fixed: 3561743
Change-Id: I3f1f9f7827c340b688be6aa58fba9340dd0876ad
Signed-off-by: chengxue <quic_chengxue@quicinc.com>
2023-07-31 18:01:02 -07:00
Stark Lin
b1ec7821ce msm: camera: isp: Fix crash issue for sfe bus error case
There is a fairly high probability of crashing the device when
encountering SFE BUS error, this change fixes the issue.

CRs-Fixed: 3566948
Change-Id: I0049000766de4923632447c8aecfd15b20627c16
Signed-off-by: Stark Lin <quic_starlin@quicinc.com>
2023-07-28 10:48:53 -07:00
Suraj Dongre
54407407dd msm: camera: isp: config hw modification for presil
Added code to avoid clk bw update and wait for config done for every
request when cam_presil_mode is enabled.

CRs-Fixed: 3321317
Change-Id: I64b06a081d4c80757aef4903459d58dba85bfb5f
Signed-off-by: Suraj Dongre <quic_sdongre@quicinc.com>
Signed-off-by: Mukund Madhusudan Atre <quic_matre@quicinc.com>
2023-07-28 10:48:45 -07:00
Shravya Samala
011cc16eb5 msm: camera: sync: Restructure sync device structure
Currently sync_device structure size allocated is nearly 424kb
which is leading to more than accepted page size order.
Sync table row which is array of 2048 is accounting
nearly 90% of total size of sync_device. To fix this
sync_table_row is made pointer based and allocated memory.

CRs-Fixed: 3558545
Change-Id: I0c8093c91ac7fec9f52613012b139192b827b8d9
Signed-off-by: Shravya Samala <quic_shravyas@quicinc.com>
2023-07-28 10:48:45 -07:00
Karthik Anantha Ram
669bd35816 msm: camera: reqmgr: Reset apply map for all pd tables on bubble
Reset apply map for all devices for the bubbled request for it
to be re-applied correctly.

CRs-Fixed: 3560153
Change-Id: I48e40b6edbfaa6ea60b8d8fb4155e8a612ab3c76
Signed-off-by: Karthik Anantha Ram <quic_kartanan@quicinc.com>
2023-07-26 15:59:45 -07:00
Karthik Anantha Ram
fadf0e5db2 msm: camera: sync: Update synx handle state
On signaling the synx handle, mark the row as signaled.

CRs-Fixed: 3565287
Change-Id: I88f0d6a8455eecf62ffb084c0a540179d41fa64c
Signed-off-by: Karthik Anantha Ram <quic_kartanan@quicinc.com>
2023-07-26 15:59:21 -07:00
Li Sha Lim
0fc752119d msm: camera: common: Fix double-free scenario
In situations where there are multiple flush requests,
a double-free of buffer tracker occurs when the sync
callback which operates in a workqueue contexts interrupts
an ongoing flush request operation. This change provides
the fix to prevent it from happening.

CRs-Fixed: 3554278
Change-Id: I675b22b76c0f10fcf1808dc3fe0bc48ebd19a2e4
Signed-off-by: Li Sha Lim <quic_lishlim@quicinc.com>
2023-07-26 15:58:55 -07:00
Pranav Sanwal
eff9517e23 msm: camera: tfe: Fix compilation for TFE
Fix TFE related compilation failiures in lnx.dev branch.

CRs-Fixed: 3543205
Change-Id: Ie9582f52a5e0960d419d4e791c58e16ae4c7209e
Signed-off-by: Pranav Sanwal <quic_psanwal@quicinc.com>
2023-07-26 15:58:28 -07:00
Chandan Jha
4252b1f555 msm: camera: cdm: Fixing memory leak in cdm driver
Free allocated memory in case of error scenario during
cdm interrupt handling.

CRs-Fixed: 3555034
Change-Id: Id0bcdd3a0ce4b78ffb13aa1655f886f808a8b4a0
Signed-off-by: Chandan Kumar Jha <quic_cjha@quicinc.com>
2023-07-26 15:57:15 -07:00
Chandan Jha
113320bfd5 msm: camera: isp: Update WM config in case of dual ife
Update properly WM config in case of dual ife usecase.

CRs-Fixed: 3545754
Change-Id: I730fb01408ea1281898b38c3e4897b84e884e366
Signed-off-by: Chandan Kumar Jha <quic_cjha@quicinc.com>
2023-07-26 15:56:30 -07:00
Ming Pan
032cd5a542 msm: camera: isp: Update the value of macro CAM_ISP_BW_CONFIG_V3
The value of macro CAM_ISP_BW_CONFIG_V3 should be 3,
but the current value is 2, we need to update it.

CRs-Fixed: 3558398
Change-Id: Iab07cc08434e31c22890f5f1311e9010ecd460d6
Signed-off-by: mingpan <quic_mingpan@quicinc.com>
2023-07-26 15:54:57 -07:00
Stark Lin
b45055890c msm: camera: isp: Remove needless member of struct event_info
When encountering errors on vfe bus, there is no need to set
a param to mark all the error out ports, using existig member
res_id is enough to deal with cases. Thus removing the newly
added member out_port_id of struct event_info to avoid burdensome
code.

CRs-Fixed: 3506350
Change-Id: I44a10b578a867a73509f1458ae182ceb7373b4a3
Signed-off-by: Stark Lin <quic_starlin@quicinc.com>
2023-07-26 14:53:37 -07:00
Stark Lin
c0377f2bff msm: camera: isp: Isp irq injection framework
This change constructs a framework of ISP IRQ injection which
adds support for HW err IRQ simulation.

CRs-Fixed: 3430944
Change-Id: I9552d0aa8b4672bfa04bfc78714d87b72140ad9a
Signed-off-by: Stark Lin <quic_starlin@quicinc.com>
2023-07-26 14:53:35 -07:00
Wang Kan
7d852cc75c msm: camera: csiphy: Add support for SM8750
This change adds bring up sequence header and
driver support for SM8750.

CRs-Fixed: 3557518
Change-Id: I6daddb5bca67032a5bfd3bc30bbd3d076f8599a4
Signed-off-by: Wang Kan <quic_wkan@quicinc.com>
2023-07-18 17:36:12 -07:00
Atiya Kailany
2bb45ffd4c msm: camera: common: Fixing memory leak issues
This change removes some dead code and fixes memory leak
issues and mismatched labels.

CRs-Fixed: 3394193
Change-Id: Ieb6f0d56cddc58be4caea6f0aece63a793a08c07
Signed-off-by: Atiya Kailany <quic_akailany@quicinc.com>
2023-07-13 17:36:44 -07:00
Atiya Kailany
1abd303a6f msm: camera: utils: revert to Add support for cesta hw client voting through mmrm
Currently, cesta hw client rates are being set through mmrm, camera
passes clk rate required and voting happens on mmrm side. This reverts that
funtionality and allows camera to use qcom_clk_crm api to vote directly
in util layer without passing to mmrm.

CRs-Fixed: 3385745
Change-Id: I0b9c6f6f3fc3c7d1513abd7ccf1d2d7180851c61
Signed-off-by: Atiya Kailany <quic_akailany@quicinc.com>
2023-07-13 17:36:34 -07:00
Wang Kan
e7ef91e5cc msm: camera: csiphy: Update CSIPHY header for SM8650
This change updates CSIPHY header for SM8650.
Modify some register values for short channel
from 80Msps to 1Gsps.

CRs-Fixed: 3557454
Change-Id: I0fee8747baec55c6712d4a803bfc421320b57626
Signed-off-by: Wang Kan <quic_wkan@quicinc.com>
2023-07-13 17:36:27 -07:00
Wang Kan
4ae361e5f6 msm: camera: csiphy: Remove duplicate register settings
Remove data rate settings from common register array.
This change is to avoid re-programming same registers,
with different values.

CRs-Fixed: 3554020
Change-Id: Ia397f669ba97c73a73c3a31fb80b5c233cdb5dd5
Signed-off-by: Wang Kan <quic_wkan@quicinc.com>
2023-07-13 17:36:21 -07:00
zhaocao
aefe177f6d msm: camera: sensor: support streamon/streamoff can be updated
Remove restriction that we can only configure streamon/streamoff
from cslpacket once. streamoff packets should not be rejected
when last request to flush.

Change-Id: I0691540f01181fa9f2d6a216537d5f55256d8815
CRs-Fixed: 3524017
Signed-off-by: zhaocao <quic_zhaocao@quicinc.com>
2023-07-13 17:36:13 -07:00
Depeng Shao
bd7f01665c msm: camera: reqmgr: Enhance the injecting delay
This change updates the injecting delay logic to
support different delay value, e.g. 0,1,2. It also
support multi EOF applied devices in case multi
devices need to be applied at EOF.

CRs-Fixed: 3521003
Change-Id: I929d4211674a1376125dd5f8e55950da9ab3ed6b
Signed-off-by: Depeng Shao <quic_depengs@quicinc.com>
2023-07-12 18:36:20 -07:00
Abhilash Kumar
947a93de53 msm: camera: ife: Remove NULL pointer dereference logic in IFE hw manager
While dumping information about already acquired IFE hw manager contexts,
we are iterating over IFE out resource list and SFE out resource list. Use
of 'max_ife_out_res' and 'max_sfe_out_res' has scope of reaching out of
bound and access unallocated memory.
This change makes use of number of IFE and SFE out resources stored in the
IFE hw manager context to iterate and dump the information properly and
thus solving the out of bounds access.

CRs-Fixed: 3550510
Change-Id: Ifeb7702209958f067a601ca591bb273820e98e1c
Signed-off-by: Abhilash Kumar <quic_krabhi@quicinc.com>
2023-07-12 18:36:14 -07:00
Karthik Anantha Ram
a1d72156a6 msm: camera: core: Avoid active list reinit
Reinitialize active list only after the flush call to the
respective driver's HW layer.

CRs-Fixed: 3546603
Change-Id: Ib0a5cb208147d2c81717188e89acb5eba474b454
Signed-off-by: Karthik Anantha Ram <quic_kartanan@quicinc.com>
2023-07-10 15:36:12 -07:00
Soumen Ghosh
282a1e7866 msm: camera: isp: csid test bus change
setting value to reset controller, which issues the sync reset to all,
CSID registers and also sends reset to bus.

CRs-Fixed: 3550726
Change-Id: I897d3db876149337864c9889fb99d89d9df3ac43
Signed-off-by: Soumen Ghosh <quic_soumeng@quicinc.com>
2023-07-07 16:06:46 -07:00
Karthik Anantha Ram
34582e7146 msm: camera: isp: Remove redundant CSID global SW reset
When the camera subsystem is powered on (titan_top), async reset
is issued thereby ensuring clean state for all CSIDs. At the
start of the use-case, issuing a sync global SW reset is
redundant, and can be avoided. At the end of the use-case, issue
a SW sync global reset thereby ensuring all SWI registers are
wiped out for the CSID and all connected cores. The sync global
reset also ensures the rx decoder is also reset.

CRs-Fixed: 3545161
Change-Id: I0f5e25bad8508f72b2a0395df4dafc368f71243c
Signed-off-by: Karthik Anantha Ram <quic_kartanan@quicinc.com>
2023-07-07 16:06:41 -07:00
Atiya Kailany
57f43538c7 msm: camera: utils: Add support for LowSVS_D1
Currently, lowest clk voting level supported is LowSVS, this
change will add support to a lower voting level, LowSVS_D1.

CRs-Fixed: 3480799
Change-Id: Ibdfe9d1d05aa45439a537cebe828cceea83f39d4
Signed-off-by: Atiya Kailany <quic_akailany@quicinc.com>
2023-07-07 16:06:34 -07:00
Chandan Kumar Jha
06420c01fc msm: camera: isp: Change error print into rate limit logs
Changing error logs into rate limit logs to avoid
excessive logging.

CRs-Fixed: 3522504
Change-Id: I773fbdc1ae0cc38dd7b6793381c266a47f9bc93d
Signed-off-by: Chandan Kumar Jha <quic_cjha@quicinc.com>
2023-07-07 16:06:27 -07:00
Vijay Kumar Tumati
77c1ce29af msm: camera: smmu: Do not remap a buffer to the same device
If a buffer is already mapped to a device or a context bank,
do not try to map it again. This causes inconsistency between
the number of times it is attached and detached.

CRs-Fixed: 3510467
Change-Id: I1cfa5bc68edae1147562c3bbf3609c278d837bcd
Signed-off-by: Vijay Kumar Tumati <quic_vtumati@quicinc.com>
2023-07-07 16:06:18 -07:00
Vijay Kumar Tumati
db988fcff4 msm: camera: csiphy: Refine MINK API usage for secure camera
Use MINK API for all the targets that support domain ID and
use legacy API for all other targets. In addition, use a
target based macro to not compile the MINK API for the
older targets where those APIs are not defined.

Change-Id: I0d8f05df6ca8126db1e3ad8456fe78aa77a33ebf
CRs-Fixed: 3529425
Signed-off-by: Vijay Kumar Tumati <quic_vtumati@quicinc.com>
2023-07-07 16:06:10 -07:00
Wang Kan
d8d21bbe93 msm: camera: icp: Remove icp dev type info
This change removes icp dev type info when
logs have icp ctx string. Because icp string
includes dev type info.

CRs-Fixed: 3542004
Change-Id: Ib7464b3937aaddf0efc27d731865a1631e8cf9cc
Signed-off-by: Wang Kan <quic_wkan@quicinc.com>
2023-07-06 18:06:13 -07:00
Wang Kan
9603b9ffba msm: camera: csiphy: Change csiphy datarate default channel from std to short
This change changes csiphy datarate default channel from std to short.

CRs-Fixed: 3534590
Change-Id: I52cb37fc89c770795fc1fbec57c91eeb6ab379f7
Signed-off-by: Wang Kan <quic_wkan@quicinc.com>
2023-07-05 17:51:32 -07:00
Chandan Kumar Jha
9417997bb2 msm: camera: isp: Add check to prevent duplicate deferred ack increment
Due to the scheduling delay, the top half was getting delayed for
buff-done events. 2 different requests buff-done is merged due to
top half delay and we incremented 2 times deferred ack due to merger
of buff-done events. This check will prevent duplicate deferred
ack increments.

CRs-Fixed: 3477436
Change-Id: If6bbd460a0a1025758f330f26eaf1099de2daa38
Signed-off-by: Chandan Kumar Jha <quic_cjha@quicinc.com>
2023-07-05 17:51:20 -07:00
Shivakumar Malke
3a40a7b5b9 msm: camera: jpeg: dump jpeg register during pagefault
This change dump jpeg dma/enc registers during pagefault
for debug purposes.

CRs-Fixed: 3503307
Change-Id: I3a9c9d76302f2cc1eb7d23193bfdd566767a6428
Signed-off-by: Shivakumar Malke <quic_smalke@quicinc.com>
2023-07-05 17:51:06 -07:00
Soumen Ghosh
9e69478cf5 msm: camera: isp: Check for execution context prior to obtaining lock
Currently, in_interrupt() is used to determine task context.
in_interrupt() would return 0 if the execution is in task context;
a spin lock is obtained with bh disabled. Since the bh's are disabled,
the preempt count/soft_irq disable count would increase.
When we attempt to release the lock, the same in_interrupt() API
would now return non-zero, failing to release the lock.
The change uses appropriate preempt API to determine execution context.

CRs-Fixed: 3509317
Change-Id: I43f981bf3a2d4c238cebc4b29fa8a9aa0a8e0df3
Signed-off-by: Soumen Ghosh <quic_soumeng@quicinc.com>
2023-06-28 14:36:12 -07:00
Soumen Ghosh
833000f416 msm: camera: cpas: correcting the enum value of LLCC staling mode
This change to add the camera internal LLCC staling mode enum,
rather than using direct kernel LLCC enum.

CRs-Fixed: 3523216
Change-Id: I81b5f0b84a2dd429061cc45bcaea198d909b2364
Signed-off-by: Soumen Ghosh <quic_soumeng@quicinc.com>
2023-06-26 14:04:29 -07:00
Karthik Anantha Ram
57f2caba95 msm: camera: isp: Unsubscribe for IRQ events only on CSID stop
All the IRQs are masked out at the start of the stop sequence.
When unsubscribing for respective IRQ controllers, only clean up
internal data structures without impacting the mask registers.

CRs-Fixed: 3535921
Change-Id: I7f05867f07fcfabe065269734c67c5e11e0a9fe2
Signed-off-by: Karthik Anantha Ram <quic_kartanan@quicinc.com>
2023-06-26 14:04:15 -07:00
Yash Upadhyay
c98bea4b04 msm: camera: tfe: Add support for TFE BW limiter
Add blob to allow userland to configure BW limter for TFE WMs.

CRs-Fixed: 3505174
Change-Id: I5c671cbcfa5557082c4ae5302471a2ece45294ab
Signed-off-by: Dharmender Sharma <quic_dharshar@quicinc.com>
Signed-off-by: Yash Upadhyay <quic_yupadhya@quicinc.com>
2023-06-26 14:04:03 -07:00
Wang Kan
033efcbed0 msm: camera: ois: Fix stop ois logic
When ois get stop op code and the state is not in start,
we need return directly and don't set state to config.
This change also adds ctrl mutex init when ois i2c
component bind.

CRs-Fixed: 3520698
Change-Id: I0041f9aa3af250d449f7b757791ef684fa1b385f
Signed-off-by: Wang Kan <quic_wkan@quicinc.com>
2023-06-26 14:03:56 -07:00
Wang Kan
512fb4a19b msm: camera: csiphy: Add support for long and short channel
Config different channel settings according to the flag
including short and standard channel.

CRs-Fixed: 3441333
Change-Id: I90ae6f941debcd63ecad1e24363997c19bad59ca
Signed-off-by: Wang Kan <quic_wkan@quicinc.com>
2023-06-26 14:03:49 -07:00
Depeng Shao
11874984b4 msm: camera: isp: Add notify frame skip for bubble applied substate
For sHDR usecase, we may enter bubble applied substate, then
isp trigger bubble recovery again, we need isp to apply default
setting in this case. This change adds notify frame skip interface
for bubble applied substate to apply the default settings.

CRs-Fixed: 3533564
Change-Id: Ie82aa73786902328b21909ba958d0a225ed49916
Signed-off-by: Depeng Shao <quic_depengs@quicinc.com>
2023-06-26 14:03:42 -07:00
Stark Lin
7ea1557b34 msm: camera: isp: Fix issues for handling hw err
This change fixes below issues:

1. When we handling hw err irq, hw info of vfe and sfe should be dumped
based on res_id. However, the res_id that passed to handle_hw_err
function was invalid, which results the dump operation fail to execute.

2. If the error that SFE RD encountering is not the type of violation,
it will return a NULL pointer of ctx and causing fail to notify hw mgr.

3. When facing multiple errors on different out ports, it's only able to
notify hw mgr to handle one of them and ignore the rest, which results
failing to respond to all the errors.

CRs-Fixed: 3446685
Change-Id: I6861a3e7565e4aff2ebd2e5fbf589f406e65f517
Signed-off-by: Stark Lin <quic_starlin@quicinc.com>
2023-06-26 14:03:27 -07:00
Karthik Dillibabu
f910aa0b4f msm: camera: common: Partial Camera Support
This change creates a sysfs entry(subparts_info) which
has info about number of IFEs, IFE-LITEs, SFEs & CUSTOM,
whose values are populated in their respective drivers.
Also, validates whether a particular IFE, SFE and CUSTOM
is supported or not. Based on this, probe of IFE, SFE and
CUSTOM drivers will happen accordingly.

CRs-Fixed: 3482745
Change-Id: Iff6e79a7793b14b1f368f215020617f10dbd4bb5
Signed-off-by: Karthik Dillibabu <quic_kard@quicinc.com>
2023-06-26 14:00:13 -07:00
Li Sha Lim
02b2cddbba msm: camera: smmu: Fix free sequence of buffer tracker
Add a goto label to fine-grain situations where
buffer tracker list is to be freed, and when it
doesn't, where the submitted packet request id
is less than or equal to request that was last
flushed, as this call will cause null pointer
access.

CRs-Fixed: 3507867
Change-Id: I1b909473baf7a227bbd649e4c883daa485602cd9
Signed-off-by: Li Sha Lim <quic_lishlim@quicinc.com>
2023-06-21 15:06:49 -07:00
illa lakshmi soujanya
1c59934ed7 msm: camera: sensor: Add changes to prevent unmap buffers
The function cam_mem_mgr_release can unmap buffers when in use.
This change with cam_mem_put_cpu_buf prevents unmaping the buffers in use.

CRs-Fixed: 3489559
Change-Id: I3a0d7ee0d3e86a2a315bc44e15ca298e71d62ffd
Signed-off-by: illa lakshmi soujanya <quic_illa@quicinc.com>
2023-06-21 15:06:41 -07:00
Atiya Kailany
de76f19956 msm: camera: utils: Add support for cesta hw client voting through mmrm
This change will allow clients voting through mmrm to use the new mmrm
api and vote according to their drv_type. This change affects
registering, unregistering and setting the clk rate to sw and
hw clients.

CRs-Fixed: 3385745
Change-Id: I11f76a0de3ba0d8d969093725d4c528afef51373
Signed-off-by: Atiya Kailany <quic_akailany@quicinc.com>
2023-06-21 15:06:34 -07:00
Shivakumar Malke
6d99262523 msm: camera: mem_mgr: Add refcount to track in use buffers
The function cam_mem_mgr_release can unmap the buffers when in use.

This change prevents unmapping the buffers when in use.

CRs-Fixed: 3489559
Change-Id: I2e72e795d39ac15abfa56c19043c419a03686966
Signed-off-by: Shivakumar Malke <quic_smalke@quicinc.com>
2023-06-21 15:06:26 -07:00
Stark Lin
87913e552d msm: camera: isp: Fix unimplemented axi vote reduction issue
If no valid axi BW request is found in 6 continuous requests, the axi
bw vote will remain unchanged, causing BW reduction fail to execute,
and error axi vote log will be printed per request. We need to vote
current request even it's zero to do reduction in this case.

CRs-Fixed: 3507989
Change-Id: Ibf81bc7098ae2599c0fc3d31537c58e18e781704
Signed-off-by: Stark Lin <quic_starlin@quicinc.com>
2023-06-21 15:06:18 -07:00
Stark Lin
d7e26e68c3 msm: camera: isp: Fix unmatched size issue for bitwise operation
This change fixes a known issue:
Operands in a bitwise operation have different size.

CRs-Fixed: 3523401
Change-Id: Ic7ef67a5bc5413c137fee7693efb2d7ad53ceb50
Signed-off-by: Stark Lin <quic_starlin@quicinc.com>
2023-06-21 15:06:11 -07:00
mingpan
9d1dd49705 msm: camera: isp: Remove isp state monitor from struct cam_isp_context
Now isp state monitor is moved into dbg_monitors, but some function
is still using isp state monitor in struct cam_isp_context. we should
use isp state monitor in dbg_monitors and need to remove isp state
monitor from struct cam_isp_context.

CRs-Fixed: 3514701
Change-Id: Ib993f25234654ad5be74617d6ddb82355ece33bc
Signed-off-by: mingpan <quic_mingpan@quicinc.com>
2023-06-20 18:06:10 -07:00
Suraj Dongre
f3a5736b6f msm: camera: isp: Add support for composite config in csid v980
On v980, context-based IPPs are introduced, per TFE hw. This
change programs the IPP_IRQ_COMP_CFG0 register, which has
information on how the IPP ctxt paths from CSID (post CAMIF)
are mapped to the ctxt paths in TFE.

Since this information can change dynamically, per frame basis,
this is programmed by UMD through command buffer. This change
provides the support for it.

CRs-Fixed: 3321317
Change-Id: I845bba4b7fd09eeb42821b5b7f1cbc6022abe631
Signed-off-by: Li Sha Lim <quic_lishlim@quicinc.com>
Signed-off-by: Gaurav Jindal <quic_gjindal@quicinc.com>
Signed-off-by: Mukund Madhusudan Atre <quic_matre@quicinc.com>
Signed-off-by: Suraj Dongre <quic_sdongre@quicinc.com>
2023-06-16 13:28:00 -07:00
Chandan Kumar Jha
3d86333d56 msm: camera: cpas: handle return value in cpas start sequence
RC value is getting modified during CPAS start in error
scenario. Handle return value which helps to retain
the original rc value.

CRs-Fixed: 3477436
Change-Id: I7006c60c1c5903c85f18f6eb385859b43b0cedc9
Signed-off-by: Chandan Kumar Jha <quic_cjha@quicinc.com>
2023-06-16 13:28:00 -07:00
Mukund Madhusudan Atre
8631f02f6d Revert "msm: camera: isp: Add support to stream on csid for v980 hw"
This reverts commit 9f35ceecf8b578e6c1ee674783102ffa17639691.

Change-Id: I166f855ccf4321138c4022075afa1306deadf72f
Signed-off-by: Mukund Madhusudan Atre <quic_matre@quicinc.com>
2023-06-16 13:28:00 -07:00
Mukund Madhusudan Atre
b6d9b8278c msm: camera: isp: Add support to stream on csid for v980 hw
Add support to allocate IPP1/2 resources and handle corresponding
configuration. Add support to skip camif and cfg1 register
programming so that the cmd buffer settings could take effect.

CRs-Fixed: 3321317
Change-Id: I959666aa14618741148320a50e53f252882b6874
Signed-off-by: Mukund Madhusudan Atre <quic_matre@quicinc.com>
2023-06-12 18:56:55 -07:00
wasikhan
63cbaf576b msm: camera: csiphy: Fix compile time error
Address the inconsistency in a function prototype
across multiple kernel versions.

Change-Id: Ib5d3c3df74a89a019b0f1f858746888ce0101512
CRs-Fixed: 3509086
Signed-off-by: Vijay Kumar Tumati <quic_vtumati@quicinc.com>
Signed-off-by: wasikhan <quic_wasikhan@quicinc.com>
2023-06-09 14:34:08 -07:00
mingpan
400dfd20c5 msm: camera: cpas: Dump cpas vote info when CRM dump request
Dump cpas vote info when CRM dump request, just like
cam_req_mgr_dump_state_monitor_info.

CRs-Fixed: 3441303
Change-Id: Ic5c2e671a27593ef1c25fa650c2148dd88c9968f
Signed-off-by: mingpan <quic_mingpan@quicinc.com>
2023-06-01 16:42:10 -07:00
Wang Kan
0f4492b985 msm: camera: reqmgr: Add protection for link reset
When crm close, call free link which free in_q.
The in_q ptr is null. It will result in null
in_q ptr deref when call notify trigger. So need
add spin lock to protect req data.

CRs-Fixed: 3488142
Change-Id: I25101f00e07bd56f1449085f2c6ce3ce3141adc3
Signed-off-by: Wang Kan <quic_wkan@quicinc.com>
2023-05-31 17:06:37 -07:00
Vijay Kumar Tumati
16be1306ef msm: camera: csiphy: Handle process shutdown during secure camera
Use SCM 7 call during the process shutdown. This is to
workaround a race condition between the close of camera FD
and the invoke driver FD that leads to a device crash.
Additionally, keep the Domain ID clocks on only during
protect or unprotect operations.

CRs-Fixed: 3509086
Change-Id: Ic091aa737df10bb2b41190c2f850c31fd17af9b2
Signed-off-by: Vijay Kumar Tumati <quic_vtumati@quicinc.com>
2023-05-31 17:06:31 -07:00
Mukund Madhusudan Atre
ebaa2a7356 msm: camera: isp: Add support to acquire hw for spectra v980
Add support to pre-process acquire information for csid ipp
paths, and make sure correct resource is acquired. Add support
to have destination mask consolidated for camif resource in vfe.
Add hw context id info for vfe output resource acquire. Add
support for exceptions in context config for certain bus ports.

CRs-Fixed: 3321317
Change-Id: I5a812c29c1aaa72d186d0398a024c0da76ec862b
Signed-off-by: Mukund Madhusudan Atre <quic_matre@quicinc.com>
Signed-off-by: Suraj Dongre <quic_sdongre@quicinc.com>
2023-05-31 17:06:24 -07:00
Pranav Sanwal
284a8e39b2 msm: camera: ife: prevent scm calls for SAFE signalling
problem:
scm calls to enable/disable SAFE signal introduced due to HW limitation
in some targets from ife causing overall system delay whenever
camera starts and other HW components also making scm calls.

solution:
prevent redundant SCM calls for SAFE signal.

CRs-Fixed: 3511194
Change-Id: Ib6692d599e9ec9e9182a9e6eb0aef52322cbfdef
Signed-off-by: Pranav Sanwal <quic_psanwal@quicinc.com>
2023-05-31 17:06:18 -07:00
Wang Kan
bb8ce626cd msm: camera: isp: IFE cpas state monitor enhancement
IFE cpas state monitor enhancement by printing ctx id,
hw index, frame id, event id and request id.

CRs-Fixed: 3368290
Change-Id: I41a01382ec2bc6f0c7b9f89c8bb20da42774a65c
Signed-off-by: Wang Kan <quic_wkan@quicinc.com>
2023-05-31 17:06:10 -07:00
Gaurav Jindal
95d205bee9 msm: camera: isp: Add Multi Context IRQ support in CSID Driver
Adds support in Multi Context IRQs in CSID Driver.

CRs-Fixed: 3321317
Change-Id: I49e1645b1f655b02e8097158798e23259598b8ee
Signed-off-by: Gaurav Jindal <quic_gjindal@quicinc.com>
2023-05-26 18:36:33 -07:00
Gaurav Jindal
5b90165446 msm: camera: isp: Add support for Multi Context IO Buffer Config
In case of multi context supported targets for MC ports,
before configuring the bus related registers, correct context
needs to be configured to update the correct registers in the
respective context domain.
This commit adds support for context selection register
and update the io buffers for each context sequentially.

CRs-Fixed: 3321317
Change-Id: Icd660c2dfa56fad0d349679701a638943a0e833c
Signed-off-by: Gaurav Jindal <quic_gjindal@quicinc.com>
2023-05-26 18:36:28 -07:00
Wang Kan
56e0bcc8ee msm: camera: common: Fix isp log errs and format errs
Fix isp log errs and format errs.

CRs-Fixed: 3499636
Change-Id: Ieb5b81b95dea440b1da17cb5bc9be86f75b7c4f6
Signed-off-by: Wang Kan <quic_wkan@quicinc.com>
2023-05-26 18:36:22 -07:00
Depeng Shao
16652c1360 msm: camera: sensor: Add process evt interface for i2c sensor
This change adds process_evt interface for i2c sensor driver.

CRs-Fixed: 3482079
Change-Id: Id3007497dd48f44f38b25f2b287afc1c685d01e7
Signed-off-by: Depeng Shao <quic_depengs@quicinc.com>
2023-05-26 18:36:17 -07:00
Wang Kan
1b68e6ed94 msm: camera: isp: Transfer rightly hw err info from ife to isp ctx
When check CSID frame size err, is not bus overflow, result in
the err event data don't get error type info and can't transfer
hw err info rightly from ife hw to isp ctx. So first let err 
event data get err type info.

CRs-Fixed: 3500372
Change-Id: Ia90a8c28028ae63174d30d2513e6d1f042810d43
Signed-off-by: Wang Kan <quic_wkan@quicinc.com>
2023-05-26 18:36:09 -07:00
Karthik Dillibabu
f1adead069 msm: camera: core: validation of session/device/link handle
This change is to validate session, device and link handle.
Also, checks whether the device handle belongs to
correct session handle or not.

CRs-Fixed: 3496553
Change-Id: I6b86bf7d0908a280e90e085a3b3e1727facdf8c6
Signed-off-by: Karthik Dillibabu <quic_kard@quicinc.com>
2023-05-25 22:06:10 -07:00
Chandan Kumar Jha
75a996d9a5 msm: camera: isp: Avoid race condition to prevent list corruption
in case of back-to-back bubble requests, We do internal recovery.
We don't have locks for list protection in the internal recovery flow.
From the core dump, we had seen that we were handling bubble in one core
but we had done list modification on another core during internal
recovery without list protection, which results in list corruption.
We are accessing the request queue during internal recovery without
any locks which are resulting in list corruption.
We need to use locks to prevent list corruption in the internal
recovery flow.

CRs-Fixed: 3444802
Change-Id: Id72077647795e51e112b030d4fb75d80299c1bed
Signed-off-by: Chandan Kumar Jha <quic_cjha@quicinc.com>
2023-05-22 17:06:16 -07:00
Depeng Shao
a219b9f118 msm: camera: sensor: Check the result of i2c transfer
The i2c transfer interface returns the num of message is
processed if there is no issue, this change checks if the
result of i2c transfer is same with the num of message,
the return value is assigned as 0 if they are same.

CRs-Fixed: 3495774
Change-Id: I408038120ac2371f1ed031daa364c2e2563e3606
Signed-off-by: Depeng Shao <quic_depengs@quicinc.com>
2023-05-22 17:06:08 -07:00
mingpan
33060dc422 msm: camera: isp: Correct the logic of illegal programming check
It is wrong to use crop_v_en_shift_val and early_eof_en_shift_val
to do AND operation with cfg1, instead, we should use
BIT(crop_v_en_shift_val) and BIT(early_eof_en_shift_val). Besides,
register rup_aup_cmd_addr is not a readable register, so we can't
read it's value from it.

CRs-Fixed: 3500551
Change-Id: Ied566a968b0403498ce859544659f9dbe40ce770
Signed-off-by: mingpan <quic_mingpan@quicinc.com>
2023-05-20 10:06:38 -07:00
zhuo
a6ef23e7e5 msm: camera: utils: Add support bypass clock/regulator/icc wrapper
Sometimes need to avoid access clock/regulator/icc api, this change
add support bypass clock/regulator/icc wrapper through enable
some debugfs parameters and devicetree.

CRs-Fixed: 3445248
Change-Id: I0546975bf063625b39b771c776813e7dbff84e06
Signed-off-by: zhuo <quic_zhuo@quicinc.com>
2023-05-20 10:06:32 -07:00
Mukund Madhusudan Atre
27216cc09b msm: camera: isp: Enhance frame timing IRQ debugging
In VFE top, currently it is assumed that frame timing
IRQs will be part of status 1 register. Remove that
assumption to support v980 hw as well. Also, when
frame irq debug is enabled in ife hw manager, don't
trigger callback, as we just want to see if frame
reached IFE/TFE or not.

CRs-Fixed: 3321317
Change-Id: I544727d4bec628b9041531015f24bf73e8ae2be1
Signed-off-by: Mukund Madhusudan Atre <quic_matre@quicinc.com>
2023-05-20 10:06:27 -07:00
Li Sha Lim
b3f493269c msm: camera: smmu: Early PF detection
This change adds support to detect early
unmapping of buffers from UMD, and signal
when the error occurs by sending an error
code to UMD.

At present, buffers are allocated and/or mapped
by UMD, and the following sequence occurs.

KMD prepares packets sent during a config ioctl,
and these packets reside in the mapped buffers;
HW blocks then access these buffers, and may
write output to other mapped buffers(io buffers);
Once HW is done(upon a buf done), KMD signals
this event to UMD;
UMD may free/unmap these relevant buffers.

This change adds support to detect cases where a
free/unmap happens before/while HW is accessing
these buffers.

This feature is enabled by default, but a debugfs
variable disable_buf_tracking is added under smmu
which will enable the user to disable the feature.
Camera server needs to be restarted whenever this
variable is set/unset for changes to take place.

CRs-Fixed: 3382609
Change-Id: I39c3f0c373743c10bc2e6304ffbdc820e3c95970
Signed-off-by: Li Sha Lim <quic_lishlim@quicinc.com>
2023-05-20 10:06:15 -07:00
Stark Lin
c23a3f448c msm: camera: isp: Add support for HWPD debugging
HWPD is associated with several modules, but only image size violation
displayed in the kernel when an error occur. Now we will pass the error
code of HWPD violation to UMD to help UMD to take necessary action and
dump relevant info.

CRs-Fixed: 3440015
Change-Id: I6483b228a8eeaac3bf54f5f83f8f8deab3da6250
Signed-off-by: Stark Lin <quic_starlin@quicinc.com>
2023-05-20 10:06:07 -07:00
Karthik Anantha Ram
6d25986b9f msm: camera: icp: Optimize FW uncached region for ICP
Allocate memory based on what is configured to FW. Avoid
hardcoded allocations, thereby reducing the memory
footprint. The change also updates size check for a SMMU
mapping, if the size of the buffer is beyond the assigned
va range fail the mapping.

CRs-Fixed: 3477543
Change-Id: I3c2e262f57cdfdbd51255679b2405d855d7d5353
Signed-off-by: Karthik Anantha Ram <quic_kartanan@quicinc.com>
2023-05-18 23:36:31 -07:00