Commit Graph

2046 Commits

Author SHA1 Message Date
Shridhar Rasal
197fd56298 video: tegra: host: nvdla: update postfences prior to engine submit
- Postfences should be ready for user before response from engine.
- this helps to avoid race between task complete, response to user and
  user waiting on fence.
- So update postfence prior to register notifier and command submission.
- minimize engine poweron window by moving poweron call just before submit.
  this should help to get better power number.

Jira DLA-724

Change-Id: I9df0a125574a95def9b85390e1e9fa008450aa24
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1653440
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@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:40 +00:00
Shridhar Rasal
22753e50e5 video: tegra: host: nvdla: add debug fw category
- Add new category for firware logging for better categorize
  different logs

Jira DLA-826

Change-Id: I5f1763991af6785a46c4e5ef4875897a489f13e6
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1679413
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@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:40 +00:00
Tejas Bahulkar
63ea6344fd video: tegra: host: dla: Add TSP Support.
Bug 1962781

Change-Id: I39105723a2e5701bf1b72e5c4a18c66f91ea7e73
Signed-off-by: Tejas Bahulkar <tbahulkar@nvidia.com>
Signed-off-by: Prashant Gaikwad <pgaikwad@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1671556
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-14 11:46:40 +00:00
Arvind M
abd075040f video: tegra: host: nvdla: avoid trace_printk use
1. introduce TEGRA_NVDLA_TRACE_PRINTK Kconfig flag and set to 'n'
    by default
2. control trace_printk using the flag
3. prevents allocation of extra kernel memory with trace_printk
    presence

Bug 200350221

Change-Id: Iaa644f196fcc9a44f1b0744a55a0a0a1a585653d
Signed-off-by: Arvind M <am@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1672074
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
2023-04-14 11:46:40 +00:00
Shridhar Rasal
596b964084 video: tegra: host: nvdla: ignore sub-minor version
- DLA firmware release and version update policy revised,
  ignore sub-minor firmware version.

- update sub-minor change to match with current firmware release

Jira DLA-761
Jira DLA-757

Change-Id: I2f74c2871992dac8c0c6ca7474e5bbd8bef191fe
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1669253
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@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:40 +00:00
Mikko Perttunen
25548ef03f video: tegra: host: Remove clamping code
Remove both module clamping and CV cluster clamping code, as these
operations are now performed by the BPMP firmware.

Jira HOSTX-328

Change-Id: I5ea4d3483a29a65ca6fb2ab252c6e969387f20f4
Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1645319
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-14 11:46:40 +00:00
Shridhar Rasal
29cda9809f video: tegra: host: dla: remove syncpt refcnt
As syncpoint refcounting is managed by common nvhost queue framework,
remove it's ref counting handling from submit path.

Bug 200391126

Change-Id: Ic769c6e71e5b470d21ea54e6efd5d45afd396686
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1661850
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@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:40 +00:00
Shridhar Rasal
f9c0b87ec8 video: tegra: host: nvdla: fix firmware reload refcnt
Fix DLA firmware poweron sequence for reload firmware through debugfs.
DLA free'ing resources and poweron is already handled in abstract API:
flcn_reload_fw()

Jira DLA-722

Change-Id: I04c4138ee9d2c0afc64a442cfafb372fe484ea96
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1647794
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@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:40 +00:00
Shridhar Rasal
2b650860d1 video: tegra: host: nvdla: region select based on submit mode
- Currently, trace, debug, GCOV region selected based on isolate
  contexts status. As MMIO mode needs these regions features enabled,
  move region selection based on submit mode.
- Disable region selection for channel mode submission as there is
  known issue within it.
- Make default print logging as error
- Move firmware debug prints under DLA driver print logging instead
  device logging.

Change-Id: I06e6b9be5ea597830c12f7476be6edd74d304617
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1654976
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@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:40 +00:00
Shridhar Rasal
c1483f7aa4 video: tegra: host: move task actions to task struct
- Currently, task actions and memory handles are managed outside task struct
  and they are linked to task through memory pointer operations.
- As these pointers are linked to task always, add them as part task struct.

Jira DLA-718

Change-Id: I1530ff63f3fc2b7a13249f7675216be6cfbfd348
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1654954
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@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:40 +00:00
Shridhar Rasal
3e0877e4db video: tegra: host: deal with no syncpoint task
- It is possible that, user can submit task without syncpoint or syncfd.
  However, kernel task-cleanup path requires minimum one syncpoint fence.
  Set fence counter to 1, if user don't set it.

- Now queue framework manages syncpoint refcounts through queue alloc and
  release. Skip dealing with it again in task submission and complete path.

- Remove un-necessary debug prints from queue abort which also does update
  syncpt min.

Jira DLA-718

Change-Id: I6f8313d3b0f4802ef8b45bf55b28ca3f27bb1ea1
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1654953
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@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:40 +00:00
Shridhar Rasal
0870b7d47e video: tegra: host: balance task ref counter
kref object reference counters set refcount to 1 on init.
Task references must be released after task submit done.

Reference acquired for command submission, free'd through task complete
notifier.

Jira DLA-718

Change-Id: I7aecfa45f90e19531e4ac57eadd1a20d72ab2291
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1654952
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@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:40 +00:00
Shridhar Rasal
2ea8b58dd3 drivers: video: tegra: host: decode fw version tag
- Decode firmware version tag from ucode binary.
- Add debugfs to dump firmware version tag

Jira DLA-318

Change-Id: I0208d8c8da2d91454f3ba0f4efa618cb44e22787
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Signed-off-by: Prashant Gaikwad <pgaikwad@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1645226
GVS: Gerrit_Virtual_Submit
Reviewed-by: Mitch Harwell <mharwell@nvidia.com>
Tested-by: Mitch Harwell <mharwell@nvidia.com>
Reviewed-by: Ken Adams <kadams@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-14 11:46:40 +00:00
Prashant Gaikwad
2c981f2b3f drivers: video: tegra: host: nvdla: update os inteface
- Update firmware version to 11.3

Change-Id: I051459ef060246da5428ef8237b244ff445b2f88
Signed-off-by: Prashant Gaikwad <pgaikwad@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1645961
GVS: Gerrit_Virtual_Submit
Reviewed-by: Mitch Harwell <mharwell@nvidia.com>
Tested-by: Mitch Harwell <mharwell@nvidia.com>
Reviewed-by: Ken Adams <kadams@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-14 11:46:40 +00:00
Prashant Gaikwad
961a5dfbcc drivers: video: tegra: host: nvdla: increase address list size
Some large networks need number of addresses more than
512. Increase the limit to 4K.

Change-Id: I5880f0ecce566ec5d4da3cec3ed2346a868fadce
Signed-off-by: Prashant Gaikwad <pgaikwad@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1644471
GVS: Gerrit_Virtual_Submit
Reviewed-by: Mitch Harwell <mharwell@nvidia.com>
Tested-by: Mitch Harwell <mharwell@nvidia.com>
Reviewed-by: Ken Adams <kadams@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-14 11:46:40 +00:00
Prashant Gaikwad
0f2266c47a drivers: video: tegra: host: nvdla: add emu task submit
Emulator tasks execute on CCPLEX in DLA UMD thread but
these tasks need synchronization between other tasks
runing on DLA engine or some other engines.

Synchronization between DLA and other engines is through
sync point as NvMedia layer does not support semaphore.

This requires assigning and incrementing sync point
value for emulator tasks too.

This change adds an IOCTL to increment sync point
max value and report it back to UMD so that DLA UMD
can communicate it to other engines.

Jira DLA-677

Change-Id: I1c4ce66868e8ab7315f37c0a6b62e1f5335a1c3a
Signed-off-by: Prashant Gaikwad <pgaikwad@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1643572
GVS: Gerrit_Virtual_Submit
Reviewed-by: Mitch Harwell <mharwell@nvidia.com>
Tested-by: Mitch Harwell <mharwell@nvidia.com>
Reviewed-by: Ken Adams <kadams@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-14 11:46:40 +00:00
Prashant Gaikwad
cfdba15b5a tegra: host: nvdla: reduce debug level for fw prints
Firmware can span kernel log for large networks,
reduce print level for firmare prints.

Bug 2045645

Change-Id: I1a4cf18dc8350ca4a0ef06a47161c35c9198055e
Signed-off-by: Prashant Gaikwad <pgaikwad@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1642273
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-14 11:46:40 +00:00
Shridhar Rasal
20a3db1511 video: tegra: host: add DLA channel submit
- Add support to submit DLA tasks through host1x channel
- Add prefence support for channel mode submission
- Allow submit mode to switch between host1x channel and MMIO
- Add debugfs for submit mode
- enable isolate contexts

Jira DLA-105

Change-Id: I3656fba5a9f7db0c71c0f8b856dbb777513fa32b
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Signed-off-by: Prashant Gaikwad <pgaikwad@nvidia.com>
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1610233
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@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:40 +00:00
Prashant Gaikwad
7b0f8ad3ae video: tegra: host: nvdla: update firmware version
Change-Id: Ie262c367d6640a99401b53e0a222673f543fa533
Signed-off-by: Prashant Gaikwad <pgaikwad@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1626891
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Mitch Harwell <mharwell@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-14 11:46:40 +00:00
Gunjan Mehta
0e40b46ed5 video: tegra: host: nvdla: update max addresses/task
- also update firmware version to 0.11.1

todo:
- kmd should inherit max addresses/task as firmware's
  exported interface and so should UMD as well
- the suitable refactor is tracked in : Jira DLA-251

JIRA DLA-609

Change-Id: I5b198a38cf602cd922dbd4cb0f4b21ba8b7ef580
Signed-off-by: Gunjan Mehta <gmehta@nvidia.com>
Signed-off-by: Prashant Gaikwad <pgaikwad@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1612916
Reviewed-by: Mitch Harwell <mharwell@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Amit Sharma (SW-TEGRA) <amisharma@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-14 11:46:40 +00:00
Jon Mayo
30427bb55e tegra: host: nvdla: Add debug to reload firmware
Writing "1" to /sys/kernel/debug/nvdlaX/firmware/reload will trigger the
reload of the DLA firmware.

Change-Id: I5d411c05811bd77011b19cc54aa2065b5a301363
Signed-off-by: Jon Mayo <jmayo@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1603515
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Shridhar Rasal <srasal@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:40 +00:00
Bharat Nihalani
978b83a652 drivers: Remove references to srctree.t9x
linux-t19x kernel repo is now collapsed into linux-nvidia repo.

So remove references to srctree.t19x that points to "kernel/t19x"
folder that should not be used anymore.

Bug 200363166

Change-Id: I091eee3066a7a975cb28a051a8fa036374b672a4
Signed-off-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1601029
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
2023-04-14 11:46:40 +00:00
Stephen Warren
d6dac08165 t19x: use $(srctree.$(overlay))
Update all Makefiles to make use of the new srctree.$(overlay) variables
to remove hard-coding the path to any overlays.

Bug 1978395

Change-Id: Ic512ceebb15fa5e5a132b72446ab476ecac6e37e
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1593801
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-by: Alexander Van Brunt <avanbrunt@nvidia.com>
Reviewed-by: Timo Alho <talho@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-14 11:46:40 +00:00
Ivan Raul Guadarrama
61b5174ee8 tegra: host: nvdla: Add clearing logic to ISR
Add logic to clear the falcon interrupt flag to the DLA ISR code.
This is needed because any engine specific code will be removed from
the common falcon ISR code.

Bug 1800927

Change-Id: I516df43503ea401d1f84ecc4bfd385d22ab4cd0f
Signed-off-by: Ivan Raul Guadarrama <iguadarrama@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1593502
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Shridhar Rasal <srasal@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Arto Merilainen <amerilainen@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-14 11:46:40 +00:00
Shridhar Rasal
7520eea4dd video: tegra: host: enable firmware gcov support
- add debugfs to enable firmware gcov and dump gcov data
- on request for enabling gcov, allocate gcov region and inform
  firmware about gcov PA
- gcda debugfs dumps gcda data stored by firmware

Change-Id: Ibca37048120eba21aa5f1d4936bd4ae5254fdddf
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1586783
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-14 11:46:40 +00:00
Stephen Warren
d483e0b167 t19x: use kernel overlay features
Update all Kconfig files and Makefiles to rely on the kernel overlay
feature. In particular, don't include any Kconfig files or Makefiles
from other overlays. -I directives in CFLAGS are not yet cleaned up.

Bug 1978395

Change-Id: I5ee70b91c5137dd8b36e0adb56a0763fbf2cb123
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1561188
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:40 +00:00
Sai Gurrappadi
73f1b216b8 video: tegra: Fix up CV cluster clamping
CV cluster clamping is currently owned partly by nvhost and partly by the
client modules in their poweroff sequences. This leads to a mismatch in
ref counts if the client specific finalize_poweron() call doesn't work.
nvhost side ends up retrying to boot the device three times at which point
we are left with a mismatch in the cluster clamp ref counts.

To fix this, move out cluster clamping back to nvhost which allows us to
maintain consistent state for the ref count.

Bug 200352108

Change-Id: I9ccc71035934ccc147b8d8a8995afd060af333e8
Signed-off-by: Sai Gurrappadi <sgurrappadi@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1572788
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-14 11:46:40 +00:00
Shridhar Rasal
6ea50d7295 video: tegra: host: dla: update firmware version
Change-Id: I2dc1c67a6308a2bf8ba562c1f03b251f12aa7794
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1574239
Reviewed-by: Prashant Gaikwad <pgaikwad@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-14 11:46:40 +00:00
Amit Sharma (SW-Tegra)
fc6b594563 tegra: host: nvdla: Add dump and trace buffer to nvdla_device
Add dump and trace buffers to nvda_device as nvdla_device is
correct place to keep them.

Jira DLA-330

Change-Id: Id282e49e3586e67a3f57f2151c9f7c3590fa0e5b
Signed-off-by: Amit Sharma (SW-Tegra) <amisharma@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1561392
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
Reviewed-by: Prashant Gaikwad <pgaikwad@nvidia.com>
Reviewed-by: Shridhar Rasal <srasal@nvidia.com>
2023-04-14 11:46:40 +00:00
Sai Gurrappadi
5002cec200 video: tegra: host: t19x: CV cluster clamps for pg
The CV cluster needs to be clamped before/after a rail gate/ungate
sequence. Since there is no way to hook into the CV power domain's
poweroff/poweron functions, track references to the CV domain explicitly
by having client CV modules get/put references to the CV cluster.

The first client module to poweron will result in the CV cluster clamp
getting disabled and the last client module to poweroff will result in the
clamp getting set. This will ensure that any subsequent CV rail gating
sequence happens with the clamps in place.

Jira HOSTX-194

Change-Id: Ic65176e15c1a487a020712a02147cbfc3f2f83c3
Signed-off-by: Sai Gurrappadi <sgurrappadi@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1517643
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-14 11:46:40 +00:00
Ishan Mittal
35c796151b t19x: nvhost-t19x: Change all Makefile to makefile.t19x
Bug 200295104

Change-Id: I51e6444318eda275082bb530a7058b777951aa93
Signed-off-by: Ishan Mittal <imittal@nvidia.com>
2023-04-14 11:46:40 +00:00
Ishan Mittal
044eaae9c2 t19x: Change all references from nvhost to nvidia
- Change references from nvhost to nvidia
- Change references from nvhost-t19x to t19x

Change-Id: I6c9b275bdb20dfa975145124395b61493a1ff5a9
2023-04-14 11:46:40 +00:00
Arto Merilainen
56a67d3275 video: tegra: host: Support channels in queues
This change adds support for allocating channels for queues and
submitting tasks through them. This is useful in cases where
direct MMIO cannot be used for task submission (e.g. virtualization).

JIRA PVA-443

Change-Id: Iae819d03d1d378059310b67ebc2e5af4690d5c80
Signed-off-by: Arto Merilainen <amerilainen@nvidia.com>
Reviewed-on: http://git-master/r/1481833
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-14 11:46:40 +00:00
Arto Merilainen
9e56c92bc9 video: tegra: host: Support CVNAS
This change modifies code to support to determine if an allocation
has been done from the CVNAS or DRAM. This information is needed
primarily for PVA since it needs to choose the port that is used
for DMA accesses.

JIRA PVA-457

Change-Id: I99305f8940a2c07eadd65999ee175185b257713c
Signed-off-by: Arto Merilainen <amerilainen@nvidia.com>
Reviewed-on: http://git-master/r/1488003
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-by: Prashant Gaikwad <pgaikwad@nvidia.com>
Reviewed-by: Vinod Gopalakrishnakurup <vinodg@nvidia.com>
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-14 11:46:40 +00:00
Arto Merilainen
c3c9346cbd video: tegra: host: Fix releasing of buffers
Currently releasing of the buffers goes through the rb tree,
releases buffers and goes to the next node. However, if the
buffer has been released, rb_next() will point to a released
memory address.

Since rb_tree() might get rebalanced after removal of a node,
rb_next() pointer may no longer be the correct next node. In
order to overcome the issue, this change adds a separate list
for traversing through the nodes sequentically.

JIRA HOSTX-214

Change-Id: I7ab5fd547dec0d3b8d66361bad9f1412ff875b7e
Signed-off-by: Arto Merilainen <amerilainen@nvidia.com>
Reviewed-on: http://git-master/r/1483987
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sai Gurrappadi <sgurrappadi@nvidia.com>
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
Reviewed-by: Vinod Gopalakrishnakurup <vinodg@nvidia.com>
Reviewed-by: Prashant Gaikwad <pgaikwad@nvidia.com>
Tested-by: Amit Sharma (SW-TEGRA) <amisharma@nvidia.com>
2023-04-14 11:46:40 +00:00
Prashant Gaikwad
89e5bb479b video: tegra: host: dla: release from fw bin 0.10.0
Jira DLA-354

Change-Id: I4a4430d213f0bf20a034e92b04d0add5c7ad3009
Signed-off-by: Prashant Gaikwad <pgaikwad@nvidia.com>
Reviewed-on: http://git-master/r/1481311
Reviewed-by: Amit Sharma (SW-TEGRA) <amisharma@nvidia.com>
Reviewed-by: Inamdar Sharif <isharif@nvidia.com>
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-14 11:46:40 +00:00
Shridhar Rasal
cd14b7e09f video: tegra: host: nvdla: add task timeout support
- pass task timeout parameter from user to engine for book keeping
  of task runtime
- as stack framesize crossing limit of 2048 bytes, reduce number of
  maximum task can be submitted in one go.

Jira DLA-374
Bug 200302518

Change-Id: I99d3706d9d80ac0201529d68c0a959cdd22a1488
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Signed-off-by: Prashant Gaikwad <pgaikwad@nvidia.com>
Reviewed-on: http://git-master/r/1468355
Reviewed-by: Amit Sharma (SW-TEGRA) <amisharma@nvidia.com>
Reviewed-by: Inamdar Sharif <isharif@nvidia.com>
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-14 11:46:40 +00:00
Shridhar Rasal
24850d2fef video: tegra: host: dla: remove num postaction limit
- User needed to set minimum one postaction as syncpoint, this
limitation has been removed in enhancement in KMD.
- Don't allow user to set queue resume and suspend at same time.

Change-Id: I5d780d4941040211809f72ec770fc4db853551c6
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Signed-off-by: Prashant Gaikwad <pgaikwad@nvidia.com>
Reviewed-on: http://git-master/r/1478966
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
Reviewed-by: Amit Sharma (SW-TEGRA) <amisharma@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-14 11:46:40 +00:00
Prashant Gaikwad
4dfdfde5ec video: tegra: host: dla: release from fw bin 0.9.0
Jira DLA-354

Change-Id: I730737cb1fa679618a2a5f66e0d69f82fc38f393
Signed-off-by: Prashant Gaikwad <pgaikwad@nvidia.com>
Reviewed-on: http://git-master/r/1474271
Reviewed-by: Inamdar Sharif <isharif@nvidia.com>
Tested-by: Inamdar Sharif <isharif@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
2023-04-14 11:46:40 +00:00
Shridhar Rasal
7ee9a72a2d video: tegra: host: add multiple postactions of type SYNCPT/SYNCFD
- Enhance KMD to add multiple postactions of type syncpoint and syncfd
  while task submit only a syncpoint was assigned to given task as
  a postaction. This was limiting to user to submit a task with
  multiple types of actions like, syncpoint, syncfd.
  To overcome limitation: added fence counter for type syncpoint and syncfd,
  registered fence counter with nvhost for syncpoint completion notifier,
  and for individual postaction respective fence sent back to user.
- Timestamp semaphore as a separate preaction is not supported
  by engine, However timestamp semaphore preaction can be inserted
  as semaphore preaction. In that case, engine ignore timestamp
  data and validates semaphore value.
- add debug messages for buffer pin failure paths

Jira DLA-273
Jira DLA-375

Change-Id: I26882d0d61f46bed3c3cace99901ba7c506b9977
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: http://git-master/r/1470472
Reviewed-by: Prashant Gaikwad <pgaikwad@nvidia.com>
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-14 11:46:40 +00:00
Shridhar Rasal
e13e5a98dc video: tegra: host: nvdla: treat syncfd as syncpt/gos
Fence type as syncfd is between user and kernel. Kernel translates
syncpoint as syncfd before sending back postactions.

For engine, syncfd is same as syncpt/gos action, so send syncfd actions as
as syncpt/gos.

Jira DLA-273

Change-Id: I750f112544d2c28bdc14f03f5e823503b09a18ad
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: http://git-master/r/1469528
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
Reviewed-by: Inamdar Sharif <isharif@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-14 11:46:40 +00:00
Arto Merilainen
6557218255 video: tegra: host: Use dmabuf instead of fd
The buffer management code is currently using fd as the buffer
identifier, however, fds are ambiguous as identifiers: If user
closes a dmabuf fd and allocates a new one, the two buffers may
share the same fd. If the new dmabuf fd is passed to kernel,
kernel incorrectly uses the old memory buffer.

This patch reworks buffer management code to use dmabuf pointers
as identifier instead of dmabuf fds.

Reduce PVA_MAX_PIN_BUFFER from 256 to 64

nvhost_buffer_pin, nvhost_buffer_unpin, nvhost_get_iova_addr,
nvhost_buffer_submit_pin and nvhost_buffer_submit_unpin are
modified to pass dmabuf pointer instead of fd handle.

JIRA PVA-357

Change-Id: I1f736cbcf704d0872a8e97de28308649f0f1586b
Signed-off-by: Arto Merilainen <amerilainen@nvidia.com>
Signed-off-by: Vinod G <vinodg@nvidia.com>
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: http://git-master/r/1455918
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-14 11:46:40 +00:00
Mikko Perttunen
f15d907c3d video: tegra: host: dla: Make nvdla_dump_task static
This function is only used locally, so make it static.

Bug 200088648

Change-Id: Icd387244e5ad0d058def22cba2d021bd82760901
Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Reviewed-on: http://git-master/r/1330520
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-14 11:46:40 +00:00
Prashant Gaikwad
e6da13f8df video: tegra: host: dla: release from fw bin 0.8.0
Manual padding added in DLA interface

Change-Id: I49b59ee7dc76e1d2fd1da32bba40251f5b2e7598
Signed-off-by: Prashant Gaikwad <pgaikwad@nvidia.com>
Reviewed-on: http://git-master/r/1454511
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Shridhar Rasal <srasal@nvidia.com>
2023-04-14 11:46:40 +00:00
Shridhar Rasal
24e20161d9 video: tegra: host: dla: add IOCTL to send fw version and q status
- Add IOCTL to send DLA firmware version.
- If DLA engine is not powered on before IOCTL call, poweron engine and
  send version.
- Add IOCTL to send queue status, like current fence

Jira DLA-316
Jira DLA-336

Change-Id: I2367446f99809253c4b765b751d66712f969442c
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: http://git-master/r/1326511
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Prashant Gaikwad <pgaikwad@nvidia.com>
Reviewed-by: Amit Sharma (SW-TEGRA) <amisharma@nvidia.com>
2023-04-14 11:46:40 +00:00
Mikko Perttunen
22eef7be76 video: tegra: host: Fix T19x driver build on kernel 4.9
NVDLA and PVA drivers still rely on the old DMA
attribute API, so fix them to work on both pre-4.9
and 4.9 APIs.

Bug 1852328

Change-Id: I6f32670dc1da458e642156b4bbd8c104d4984f75
Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Reviewed-on: http://git-master/r/1453038
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-14 11:46:40 +00:00
Shridhar Rasal
9975af6bd9 video: tegra: host: dla: add flag for GoS enable
- add flag to check gos enabled status
- As there is no clean way to get GoS enable status without invoking any
  GoS API, ignore error from retrieving GoS regions table.
- However, update gos enable flag based on return status from GoS API.
- Use this flag for retriving GoS syncpoint IOVA, this is required to
  avoid
  un-necessary calls to nvhost and nvmap.

- __func__ is already included in DLA debug print wrapper API's, remove
  redundant parameters passing

- Fix dumping num of prefences

- In task submission, as network descriptor is mandatory to pass to
  engine, expect minimum one num of addresses per task.

Jira DLA-326

Change-Id: I2483a606fd8454a92363cfbaf4462280e221e20c
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: http://git-master/r/1322085
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
2023-04-14 11:46:40 +00:00
Prashant Gaikwad
5b4625fc7a video: tegra: host: dla: release from fw bin 0.7.0
Jira DLA-312

Change-Id: I84f31dd6bb5919838ed4ef169894687ebf44637d
Signed-off-by: Prashant Gaikwad <pgaikwad@nvidia.com>
Reviewed-on: http://git-master/r/1309410
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: Shridhar Rasal <srasal@nvidia.com>
2023-04-14 11:46:40 +00:00
Shridhar Rasal
8d762b1892 video: tegra: host: dla: add GoS region feature
- use of GoS region gives better performance for reading for than
  one GoS from same region compared to reading using semaphores.
- Add Gos region based approach for filling GoS action

Jira DLA-326

Change-Id: I4fab7d7fad2f3120b1d0900dfb94912bce01b95b
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: http://git-master/r/1317112
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Prashant Gaikwad <pgaikwad@nvidia.com>
2023-04-14 11:46:40 +00:00
Shridhar Rasal
5399f69fc7 video: tegra: host: dla: fix filling postaction
- firmware should update output status before updating semaphores,
  reorder postaction list.
- add firmware version checks support for different variation of code
- firmware expect that, printf buffer shouldn't be aligned by 256 after
  version 0.6.0, fix setting printf buffer start address.

Jira DLA-312

Change-Id: I98695678523021a6e98b8f90f5c294db3ed2a634
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: http://git-master/r/1317111
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Prashant Gaikwad <pgaikwad@nvidia.com>
Reviewed-by: Amit Sharma (SW-TEGRA) <amisharma@nvidia.com>
2023-04-14 11:46:40 +00:00