Commit Graph

2770 Commits

Author SHA1 Message Date
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
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