Commit Graph

92 Commits

Author SHA1 Message Date
Savita Patted
23f6977ce5 Merge "msm: camera: util: Fix printing of tag in trace logs" into camera-kernel.lnx.5.0 2021-06-07 18:50:34 -07:00
Anand Ravi
db09e75c0e msm: camera: util: Fix printing of tag in trace logs
This commit fixes regression in printing trace logs caused by
'commit 27ad84d827 ("msm: camera: utils: Add support for multiline
printing to log buffers")'.

CRs-Fixed: 2960607
Change-Id: If136339286647ce21adbcb1425c905b045dac7ef
Signed-off-by: Anand Ravi <ananravi@codeaurora.org>
2021-06-02 16:17:03 -07:00
Mukund Madhusudan Atre
c31cb00512 msm: camera: common: Add common function to modify timer
Add common function to modify system timer, with timeout
multiplier as a debug capability.

CRs-Fixed: 2932495
Change-Id: I73282aa30b938b7efce97a2e8fd757b04096ccad
Signed-off-by: Mukund Madhusudan Atre <matre@codeaurora.org>
2021-06-02 11:10:53 -07:00
Suraj Dongre
3266ccca59 msm: camera: utils: debug mask for presil framework
Add a new debug mask for presil framework core logic.
Update debug module to support more than 32 bit values.

CRs-Fixed: 2932495
Change-Id: Ia13a606c339d487fee7669ddccb9511c0c0567ca
Signed-off-by: Suraj Dongre <sdongre@codeaurora.org>
Signed-off-by: Mukund Madhusudan Atre <matre@codeaurora.org>
2021-05-28 19:05:03 -07:00
Vikram Sharma
5ca9544430 msm: camera: cre: update image address correctly for 36bit iova
This change upadates the image address programming for 36bit
iova, both on read and write engine.

CRs-Fixed: 2893978
Change-Id: I37f556191b840ba794e7373d9aea5831dc90ab1b
Signed-off-by: Vikram Sharma <vikramsa@codeaurora.org>
2021-05-25 21:50:21 -07:00
Vikram Sharma
455abec717 msm: camera: cre: unit test fixes
Fixes for the issues found in Unit testing of CRE.

CRs-Fixed: 2893978
Change-Id: I7b8061cf2fd4693bde084a003bc101be1cbde1d1
Signed-off-by: Vikram Sharma <vikramsa@codeaurora.org>
2021-05-17 01:13:41 -07:00
Haritha Chintalapati
0542af5b27 Merge "msm: camera: utils: Enable using mmrm API in camera" into camera-kernel.lnx.5.0 2021-05-13 12:04:28 -07:00
Haritha Chintalapati
2e994b2c81 Merge "msm: camera: utils: Add using mmrm in camera" into camera-kernel.lnx.5.0 2021-05-13 12:03:54 -07:00
Haritha Chintalapati
f144ee8473 Merge "msm: camera: utils: Add camera clk wrapper infrastructure" into camera-kernel.lnx.5.0 2021-05-05 22:06:15 -07:00
Pavan Kumar Chilamkurthi
ba7a561d66 msm: camera: utils: Enable using mmrm API in camera
Enable using mmrm APIs for camera clk set rates.

CRs-Fixed: 2901925
Change-Id: Id80f2d46b62aef9ebcbb238a342925c74aac053a
Signed-off-by: Pavan Kumar Chilamkurthi <pchilamk@codeaurora.org>
2021-05-02 00:00:03 -07:00
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
Haritha Chintalapati
020e9a7d77 Merge "msm: camera: utils: Add support for multiline printing to log buffers" into camera-kernel.lnx.5.0 2021-04-30 19:17:36 -07:00
Camera Software Integration
5341e5810f Merge "msm: camera: utils: Modify pointer check for clk debugfs" into camera-kernel.lnx.5.0 2021-04-28 21:22:55 -07:00
Pavan Kumar Chilamkurthi
cd745eb39a msm: camera: utils: Add camera clk wrapper infrastructure
Source clocks that are shared with multiple devices need
to be consolidated before setting clock rate on them.
If not, a set call with lower freq from one device
overwrites the frequency that previously set by another
device, causing issues. Clk wrapper helps to consolidate
the frequency among multiple devices and set the max
frequency required by all of them. A shared clock notation
is defined in DT and go through clk wrapper based on that.

CRs-Fixed: 2901925
Change-Id: Ia5b2b5fd3c0619c994e27d96fad6e11d126de182
Signed-off-by: Pavan Kumar Chilamkurthi <pchilamk@codeaurora.org>
2021-04-23 16:09:53 -07:00
Anand Ravi
27ad84d827 msm: camera: utils: Add support for multiline printing to log buffers
Introduce new macros to print into log buffers that prefix the
appropriate tags. This allows the usual search filters to pick up all
the lines of the log.

CRs-Fixed: 2928828
Change-Id: I3d27490b324e884eb9cce2bfd184e82418099484
Signed-off-by: Anand Ravi <ananravi@codeaurora.org>
2021-04-23 15:20:31 -07:00
Haibin Liu
693c6dfdae msm: camera: reqmgr: add trace log for separating multi camera
Based on link_hdl/sensor id, that can separate multi camera event
on reqmgr, apply request, bufdone, isp_active_irq.
Add log of link_hdl/sensor id in above trace event,
that systrace can show independent camera trace event.

CRs-Fixed: 2924042
Change-Id: I7088a8a489a05dae4e62dc131d1c0c45c72038e2
Signed-off-by: Haibin Liu <haibinl@codeaurora.org>
2021-04-19 21:51:51 +08:00
Karthik Anantha Ram
fdc5430f3e msm: camera: utils: Modify pointer check for clk debugfs
Modify pointer check when creating clk debugfs in soc utils.

CRs-Fixed: 2841729
Change-Id: I4d23c94cc5424809e445ba7e6321a568e14bfe5f
Signed-off-by: Karthik Anantha Ram <kartanan@codeaurora.org>
2021-04-16 09:46:17 -07:00
Savita Patted
3ee126894b Merge "msm: camera: smmu: Update header include for SMMU API's" into camera-kernel.lnx.5.0 2021-04-02 18:03:48 -07:00
Vikram Sharma
23762a67ed msm: camera: cre: Add CRE driver changes
Add new camera driver Camera Reformat Engine (CRE).

CRs-Fixed: 2893978
Change-Id: Ia39b222493393bf7bb72525c86f0060ca0dc77c2
Signed-off-by: Vikram Sharma <vikramsa@codeaurora.org>
2021-03-31 02:49:52 -07:00
Karthik Jayakumar
4d74da7de3 msm: camera: smmu: Update header include for SMMU API's
Due to restructuring of memory API's new header files contain old
DMA_ATTR macro's.

CRs-Fixed: 2835738
Change-Id: If2b13866c41dcf7b19b47e40fc2d3801c2161816
Signed-off-by: Karthik Jayakumar <kjayakum@codeaurora.org>
2021-03-30 16:05:37 -07:00
Savita Patted
520829f658 Merge "msm: camera: cdm: Fix of_match table null entry" into camera-kernel.lnx.5.0 2021-03-24 19:53:05 -07:00
Karthik Jayakumar
8abb54dcb1 msm: camera: cdm: Fix of_match table null entry
global-out-of-bounds issue on:
msm_cam_hw_cdm_dt_match
Due to no null-terminating struct in the array.

CRs-Fixed: 2883523
Change-Id: I36e4811f239993e1e6de158df959157217c28bfe
Signed-off-by: Karthik Jayakumar <kjayakum@codeaurora.org>
2021-03-22 16:53:25 -07:00
Anand Ravi
d7e5ba94ce msm: camera: utils: Add priority to debug logs
Priority of debug logs allows for better control of which debug logs are
printed. Debug logs default to lowest priority.

CRs-Fixed: 2899680
Change-Id: I59de2d60aac80052b8c7219f866e242d9b475b4d
Signed-off-by: Anand Ravi <ananravi@codeaurora.org>
2021-03-18 11:52:30 -07:00
Karthik Anantha Ram
7409042572 msm: camera: common: Change the max base type for reg dump
With the newly added register base types for reg dump, the
validation needs to be changed to account for the new max.

CRs-Fixed: 2841729
Change-Id: I6babe7a1e4d6def51b8e433be4431f04a0a417e8
Signed-off-by: Karthik Anantha Ram <kartanan@codeaurora.org>
2021-03-11 16:09:43 -08:00
Gaurav Jindal
bc400e47fa msm: camera: common: Add common wait and poll interface
In current implementation, each driver call wait_for_completion_timeout
and readl_poll_timeout with own timeout values.
In case of slow environments like presil, lot of hacks are needed to
change the timeouts for each driver. It needs multiple code changes
and compilations, thus consuming time.
This commit implements a common interface to call
wait_for_completion_timeout and readl_poll_timeout.
Debug variable is also introduced to
change the timeout value. This will help to change the timeout
without compilations and changes at multiple places.

Change-Id: Iba51e0805a49ed325147a12688c2fe6619bb68e6
CRs-Fixed: 2830502
Signed-off-by: Gaurav Jindal <gjindal@codeaurora.org>
2021-03-02 14:17:09 +05:30
Jigar Agrawal
28a19c52e1 msm: camera: common: Improve the CSID logging
Improve CSID irq logging for better debugging.
Add support to dump the hw source clock.

CRs-Fixed: 2808577
Change-Id: I06608588ef7a6e0ebc174a1ba138f6e16a9094f2
Signed-off-by: Jigar Agrawal <jigar@codeaurora.org>
2021-01-26 20:40:06 -08:00
Haritha Chintalapati
779d4efce0 Merge "msm: camera: smmu: IOMMU fault id's API update" into camera-kernel.lnx.5.0 2021-01-25 14:48:24 -08:00
Karthik Jayakumar
bc04b3a8ef msm: camera: smmu: IOMMU fault id's API update
Need to update API's provided by memory team for retreiving fault id's when an
SMMU translation fault occurs for the new kernel version.

CRs-Fixed: 2835738
Change-Id: I061914ce01196fd1271c8a466f6a4ef8e6dce28f
Signed-off-by: Karthik Jayakumar <kjayakum@codeaurora.org>
2021-01-25 12:18:36 -08:00
Karthik Jayakumar
8615106476 msm: camera: req_mgr: Update V4L2 enum names for Waipio
V4L2 driver macro VFL_TYPE_GRABBER has been renamed to VFL_TYPE_VIDEO
in linux kernel 5.8+.

CRs-Fixed: 2835738
Change-Id: Iaddec45b3532094a110e386c6462f08c36a5fd21
Signed-off-by: Karthik Jayakumar <kjayakum@codeaurora.org>
Signed-off-by: Jeyaprakash Soundrapandian <jsoundra@codeaurora.org>
Signed-off-by: Karthik Jayakumar <kjayakum@codeaurora.org>
2021-01-22 10:22:38 -08:00
Camera Software Integration
43c1caa9f5 Merge "msm: camera: config: Makefile update to support GKI 2.0" into camera-kernel.lnx.5.0 2021-01-20 16:22:50 -08:00
Karthik Jayakumar
2c67e897da msm: camera: common: Add cam_free_clear to cam_compat
Kernel 5.10 and up have renamed kzfree to kfree_secure. As such,
we have added a cam_free_clear function to redirect all uses of kzfree
uses to the appropriate function depending on the kernel version the
driver is built against.

CRs-Fixed: 2835738
Change-Id: I72d191c9fb0454a4dbb1392894a909e81fe07caa
Signed-off-by: Karthik Jayakumar <kjayakum@codeaurora.org>
2021-01-15 08:55:04 -08:00
Karthik Jayakumar
8c2e1cab8f msm: camera: config: Makefile update to support GKI 2.0
Adds support for camera kernel driver source being moved to Vendor SI.

CRs-Fixed: 2835738
Change-Id: Ibb876edb1284bc77c366c3ef9e1ee9a39981c960
Signed-off-by: Karthik Jayakumar <kjayakum@codeaurora.org>
2021-01-11 10:11:37 -08:00
Jeyaprakash Soundrapandian
accaa3a3c6 msm: camera: utils: Consume upstream api for io
camera io function call needs to use directly
from upstream api's.

CRs-Fixed: 2835738
Change-Id: I54c00bf784721984d060c34e472c6eea4e5ca012
Signed-off-by: Jeyaprakash Soundrapandian <jsoundra@codeaurora.org>
2020-12-18 19:17:04 -08:00
Pavan Kumar Chilamkurthi
d1177505ae msm: camera: utils: Add option to not set src clk rate
Clients like cpas scale some clocks like slow_ahb, fast_ahb
through vote level based on other hw's src clk freq while
the actual src clock (camnoc) is calculated and set directly
through set_src_clk API. This will overwrite freq of camnoc_axi
with the same level as AHB when ahb clocks are set. Do not
set src clk rate while setting rate for other clocks using level.

CRs-Fixed: 2793673
Change-Id: I5538a5cebf4e47c407a2bf9778136500b1162b4a
Signed-off-by: Pavan Kumar Chilamkurthi <pchilamk@codeaurora.org>
2020-10-27 02:51:15 -07:00
Tejas Prajapati
4574450a12 msm: camera: common: Merge camera-kernel.3.1 changes in camera-kernel.4.0
msm: camera: cdm: Fix dangling pointer issue
msm: camera: cdm: change work record to atomic variable
msm: camera: utils: Adding device type to track device handles
msm: camera: tfe: Reduce stack footprint during bw vote
msm: camera: req_mgr: Thread switch delay detection mechanisms
msm: camera: cdm: Avoid submitting BL if FIFO is full
msm: camera: tfe: check cdm hang in the tfe config timeout
msm: camera: req_mgr: Delay detection mechanism
msm: camera: cdm: Debug info in case of cdm page fault
msm: camera: isp: Max context reduction for TFE in isp driver
msm: camera: ope: Maintain current clock value during acquire
msm: camera: req_mgr: Limit CAM_ERR log in case of no empty task
msm: camera: cdm: Decrement write-count only after Bl commit
msm: camera: isp: Added CSID recovery mechanism.

CRs-Fixed: 2792394
Change-Id: I1c7a903ae15b572acf3f6318cda7394cb6549c8d
Signed-off-by: Tejas Prajapati <tpraja@codeaurora.org>
2020-10-13 12:08:01 +05:30
Jigarkumar Zala
0934fe0103 msm: camera: isp: Add code for SFE HW
Add initial code drop for SFE HW.

CRs-Fixed: 2733230
Change-Id: I44437bbe05d8c60d219c31cb626a4c9845a469e0
Signed-off-by: Jigarkumar Zala <jzala@codeaurora.org>
2020-09-08 13:39:08 -07:00
Camera Software Integration
3f1cf31dee Merge "msm: camera: common: Fix enable/disable for dsp clock source" into camera-kernel.lnx.4.0 2020-08-31 13:23:31 -07:00
Camera Software Integration
682befb851 Merge "msm: camera: utils: Route camera logs to ftrace" into camera-kernel.lnx.4.0 2020-08-28 13:08:32 -07:00
Mukund Madhusudan Atre
4f8f47ab0f msm: camera: common: Fix enable/disable for dsp clock source
Currently, if dsp clock source is not found in device tree, still
we are trying to enable/disable clock source. Check for availability
of that optional clock before toggling it.

CRs-Fixed: 2762106
Change-Id: I2a4467f5383343bdf1e6607712270f574c76e51e
Signed-off-by: Mukund Madhusudan Atre <matre@codeaurora.org>
2020-08-27 18:14:39 -07:00
Pavan Kumar Chilamkurthi
ca73e251f0 msm: camera: utils: Route camera logs to ftrace
Add debugfs setting to route camera logs : ERR,
WARN, INFO, DBG to ftrace.
Add CAM_TRACE macro for adding any new traces in drivers.

Usage:
CAM_TRACE : By default printed in ftrace
CAM_ERR, CAM_WARN, CAM_INFO, CAM_DBG : enable using
debugfs debug_type = 1 or 2
For CAM_DBG : In addition to above enable debug_mdl with
required mask.

adb shell "echo <value> > /sys/module/camera/parameters/debug_type"
All CAM_xx (except CAM_TRACE) logs are routed as below :
0 (default) - only logcat
1 - only ftrace
2 - both logcat and ftrace.

CRs-Fixed: 2762931
Change-Id: I5254a7fef346c7ba21a3ea1eed21e5353f42fd03
Signed-off-by: Pavan Kumar Chilamkurthi <pchilamk@codeaurora.org>
2020-08-26 01:36:30 -07:00
Pavan Kumar Chilamkurthi
f4ec43b748 msm: camera: cpas: Add more debug information in cpas dump
Enhance cpas state dump to get more information about
bandwidth and clock status. This additional state dump
can be enabled using debugfs.

adb shell "echo 1 > /sys/kernel/debug/camera_cpas/full_state_dump"

Traverse through all bw tree nodes and print info in each node.
Print current clk frequencies of all clocks that cpas enables.
Read rpmh bcm status registers to understand mmnoc clk freq.
Add cpas monitor to save important info whenever clients
notify with an event. This monitor info is printed in cpas
state dump.

CRs-Fixed: 2754299
Change-Id: Ib9007091f7e34127f1ca92498e2537b2a06887cb
Signed-off-by: Pavan Kumar Chilamkurthi <pchilamk@codeaurora.org>
2020-08-25 02:29:26 -07:00
Trishansh Bhardwaj
3da4eff78a msm: camera: tfe: Fix NULL ptr dereference
Fixes NULL ptr deref caused by incorrectly passing res_id in place
of res_type.

CRs-Fixed: 2755471
Change-Id: I55ccb6a5fec6e61f79ed0b2cd9fc0cdc62f65b0e
Signed-off-by: Trishansh Bhardwaj <tbhardwa@codeaurora.org>
2020-08-15 11:45:39 +05:30
Mukund Madhusudan Atre
397fcc6f55 msm: camera: utils: Add CAM_IO_ACCESS log category
Currently, CAM_UTIL debug logs when enabled, flood the logcat
with io read/write access logs, which are not necessary when
debugging clocks, interrupts and other parameters. Add separate
entry for IO access in debug util.

CRs-Fixed: 2743063
Change-Id: Id13393211bcc6fdc620aaffe8f8ab27a6b7c6986
Signed-off-by: Mukund Madhusudan Atre <matre@codeaurora.org>
2020-08-05 15:20:17 -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
Camera Software Integration
e3e118457a Merge "msm: camera: csiphy: Update logic for lane enablement" into camera-kernel.lnx.4.0 2020-07-07 17:56:13 -07:00
Camera Software Integration
37eb5e1921 Merge "msm: camera: utils: Add final BW vote logs as perf logs" into camera-kernel.lnx.4.0 2020-07-07 17:55:55 -07:00
Camera Software Integration
fb8c7dbeb3 Merge "msm: camera: common: Enable debugfs compile check" into camera-kernel.lnx.4.0 2020-07-07 17:55:41 -07:00
Karthik Jayakumar
7c8204a42d msm: camera: common: Enable debugfs compile check
Guards debugfs features in camera driver to only be compiled when
CONFIG_DEBUG_FS is enabled.

CRs-Fixed: 2717236
Change-Id: I0de77741301d259cbec64e8a2e27830981b2b69d
Signed-off-by: Karthik Jayakumar <kjayakum@codeaurora.org>
2020-07-01 10:59:24 -07:00
Mukund Madhusudan Atre
d543187b79 msm: camera: utils: Add final BW vote logs as perf logs
AHB and AXI BW voting path requires all key logs to be perf.
Change BW voting logs in utils to perf for easier debugging.

CRs-Fixed: 2584631
Change-Id: I41ef094f6633101bb7b636ea310aca81de0101c7
Signed-off-by: Mukund Madhusudan Atre <matre@codeaurora.org>
2020-06-30 10:10:52 -07:00
Jigarkumar Zala
fa08068801 msm: camera: csiphy: Update logic for lane enablement
Currently lane enablement is happening as a part of lanemask
field, which is send by UMD. Lane enablement should be purely
depends on laneCnt and laneAssign attributes. Also, combo mode
sensors needs to come with combo mode flag set from the UMD.
This change updates the logic for lane enablement with respect
to laneAssign and laneCnt, and also covers all combomode selection
as per the request. This change also enables the sensors to acquire
and streamon/streamoff at anytime in session.

CRs-Fixed: 2677450
Change-Id: I4f0d3ffd7245a931c273611c9c4b7e503c038664
Signed-off-by: Jigarkumar Zala <jzala@codeaurora.org>
2020-06-29 15:56:53 -07:00