Commit Graph

50 Commits

Author SHA1 Message Date
Jigar Agrawal
b5c4f91b83 msm: camera: common: Add a check for 0 reg-val pairs in cdm command
Add a check for reg-val count=0 in reg_random command. Count=0 in
reg_random cdm command will throw an invalid command HW error.

CRs-Fixed: 2916477
Change-Id: Idb8654c3752963cf5a52147d350e291208b917d0
Signed-off-by: Jigar Agrawal <jigar@codeaurora.org>
2021-04-20 12:17:50 -07:00
Haritha Chintalapati
d62972c20f Merge "msm: camera: common: Use the appropriate header for spinlock" into camera-kernel.lnx.5.0 2021-04-14 19:20:47 -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
Alok Chauhan
12306c0a9e msm: camera: ope: Update for new IQ modules
Added changes to dump new IQ modules as well
in OPE during page fault and hang scenarios.

CRs-Fixed: 2878214
Change-Id: I97e7d4ee2ed9899ed299155c9aca8b094dff18f0
Signed-off-by: Alok Chauhan <alokc@codeaurora.org>
2021-04-06 22:17:24 +05:30
Alok Chauhan
a78cf863fd msm: camera: ope: Dump stripe info at the time of hang
Add logic to dump stripe info and wait event status at the
time of cdm hang.

CRs-Fixed: 2878214
Change-Id: Ib9892b0273e4436988c5f1384d18d60d29529c94
Signed-off-by: Alok Chauhan <alokc@codeaurora.org>
2021-04-06 21:48:51 +05:30
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
Savita Patted
1ee4bca76c Merge "msm: camera: ope: Handle OPE smmu fault with pid info" into camera-kernel.lnx.5.0 2021-03-09 20:18:26 -08:00
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
Vikram Sharma
57bff5aede msm: camera: ope: Handle OPE smmu fault with pid info
Kernel apis provide information fault caused pid and mid data.
Handle the OPE smmu fault using pid and mid data. Based on the
mid data, dump only corresponding port info which caused the
fault. Pid and mid values are target dependent, these values
will be updated on the ope node dt entries.

CRs-Fixed: 2857868
Change-Id: I909f1787e71e67e5ed1d3464dfeb506418d151e4
Signed-off-by: Vikram Sharma <vikramsa@codeaurora.org>
2021-02-24 23:40:40 -08:00
Rishabh Jain
01249ea8d9 msm: camera: ope: Add support to dynamic switch pix_pattern
Add support to dynamically switch pix_pattern of read clients
based on data received in each request.

CRs-Fixed: 2811530
Change-Id: Icb3ebd33cae59b8db87bc0011d6560492ad29c3a
Signed-off-by: Rishabh Jain <risjai@codeaurora.org>
2021-02-23 10:58:45 -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
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
Camera Software Integration
3224cf35c3 Merge "msm: camera: cdm: Improve error handling during cdm hang" into camera-kernel.lnx.4.0 2020-12-10 10:59:56 -08:00
Camera Software Integration
a1aae58315 Merge "msm: camera: ope: free unused memory in ope acquire" into camera-kernel.lnx.4.0 2020-12-10 10:59:47 -08:00
Haritha Chintalapati
9d99a4fc95 Merge "msm: camera: ope: Avoid submitting NULL request to CDM" into camera-kernel.lnx.4.0 2020-12-02 19:10:56 -08:00
Alok Chauhan
63bca8c33d msm: camera: cdm: Improve error handling during cdm hang
Reduce logging as part of error handling to avoid
flooding kernel log with excessive log. Apart from
that send feedback to client irrespective of cdm
reset status.

CRs-Fixed: 2826285
Change-Id: I9b0d8c6f64ced4972bb20e26774508573c815e4f
Signed-off-by: Alok Chauhan <alokc@codeaurora.org>
2020-12-02 10:38:53 +05:30
Shravya Samala
c3c2045115 msm: camera: ope: Check array size of input sync obj
Incase of input buffer, check array size of input sync obj before assigning
fence.

CRs-Fixed: 2821583
Change-Id: I5cd7968cfbe0be86a8967565616bf6eb1cf7fcf7
Signed-off-by: Shravya Samala <shravyas@codeaurora.org>
2020-11-30 00:02:02 -08:00
Alok Chauhan
5a24b2b912 msm: camera: ope: free unused memory in ope acquire
OPE driver allocate memory dynamically to store cdm
acquire and bw data in acquire time and don't use later.
These memories can be freed before returning from acquire.

CRs-Fixed: 2827058
Change-Id: Ibf87282862f2ae4655da3c69016bedb7f96bca1c
Signed-off-by: Alok Chauhan <alokc@codeaurora.org>
2020-11-27 12:21:44 +05:30
Alok Chauhan
e874b94c3a msm: camera: ope: Avoid submitting NULL request to CDM
In corner case, there is a chance that userspace can submit
request while flush is ongoing. In some cases submitted request
can get flushed and corresponding data structures  memory gets
freed.

Add a logic to check for pending request before submitting request
to cdm hw.

CRs-Fixed: 2815901
Change-Id: I74096201e204f204c4f15d14698b4e9af6435f55
Signed-off-by: Alok Chauhan <alokc@codeaurora.org>
2020-11-24 22:02:25 -08: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
Shravya Samala
ef90082f0b msm: camera: ope: Fix false hw hang detection
While preparing config packet at HW layer,
we are setting Ope request timer even before
processing command buffer and IO cfg. This is
leading to false hw hand detection.
Expectation is Ope request timer has to
start after req is submitted to HW.

CRs-Fixed: 2788900
Change-Id: Idd1420b2ee1aed4bfe947cf5617bbec9b39147d3
Signed-off-by: Shravya Samala <shravyas@codeaurora.org>
2020-10-07 13:13:56 +05:30
Vikram Sharma
345ff8c633 msm: camera: ope: Handle race while dumping ope req list
While dumping OPE req list we were not protecting it in context mutex,
this can result into unexpected behaviors. This change take care of
protecting the dump logic using mutex.

CRs-Fixed: 2750458
Change-Id: I916822b498cde3922274c18a06b98c898bff1d65
Signed-off-by: Vikram Sharma <vikramsa@codeaurora.org>
2020-09-29 22:21:52 -07:00
Rishabh Jain
b457f5fae5 msm: camera: ope: Increase max bl limit
Increase max bl limit for OPE to 24 to support maximum
48 stripes.

CRs-Fixed: 2761455
Change-Id: I961be1344fac0084649df321225e94a50d4e5a98
Signed-off-by: Rishabh Jain <risjai@codeaurora.org>
2020-09-17 21:18:40 -07:00
Tejas Prajapati
8e746194c9 msm: camera: ope: remove the check for dev_type
Calculate the total clk of all the ctx
irrespective of the use case for the ctx. Remove
dev_type check to add all the ctx clk while
calculating total clk.

CRs-Fixed: 2754351
Change-Id: I5c1681ac1a88cfec752ff58fd8b1f6ac5d05b28a
Signed-off-by: Tejas Prajapati <tpraja@codeaurora.org>
2020-09-12 08:36:35 -07:00
Alok Chauhan
19dbfda860 msm: camera: ope: Updated logic to calculate num bw path
Ope driver was incorrectly calculating the number
of bw path. This is causing bw to be skip for some
of the ports.

Updated logic to correctly calculate number of path
based on valid path type.

CRs-Fixed: 2715586
Change-Id: I95b6dcfae454713a7b5db6d629310244bb304b19
Signed-off-by: Alok Chauhan <alokc@codeaurora.org>
2020-09-04 00:13:31 -07:00
Trishansh Bhardwaj
7aa0932eeb msm: camera: common: Merge camera-kernel.3.1 changes in camera-kernel.4.0
msm: camera: ope: Fix OPE hang dump
msm: camera: cdm: Add a check for fifo list in cdm workqueue
msm: camera: ope: Add a check to validate dmi cmd address
msm: camera: ope: Add check for number of stripe
msm: camera: tfe: Support tfe pdaf port
msm: camera: ope: Handle reset IRQ delay
msm: camera: ope: enable pp modules hw status dump
msm: camera: ope: Fix OPE clock issue
msm: camera: ope: Add LDAR dump support
msm: camera: ope: Add context state check in process cmd
msm: camera: ope: Change parameters to find time difference
msm: camera: ope: Add debug fs for dumping frame setting logs
msm: camera: ope: Add debugfs support to dump ope hang dump
msm: camera: tfe: Handle unsupported outport format
msm: camera: ope: add page fault handlers in ope driver
msm: camera: ope: Reduce OPE BUS memory
msm: camera: ope: Change turbo clock limit.

CRs-Fixed: 2729996
Change-Id: I683ed07082b455599f89dbc18f353b6a1e48b129
Signed-off-by: Trishansh Bhardwaj <tbhardwa@codeaurora.org>
2020-08-30 14:22:47 +05:30
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
acb34abbad msm: camera: core: Handle event failure reason propagation
Handle event failure reason propagation in camera kernel
driver. Individual camera kernel driver will fill reason
codes for sync failure and send it to sync driver. Sync
driver will add this as part of sync event header and
propagate to user space.

CRs-Fixed: 2750553
Change-Id: I284390fc45757ba8291a44400e2263b9be64b092
Signed-off-by: Alok Chauhan <alokc@codeaurora.org>
2020-08-16 11:15:21 +05:30
Camera Software Integration
12fbb55700 Merge "msm: camera: ope: Fix unsequenced clang warning" into camera-kernel.lnx.4.0 2020-07-28 16:13:04 -07:00
Karthik Anantha Ram
934bb3ea14 msm: camera: ope: Fix unsequenced clang warning
Address unsequenced operations to avoid any undefined behavior.

CRs-Fixed: 2738394
Change-Id: Ieac88c20d1411771d8b722ccb4c417b47570f7ca
Signed-off-by: Karthik Anantha Ram <kartanan@codeaurora.org>
2020-07-24 17:17:00 -07:00
Trishansh Bhardwaj
97eeefea15 msm: camera: tfe: Enable TFE and OPE for bengal
Enable TFE and OPE compilation for bengal target.

CRs-Fixed: 2729996
Change-Id: I648cae32f39a5bf7225c8be545f1c310e24db8e6
Signed-off-by: Trishansh Bhardwaj <tbhardwa@codeaurora.org>
2020-07-23 05:42:11 -07:00
Pavan Kumar Chilamkurthi
e618f72d9f msm: camera: core: Handle request abort and signal fence CANCEL
Handle request abort cases from underlying hw mgr, hw layers.
This will handle in differentiating ERROR vs ABORT returned
from firmware in case of ICP and signal the fence accordingly.
By the time flush is issued to firmware, if a request is not
yet processed, firmware signals with Abort, which needs to be
propogated as CANCEL instead of ERROR to core context layer
so that context layer signals the fence accordingly as
ERROR or CANCEL.

CRs-Fixed: 2702771
Change-Id: I8fe6bd1c8f5cf09b99196a1caac1283032418f8c
Signed-off-by: Pavan Kumar Chilamkurthi <pchilamk@codeaurora.org>
2020-06-29 02:38:06 -07:00
Suresh Vankadara
c92348064f msm: camera: common: Update holi camera workq wrapper
Update OPE and TFE drivers to use new camera workq
wrapper functions.

CRs-Fixed: 2716498
Change-Id: I05ecefb191a544c2953ac7e71a7c9a95d1f1fb10
Signed-off-by: Suresh Vankadara <svankada@codeaurora.org>
2020-06-23 10:51:59 +05:30
Suresh Vankadara
0929575916 msm: camera: cpas: Add support for holi camnoc
Holi has different version of camnoc and CPAS version
which requires separate register space and camnoc
interface changes and CPAS version change.
This change adds the same.

CRs-Fixed: 2701462
Change-Id: I9fbfab592278ba7804809872b4b4b235895477f2
Signed-off-by: Suresh Vankadara <svankada@codeaurora.org>
2020-06-09 12:12:39 +05:30
Trishansh Bhardwaj
172d34b6f7 msm: camera: common: Merge camera-kernel.3.1 changes in camera-kernel.4.0
msm: camera: tfe: Fix variable initialization issues
msm: camera: isp: Dual tfe event check with proper hw idx
msm: camera: smmu: Add support for non-contiguous mermory region
msm: camera: smmu: Use iommu best match algo for camera
msm: camera: ope: Optimize allocation of IO configuration
msm: camera: ope: Fix for KW Issues
msm: camera: ope: Add support for stripe level height configuration
msm: camera: tfe: Enable the delay line clc
msm: camera: ope: Fix false alarm for OPE HW timeout
msm: camera: tfe: Support register dump per request
msm: camera: ope: Increase max number of stripes
msm: camera: ope: Change packer and unpacker format in case NV12
msm: camera: tfe: Add packet code get command for tfe
msm: camera: ope: Trigger recovery in case of violation on write bus
msm: camera: ope: Protect ope hw reset with mutex
msm: camera: ope: Add a check for valid request in cdm callback
msm: camera: ope: Remove the BW & clock vote in release context
msm: camera: ope: Reduce OPE BUS memory
msm: camera: ope: Fix return value for ope acquire
msm: camera: ope: Fix false alarm for OPE request timeout
msm: camera: ope: Avoid deadlock during recovery after HW hang
msm: camera: tfe: tfe debug enhancement
msm: camera: cdm: Fix irq_data value in case of inline irq
msm: camera: flash: Switch off flash on provider crash
msm: camera: ope: Initialize ope hw mutex structure
msm: camera: cdm: Flush all available FIFOs during reset
msm: camera: cpas: Add mandatory bw option for axi ports clocks
msm: camera: ope: Use vzalloc to allocate the write bus ctx structure
msm: camera: ope: Fix handling of init hw failure
msm: camera: tfe: Enable per frame register dump for rdi only context
msm: camera: cdm: Protect cdm core status bits with mutex
msm: camera: cdm: correct the error check in cmd submit irq
msm: camera: ope: Fix unclock access during HW reset
msm: camera: ope: Program frame level settings after idle event
msm: camera: ope: Delay releasing of resources for last context
msm: camera: isp: Increase default SOF freeze timeout
msm: camera: smmu: Add map and unmap monitor
msm: camera: isp: Add trace events across ISP
msm: camera: smmu: Profile time taken for map, unmap
msm: camera: ope: Start context timer on receiving new request
msm: camera: tfe: Reduce stack size during set axi bw
msm: camera: cdm: Check for HW state before dumping registers
msm: camera: ope: Reduce stack footprint during acquire
msm: camera: tfe: Disable clock if tfe2 is not supported
msm: camera: cdm: Avoid cdm pause incase of BL submit
msm: camera: tfe: Optimize CSID IRQ logging
msm: camera: ope: Move request id validity check outside of lock
msm: camera: tfe: Correct the tfe hw manager dump logic
msm: camera: ope: Synchronize flush and submit BLs
msm: camera: cdm: Protect cdm reset status
msm: camera: cdm: Handle cdm deinit sequence properly
msm: camera: tfe: Reduce reset timeout to 100ms
msm: camera: ope: Fix hang detection
msm: camera: ope: Make non-fatal logs as debug and info logs
msm: camera: tfe: set overflow pending bit to zero after HW reset
msm: camera: ope: Do not disable CDM during error handling
msm: camera: ope: Add support for OPE Replay
msm: camera: ope: Stop OPE in case of init failure
msm: camera: ope: Synchronize process cmd and flush request
msm: camera: cdm: Fix CDM IRQ handling
msm: camera: tfe: LDAR dump for TFE
msm: camera: ope: Fix the length check for debug buffer
msm: camera: cdm: Fix CDM reset logic
msm: camera: ope: Dump debug registers in case of HW hang
msm: camera: tfe: Support the RDI bus port for line based mode
msm: camera: cdm: Handle out of order reset done events
msm: camera: ope: Consider other contexts during timeout
msm: camera: ope: Put GenIRQ in last stripe BL
msm: camera: tfe: Process the rdi interrupts for rdi only resource
msm: camera: jpeg: Check the HW state before accessing register
msm: camera: csiphy: Update csiphy power-up sequence for lito v2
msm: camera: cdm: Secure freeing of request lists using locks
msm: camera: cpas: Add support for Scuba camnoc
msm: camera: csiphy: Clear secure phy flags on release
msm: camera: tfe: validate the tfe bw num paths
msm: camera: ope: Reorder the reset order in ope acquire
msm: camera: ope: Dump debug registers in case of reset failure
msm: camera: ope: Add logic to detect hang in CDM
msm: camera: isp: Increase max count of cfg to support more init packets
msm: camera: core: Fix cpas axi clk rate overflow.

CRs-Fixed: 2668666
Change-Id: I882ca4bd117bebc7d1c62bc82299d69d7b5c9388
Signed-off-by: Trishansh Bhardwaj <tbhardwa@codeaurora.org>
2020-06-03 11:48:47 +05:30
Rishabh Jain
704dc07b7b msm: camera: ope: Clear comp events before each request
If there is a stale entry of any event in the CDM,
it will end the wait of same event in next request.
So, clearing the comp events before each request.

CRs-Fixed: 2611231
Change-Id: I252ee5edaea1cda34dc48343dd6bc865b490e977
Signed-off-by: Rishabh Jain <risjai@codeaurora.org>
2020-02-12 12:06:50 -08: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
Suresh Vankadara
f1f6915ed4 msm: camera: ope: Fix OPE AHB voting issue
Initialize AHB voting variable in OPE acquire
to fix AHB voting issue for OPE.

CRs-Fixed: 2594541
Change-Id: I5bf8c0b1315a351abd80341100bdaf42333c4c24
Signed-off-by: Suresh Vankadara <svankada@codeaurora.org>
2020-01-16 17:45:48 +05:30
Ravikishore Pampana
12548365df msm: camera: common: secure camera fixes
Isp bus port secure mode not coming properly. Added proper
logic to get the bus port secure mode correctly.
Use secure iommu handle to get secure buffer for ope.
Add spin lock for tfe irq handler.
Use proper bw structure to copy the user send blob
data.

CRs-Fixed: 2594541
Change-Id: Icb8ecf869681c370efa084991505036f90a35065
Signed-off-by: Ravikishore Pampana <rpampana@codeaurora.org>
2020-01-16 17:45:47 +05:30
Rishabh Jain
eb74ea19e4 msm: camera: ope: Fixed for IRQ mask and log printing
Adding fixes to set IRQ mask after reset and strings to
print OPE CPAS PATH enums.

CRs-Fixed: 2594541
Change-Id: I5873b8b0494623c36ca94edf7a26cc952fbb5e68
Signed-off-by: Rishabh Jain <risjai@codeaurora.org>
2020-01-16 17:45:46 +05:30
Rishabh Jain
130865bbdf msm: camera: ope: Avoid dead lock during flush
During flush OPE driver takes lock on OPE context and
calls the CDM flush, in which CDM notifies OPE for all
pending requests. If at the same time CDM is notifying
OPE for successful request that thread also tries to
take lock on OPE context. CDM also tries to takes lock
on CDM client in each notify call. Due to which,
dead lock is occurring.

So taking the lock on OPE context in OPE flush after
CDM flush.

CRs-Fixed: 2594541
Change-Id: I6ae9105d33a49a638141973cdd6a4a99621dc4c5
Signed-off-by: Rishabh Jain <risjai@codeaurora.org>
2020-01-16 17:45:46 +05:30
Rishabh Jain
bd1e6c2420 msm: camera: ope: Add fixes for probe, bus read and req_timer
As we are accessing hw version register during probe so calling
cpas_start and cpas_stop during probe.
Disabling the read clients which are not enabled for the request.
Resetting the req_timer when we receive the request from UMD.

CRs-Fixed: 2594541
Change-Id: I4a739fedbb498bd0c6b5b1e4cef38de3e4c722ed
Signed-off-by: Rishabh Jain <risjai@codeaurora.org>
2020-01-16 17:45:45 +05:30
Rishabh Jain
a90aec6cb4 msm: camera: ope: Corrected parameter for deiniting idle clock
Corrected the parameter needed to be passed in cam_ope_deinit_idle_clk.

CRs-Fixed: 2594541
Change-Id: Ibeb8558fd0724fff61f4a6ddadd3b3cf6a6b3ed2
Signed-off-by: Rishabh Jain <risjai@codeaurora.org>
2020-01-16 17:45:44 +05:30
Chandan Kumar Jha
594b0acba5 msm: camera: common: Remove division on uint64_t
Arm arch does not support dividing 64 bit integer, replacing it with
do_div call.
Fix variable type to work with both 32/64 bit arch.

CRs-Fixed: 2594541
Change-Id: I6b30f089bc998e98c7f2e20dc7fc11eedf6e6bc7
Signed-off-by: Chandan Kumar Jha <cjha@codeaurora.org>
2020-01-16 17:45:44 +05:30
Trishansh Bhardwaj
4aad75a2f9 msm: camera: ope: Support 32 bit arch
Update datatypes to work with 32 bit kernel.

CRs-Fixed: 2594541
Change-Id: I72d628152134770d7e09c3684443e25c47d9d1dc
Signed-off-by: Trishansh Bhardwaj <tbhardwa@codeaurora.org>
2020-01-16 17:45:41 +05:30
Trishansh Bhardwaj
41533c5eb2 msm: camera: ope: Corrected batch mode and stripe for ope
Corrected the striping creation for non real time device.
Disabled the ope stripe base bus. Corrected the batch mode
creation for ope bus read.

CRs-Fixed: 2594541
Change-Id: I87adbab25b84d74162a6a8ce2db1412a6d9058d0
Signed-off-by: Rishabh Jain <risjai@codeaurora.org>
Signed-off-by: Trishansh Bhardwaj <tbhardwa@codeaurora.org>
2020-01-15 14:38:50 -08:00
Trishansh Bhardwaj
a46b9bff7a msm: camera: ope: Add dynamic clock support
Dynamic clock and bandwidth support is added to
OPE.

CRs-Fixed: 2594541
Change-Id: Ib53ec47c7074f01f1bb55e17c97e5dacc550a129
Signed-off-by: Suresh Vankadara <svankada@codeaurora.org>
Signed-off-by: Trishansh Bhardwaj <tbhardwa@codeaurora.org>
2020-01-15 14:38:25 -08:00
Trishansh Bhardwaj
12d9311463 msm: camera: ope: Add support to OPE driver
OPE is camera offline engine, support is added
to enable camera OPE hardware.

CRs-Fixed: 2594541
Change-Id: I65c69f5763d05abf265b645b09c95c55fb290182
Signed-off-by: Suresh Vankadara <svankada@codeaurora.org>
Signed-off-by: Ravikishore Pampana <rpampana@codeaurora.org>
Signed-off-by: Trishansh Bhardwaj <tbhardwa@codeaurora.org>
2020-01-15 14:37:54 -08:00