Commit Graph

2046 Commits

Author SHA1 Message Date
Arvind M
bf51097601 nvdla: kmd: add debugfs support for testing SC7
[1] Add suspend debugfs node to control suspend and resume operations.
    - /sys/kernel/debug/nvdla0/suspend
    - /sys/kernel/debug/nvdla1/suspend
[2] Any requests to DLA between suspend and resume shall fail.

Command to trigger suspend
    echo 1 > /sys/kernel/debug/nvdla0/suspend
    echo 1 > /sys/kernel/debug/nvdla1/suspend

Command to trigger resume
    echo 0 > /sys/kernel/debug/nvdla0/suspend
    echo 0 > /sys/kernel/debug/nvdla1/suspend

Jira DLA-5365

Change-Id: I5f30b57fce70a2904c2ac4cfeba413f86c6263a6
Signed-off-by: Arvind M <am@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2660805
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Amit Sharma (SW-TEGRA) <amisharma@nvidia.com>
Reviewed-by: Praveen K <kpraveen@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-14 11:47:58 +00:00
Arvind M
a8e71d52d5 nvdla: kmd: add suspend-resume ops for SC7 support
[1] SC7 power state switches off all modules except for RAM and
    AON regions.
[2] DLA suspend operation is responsible for the following.
    - Readiness: Checks if there are no outstanding tasks in queues.
    - Suspend: Initiates power-off sequence.
[3] DLA resume operation is responsible for the following.
    - Resume: Initiates power-on sequence.
[4] In addition, each module maintains is_suspended flag to
    communicate the state of suspension.

Jira DLA-5365

Change-Id: I594a1a2731a4f28f552e4be06338fca2fa4e7ca1
Signed-off-by: Arvind M <am@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2659248
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-14 11:47:58 +00:00
Ketan Patil
36128676f5 video: tegra: host: nvdla: Cleanup GOS functionality
GOS functionality is getting deprecated, hence cleanup the corresponding
code from nvdla.

Bug 3478260
Bug 200722684

Change-Id: I5923804b817fa2ab0421b5e0fdaa1f95cf79cd2e
Signed-off-by: Ketan Patil <ketanp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2657226
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-14 11:47:58 +00:00
Amit Sharma
7a2a02ea63 nvdla: Fix CERT-C violation
- Fix following CERT-C violation by typecasting __u32 to __s32 as per
  API.
  cert_int31_c_violation: Casting "desc->import_id" from "unsigned int" to
  "int" without checking its value may result in lost or misinterpreted
  data.

Bug 3470815

Change-Id: I3599bbbbf10f28d3cefb037ca907a0b8519b2f38
Signed-off-by: Amit Sharma <amisharma@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2659347
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Arvind M <am@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-14 11:47:58 +00:00
Amit Sharma
9de4a4df0a nvdla: Use import_id for creating dma buf memory
[1]: Add import_id field in `nvdla_mem_share_handle`.
[2]: Use import_id for creating the dma buf.
[3]: Use share_id/handle as key for search/insert the vm tree.
[4]: Optimize code and avoid un-necessary dma_buf_get/put which
     become possible with [3]

Bug 3470815

Change-Id: Idb1df6ef04301e1ade4e39d3489502759e7d8462
Signed-off-by: Amit Sharma <amisharma@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2645563
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: Praveen K <kpraveen@nvidia.com>
Reviewed-by: Arvind M <am@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-14 11:47:58 +00:00
Jon Hunter
90998456e4 video: tegra: Migrate to fuse helpers
The fuse function tegra_get_sku_id() does not exist in upstream and so
when building downstream drivers against an upstream kernel, the build
fails. The tegra_get_sku_id() calls the function tegra_fuse_readl()
which is supported in upstream and exported so can be used by external
kernel modules. The implementation of the tegra_get_sku_id() has been
moved to the header file 'fuse-helpers.h' that can be used by drivers
and allow drivers to be built as external modules. Therefore, migrate
drivers to use this implementation so we can move the implementation
from the downstream kernel.

Bug 2444929

Change-Id: I5a71044a11b63becc726784b9afb31c6384cb651
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2653442
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-14 11:47:58 +00:00
Jon Hunter
66674c2da3 nvdla: Clean-up header files
Remove all unneeded headers from the NVDLA driver and only include
those that are necessary.

JIRA LS-410

Change-Id: I49cc0cab06bb079b9f4b88acba5b4075307e3af4
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2653100
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Arvind M <am@nvidia.com>
Reviewed-by: Praveen K <kpraveen@nvidia.com>
Reviewed-by: Amit Sharma (SW-TEGRA) <amisharma@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-14 11:47:58 +00:00
Jon Hunter
5a37797912 video: tegra: host: Add syncpt set minval helper
Add a new help function nvhost_syncpt_set_min_update() that sets the
syncpt minimum value and updates. By adding this helper function we
can then also add an implementation that will work with the upstream
Tegra Host1x driver.

JIRA LS-410

Change-Id: I86271418b6b78468d5f76b781b8fe8f8b9ec14c7
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2653096
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Amit Sharma (SW-TEGRA) <amisharma@nvidia.com>
Reviewed-by: Praveen K <kpraveen@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-14 11:47:58 +00:00
Jon Hunter
16b7d0418a video: tegra: nvdla: Don't use nvhost print macros
The NVDLA driver uses the nvhost_err() and nvhost_dbg_fn() macros which
simply call dev_err() and dev_info(), respectively. When compiling the
NVDLA driver against an upstream Linux kernel, nvhost_err() and
nvhost_dbg_fn() are not found and compilation fails. Fix this by
replacing nvhost_err() with either dev_err() or pr_err() and replace
nvhost_dbg_fn() with nvdla_dbg_fn().

JIRA LS-410

Change-Id: Ib89a187f330a4a80bd0b0329171a02f6336565ff
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2643161
Reviewed-by: Arvind M <am@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Amit Sharma (SW-TEGRA) <amisharma@nvidia.com>
Reviewed-by: Praveen K <kpraveen@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-14 11:47:58 +00:00
Ashish Mhetre
6905c6d0dd video: tegra: host: Remove dma-attrs
dma-attrs.h is a downstream header and it's getting removed.
So remove it's usage from drivers.

Bug 3415117

Change-Id: I0e8c0f44a42fcdd28032f44ee2ab8ceb884955bc
Signed-off-by: Ashish Mhetre <amhetre@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2627420
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-14 11:47:58 +00:00
Arvind M
2c2177fa72 nvdla: kmd: remove dependency on tegra_get_chip_id
[1] This commit makes use of platform data corresponding to matched
    DT entry to deduce chip ID equivalent.
[2] Platform data version which corresponds to firmware version
    shall help in identifying chip type.

Bug 200524968
Jira DLA-5054

Change-Id: I122ebf73c1cd8b9453704f1d0f9e6df2cce1ed1b
Signed-off-by: Arvind M <am@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2615128
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Praveen K <kpraveen@nvidia.com>
Reviewed-by: Amit Sharma (SW-TEGRA) <amisharma@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-14 11:47:58 +00:00
Arvind M
671d3cb05a Revert "tegra: host: nvdla: add T194-A01 WAR"
This reverts commit b72050fa13465850279850c8594f3be4fbf9066f.

[1] WAR is enabled through debugfs node.
[2] WAR is present only on linux and it is applicable only on T194-A01.

Considering the above, this WAR shall be removed from linux as well.
In addition, this commit removes some dependency on fuse for chip id and
revision (tegra_get_chip_id and tegra_chip_get_revision).

Bug 200524968
Jira DLA-5054

Change-Id: Ic1c73ad6d9570d39fbea0b54be4853c734630fa5
Signed-off-by: Arvind M <am@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2615127
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Anup Mahindre <amahindre@nvidia.com>
Reviewed-by: Praveen K <kpraveen@nvidia.com>
Reviewed-by: Amit Sharma (SW-TEGRA) <amisharma@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-14 11:47:58 +00:00
Kartik
cf34ba7614 video: tegra: use 4 bytes for dla fuse nvmem cell
Fuse nvmem cell read returns a 4-byte integer value.

Update nvhost_nvdla_read_chip_option_register to use int value
to read the dla_disable fuse.

Change-Id: Ieedfa3302475cae95c7c0f635f84e30e3dff8475
Signed-off-by: Kartik <kkartik@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2574252
Tested-by: Bitan Biswas <bbiswas@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-14 11:47:58 +00:00
Anup Mahindre
ede0003718 dla: kmd: Reflect updates to dla_os_interface.h
- dla_os_interface in FW was updated to switch to enums
- Reflect this update in this copy of the file

Jira DLA-3750

Change-Id: I9132f689fb82a6a89cc88e96033c486023e11a3a
Signed-off-by: Anup Mahindre <amahindre@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2559410
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: Bharat Nihalani <bnihalani@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-14 11:47:58 +00:00
Anup Mahindre
911977d5dd nvdla: kmd: Expose full set of limits for task parameters
- Certain task parameter limits were not exposed to UMD / Users
- Expose these limits and rename to provide consistent KMD interface
across linux / qnx

Jira DLA-4467

Change-Id: Ibcf1de5f4d442d9b1f3fefaf71195bc6e58fff5c
Signed-off-by: Anup Mahindre <amahindre@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2546453
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2558254
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-14 11:47:58 +00:00
Praveen K
584f8bd83d video: tegra: host: nvdla: Remove CONFIG_TEGRA_T23X_GRHOST checks
- Remove CONFIG_TEGRA_T23X_GRHOST as linux-t23x repo is merged
  to linux-nvidia repo

Bug 200751144

Change-Id: Ia2af1e924dd0033d13da9e1c7ea7ae03832ead43
Signed-off-by: Praveen K <kpraveen@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2558796
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: Amit Sharma (SW-TEGRA) <amisharma@nvidia.com>
Reviewed-by: Anup Mahindre <amahindre@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-14 11:47:58 +00:00
Praveen K
ee5079ad5b video: tegra: host: nvdla: Add Fuse check for t234
- Check for fuse register to identify
  cases where a DLA t234 instance is floorswept

Jira DLA-4785
Bug 200748079

Change-Id: I78c30440806578fea86b1c5fe6f247c8117e534f
Signed-off-by: Praveen K <kpraveen@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2554212
Reviewed-by: Amit Sharma (SW-TEGRA) <amisharma@nvidia.com>
Reviewed-by: Anup Mahindre <amahindre@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Ken Adams <kadams@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-14 11:46:41 +00:00
Arvind M
c7692f6826 nvdla: kmd: add support for stride signal action
NVDEV_FENCE_SIGNAL_STRIDE fence action translates to
ACTION_INCREMENT_SEM firmware action.

Jira DLA-4445

Change-Id: Idb537ea784614d031f66c570359dbc7dd74374af
Signed-off-by: Arvind M <am@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2548309
Reviewed-by: Amit Sharma (SW-TEGRA) <amisharma@nvidia.com>
Reviewed-by: Anup Mahindre <amahindre@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-14 11:46:41 +00:00
Arvind M
9bf2e99b45 nvdla: kmd: add bypass exec support with submit
[1] NVDLA_SUBMIT_FLAGS_BYPASS_EXEC flag allows its clients
    (UMD or nvdla_kmd_sanity) to bypass execution for a
    submission. This flag is a property of submission and
    shall directly apply on all tasks within that submit.
[2] With above flag set, it propagates information to firmware
    through task descriptor and firmware shall be responsible
    for bypassing the execution.

Jira DLA-4443

Change-Id: I70000ef486905c812fec65f265a378a99844c10a
Signed-off-by: Arvind M <am@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2544802
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Anup Mahindre <amahindre@nvidia.com>
Reviewed-by: Amit Sharma (SW-TEGRA) <amisharma@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-14 11:46:41 +00:00
Anup Mahindre
ae34c03649 video: tegra: host: nvdla: Align max buffers per task limit
- Max buffers per task limit was reduced to 384 recently as
  per all usecases from UMD
- Rename the macro to MAX_NVDLA_BUFFERS_PER_TASK to avoid
  conflict with another macro defined in nvdla_inf.h
- Reflect this change in uapi

Jira DLA-4376

Change-Id: I7d2f19901db5273ae2ae2ba7be504223c2f59e4e
Signed-off-by: Anup Mahindre <amahindre@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2517621
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-14 11:46:41 +00:00
Arvind M
c5b179e99d nvdla: kmd: synchronize access to task pool memory
[1] In the absence of synchronization to access task pool, submission may
    happen at faster rate than cleanups. This shall lead to frequent
    out-of-memory error.
[2] This commit fixes the issues through retries before throwing OOM.
    a. Sets up a communication between cleanup & submit.
    b. Retries for allocating task memory
        - Retry period:   1 ms
        - Total timeout: 10 ms

Bug 200680501

Change-Id: Iea25fbe6e7891938f6318285d4824bc1c54ddb05
Signed-off-by: Arvind M <am@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2518193
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Ken Adams <kadams@nvidia.com>
Reviewed-by: Anup Mahindre <amahindre@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-14 11:46:41 +00:00
Arvind M
da00f99aa3 nvdla: kmd: cleanup error propagation in submit
[1] Prior to this commit,
    - Errors during nvdla_fill_preactions/postactions are ignored and continued.
    - Resources (task memory, references) are not cleaned up leading to resource
        leak.
[3] This commit fixes the issue by handling resource cleanup and errors
    propagations.

Bug 200680501

Change-Id: I34d96d24e669f79cca09e38ba9ecb0ccb0c7d726
Signed-off-by: Arvind M <am@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2517596
Reviewed-by: Ken Adams <kadams@nvidia.com>
Reviewed-by: Anup Mahindre <amahindre@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-14 11:46:41 +00:00
Anup Mahindre
6242fdd281 video: tegra: host: nvdla: Add support for internal buffers
- Add buffer type field to nvdla_mem_handle
- For internal buffers, skip pin and unpin operations and pass the
offset as final adress
- Also update error handling in nvdla_map_task_memory to match with
  convention

Jira DLA-4376

Change-Id: I662da30cb9c606d2f67b792f09e026af391c89d1
Signed-off-by: Anup Mahindre <amahindre@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2503708
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Praveen K <kpraveen@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-14 11:46:41 +00:00
Anup Mahindre
65f1839c50 video: tegra: host: nvdla: Add missing U suffix
Add U suffix to fix MISRA 7.2 violation

Jira DLA-4201

Change-Id: I231e07af4fefd9a679c16a67a91a243000ba1a19
Signed-off-by: Anup Mahindre <amahindre@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2469710
(cherry picked from commit c0662c72635f51f4c8076246473d1cfd2668a05c)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2471611
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-14 11:46:41 +00:00
Anup Mahindre
37453d24df video: tegra: host: nvdla: Update KMD-FW handshake mechanism
Update handshake mechanism to signal interuppt handling complete which
avoids race condition.

Jira DLA-4201

Change-Id: I23e24a0c9b95a413e4600e24444244498cc8c414
Signed-off-by: Anup Mahindre <amahindre@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2466726
(cherry picked from commit 352216de11d9797068bcf6e3fb72fd061971e271)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2468166
GVS: Gerrit_Virtual_Submit
Reviewed-by: Praveen K <kpraveen@nvidia.com>
Reviewed-by: Amit Sharma (SW-TEGRA) <amisharma@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: Bharat Nihalani <bnihalani@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-14 11:46:41 +00:00
Ken Adams
7b57280b9b video: tegra: host: nvdla: arm timer k5.9 change
kernel api changed for arch timer

Jira DLA-3520

Change-Id: I10a056f15e5bed437c907aae6a09b01fb8a504cd
Signed-off-by: Ken Adams <kadams@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2407447
Reviewed-by: automaticguardword <automaticguardword@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-14 11:46:41 +00:00
Anup Mahindre
47e0dd7c59 video: tegra: host: dla: Use nvhost_fence APIs
The differences between sync_fence ("android sync")
and dma_fence are abstracted away by nvhost in the
nvhost_fence interface. So this change removes use
of sync_fence APIs and replaces them with nvhost_fence
APIs. The nvhost_fence APIs will further either call
sync_fence APIs or dma_fence APIs for given config.

The sync_fence APIs from android staging branch is now
moved to kernel so this change removes header from
android staging branch.

Bug 200624256

Change-Id: Ib25385aec35befd29e04481f612b43cc4159ed6e
Signed-off-by: Anup Mahindre <amahindre@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2367281
Reviewed-by: automaticguardword <automaticguardword@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: Ken Adams <kadams@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-14 11:46:41 +00:00
Arvind M
9eec5aea15 nvdla: kmd: handle {RELEASE,ALLOC}_QUEUE ioctls
[1] This commit separates the allocation and deallocation
    of mission critical resources away from open() and close()
[2] It is achieved through introduction of NVDLA_IOCTL_{ALLOC,RELEASE}
    IOCTLs.
[3] nvdla_buffer_* APIs introduced to facilitate easier split.

Bug 200628173

Change-Id: I3fb07ecaff69c62ec5eb9e5bea39b07ae1624240
Signed-off-by: Arvind M <am@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2403689
Reviewed-by: automaticguardword <automaticguardword@nvidia.com>
Reviewed-by: Anup Mahindre <amahindre@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-14 11:46:41 +00:00
Shridhar Rasal
ca570376ea video: tegra: host: nvdla: restore dma mask to 39
This reverts commit d992031895beef8ba8032b41834b2202b76de561.

Reason for revert: GP CMOD fix is available for 2 OP's issue

Bug 200640073
Bug 200642227

Change-Id: Ic6dba0e851cb03f81b32a63d97252a2e41c3bfb0
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2394644
Reviewed-by: automaticguardword <automaticguardword@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: Amit Sharma (SW-TEGRA) <amisharma@nvidia.com>
Reviewed-by: Praveen K <kpraveen@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-14 11:46:41 +00:00
Bharat Nihalani
c9b67234bc Revert "Revert "video: tegra: host: nvdla: set dma mask to 32 for vdk""
This reverts commit be12492bb28a0d953a5f71abad73fe81e00fafee.

Reason for revert: NET27 update is causing DLA GP_BDMA tests to fail.
The issue is identified to be in CMOD patch from http://nvbugs/200640073/27.
Until CMOD issue is fixed, this kernel change also needs to be reverted.

Bug 200642227

Change-Id: I0c83fed7cf2ad415b6922d446553d9eb342e1df5
Signed-off-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2389505
Reviewed-by: automaticguardword <automaticguardword@nvidia.com>
Reviewed-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-14 11:46:41 +00:00
Shridhar Rasal
4b9266848d Revert "video: tegra: host: nvdla: set dma mask to 32 for vdk"
This reverts commit 7bfaa9450e91436f7fbede5b1848e7cd26c6ad73.
CMOD fix available for GP high register address issue, so
update dma set mask to 39

Bug 200640073
Bug 200620406

Change-Id: Ib8f17b6ce4b126895d464cb088f3a999ac12e133
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2386005
Reviewed-by: automaticguardword <automaticguardword@nvidia.com>
Reviewed-by: Praveen K <kpraveen@nvidia.com>
Reviewed-by: Amit Sharma (SW-TEGRA) <amisharma@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-14 11:46:41 +00:00
Shridhar Rasal
86c508b59b video: tegra: host: nvdla: set dma mask to 32 for vdk
DLA t23x vdk doesn't work for IOVA higher than 32 address range,
so cap DMA available range to 32 for vdk plarform.

This is temp fix until CMOD fix available.

Bug 200637192
Jira DLA-3510

Change-Id: Ic5627e4aeb154e10494a3d71b63c3baa4d9eab81
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2382424
Reviewed-by: Praveen K <kpraveen@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-14 11:46:41 +00:00
Anup Mahindre
86fbda4e99 video: tegra: host: nvdla: Use vfree for v*alloced memory
A previous change shifted from k*alloc to v*alloc as physically
contiguos memory was not really required. A kfree was left out in error
paths. Fix this problem by using vfree instead.

Bug 200621525

Change-Id: I1074d84a2366cc52d172b5817de2d7df60a23028
Signed-off-by: Anup Mahindre <amahindre@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2373692
Reviewed-by: automaticguardword <automaticguardword@nvidia.com>
Reviewed-by: Ken Adams <kadams@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-14 11:46:41 +00:00
Santosh B S
b57a9dee10 video: tegra: host: adapting to icc framework
Code changes to use interconnect framework APIs

Jira HOSTX-2056

Change-Id: Ic453155b1889c7aa9954c1c3d20dbdf8ecb4cf5c
Signed-off-by: Santosh B S <santoshb@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2368350
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Arto Merilainen <amerilainen@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-14 11:46:41 +00:00
Anup Mahindre
74d694cade video: tegra: host: nvdla: Fix MISRA 10.3 violation
The constants defined in dla_*_fw_version.h have UL suffix which
translates to 64 bit unsigned integer on 64 bit architectures and 32
bit unsigned integers on 32 bit architectures such as falcon.
To be MISRA rule 10.3 compliant on both, use explicit typecast to
uint32_t which should work across both.

This change does not fix any violations in here but reflects an
update to this file that helps fix 10.3 violation in QNX KMD.

Change-Id: Ia47c2f97ee8c18bfeea071861d5dbab15293551a
Signed-off-by: Anup Mahindre <amahindre@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-t23x/+/2369151
Tested-by: Bharat Nihalani <bnihalani@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-14 11:46:41 +00:00
Anup Mahindre
4827ba8442 video: tegra: host: nvdla: Fix MISRA 10.3 violation
The constants defined in dla_t19x_fw_version.h have UL suffix which
translates to 64 bit unsigned integer on 64 bit architectures and 32
bit unsigned integers on 32 bit architectures such as falcon.
To be MISRA rule 10.3 compliant on both, use explicit typecast to
uint32_t which should work across both.

This change does not fix any violations in here but reflects an
update to this file that helps fix 10.3 violation in QNX KMD.

Change-Id: I18102f037f15568954dfe47467e20058308b0405
Signed-off-by: Anup Mahindre <amahindre@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2367282
Reviewed-by: automaticguardword <automaticguardword@nvidia.com>
Reviewed-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-by: Amit Sharma (SW-TEGRA) <amisharma@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-14 11:46:41 +00:00
Ankit Patel
68df82f0f7 video: tegra: host: free channel on job completion
This issue mostly seen in T210 when resource policy for modules are set to
RESOURCE_PER_DEVICE and test with kernel_submit regression, Then it generally
leads to a crash in second or forthcoming iteration of kernel_submit.

Observation:

After completion of channel's job, module gets suspended without freeing the
channel, And when module resume, it's start submiting job on the channel's
syncpoint which is already freed by others.

This scenario occurs in two cases with VIC module,

   1 A user application(Ex: nvgpu) freed the syncpoint and VIC module is
     in suspend, Now when module will resume it will expect same syncpt
     active and belongs to it.

   2 In between of 1st possibility If other module(Ex: nvenc) gets the
     syncpoint from free list when the first module(VIC) is suspended,
     Now when first module(VIC) resume and start submiting job on the same
     syncpoint which is already acquired by other module.

Changes made :
	o Now, Channel will be freed on channel dma completion
	o Channel will be re-acquire on every submit
	o Syncpoint will not be freed when channel gets free.
	o Syncpoint will be acquire once by user space and will be
	freed when use space release the device
	o Now, Syncpoints gets mark used and unused using chid
	o Set resource policy to RESOURCE_PER_DEVICE for msenc, nvdec,
	nvjpg and vic

Bug 200582662

Change-Id: Ief7658974cbd958f883e7b83add5902f766826df
Signed-off-by: Ankit Patel <anpatel@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2352726
(cherry picked from commit 745c3c8d46c23353a81e5e6035af3ed3848b02eb)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2366098
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-14 11:46:41 +00:00
Mikko Perttunen
bb9c174767 video: tegra: host: Cleanup for Makefile and configuration
To allow building nvhost as a module, clean up the Makefile,
Kconfig and config symbol references:

* Add most stuff into the nvhost-y/m object list, rather
  than having separate targets.
* Make Kconfig symbols that are not the root GRHOST symbol
  bool rather than tristate.
* Update most references to config symbols to use
  IS_ENABLED rather than defined.
* While at it, make pre-T234 support be built in always.

Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Change-Id: I9eded315067239da7dfd3677a69e7b707cfdc127
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2363201
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-14 11:46:41 +00:00
Shridhar Rasal
36f80259cc video: tegra: host: nvdla: add DLA fw version check
- update DLA1 FW version for multichip support
- include DLA2 driver's build path
- For firmware verification with multi-chip support,
  - Need to get way to distinuguish chip.
  - Use tegra_get_chip_id() is not recommended practice
  - Alternately, using nvhost_device_data's "version" param which distinguishes
    chip specific data at compile time
  - So encode fw version into "version" param
  - include firmware version header to encode
  - Inline function can't be used at compile to encode "version" param
    through macro

Jira DLA-3182

Change-Id: Id958133739acba583690b9fdf440fa1729b2b51e
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2359966
Tested-by: Bharat Nihalani <bnihalani@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-14 11:46:41 +00:00
Anup Mahindre
ebbbba1533 video: tegra: host: nvdla: Avoid contiguos alloc
Avoid requesting physically contiguos allocation where it is not
required since this can fail in case of fragementation.

Bug 200621525

Change-Id: Icdf5f88b5336950212c62f8a7f0469b7b16e0ac5
Signed-off-by: Anup Mahindre <amahindre@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2360778
Tested-by: Bharat Nihalani <bnihalani@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: Ken Adams <kadams@nvidia.com>
Reviewed-by: Mitch Harwell <mharwell@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-14 11:46:41 +00:00
Mikko Perttunen
e36f30ec5b video: tegra: host: Separate GoS code from syncpoint shim code
GoS and syncpoint shim support are not really related, so separate them out
and make GoS support optional via config symbol.

Jira HOSTX-2016

Change-Id: I25990f34e39db7dddf3a2e4b06917e4c458230a7
Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2351143
Reviewed-by: automaticguardword <automaticguardword@nvidia.com>
Reviewed-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-14 11:46:41 +00:00
Shridhar Rasal
540da62cf1 video: tegra: host: nvdla: add DLA2 fw version check
- Adds DLA2 firmware version interface for version
  verification
- Include DLA driver's t23x build path
- For firmware verification with multi-chip support,
  - Use nvhost_device_data's "version" param which distinguishes
    chip specific data at compile time
  - So encode fw version into "version" param.
- Inline function can't be used at compile so use available macro

Jira DLA-3182

Change-Id: Id9185c98ae924faea7a16d5f88d30c9b183c94f2
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-t23x/+/2359968
Reviewed-by: Praveen K <kpraveen@nvidia.com>
Reviewed-by: Amit Sharma (SW-TEGRA) <amisharma@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: Bharat Nihalani <bnihalani@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-14 11:46:41 +00:00
Bitan Biswas
4176935c35 kernel: nvidia: use k5.4 fuse APIs
Selected k4.14 fuse API mapping to k5.4 fuse API used is:
	tegra_read_chipid()		->	tegra_read_chipid()
	enum tegra_chipid tegra_get_chipid() ->	u8 tegra_get_chip_id()
	u8 tegra_get_chip_id()		->	u8 tegra_get_chip_id()
	tegra_get_platform()		->	tegra_get_platform()
	tegra_hidrev_get_chipid(chipid) ->	u8 tegra_get_chip_id()
	enum tegra_revision tegra_chip_get_revision() ->
				enum tegra_revision tegra_chip_get_revision()
		(Note: chip specific revision enum removed in k5.4,
		hence chip_id and revision comparison needed now.)
	u32 tegra_get_sku_id()		->	u32 tegra_get_sku_id()

Below downstream fuse data types are no longer used in k5.4:
	enum tegra_chipid

K5.4 specific T210b01 check is done using is_t210b01_sku().

bug 200591811

Change-Id: I2a259669802cb22bccafd435fa9fb7027ee0a9d3
Signed-off-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2335855
Reviewed-by: automaticguardword <automaticguardword@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-14 11:46:41 +00:00
Shridhar Rasal
e5d321cc10 video: tegra: host: nvdla: fix fw reloading
- Engine hang like issue causes device power reference
  count to go out of sync
- So forcefully put device into idle before firmware reload
- Reset device after firmware reload to make sure engine
  in clean state

Jira DLA-3147

Change-Id: I22c825065cb9157c85b8fd5ad4fcaac764383a9f
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2329686
Reviewed-by: automaticguardword <automaticguardword@nvidia.com>
Reviewed-by: Ken Adams <kadams@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-14 11:46:41 +00:00
Sudeshna
e793ebb2f8 video: tegra: nvdla: Bring Kernel Mode Driver up for Orin
Add new device node support for NVDLA in Kernel Mode Driver.

Change-Id: I050b5cbfd83b366b848bc92628deed83d43f0896
Jira: DLA-3099
Signed-off-by: Sudeshna <sguha@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2322119
Reviewed-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-14 11:46:41 +00:00
Shridhar Rasal
bd8b6299e5 video: tegra: host: nvdla: update dma mask
- update dma mask to set to 39 bit for allow dma address as per POR.

Bug 200565560

Change-Id: I86fd470b46089347958c44174ed535a6a55ef2f9
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2283414
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Anup Mahindre <amahindre@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: automaticguardword <automaticguardword@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-14 11:46:41 +00:00
Shridhar Rasal
aaf11d61f1 video: tegra: host: nvdla: set EMC rate on device open
Currently,
 - On device node close, nvhost ACM updates clock rate
   to default rate.
 - DLA default rate is set to UINT_MAX.
 - These causes max rate requests from DLA on device node close.

Fix,
 - Set default rate for DLA as zero. On device node close, aggregrate
   requests capped.
 - On device node open, keep EMC requests to max.
   so DLA inference doesn't impact for perf.

Bug 2769574

Change-Id: Icdaa8943ee143a5fa8c7310db9b7fac636c5be50
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Signed-off-by: nmalwade <nmalwade@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2255718
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-14 11:46:41 +00:00
Amit Sharma
70734cedf3 host: nvdla: Update dla_os_interface header
In order to make DLA Firmware code MISRA-C compliant there are
some changes in dla_os_interface.h to correctly align the data types.
Therefore update the KMD dla_os_interface.h.

Jira DLA-2716

Change-Id: Id519fb99d8a779d8363fab7140fb0b6a5142b00e
Signed-off-by: Amit Sharma <amisharma@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2241429
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-14 11:46:41 +00:00
Gunjan Mehta
59fe8f5aef dla: linux: add speculation barrieir in linux driver
Bug 200483495

Add speculation barriers for if and for loops to prevent spectre variant
1-S type attacks

Change-Id: If44a2c96047899accecf9604f3893daf681656c7
Signed-off-by: Gunjan Mehta <gmehta@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2230039
Reviewed-by: Arvind M <am@nvidia.com>
Tested-by: Arvind M <am@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-14 11:46:41 +00:00
Arvind M
31a4285b17 video: tegra: host: pin with specific permission
[1] Facilitate pinning of buffer with user requested access
    permission
[2] This feature allows to restrict access to buffers shared
    with the device.

Jira DLA-2502

Change-Id: I175ad10922480689de57eb832040a7d59b29b9bd
Signed-off-by: Arvind M <am@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2209415
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Ken Adams <kadams@nvidia.com>
Reviewed-by: Prashant Gaikwad <pgaikwad@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-14 11:46:41 +00:00