Commit Graph

30 Commits

Author SHA1 Message Date
George Shen
8adf2c6b69 msm: eva: Map dsp hfi queue using dma alloc api
Use dma_alloc_coherent to allocate 4MB dsp hfi queues and map
them in non-io-coherent way.

Change-Id: I6d8adb58ebcddae569259862a83e3aeffa3d2304
Signed-off-by: George Shen <quic_sqiao@quicinc.com>
2023-08-21 23:18:59 -07:00
George Shen
8cdf80c8ac msm: eva: Allow up to 40 buffers in a frame
MVResampling frame packet has up to 38 buffers. Without the
change, kernel will complain if MV resampling number is increased
above 13.

Change-Id: I95a97045a312163f378be157394a4ff041b57a57
Signed-off-by: George Shen <quic_sqiao@quicinc.com>
2023-07-10 12:06:09 -07:00
George Shen
ea94318515 msm: eva: mmap firmware debug memory
For user mode to save into a dump file. It helps FW debugging.

Change-Id: I1c9c52d27d0dfd20e3eeb54b203416f6df095c8d
Signed-off-by: George Shen <quic_sqiao@quicinc.com>
2023-06-20 14:14:02 -07:00
George Shen
37a21d759b msm: eva: Recover EVA SMMU fault
Needs extra change to enable EVA SMMU fault. This change clears
all the obstacles to achieve the goal.

Change-Id: Ia93ff2132ff53741f3c20d4271083f6f93824cac
Signed-off-by: George Shen <quic_sqiao@quicinc.com>
2023-05-23 10:06:11 -07:00
George Shen
1f5a03e9a6 msm: eva: Use pool allocator to allocate wncc oobs
Keep wncc working in case of kernel heap leakage. wncc buffer
requires 128kb. Driver will pre-allocate and store 8 buffers
in the pool if wncc use case starts.

Save all recently de-register wncc buffer mappings through
deregister_buffer API.

Change-Id: Iaa422bed9d3dd6f6cfe349a4931bfde28a3e3a51
Signed-off-by: George Shen <quic_sqiao@quicinc.com>
2023-04-27 13:52:41 -07:00
George Shen
5d31120817 msm: eva: Save buffer mappings of last frame
Help debugging SMMU fault.

Change-Id: I93f041b9c117f1cce0d4a8ad9f723d9d31b02010
Signed-off-by: George Shen <quic_sqiao@quicinc.com>
2023-03-19 22:06:35 -07:00
George Shen
f2e6be65e4 msm: eva: Move cvp_buf_type to UAPI
Ensure consistent buffer type use between UMD and KMD.

Change-Id: I77d619420d584e3c29babc8ddc5e80232f901009
Signed-off-by: George Shen <quic_sqiao@quicinc.com>
2022-12-05 13:22:44 -08:00
Yu SI
7597271dde msm: eva: synx v2 support
propagated sync v2 support from 2.0
reference 4162025

Change-Id: I3427657e21e7eda92088d828203a330ba3c86335
Signed-off-by: Yu SI <quic_ysi@quicinc.com>
Signed-off-by: George Shen <quic_sqiao@quicinc.com>
2022-10-10 18:20:57 -07:00
George Shen
fcbb3d87ab msm: eva: Propagate tip of 2.0 to 3.0
Add back all changes made after Aug. 3rd from
Kailua to Lanai.

Change-Id: I725b77892ab24354014b3d9bbc13d14c710aff5a
Signed-off-by: George Shen <quic_sqiao@quicinc.com>
2022-09-27 12:52:27 -07:00
George Shen
dcbb74265f msm: eva: Add Lanai EVA HFI check
Adds XRA, DLFL, DLFD, RGE and ITOF packets sanity check.
Optimizes packet type table to avoid linear search during
each packet handling. Instead use packet type as index to expedite
searching. Packet type table grows to over 60 entries and each
entry uses 40B. There will be quite some memory access delay for
each packet handling without optimization.

Change-Id: I1ee26d0d5d0b83d3c15fbcafa7414017c418b6e3
Signed-off-by: George Shen <quic_sqiao@quicinc.com>
2022-07-29 11:02:27 -07:00
George Shen
e92994b6b9 msm: eva: Avoid caching persist buf mapping
Remove unused user persist buffer unmap code as the HFI of
UNMAP_USER_PERSIST is not supported.

Change-Id: If8ca0c24318adb1d33ab525ac0023bc5f8ae4573
Signed-off-by: George Shen <quic_sqiao@quicinc.com>
2022-07-06 12:51:32 -07:00
George Shen
4bfd66f039 msm: eva: Enhance SMMU fault debugability
Changes only applicable on CPU EVA path, including
- tracking packet type and buffer index for each dma_buf
- print feature config packet type
- print session properties in error cases.

Change-Id: I938cf463bee9284760145f3fd9e030b3b8134caa
Signed-off-by: George Shen <quic_sqiao@quicinc.com>
2022-07-01 09:25:43 -07:00
Sabharsh Sidhu
01c34574ca msm: eva: Add WarpNCC CPU support
Adds Out-of-Band (OOB) functionality. Adds
WarpNCC OOB processing for metadata buffer
IOVA population. Adds WarpNCC source buffer
registration that does IOVA book-keeping and
returns buffer ID to UMD.

Change-Id: I182c270454eec194f28a31c494bae0ad9eface02
Signed-off-by: Sabharsh Sidhu <quic_ssidhu@quicinc.com>
2022-02-01 14:13:13 -08:00
Yu SI
4981885760 msm: eva: merged tip from eva-kernel.lnx.1.0
merged tip source code from eva-kernel.lnx.1.0,
and verify the promotion flow.

Change-Id: I031508fd8a23995a166506f3d190e5e228eb13c2
Signed-off-by: Yu SI <ysi@codeaurora.org>
2021-10-27 18:14:30 -07:00
George Shen
0e72292d71 msm: eva: Avoid dereference NULL smem
Check and return error in case of NULL smem.

Change-Id: I0f1f6a0746fe2110e0f5f306c22133caba6f2d63
Signed-off-by: George Shen <sqiao@codeaurora.org>
2021-09-20 16:18:54 -07:00
George Shen
f8342d4cf9 msm: eva: Remove deprecated header
Allows compiling independent of synx, fastrpc and mmrm readiness.

Avoid including KP 2.0 deprecated headers.

Change-Id: Ibf026f409b7f6284705c95b01a5251ac6a498b32
Signed-off-by: George Shen <sqiao@codeaurora.org>
2021-09-09 16:34:56 -07:00
George Shen
72eb20af3d msm: eva: Add SSR counter
Support configurable number of SSR tolerance before calling
BUG_ON in SMMU fault scenario.

Change-Id: I19dabbeaa1cf5be86f42a6ace62ef5da12743e79
Signed-off-by: George Shen <sqiao@codeaurora.org>
2021-08-13 13:43:45 -07:00
Chris Goldsworthy
30223d90a7 msm: eva: Fix DMA-BUF double free
msm_cvp_smem_put_dma_buf() releases the EVA driver's reference it uses
for DMA mappings, by decrementing the refcount of the underlying
struct file that all DMA-BUFs use for life cycle tracking. By
accident, the EVA driver held a direct reference to the underlying
file using the struct msm_cvp_smem->file variable. The EVA driver,
after releasing it's reference to the DMA-BUF, inadvertently called
fput() on the struct_cvp_smem->file variable, which leads to a double
free.

Resolve this by removing the struct msm_cvp_smmem->file variable, and
by removing the corresponding fput().

Change-Id: I108cd87509673008ff55fc94fda76aa21f21bd5d
Signed-off-by: Chris Goldsworthy <cgoldswo@codeaurora.org>
2021-07-30 10:22:54 -07:00
George Shen
966d521450 msm: eva: Remove warning during buf unmapping
Persistent buffer unmap is different than frame buffer. It's
expected to be released at the end of session instead of at
frame boundary. Remove the warning of "unexpected unmapping".

Change-Id: I24bfae0b67b1a8989e6a710556d94c8bc4e90aff
Signed-off-by: George Shen <sqiao@codeaurora.org>
2021-07-09 14:26:17 -07:00
George Shen
98e9135563 msm: eva: Simplify EVA DSP interface
Control EVA directly through kernel driver low-level functions.
Add error handling in session creation.
Unwind task and file reference count during buffer un-mapping.

Change-Id: I1ae5ae4afd3fea8e90faee1d8fe2c1ff92eeb9c2
Signed-off-by: George Shen <sqiao@codeaurora.org>
2021-04-08 13:13:23 -07:00
George Shen
600394cf35 msm: eva: Update date of source
To comply with open source scan requirements.

Change-Id: Idd9a4dec7dbe7ee7d4dd7294083d9b045438f67d
Signed-off-by: George Shen <sqiao@codeaurora.org>
2021-03-15 14:53:26 -07:00
George Shen
8f044d707a msm: eva: Deprecate dma_buf_get_flags()
Migrate to new kernel API to retrieve buffer attributes.

Change-Id: I1163c975b8e7f666694394be90f2999eabba1e23
Signed-off-by: George Shen <sqiao@codeaurora.org>
2021-02-18 22:28:12 -08:00
George Shen
6f2d4b9361 msm: eva: enhance DSP session resource management
Improve debugability and error handling in future.

Change-Id: I4f116e106f243143f4f62eb28fbf338e219018c6
Signed-off-by: George Shen <sqiao@codeaurora.org>
2021-02-18 13:24:35 -08:00
George Shen
f3d06c8ef3 msm: eva: New DSP driver interface
New CPU-DSP interface aims to replace reverse RPC in DSP EVA
applications.

Change-Id: I4225dfa0b1acf8015a763263520442712e571851
Signed-off-by: George Shen <sqiao@codeaurora.org>
2021-01-18 21:12:51 -08:00
Yu SI
085cc3a1a8 msm: eva: feature related Waipio eva driver change
Feature related Waipio_EVA_driver_code changes

Change-Id: I49955d8b33d8c2e668555ac2a1795ea8d5710442
Signed-off-by: Yu SI <ysi@codeaurora.org>
2021-01-13 11:39:44 -08:00
George Shen
928365194b msm: eva: Initial migration to new dma-buf API
Per Waipio requirement.

Change-Id: Ic501909c93e9c12cb873458f47f7f86e598f16b0
Signed-off-by: George Shen <sqiao@codeaurora.org>
2020-10-21 14:19:00 -07:00
Yu SI
5f1c0b90c3 msm: eva: rename cvp to eva for private h and such
renamed cvp to eva for msm_eva_private.h and
other source and header depending on this file

Change-Id: I987cfedca62c82e5e26af230b4f36c84f1318a95
Signed-off-by: Yu SI <ysi@codeaurora.org>
2020-09-25 18:39:18 -07:00
George Shen
0c218a6148 msm: eva: propagate tip of CVP driver to EVA
Merge cvp driver to EVA

Change-Id: I3fb962bfae750f49f821c16061bd78fa5425959e
Signed-off-by: George Shen <sqiao@codeaurora.org>
2020-08-06 22:57:54 -07:00
George Shen
34e78bca0c msm: eva: Rename UAPI header
From msm_cvp_private.h to msm_eva_private.h

Change-Id: I22f428e774fc725e1a88968da823a29f0ce68ffa
Signed-off-by: George Shen <sqiao@codeaurora.org>
2020-07-23 14:39:15 -07:00
George Shen
387d008122 msm: eva: Initial eva driver
For Waipio.

Change-Id: I2fa0eeadcbf9252190a6febbe0f890f1dc7b1524
Signed-off-by: George Shen <sqiao@codeaurora.org>
2020-07-10 16:34:39 -07:00