Commit Graph

59 Commits

Author SHA1 Message Date
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
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
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
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
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
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
Sokchetra Eung
740de40e65 msm: camera: utils: Add support for multiple IRQ lines per device
Update SOC util to be able to parse multiple irq names from DT and,
request, enable, disable multiple irq lines per soc.

All IRQ lines per SOC will have the same handler but different data,
so ISR will have their own private data to differentiate source of irq
in the same handling function.

CRs-Fixed: 3395596
Change-Id: Id9ca1cd3ef105d732a82decd7c8078bd29668326
Signed-off-by: Sokchetra Eung <quic_eung@quicinc.com>
2023-03-17 21:36:05 -07:00
Atiya Kailany
51c72321ae msm: camera: custom: Removing dead code
This change removes some variables that are
never used after assignment.

CRs-Fixed: 3394193
Change-Id: I47458d5408b14580a309749823e29b3d61f85681
Signed-off-by: Atiya Kailany <quic_akailany@quicinc.com>
2023-03-07 18:06:17 -08:00
Atiya Kailany
cfa0b3800b msm: camera: custom: Removing dead code
Some variables are never used after assignment,
so they are removed.

CRs-Fixed: 3394193
Change-Id: I3e475f96e6ff419aaa67ef0910c886dc707fc93b
Signed-off-by: Atiya Kailany <quic_akailany@quicinc.com>
2023-02-22 16:06:15 -08:00
Petar Ivanov
d82dbbff8a msm: camera: common: Add hw mgr intf query cap v2
Add switch case to handle query cap v2 ioctl, and add query cap
v2 hw mgr intf function pointer to handle query cap v2.

CRs-Fixed: 3364267
Change-Id: I1f992982f8d06755c977839ee61ee450306d65a5
Signed-off-by: Petar Ivanov <quic_pivanov@quicinc.com>
Signed-off-by: Sokchetra Eung <quic_eung@quicinc.com>
2023-01-20 15:06:11 -08:00
Mukund Madhusudan Atre
b2def29ddc msm: camera: common: Add support for cesta based clk scaling
On chipsets having cesta hw block support, for cesta supported clks
clk frequency can be changed during veritcal blanking based on
CSID DRV events. For this to happen, camera clients need to setup
high and low clock votes through hw clients. Use corresponding clk,
crm APIs to setup high, low clk frquencies and do channel switch
to apply newly set rates. Clients can also set clk frequency through
sw client which will set the floor. This feature helps in saving
power for usecases where vertical blanking is high such as
Fast Shutter usecase.

CRs-Fixed: 3294948
Change-Id: I1bcf650b439991a23b2a0f0f9a5162bdcd60dc64
Signed-off-by: Mukund Madhusudan Atre <quic_matre@quicinc.com>
Signed-off-by: Pavan Kumar Chilamkurthi <quic_pchilamk@quicinc.com>
2022-12-14 11:06:09 -08:00
Joshua Florez
337721da5f msm: camera: common: Remove logically dead code
Removes logically dead code from various locations.

CRs-Fixed: 3325322
Change-Id: I2bfebbeb50cb6179bea8f02292027dab1d7f6e9b
Signed-off-by: Joshua Florez <quic_jflorez@quicinc.com>
2022-11-29 17:36:09 -08:00
Karthik Jayakumar
1425e0a45e msm: camera: custom: Move include to cam_compat
Moves ion include to cam_compat since there is difference in location
between 5.10 and 5.15 kernels.

CRs-Fixed: 3048249
Change-Id: Ieb2ea976c149475ef6618fae53813c7a49b90ae0
Signed-off-by: Karthik Jayakumar <kjayakum@codeaurora.org>
2021-11-01 13:15:33 -07:00
Anand Ravi
0417e88967 msm: camera: req_mgr: Allow request cancellation if not applied to IFE
Since we don't wait for requests to be ready on lower pd devices before
applying request on higher pd devices, add provision to cancel request
if it has not been applied on IFE.

CRs-Fixed: 3014942
Change-Id: I8850b0dfe3f88e04b86f7bb6b597657ad7e0a4f9
Signed-off-by: Anand Ravi <ananravi@codeaurora.org>
2021-09-27 14:41:03 -07:00
Depeng Shao
c8ac17dee6 msm: camera: reqmgr: Fix request sync issues
Fix several request sync issues.

CRs-Fixed: 3029196
Change-Id: I92b4048b392fa19e2c9748a5ee0efd9ef0b4e680
Signed-off-by: Depeng Shao <depengs@codeaurora.org>
2021-09-20 13:04:31 +08:00
Mukund Madhusudan Atre
5dba22d1fc msm: camera: common: Add buffer send and receive mechanism
Add packet based buffer send and retrieve mechanism for
presil testing.

CRs-Fixed: 2932495
Change-Id: Ifd1e0fdb8b12feabb884e02a07a3813db01a3899
Signed-off-by: Mukund Madhusudan Atre <matre@codeaurora.org>
2021-09-09 12:41:00 -07:00
Chandan Kumar Jha
cf99d6942b msm: camera: isp: Add decode format1 support for v780
Decode format1 is required for payload decoding in
multi VCDT usecase.Format type is packed in 8 bits.

We will get 8 bits value as format type from UMD to
get decode format1.

CRs-Fixed: 2948116
Change-Id: I81bc816c1fc53ff8949d8920d076461ff1895e45
Signed-off-by: Chandan Kumar Jha <cjha@codeaurora.org>
2021-08-09 12:48:16 +05:30
Anand Ravi
ff11552d04 msm: camera: isp: Logging improvements to ISP context
Reduce number of logs printed by ISP and custom contexts for each
packet. Also move sync related error logs to debug logs.

CRs-Fixed: 2977145
Change-Id: Icf22eefdf0ae1d6ef006272f95352ae65cbf3b34
Signed-off-by: Anand Ravi <ananravi@codeaurora.org>
2021-07-19 11:38:22 -07:00
Savita Patted
a1e328751b Merge "msm: camera: core: v780 enhanced memory addresses" into camera-kernel.lnx.5.0 2021-07-08 13:23:13 -07:00
Karthik Anantha Ram
d785949196 msm: camera: common: Change shutdown sequence for subdevices
In subdev close call if CRM is still active wait for shutdown
from CRM [media device]. Remove subdevice check for active
handles, shutdown to happen irrespective of any active context.

If CRM is not active, subdevice shutdown should ensure there is
no access to kernel allocated buffers since at this point
memmgr is de-initialized.

As part of ICP close, remove usage of HFI queues, trigger PIL
to transfer FW memory ownership back to HLOS and power off ICP.

CRs-Fixed: 2976107
Change-Id: Ib05b3fbdcc33f4072da7ef77cf0118a807860e8c
Signed-off-by: Karthik Anantha Ram <kartanan@codeaurora.org>
2021-06-30 17:04:11 -07:00
Karthik Jayakumar
0d00f4feee msm: camera: core: v780 enhanced memory addresses
Added support for v780 enhanced memory address handling

CRs-Fixed: 2948659
Change-Id: I46ed16ad70103553a18cc69d762c6d93fc9fd8d9
Signed-off-by: Karthik Jayakumar <kjayakum@codeaurora.org>
2021-06-29 11:08:03 -07:00
Savita Patted
68de607556 Merge "msm: camera: req_mgr: Enhance camera v4l2 subdev shutdown sequence" into camera-kernel.lnx.5.0 2021-06-21 18:38:47 -07:00
Ayush Kumar
0259331da4 msm: camera: req_mgr: Re-design CRM to support multi links in sync mode
This change is to support multi links in sync mode. Supports dynmanic
switching to select master link in rtb and sat use case in sync mode.
Supports sync logic for rtb and sat use case in sync mode. Apply
requests for all links is triggered only on master epoch. Supports
bubble recovery and sync logic for different pd links in sync mode.

CRs-Fixed: 2783209
Change-Id: I81d1d0d37aa0d6e18c19ca87eac51ef3f160abfb
Signed-off-by: Ayush Kumar <ayushkr@codeaurora.org>
2021-06-04 20:23:00 +05:30
Pavan Kumar Chilamkurthi
028d6ec734 msm: camera: utils: Add using mmrm in camera
Use mmrm interface to set clock rate on all
camera clks.

CRs-Fixed: 2901925
Change-Id: I2e4c31a11e0e068693ac15356e3b3dafcfa0b078
Signed-off-by: Pavan Kumar Chilamkurthi <pchilamk@codeaurora.org>
2021-05-01 23:59:09 -07:00
Alok Chauhan
2ebae4fabe msm: camera: req_mgr: Enhance camera v4l2 subdev shutdown sequence
when provider crash occurred, there was a CSID lane overflow
observed due to shutdown sequence from CRM(sensor, csid, csiphy).
To fix the issue need to change the shutdown sequence
(csid, sensor, csiphy).

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

CRs-Fixed: 2852076
Change-Id: Ia6d8022e995823bf031400c33528eb8544dc2e29
Signed-off-by: Alok Chauhan <alokc@codeaurora.org>
2021-04-14 05:20:37 -07:00
Karthik Anantha Ram
9f4f8e114c msm: camera: common: Use the appropriate header for spinlock
With the allow list tightened, use the right header for spinlock
usage. Change replaces usage of linux/spinlock.h to
linux/spinlock_types.h.

CRs-Fixed: 2841729
Change-Id: I0247501b765436099f75c9725e9f614f0873c888
Signed-off-by: Karthik Anantha Ram <kartanan@codeaurora.org>
2021-04-12 14:42:58 -07:00
Pavan Kumar Chilamkurthi
7f750a59f0 msm: camera: common: Use pdev name for soc dev name
Having a global variable and using the same for all devices
will overwrite the name of previous device. Use pdev name
to be consistent and helps in debugging logs.

CRs-Fixed: 2901925
Change-Id: I086f3dbd12e720c5e6497355eae40ca242d3d408
Signed-off-by: Pavan Kumar Chilamkurthi <pchilamk@codeaurora.org>
2021-03-20 19:48:08 -07:00
Depeng Shao
a8fce31f3f msm: camera: reqmgr: Handle flash properly
Apply the flash at EOF and apply the other devices
at the EPOCH of next frame, then the flash can
cover all the exposure zone of current request.
Add the inject delay for SOF and EOF separate,
then we can use inject delay for more flexible
frame skip control.

CRs-Fixed: 2820683
Change-Id: Ic6a58327a0ae44c54190884ba42ea7926ec7c90e
Signed-off-by: Depeng Shao <depengs@codeaurora.org>
2021-03-18 15:30:48 +08:00
Chandan Kumar Jha
a12577028b msm: camera: isp: Fixing KW errors
Fixes KW errors for ISP.

CRs-Fixed: 2880899
Change-Id: I6926b61732991b51edd7e173bb05d2a7da96405f
Signed-off-by: Chandan Kumar Jha <cjha@codeaurora.org>
2021-02-24 19:16:16 +05:30
Chandan Kumar Jha
1576679508 msm: camera: isp: Enable PIX & LINE count irqs by default
Enable these format measure error IRQs by default in CSID.

CRs-Fixed: 2830502
Change-Id: Ic9703be3fb2672487ee6f135a41ee6454a393203
Signed-off-by: Chandan Kumar Jha <cjha@codeaurora.org>
2021-01-13 21:42:54 +05:30
Gaurav Jindal
1a5797c6a8 msm: camera: common: Optimize cam context memory
In current implementation, cam_ctx_req has a array of
hw_update_entries, in_map_entries and out_map_entries. Each
context has array of N requests. Memory for all contexts is
allocated during probe. This causes a huge memory remaining
unutilized.
This commit moves the memory allocation to context acquire time
and freeing this memory during context release. In place
of using array, now dynamic allocation is used.
A top level calculation shows a memory reduction of around 2M-
2.5M with this change including all the camera drivers.

CRs-Fixed: 2830502
Change-Id: Id63cf2a52272e2a419704dc95100694e384330c3
Signed-off-by: Gaurav Jindal <gjindal@codeaurora.org>
2021-01-06 06:53:08 -08:00
Gaurav Jindal
4b58880f6f msm: camera: isp: CSID Driver Refactoring
Due to major hw changes in latest CSID680 IP block, refactoring of
CSID kernel driver is required.
To support the hw speciific driver, version based files
are added. One common file to support the common functionality
and common utilities has also been added.

CRs-Fixed: 2830502
Change-Id: If1e2a0835ce285f968f154d2da5595e882ae6ccd
Signed-off-by: Gaurav Jindal <gjindal@codeaurora.org>
2020-12-11 22:12:44 +05:30
Karthik Anantha Ram
9ada4e4a26 msm: camera: custom: Add support for bubble handling
Add support for bubble handling in custom driver allowing
the custom block to re-apply bubbled request in sync with IFE.

CRs-Fixed: 2805278
Change-Id: I411d033f2470de3fab7587c7c019a933bda28020
Signed-off-by: Karthik Anantha Ram <kartanan@codeaurora.org>
2020-11-05 09:53:54 -08:00
Alok Chauhan
baf2d520ed msm: camera: sync: Rearrange sync reason events
Rearrange sync error reason code for better code
readability.

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

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

CRs-Fixed: 2750553
Change-Id: I206d0d51c38cfe4214814b89d241f51c1f50605b
Signed-off-by: Alok Chauhan <alokc@codeaurora.org>
2020-08-16 11:14:20 +05:30
Fernando Pacheco
0d784286a9 msm: camera: common: Avoid uninitialized accesses
Improve the error-handling code paths to prevent accesses to
uninitialized variables. This is done by either picking a sane
default for the variable or skipping accesses altogether after
an unsuccessful attempt to initialize.

CRs-Fixed: 2748220
Change-Id: Ibe383e56ec4e3f45f76f619c7d6b62c3d7dfcadb
Signed-off-by: Fernando Pacheco <fpacheco@codeaurora.org>
2020-08-06 13:41:05 -07:00
Depeng Shao
c782e8c3ab msm: camera: reqmgr: Add notify frame skip interface
This change adds support to notify frame skip when CRM
not ready to apply a normal setting. Sensor and custom
device also want to update the HW settings in some
conditions even if a frame is skipped.

CRs-Fixed: 2691642
Change-Id: Ibd2b22655d0f6b6c90663df75a0f5fad8565e918
Signed-off-by: Depeng Shao <depengs@codeaurora.org>
2020-07-14 18:45:30 +08:00
Karthik Anantha Ram
139ced0c94 msm: camera: custom: Enable driver compilation & minor fixes
Enable custom driver compilation on lahaina and few minor fixes
in custom HW driver.

CRs-Fixed: 2716300
Change-Id: I6f9ead5d2d67d91c14daf200ba12e95a1afec61d
Signed-off-by: Karthik Anantha Ram <kartanan@codeaurora.org>
2020-06-22 16:17:12 -07:00
Camera Software Integration
1b7fd53958 Merge "msm: camera: custom: Add support for SW sync & snapshot" into camera-kernel.lnx.4.0 2020-06-10 12:24:54 -07:00
Camera Software Integration
eb02dbe318 Merge "msm: camera: custom: Add dt matching string for spectra580 csid" into camera-kernel.lnx.4.0 2020-06-10 12:24:21 -07:00
Pavan Kumar Chilamkurthi
54f5035aa7 msm: camera: custom: Add dt matching string for spectra580 csid
Add dt matching string to probe spectra580 custom csid device.

CRs-Fixed: 2687917
Change-Id: Ibf220dd88dfad76742b71e7550f6b50ff6b2f57e
Signed-off-by: Pavan Kumar Chilamkurthi <pchilamk@codeaurora.org>
2020-06-09 14:16:01 -07:00
Pavan Kumar Chilamkurthi
5cb16c01ed msm: camera: cpas: Add support for custom QoS selection
Add cpas interface to allow clients or usecase to select
different QoS settings based on requirement. Selection
API must be called before camera hw powers up.

CRs-Fixed: 2687917
Change-Id: Ie524fcd6131d7c42288d0d734a7cdf6b9fcb92b7
Signed-off-by: Pavan Kumar Chilamkurthi <pchilamk@codeaurora.org>
2020-06-09 14:13:57 -07:00
Karthik Anantha Ram
02af3487fa msm: camera: custom: Add support for SW sync & snapshot
Add support to handle SW sync & ZSLSnapshot. Add substate machine
and mechanism to handle the lifecycle of requests based on irqs
accordingly.

CRs-Fixed: 2524308
Change-Id: Ie5ba97d4ae1b38f4b44c2d3935d2882df59fcac6
Signed-off-by: Karthik Anantha Ram <kartanan@codeaurora.org>
2020-06-04 10:17:55 -07:00
Karthik Anantha Ram
f81a46003b msm: camera: reqmgr: Invoke custom device at every frame
If there is a valid request CRM will apply that request to the
custom device, in scenerios during which there is no setting to
be applied to a custom device at a given epoch CRM needs to invoke
the custom device to program default settings for the next frame.

CRs-Fixed: 2524308
Change-Id: I4701c602ab68b9f64266f03a9b200d15a808165e
Signed-off-by: Karthik Anantha Ram <kartanan@codeaurora.org>
2020-06-03 16:44:50 -07:00
Pavan Kumar Chilamkurthi
74410fea6b msm: camera: sync: Add SYNC_CANCEL support in sync driver
Add SYNC_CANCEL definition and signal CANCEL instead of
ERROR in flush cases.

CRs-Fixed: 2673810
Change-Id: I1bd83e382f9b38f5f020a5af3b883083e211e3d2
Signed-off-by: Pavan Kumar Chilamkurthi <pchilamk@codeaurora.org>
2020-05-20 12:48:36 -07:00
Mukund Madhusudan Atre
5cb000ee7f msm: camera: common: Add component helper support in camera
Due to the asynchronous nature of platform probes, inter
dependency between drivers needs to be taken care during
kernel boot up. Component helper provides the facility of
adding matching drivers in a list ordered in the way we want
to bind those drivers. The CRM driver acts as component master
to make sure all slave drivers are bound before it returns
from its own bind call. Add support for serializing platform
probes through component framework.

CRs-Fixed: 2584631
Change-Id: I345da1d2b9cccf6021ac6fc899143013b7714ec4
Signed-off-by: Mukund Madhusudan Atre <matre@codeaurora.org>
2020-02-05 22:58:13 -08:00
Camera Software Integration
7212c1deb0 Merge "msm: camera: custom: Disable overflow recovery" into camera-kernel.lnx.4.0 2020-02-04 15:09:43 -08:00
Karthik Anantha Ram
118b93f5dd msm: camera: custom: Add support for immediate stop
Add support for immediate stop and reset during flush
for custom HW.

CRs-Fixed: 2585745
Change-Id: I542ac02f8d99c194efa498bc07dffae7879a6c8a
Signed-off-by: Karthik Anantha Ram <kartanan@codeaurora.org>
2020-01-30 10:53:31 -08:00