Commit Graph

2014 Commits

Author SHA1 Message Date
Dmitry Antipov
6875779b10 video: tegra: host: nvdla, pva: add task information to fences
For NSys, we're interested in having detailed information on what task
waits on a particular prefence or requests a particular postfence.
This is implemented by adding two extra fields, 'task_syncpt_id' and
'task_syncpt_thresh' to 'struct nvhost_task_fence', to record the task
this particular fence is associated with.

To avoid race conditon in pva_submit (similar to what was fixed in
0c2065fd669926536f79fd9e8ec33f33cbdcae2e), PVA task memory management
is changed to use simple kref-based scheme, much like it's done in DLA.

Finally, this patch renames syncpoint fields of 'task_fence' to 'syncpt_id'
and 'syncpt_thresh' to match the same field names in other events, which
is intended to simplify Python scripting.

JIRA DTSP-1662
JIRA DTSP-682

Signed-off-by: Dmitry Antipov <dantipov@nvidia.com>
Change-Id: I4c55efcae15eb80a0d950882d6ff6e5ac706ab20
Reviewed-on: https://git-master.nvidia.com/r/1978175
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: Shridhar Rasal <srasal@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
Ketan Patil
fb7762f5a8 drivers: Clean up dma_attrs handling code
The dma_attr type is changed from "struct" to "unsigned long"
after kernel 4.4 Remove all such dma_attrs handling instances.

Bug 2485656

Change-Id: Ia53ec03e20037ead9d176bec1b3eae7aeb40a7a8
Signed-off-by: Ketan Patil <ketanp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2000617
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sachin Nikam <snikam@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
Bharat Nihalani
369d9398da Restore "include: uapi: move nvhost user-interface headers"
This reverts commit c49670d23c368245670556b54ff83cc6b4edb96b.
The original commit was reverted because it exposed DLA UMD driver to
include kernel headers directly.

Since then, DLA UMD driver has been fixed to use headers from
user-space code. And hence restore this commit.

Bug 200471393

Change-Id: I221f56c5d12bd3db79568398a95baa61ffcd8101
Signed-off-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1980599
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-14 11:46:41 +00:00
Sharif Inamdar
f8e64ca57a Revert "include: uapi: move nvhost user-interface headers"
This is causing Android builds to fail

This reverts commit 965ceca35c92eba011163f4c637b3b9e0f073f1a.

Change-Id: I84a98d129d25e33d1828033ab48a60102252b516
Signed-off-by: Sharif Inamdar <isharif@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1959908
2023-04-14 11:46:41 +00:00
Anuj Gangwar
da392cec33 include: uapi: move nvhost user-interface headers
Move the linux user-interface headers from include/linux/
to include/uapi/linux/

Change the path for above headers in the dependent files

Bug 2062672

Change-Id: I2e116dc8f6c33f53c03fb56b923931b6e600b534
Signed-off-by: Anuj Gangwar <anujg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1953709
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-14 11:46:41 +00:00
Damian Halas
1b369aba1b video: tegra: host: probe engines based on SKUs
- Xavier has different SKUs based on which different engines are enabled
  or disabled based on fuse setttings.
- This patch probes engines only if they are actually enabled in SKU by
  reading SKU INFO.
- This makes sure that we dont access engines if they are enabled
  inadvertently in DT

JIRA EVLR-3231

Change-Id: If32082fc5826a646776a94f97a72a8590b67256c
Signed-off-by: Damian Halas <dhalas@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1823538
Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com>
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
Reviewed-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-by: Colin Tracey <ctracey@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Nirav Patel <nipatel@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
Shridhar Rasal
df6b7e15b5 video: tegra: host: nvdla: restrict DMA mask to 37
- restrict DLA DMA mask to 37 bit:
    bit-37 is special purpose bit in MC HW so
    IOVA can go upto bit-36 that is dma mask(37)

Bug 200438156

Change-Id: Icdc48a6f71bdff11cd27fd1a315939651a3d342a
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1789447
Reviewed-by: Ken Adams <kadams@nvidia.com>
Reviewed-by: Pritesh Raithatha <praithatha@nvidia.com>
Reviewed-by: Amit Sharma (SW-TEGRA) <amisharma@nvidia.com>
Reviewed-by: Prashant Gaikwad <pgaikwad@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
Dmitry Antipov
c9b3772b5e eventlib: unify NVDLA/PVA fence types and add fence recording
Bug 2170736

Change-Id: If4fdeda140bf2474a08beb2a0d7c3fc1737a1a66
Signed-off-by: Dmitry Antipov <dantipov@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1750906
Reviewed-by: Saleh Dindar <sdindar@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Colin Tracey <ctracey@nvidia.com>
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
Deepak Bhosale
e44a671c9b video: tegra: host: probe engines based on SKUs
- Xavier has different SKUs based on which different engines are enabled
  or disabled based on fuse setttings.
- This patch probes engines only if they are actually enabled in SKU by
  reading SKU INFO.
- This makes sure that we dont access engines if they are enabled
  inadvertently in DT

Bug 200428527
JIRA VFND-5075

Change-Id: I4d3a4c84452237fdab0426980282cd9c39cc2a28
Signed-off-by: Deepak Bhosale <dbhosale@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1784306
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Damian Halas <dhalas@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
Reviewed-by: Nirav Patel <nipatel@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
Pritesh Raithatha
2ed4adb936 video: tegra: host: nvdla: update dma mask
- update dma mask to set to 40 bit for allow dma address high range.

Bug 2275298

Change-Id: I586bdd63aa3d8cad9aa6792a7784b65ea8733d22
Signed-off-by: Pritesh Raithatha <praithatha@nvidia.com>
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1786196
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
Shridhar Rasal
c0f98298e1 video: tegra: host: dla: reset syncpoint to queue fence
- queue can hold non DLA tasks like EMU submission
- as queue task list doesn't hold EMU tasks, so reset fence to
  syncpoint max value.

Jira DLA-1079

Change-Id: I61369e6c9e5e658e5c376dea614527ca20760cc8
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1777120
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
Shridhar Rasal
f9a7fb0932 video: tegra: host: dla: protect abort with mutex
- Queue task list updated for: task submission, task complete and
  device close.
- Device close invokes queue abort/flush and which creates race with
  task completion path.
- this patch ensure task list access in queue abort path with queue
  tasklist mutex.

Jira DLA-1079

Change-Id: I8da491145bcd84bc58e360cfab5d7402297599d4
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1777119
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
7162faafa0 video: tegra: host: dla: dump queue stats
- Add callback to dump queue status for each task
- It dumps open queue header and task actions

Jira DLA-1097

Change-Id: Ic7fbc8a8937575658d384cc5e0f278b45b758bba
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1777118
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
Kyle Guo
04a961c54f video: tegra: host: fix error handling in nvdla_open
Bug 200399628
JIRA VFND-4862

Change-Id: I37c68e8bb6edfe651bb263f151354e2c0435d690
Signed-off-by: Kyle Guo <kyleg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1764572
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: Damian Halas <dhalas@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Shridhar Rasal <srasal@nvidia.com>
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
1c26dd79dd video: tegra: host: nvdla: update TODO
- Update TODO's
  A. FW_VERSION was added for backward compatibility for legacy firmware.
     As firmware ver <0.6.0 is expected not to be used in future, so remove
     checks, macro and TODO comment it.
  B. MAX_GRID_SIZE is not expected to managed through nvhost as that
     indirectly managed in nvmap, so remove TODO comment.
  C. Adding runtime checks in timeout for abort handler would add
     few cycles.

- Send gos region if it fails in second attempt
  A. GoS region fetch may fail for first poweron during device boot
     GoS region may not be invoked/fail in second attempt
     Explicitly attempt again if it failed in previous attempts
  B. Mark invalid error for max num grids
  C. Add more comments for future changes for GoS handling

Jira DLA-798

Change-Id: Idfd6ed2f76cbc1f6dc7ad465edbf1db0e49181c4
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1756614
Reviewed-by: Amit Sharma (SW-TEGRA) <amisharma@nvidia.com>
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
06c89b3439 video: tegra: host: nvdla: engine reset handler for recovery
- adds worker as reset handler for engine recovery from hang
- handles dla falcon module interrupt for timeout message
- schedule worker and clear interrupt on interrupt
- update firmware version

Jira DLA-643
Jira DLA-149

Change-Id: I6049c854fc8bac15771467bb51d0827265e9a233
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1712889
Reviewed-by: Amit Sharma (SW-TEGRA) <amisharma@nvidia.com>
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
3a80748615 video: tegra: host: fetch GoS table before submit
- GoS table available only after all devices
  registeres with host.
- GoS table required to send to falcon with
  every poweron.
- Currently, GoS id fetched during task submit
  data fill and before actual task submit.
- Engine is powered on just before task submit

- considering all these, it is necessary to fetch
  GoS table before first task submit fill.
- so poweron engine to fetch table first

Jira DLA-673

Change-Id: Ibf31df8ed1a8b46792dde0ffb438f416335f5e09
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1683293
Reviewed-by: Automatic_Commit_Validation_User
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
26f05f8a95 video: tegra: host: nvdla: make get GoS abstract
- Add API to get GoS id and offset for given
  syncpoint, this should help simplify code and
  error reporting.
- report error in case of issue in get GoS
- Ignore GoS enabled error as GoS checkout is
  not done on all platforms
- Re-order gos enable flag update in probe

Jira DLA-673

Change-Id: Ica1ab27524ad4727171ba23306e1603313ee9b94
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1683292
Reviewed-by: Automatic_Commit_Validation_User
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
Shreshtha SAHU
696f635f9b video: tegra: host: nvdla: add T194-A01 WAR
Create debugfs to enable T194-A01 HW issue WAR.
Below command enables the WAR.

  echo 1 > /sys/kernel/debug/nvdla0/firmware/a01_war
  echo 1 > /sys/kernel/debug/nvdla1/firmware/a01_war

Jira DLA-988

Change-Id: Ica9d753ac9b5d0ec5ab079f50373f277e5665f86
Signed-off-by: Shreshtha SAHU <ssahu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1739192
Reviewed-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
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
Amit Sharma
3fde68937a video: tegra: host: nvdla: Fix Sparse warning
Declare nvdla_send_emu_postfences() as static to fix below sparse warning:
- nvdla_ioctl.c:391:5: warning: symbol 'nvdla_send_emu_postfences'
  was not declared. Should it be static?

Bug 200408168

Change-Id: I59a14e8e85902f233678c9f7c7c351d81c9c20b8
Signed-off-by: Amit Sharma <amisharma@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1725699
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sachin Nikam <snikam@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
26b8ad6100 video: tegra: dla: Bump up max postfences
Bug 2111960

Change-Id: Id2e1a4c62350adba029cd8b56a78265ece9a65ce
Signed-off-by: Tejas Bahulkar <tbahulkar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1708185
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Shridhar Rasal <srasal@nvidia.com>
Tested-by: Shridhar Rasal <srasal@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
f3a5e0f681 video: tegra: host: nvdla: fix sparse warning
Fix below sparse warning:
- "nvdla_ioctl.c:446:5: warning: symbol 'nvdla_update_postfences' \
  was not declared. Should it be static?"

Bug 200408168

Change-Id: I137249e817e2a6ca86ba2918d8f34dc2ed8d4a48
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1703728
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sachin Nikam <snikam@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
Timo Alho
e50a8ebc8a video: tegra: host: nvdla: remove legacy PD implementation
nvdla driver implemented a legacy PD implementation via
nvhost_domain_init(). There is a proper generic power domain provider
implementation for Tegra186 and later so this is unnecessary. Hence
remove all reference to it. While at it convert the module
initialization to use module_platform_driver() macro.

Bug 1853511

Change-Id: Ia2757d144fdd029ff3564aec79e79553252ed995
Signed-off-by: Timo Alho <talho@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1695842
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
fdde319738 video: tegra: host: nvdla: update fw version
- update firmware version 0.12.0 for interface update

Jira DLA-888

Change-Id: Ib88dd72d500d1199fc00ab1f2f5283a2cc84d736
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1691937
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Prashant Gaikwad <pgaikwad@nvidia.com>
Reviewed-by: svcboomerang <svcboomerang@nvidia.com>
Tested-by: svcboomerang <svcboomerang@nvidia.com>
2023-04-14 11:46:40 +00:00
Gunjan Mehta
cff582e014 drivers: video: tegra: host: nvdla: update max addr/task
- bump the number to 6144 to unblock resnet-50 for GTC unless KMD has a
  better solution

Jira DLA-609

Change-Id: I92787ffd2ef53a7169bda776ece7452e36b8f8a3
Signed-off-by: Gunjan Mehta <gmehta@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1683015
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
466b80d901 video: tegra: host: increase num of prefence count
- NvMedia adds pre-fence per-unit * per-output-tensor + 1 *
  per-input-tensor to enable tensor reuse and synchronization,
  so increase the prefence max count to 32.

- Match fence count with status

Jira DLA-703

Change-Id: Icac0779689c9f1921c5d2ad816d731e04b5539f5
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1671196
Reviewed-by: Automatic_Commit_Validation_User
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
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