Commit Graph

85 Commits

Author SHA1 Message Date
Joshua Cha
bb2c8b1fc4 nvsciipc: increase inter-process channel count
default DriveOS inter-process endpoint count is about 1300 for now.
DriveAV requirement needs 8192 inter-process channels
(=16384 endpoints) except for DriveOS system usage.
Hence increased the number of inter-process endpoints by 2048
more in considering margin.

Bug 5224327

Change-Id: I47f5a67f9ece917ed5fe873be2e188f128d63961
Signed-off-by: Joshua Cha <joshuac@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3361956
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Simon Je <sje@nvidia.com>
2025-07-24 10:20:35 +00:00
Ketan Patil
c85efbe2a7 video: tegra: nvmap: Change data type of addr to u64
In android ATV build, userspace is 32 bit while kernel is 64 bit. Hence
value of NVMAP_IOC_CACHE differs on userspace and kernel space side,
as we are using unsigned long data type for addr field. The unsigned
long resolves to 32 bit in userspace while 64 bit in kernel space. Use
u64 data type which will always resolves to 64 bit.

Bug 5111364

Change-Id: I392146e71f7d65ba047ee2dda0d69dd202370968
Signed-off-by: Ketan Patil <ketanp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3348602
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Pritesh Raithatha <praithatha@nvidia.com>
2025-07-24 10:19:19 +00:00
Joshua Cha
915ce6717f nvsciipc: set nvsciipc max endpoint count
validate nvsciipc max endpoint count.
validate set_db entry pointer.

JIRA NVIPC-3506

Change-Id: Id29531af24367de952b2dccebe23515ad52bfd33
Signed-off-by: Joshua Cha <joshuac@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3322061
Reviewed-by: Suneel Kumar Pemmineti <spemmineti@nvidia.com>
Reviewed-by: Simon Je <sje@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:17 +00:00
Joshua Cha
bb01f4bcf7 nvsciipc: removed unused CMDs and structure
removed NVIPC_IVC_IOCTL_NOTIFY_REMOTE and NVIPC_IVC_IOCTL_GET_VMID.
removed nvsciipc_get_db_by_id structure because they're not
used by stakeholders any more.
They're dead code.

JIRA NVIPC-3488

Change-Id: I4fae43456cf96d37e4502042aef9c67aa167db9d
Signed-off-by: Joshua Cha <joshuac@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3322035
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:17 +00:00
Joshua Cha
e8d5a43b9f nvsciipc: add endpoint mutex
add endpoint mutex to nvsciipc KMD

JIRA NVIPC-3427

Change-Id: I1644213f59d24da4c4eeb693fa3016904388a26b
Signed-off-by: Joshua Cha <joshuac@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3309493
Reviewed-by: Suneel Kumar Pemmineti <spemmineti@nvidia.com>
Reviewed-by: Simon Je <sje@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:17 +00:00
Suneel Kumar Pemmineti
04ccb5c0c3 nvsciipc: enable endpoint security
- allow ioctl access if UID looked up is one of process UID
  or SGIDs.
- removed legacy codes
- set UID of set DB ioctl using sysfs

JIRA: NVIPC-2817

Change-Id: Ic910b5bdbb362e9cda0cc3af4bcd9c1642725a25
Signed-off-by: Suneel Kumar Pemmineti <spemmineti@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3225830
Tested-by: Joshua Cha <joshuac@nvidia.com>
Reviewed-by: Simon Je <sje@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:16 +00:00
Manish Bhardwaj
3ccccf0df8 nvidia-oot: mempool driver header file cert & misra error fixes
using this patch fixing below cert & misra errors:-
- misra_c_2012_rule_21_2_violation: "__UAPI_NVHVIVC_MEMPOOL_IOCTL_H__", an identifier or macro name beginning with an underscore, shall not be declared.
- misra_c_2012_rule_21_1_violation: Defining or undefining a reserved name "__UAPI_NVHVIVC_MEMPOOL_IOCTL_H__", which is an identifier or macro name beginning with an underscore.
- cert_dcl37_c_violation: The reserved identifier "__UAPI_NVHVIVC_MEMPOOL_IOCTL_H__", which is reserved for use as identifiers with file scope in both the ordinary and tag name spaces, is defined.

JIRA ESLC-8398

Change-Id: I82aca2a1c87ee4d2a145671ea0284fe739cb9b16
Signed-off-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3297795
Reviewed-by: Suresh Venkatachalam <skathirampat@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Sumeet Gupta <sumeetg@nvidia.com>
2025-07-24 10:19:15 +00:00
Manish Bhardwaj
f204e3ae77 nvidia-oot: vcpu yield driver cert & misra fixes
using this patch fixing below cert & misra errors:-
- cert_dcl37_c_violation: The reserved identifier
  "_UAPI_TEGRA_HV_VCPU_YIELD_IOCTL_H_", which is reserved for use as
  identifiers with file scope in both the ordinary and tag name spaces,
  is defined.
- misra_c_2012_rule_21_1_violation: Defining or undefining a reserved
  name "_UAPI_TEGRA_HV_VCPU_YIELD_IOCTL_H_", which is an identifier or
  macro name beginning with an underscore.
- misra_c_2012_rule_21_2_violation: "_UAPI_TEGRA_HV_VCPU_YIELD_IOCTL_H_",
  an identifier or macro name beginning with an underscore, shall not be
  declared.

JIRA ESLC-8378

Change-Id: I1d8d5f437793a0b964b1ed195f70ab84c6104895
Signed-off-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3301267
Reviewed-by: Sumeet Gupta <sumeetg@nvidia.com>
Reviewed-by: Suresh Venkatachalam <skathirampat@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:15 +00:00
Suneel Kumar Pemmineti
38d739c860 nvsciipc: Add UID member to Config structure
- Added UID member to nvsciipc_config_entry data
structure. this is needed for implementing
test_nvsciipc_cfgblob in linux.
- removed static from ioctl function to attach eBPF program
- add error-injection.h and ALLOW_ERROR_INJECTION macro to ioctl
  to use bpf_override_return()

JIRA NVIPC-2817

Change-Id: Ic27156e321368041f41fbabff9e6375140fe1d0e
Signed-off-by: Suneel Kumar Pemmineti <spemmineti@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3301786
Tested-by: Joshua Cha <joshuac@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Simon Je <sje@nvidia.com>
2025-07-24 10:19:15 +00:00
Suneel Kumar Pemmineti
63a1d3e6e0 nvsciipc: Add nvsciipc_ioctl_get_db_by_idx
- Added nvsciipc_ioctl_get_db_by_idx to retrieve
the endpoint DB entry using index

JIRA: NVIPC-2818
Change-Id: I5651cf29b11dad0ff505f5f497a896572b893e94
Signed-off-by: Suneel Kumar Pemmineti <spemmineti@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3297838
Reviewed-by: Simon Je <sje@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:15 +00:00
N V S Abhishek
2400426064 nvmap: Remove NVMAP_IOC_CACHE_LIST ioctl from nvmap
Remove NVMAP_IOC_CACHE_LIST ioctl from nvmap. As there
is no implementation for it in nvmap driver.
Also fix copyright info in uapi/linux/nvmap.h.

Jira TMM-5878
Bug 4590641

Change-Id: I5d890c38145811e70aee3ccdaff3e0e66c95c50b
Signed-off-by: N V S Abhishek <nabhishek@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3279699
Reviewed-by: Pritesh Raithatha <praithatha@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Ketan Patil <ketanp@nvidia.com>
2025-07-24 10:19:14 +00:00
Ketan Patil
cd0e863f07 video: tegra: nvmap: Cleanup NVMAP_IOC_SET_TAG_LABEL ioctl
NvRmMemSetAllocationTagLabel is not being used by any of clients. Also,
this API does not have any SHR or JAMA requirement. Hence we are
removing support for this API on linux to have a cleaner and uniform
ICD. Remove the corresponding ioctl code from nvmap.

Bug 4980808

Change-Id: I74676e07b2c617ad6554b4538ce27ab52176e5b9
Signed-off-by: Ketan Patil <ketanp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3288404
Reviewed-by: N V S Abhishek <nabhishek@nvidia.com>
Reviewed-by: Pritesh Raithatha <praithatha@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:13 +00:00
omar
79633ca404 drivers: pva: add fence update method
Fence update method is defined as increment or set.
when method ios set, the fence value is set to the value
requested.

This applies only to semaphores.

Bug

Change-Id: I1c744826868dde7950c9482ae9a0c601e63a63a1
Signed-off-by: omar <onemri@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3231374
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Ashwin Rao <ashwinr@nvidia.com>
Tested-by: Ashwin Rao <ashwinr@nvidia.com>
Reviewed-by: Sreehari Mohan <sreeharim@nvidia.com>
Tested-by: Sreehari Mohan <sreeharim@nvidia.com>
2025-07-24 10:19:10 +00:00
Praveen James
55847ce7a0 fsicom: Add support for fsi core2 and core3
fsicom driver updated to support fsicom
channels without notification. With notification
disabled channels fsicom can support all four
cores of FSI

Bug 4805453
DOS-SHR-10636

Change-Id: I6cf4dd36c1570505dbcf582499189bd974ed095f
Signed-off-by: Praveen James <pjames@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3197598
(cherry picked from commit 1dbdf63d67b102908c845671d18ddf4d14ae498f)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3206768
Reviewed-by: Kovid Kumar <kovidk@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3217458
2025-07-24 10:19:10 +00:00
Ketan Patil
8c52af9b59 video: tegra: nvmap: Add hugetlbfs support
- For NvRmHeap_GpuMem, we are switching from a carveout to huge pages
obtained from hugetlbfs.
- Allocate a handle from VA using get_user_pages, when allocation is
requested from GPU heap.
- Introduce a new field to indicate that the pages are allocated from
hugetlbfs. This field will be useful while returning the correct heap
while querying the handle params for a handle which was created using
hugetlbfs.
- Update the query heap API for GpuMem heap to return the huge pages
memory values from meminfo.

Bug 4510173

Change-Id: I0dbef4c4e95969f8e3975a6dc58f10255db0635e
Signed-off-by: Ketan Patil <ketanp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3174720
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-08-03 04:57:32 -07:00
Jon Hunter
d8bc5883f3 drivers: pva: Fix build for Linux v6.11
In Linux v6.11, commit 1a251f52cfdc ("minmax: make generic MIN() and
MAX() macros available everywhere") causes the PVA driver build to fail
with the following error:

 include/uapi/linux/nvpva_ioctl.h:601: error: "MAX" redefined [-Werror]
 601 | #define MAX(a, b) ((a) > (b) ? (a) : (b))

Fix this by add guards around the definition of 'MAX' in the
nvpva_ioctl.h file.

Bug 4749580

Change-Id: If7960e0617e659f4e264b1e638e9f8c98a027a73
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3184093
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Omar Nemri <onemri@nvidia.com>
2024-07-31 08:06:29 -07:00
Omar Nemri
baee98bcb9 drivers:pva: support up to 96 descriptors for MISR
Jira PVAAS-15361

Change-Id: Ic1c7b0396304a858c478292533ff3d1d05871741
Signed-off-by: omar <onemri@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3158078
Reviewed-by: Amruta Sai Anusha Bhamidipati <abhamidipati@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2024-06-23 19:52:45 -07:00
Yash Bhatt
6200c05e7d video: tegra: nvmap: Deprecate nvmap_ioctl_get_heap_size
Remove function nvmap_ioctl_get_heap_size from nvmap, as the ioctl NVMAP_IOC_GET_HEAP_SIZE is being deprecated and its functionality is being replaced with NVMAP_IOC_QUERY_HEAP_PARAMS.

Bug 4479027

Change-Id: I8a60810ff8b474f32413c9afe2ba3a0d7336a4d0
Signed-off-by: Yash Bhatt <ybhatt@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3110262
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Reviewed-by: Ketan Patil <ketanp@nvidia.com>
Reviewed-by: Pritesh Raithatha <praithatha@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-04-08 20:59:42 -07:00
Joshua Cha
21a661c58f nvsciipc: fix mixed license
Bug 4405013

Change-Id: I4c37c89b7dcc4c25e0b4e568b8d68d1a73c424f7
Signed-off-by: Joshua Cha <joshuac@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3028570
Reviewed-by: Kurt Yi <kyi@nvidia.com>
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-12-07 08:13:27 -08:00
Ketan Patil
343f9e764f video: tegra: nvmap: Add NUMA aware query heap API
Add a new API to query the heap params for an input heap present on the
given input numa node. e.g. User may specify to query heap information
of GPU carveout on numa node 0 or numa node 1 etc.

Bug 4231517

Change-Id: I9622828b6a28984564b4c7f17b88b4d38bbd4684
Signed-off-by: Ketan Patil <ketanp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3010795
Reviewed-by: Pritesh Raithatha <praithatha@nvidia.com>
Reviewed-by: Krishna Reddy <vdumpa@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-11-15 09:34:12 -08:00
Joshua Cha
236a2f09ee nvidia-oot: add IPA type info of IVC channel
Bug 4293372

Signed-off-by: Joshua Cha <joshuac@nvidia.com>
Change-Id: I5c0cf142afdac9a6a1108a38513af6861272a8e9
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2995973
(cherry picked from commit ebedbb2492ea13211b53a48655e9312ba6b255dd)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3004066
Reviewed-by: Kurt Yi <kyi@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-11-02 18:13:33 -07:00
abhinayaa
40bb8da496 drivers: pva: Update HW SEQ config and ADB size
- Update HW SEQ configuration for next generation of PVA.
- Add additional HW SEQ validation checks required for next
  generation of PVA.
- Update ADB size for T264

Jira PVAAS-12709

Change-Id: I8dd362f2f517bc20899d51a4bb95b8077f4c636b
Signed-off-by: abhinayaa <abhinayaa@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2891026
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2999160
Reviewed-by: Amruta Sai Anusha Bhamidipati <abhamidipati@nvidia.com>
Reviewed-by: Omar Nemri <onemri@nvidia.com>
Tested-by: Omar Nemri <onemri@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-10-20 01:26:11 -07:00
abhinayaa
97f5252632 drivers: pva: Update channel and descriptor limit
Update code to account for t26x channel and descriptor limits.

Also, the reserved descriptors for all generations of PVA HW are
at indices 60-63. Update KMD checks to ensure the reserved descriptors
are never patched, and are not linked to either during SW sequencing
or HW sequencing.

Jira PVAAS-13055

Change-Id: I276490d51d65648a406fabed06c47e45d9e6978a
Signed-off-by: abhinayaa <abhinayaa@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2908053
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2999158
Reviewed-by: Amruta Sai Anusha Bhamidipati <abhamidipati@nvidia.com>
Reviewed-by: Omar Nemri <onemri@nvidia.com>
Tested-by: Omar Nemri <onemri@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-10-20 01:26:00 -07:00
Krish Agarwal
6c013840f0 drivers: pva: add support for exe_id2
- update submission path to accept exe_id2
 - submit additional bin info to FW

JIRA PVAAS-12334

Change-Id: Ie7b314c4cf76ecfdabd40de05a9b9f1e3d3cc049
Signed-off-by: Krish Agarwal <krisha@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2860864
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2999153
Reviewed-by: Amruta Sai Anusha Bhamidipati <abhamidipati@nvidia.com>
Reviewed-by: Omar Nemri <onemri@nvidia.com>
Tested-by: Omar Nemri <onemri@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-10-20 01:25:35 -07:00
Krish Agarwal
e4fc743b3b drivers: pva: rename exe_id to exe_id1
- rename exe_id in pva_submit_task to exe_id1
 - rename exe_id in nvpva_ioctl_task to exe_id1
JIRA PVAAS-12334

Change-Id: Ieba0b6b8ac3e8af8ab3340dadabdfe64df4831ea
Signed-off-by: Krish Agarwal <krisha@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2874243
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2999152
Reviewed-by: Amruta Sai Anusha Bhamidipati <abhamidipati@nvidia.com>
Reviewed-by: Omar Nemri <onemri@nvidia.com>
Tested-by: Omar Nemri <onemri@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-10-20 01:25:30 -07:00
pshaw
01ecacf7b4 fsicom: add fsicom multi core support
- smmu and hsp support added for fsicom multi core
  feature in fsicom kernel driver
- probe, suspend and resume will be called for smmu_inst
  0 only as it will have single dev node for comm.
- mailbox 2,5 and 1,4 is used for TX and RX comm. respectively
  with FSI

Jira SS-5744

Change-Id: I859d5945853195ba76996a8c36ca19efd9c4409f
Signed-off-by: pshaw <pshaw@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2952268
Reviewed-by: Praveen James <pjames@nvidia.com>
Reviewed-by: Sumeet Gupta <sumeetg@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-08-27 21:50:21 -07:00
omar nemri
8e837b02d4 drivers: pva: add buffer serial id for fences
in order to support unique identification of semaphores
while tracing across VMs, a unique identifier is added
during buffer pin and is emitted in traces.

Bug 4149342

Change-Id: I88e53be197f5354834795aab197e8de39535ac5c
Signed-off-by: omar nemri <onemri@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2938555
Reviewed-by: Nikita Chumakov <nchumakov@nvidia.com>
Reviewed-by: Oleg Sikorskiy <osikorskiy@nvidia.com>
Reviewed-by: Amruta Sai Anusha Bhamidipati <abhamidipati@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-07-21 12:09:54 -07:00
Ketan Patil
01db38f08e video: tegra: nvmap: Add support for Serial Id feature
Add support for Serial Id feature which will be used by Nsight for
buffer tracking purpose. This feature expects a unique serial id per
buffer even if it is shared across multiple client processes.
Add following code:
- Create a new global counter field for serial id in nvmap device.
Initialize it to 0 when nvmap device is initialized.
- Introduce a new field for serial_id in nvmap_handle struct.
- When nvmap_handle is created, assign it's serial_id field with global
counter's value, and increment global counter.
- During NvRmMemQueryHandleParameters return this serial_id associated
with the handle.
- Do not decrement counter for serial_id even after freeing the handle.

Bug 4138373

Change-Id: Ic1fe22b082eefb352986f8fa44d4c38d186a366f
Signed-off-by: Ketan Patil <ketanp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2918510
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-06-10 19:46:37 -07:00
omar
cde5ffd7c5 drivers: pva: add stream and prog ID
Add stream_id and prog_id to the task submit struct.
This information can then be passed to profilers to
track which events belong to which tasks and processes.
This can be either via eventlib or ftrace.

Bug 4080222

Change-Id: I6e5d80868022b0beffd2b11330b93ab302c96ee5
Signed-off-by: omar <onemri@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2911560
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-05-30 12:18:40 -07:00
brucex
ced8d91df7 tegra_hv_vcpu_yield_ioctl: Fix header #ifdef
Incorrect header protection led to build error with clang (used to build
android common kernel)

Bug 3974840

Signed-off-by: Bruce Xu <brucex@nvidia.com>
Change-Id: I3a6ba014fbad24561ef5f46b313596876c227a49
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2895935
(cherry picked from commit 49dc6cf08e312d1bb0900ea890e22cd931c25f39)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2859501
Reviewed-by: Shardar Mohammed <smohammed@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Tested-by: Shardar Mohammed <smohammed@nvidia.com>
2023-05-29 03:55:41 -07:00
Laxman Dewangan
67d0b7dd96 pva: Drop license paragraphs
The pva files are having the SPDX license forma. Hence,
it is not required to have the license paragraphs.

Remove the non-required license paragraphs details.

Bug 4038415

Change-Id: I4d039b7d8d9ef6eea5ba53ead8c5d1e3bda223b9
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2903864
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-05-15 01:19:53 -07:00
Ketan Patil
30ebc1a639 video: tegra: nvmap: Add support for querying granule size
Add support for querying the granule size using NvRmMemQueryHeapParams.
In case of compression carveout it returns granule size in which memory
is allocated while in case of IOVMM heap, it returns PAGE_SIZE.

Bug 3956637

Change-Id: I3ec4f5388caecbca0a728e1878007f6b3d4320ef
Signed-off-by: Ketan Patil <ketanp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2899867
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Pritesh Raithatha <praithatha@nvidia.com>
Reviewed-by: Krishna Reddy <vdumpa@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-05-15 01:18:06 -07:00
omar
76961fd57b drivers: add pva driver to nvidia-oot
- copy nvpva driver and headers to nvidia-oot directory.
- remove the file copy operation as part of the build process.

Bug 4097111

Change-Id: If040773833405f3941505cb8a2ec3440e0a84c92
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2903052
Reviewed-by: Omar Nemri <onemri@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Tested-by: Omar Nemri <onemri@nvidia.com>
2023-05-13 02:04:09 -07:00
Laxman Dewangan
e8b7a5ca26 nvmap: Use SPDX license GPL 2.0 format
Use SPDX license GPL-V2.0 format and change Nvidia
copyright year to include 2023.

Bug 4078035

Change-Id: I4db6577ddb806690f6ec04f5eaf1364578102d14
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2890635
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
Reviewed-by: Ketan Patil <ketanp@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-04-22 09:59:20 -07:00
Laxman Dewangan
5535897d3d include: Use SPDX license GPL 2.0 format
Use SPDX license GPL-V2.0 format and change Nvidia
copyright year to include 2023.

Bug 4078035

Change-Id: I73edd8699dc7298ecb6efc991bc74c1b1e089d0d
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2891236
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-04-21 11:42:53 -07:00
Laxman Dewangan
cafcc24336 include: nvhost: Use SPDX license GPL 2.0 format
Use SPDX license GPL-V2.0 format and change Nvidia
copyright year to include 2023.

Bug 4078035

Change-Id: I0baf1b4d579ac7414e0936c99ba0861abee241e6
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2891215
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-04-21 11:42:48 -07:00
Laxman Dewangan
c526d32af3 nvdla: Use SPDX license GPL 2.0 format
Use SPDX license GPL-V2.0 format and change Nvidia
copyright year to include 2023.

Bug 4078035

Change-Id: Ie5d525f06dde5b3e3d332caff3d135198059d325
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2890634
Reviewed-by: Amit Sharma (SW-TEGRA) <amisharma@nvidia.com>
Reviewed-by: Ken Adams <kadams@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-04-21 11:40:49 -07:00
Ketan Patil
594e39e498 video: tegra: nvmap: Add NUMA support in nvmap
In NUMA system, user can request nvmap to allocate from any particular
node using NvRmMem APIs. Add code to request allocation from such
requested node. While allocating pages from page pool, check if those
pages belong to requested NUMA node. In some cases, we may not need to
use NUMA support e.g. in color pages allocation code, we don't need to
use NUMA, as page coloring is needed only for t19x chips.

JIRA TMM-5287
Bug 4043165

Change-Id: If8043278122068773a802d83723d287d32914e14
Signed-off-by: Ketan Patil <ketanp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2889707
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-04-19 10:44:34 -07:00
Laxman Dewangan
6449938f8d include: uapi: Add nvhost_ioctl.h from kernel/nvidia
Copy header file uapi/linux/nvhost_ioctl.h from kernel/nvidia
to avoid the build time copy of this header and get rid of
dependency of kernel/nvidia.

Bug 4038415

Change-Id: Ie6c01cd040b9918ba17f23c4050c2f9fe42c69ef
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2888617
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-04-15 08:52:55 -07:00
Akshata Bhat
5641042df8 nvdla: kmd: Update max output status count
+ Update needed to enable NvSciSync based task
status support for NvMediaDla
+ Updated all macro definitions of
MAX_NVDLA_OUT_STATUS_PER_TASK for consistency

JIRA DLA-6305

Signed-off-by: Akshata Bhat <akshatab@nvidia.com>
Change-Id: Ieacba82905e7ad19729856be32f022a13a1c37de
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2813577
Reviewed-by: Maxim Grigoriev (SW-GPU) <maximg@nvidia.com>
Reviewed-by: Amit Sharma (SW-TEGRA) <amisharma@nvidia.com>
Reviewed-by: Arvind M <am@nvidia.com>
Tested-by: Arvind M <am@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-04-14 11:47:58 +00:00
Arvind M
3349513ab1 nvdla: kmd: set DMA direction based on access type
Based on access permission requested through pin, DMA direction
is set. This allows setting a reduced access permission for DLA
firmware and/or hardware.

Jira DLA-5775

Change-Id: Ie28e9da87325f36de12269eab1487407f6272053
Signed-off-by: Arvind M <am@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2682040
Reviewed-by: Amit Sharma (SW-TEGRA) <amisharma@nvidia.com>
Reviewed-by: Praveen K <kpraveen@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Ken Adams <kadams@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
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
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
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
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
Ankit Patel
f88862a040 include: uapi: correct the include path for headers
Modified the commit e4163dbef1719b52b2d04782778767d313f37cdc

After installing the user space headers using make headers_install,
We do not have an uapi as a top level directory. Hence we must
include from the regular path linux|media|misc|video within the user
space header files.

Bug 2806057

Change-Id: I2f32a32814ac5347769177428717da7e7098147d
Signed-off-by: Ankit Patel <anpatel@nvidia.com>
(cherry picked from commit f8c05a422c4f14114c762906e24f4221a7343469)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2294559
Reviewed-by: Bibek Basu <bbasu@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
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
Arvind M
c6ec7bcb20 video: tegra: host: restores sof/eof, TS feature
This commit restores the following,
[1] 890be46 video: tegra: host: dla: refactor and cleanup code
[2] 109f8e8 video: tegra: host: add prefence signal support
[3] 6f683c8 video: tegra: host: add sof/eof taskstatus support
[4] a9cb0c9 video: tegra: host: add sof/eof timestamp support
[5] dcdb0d6 video: tegra: host: increase fw minor version

Jira DLA-1992
Jira DLA-1993

Change-Id: I9844b141b72fc553ba7d886e706e340160586129
Signed-off-by: Arvind M <am@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2135092
Tested-by: Mitch Harwell <mharwell@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Prashant Gaikwad <pgaikwad@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