Commit Graph

2046 Commits

Author SHA1 Message Date
Mikko Perttunen
32181417d1 video: tegra: host: Use $(srctree) in relative paths
In kernel 4.9, plain relative paths no longer work for
include paths, so prepend $(srctree).

Change-Id: I4c0efcb15977d6c6f16b5c7891ecb95e6c5a6fea
Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Reviewed-on: http://git-master/r/1313922
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
Reviewed-by: Timo Alho <talho@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Arto Merilainen <amerilainen@nvidia.com>
2023-04-14 11:46:40 +00:00
Shridhar Rasal
94b372e4e0 video: tegra: host: expect more than one postfence
- postfence completion routine triggers clean up of task data and
  inform UMD of completion of task, so expect minimum one postfence
  for task submit.
- add more debug message.
- validate task data after copying user data
- use local task pointer for copying postfences
- dump input task parameters

Jira DLA-251
Bug 200088648

Change-Id: I3980e095586112d50381057aa7e19991d77fdf32
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: http://git-master/r/1311386
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
d1587acdc0 video: tegra: host: dla: validate parameters before copy
Validate all input parameters before copy_to_usr to local parameter.

CID 1705805

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

Change-Id: Ib993d64056c1893588c779ea23d218d42a65e758
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: http://git-master/r/1299843
Reviewed-by: Prashant Gaikwad <pgaikwad@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-14 11:46:40 +00:00
Shridhar Rasal
a4612dc740 video: tegra: host: dla: use standard size defines
Use standard size definitions for better code readability.
Also move macro's to header files

Change-Id: Ie923cdc6ce4f0bb4d098dd3a3328f9cc232604e9
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: http://git-master/r/1297216
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
31532aa01d video: tegra: host: dla: add GoS backing support
Update syncpoint based actions with GoS semaphores.

For post actions get both GoS and MSS sem address, for pre actions
use MSS sem if GoS sem is not available.

In postactions, write 1 to MSS memory and write current max + 1 to GoS
memory.

DLA-98

Change-Id: I6dbf850bc2c5b86c372ad963a30e9cfad1fc787f
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: http://git-master/r/1283462
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
Reviewed-by: Prashant Gaikwad <pgaikwad@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-14 11:46:40 +00:00
Shridhar Rasal
da29f3cd97 video: tegra: host: dla: remove updating user bufffer with IOVA
This patch addresses two fixes:
[1]
Removes updating user buffers with IOVA.
- In address translation of address list of a tasks, handle and
  offset were replaced with actual IOVA into user buffer and same buffer
  was shared with engine. This approach is error prone.
- To fix this issue, kernel keeps IOVA list and shares with engine.
- In task submit, mem_handle list from user and updated in kernel
  copy of task.
- and while pinning user buffers, engine shared list updated with
  actual dma address retrieved from submit pin call.

[2]
Remove dynamic allocation required in address translation
- Required memory of 'kernel copy address list' and 'engine shared
  address list' both allocated from queue memory pool.
- and assigned and released along with task data.

DLA-286

Change-Id: I4d5a322adaff25e6e587d3305847540757850c77
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: http://git-master/r/1293124
Reviewed-by: Prashant Gaikwad <pgaikwad@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-14 11:46:40 +00:00
Mikko Perttunen
29973a70c0 video: tegra: host: Track nvhost API change
Nvhost power domain support has been refactored and
as part of that the function nvhost_module_add_domain
is no longer necessary and has been removed. Therefore
remove calls to this function from unit drivers.

JIRA HOSTX-156
Bug 1852328

Change-Id: Id5d404e40c301bccd531091622a92f359532b384
Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Reviewed-on: http://git-master/r/1284202
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 (SW-Tegra)
4eba150eec video: tegra: host: dla: add support for trace event
Add support for sending set_debug command to configure
trace events in firmware.
- Add new interface: dla_debug_config
- command interface for trace_event configuration

DLA-254

Change-Id: I6ea5c1c57f75891d4633839f0f82470d92109b8f
Signed-off-by: Amit Sharma (SW-Tegra) <amisharma@nvidia.com>
Reviewed-on: http://git-master/r/1291925
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-by: Prashant Gaikwad <pgaikwad@nvidia.com>
2023-04-14 11:46:40 +00:00
Amit Sharma (SW-Tegra)
d22f608f4b video: tegra: host: dla: add more options to dla debugfs
Add following details to dla debugfs:

1. To check firmware version
  - /d/nvdla*/firmware/version
2. To enable/disbale the dla firmware traces.
  - /d/nvdla*/firmware/trace/enable
3. To dump the data in readable format
  - /d/nvdla*/firmware/trace/text_trace
4. To dump the data in binary format
  - /d/nvdla*/firmware/trace/bin_trace
5. To set the categories of events
  - /d/nvdla*/firmware/trace/events/category
6. To get the help menu for setting the trace categories:
  - /d/nvdla*/firmware/trace/events/help

Rename API debug_dla_dump_show -> debug_dla_tracedump_show, and
move /d/nvdla0/fw_version -> /d/nvdla*/firmware/version.

DLA-225
DLA-254
DLA-199

Change-Id: I396b31102a1995e4deffdb6e03ab7377bb0b7fc3
Signed-off-by: Amit Sharma (SW-Tegra) <amisharma@nvidia.com>
Reviewed-on: http://git-master/r/1291924
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-by: Prashant Gaikwad <pgaikwad@nvidia.com>
2023-04-14 11:46:40 +00:00
Shridhar Rasal
31b532c889 video: tegra: host: dla: use static array for copying user data
In IOCTL path, temporary handles are dynamically allocated which keeps
user data until it populated and used by driver for different
operations. This dynamic allocation in currently done for buffer pin,
task submit and buffer unpin.

As MISRA C guidelines, keeping minimal dynamic allocation and making
static allocation for temporary handles.

Jira DLA-283

Change-Id: I1589c6f96e674e74b4607614c035ef0a0606b7db
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: http://git-master/r/1291492
Reviewed-by: Amit Sharma (SW-TEGRA) <amisharma@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-14 11:46:40 +00:00
Shridhar Rasal
bf348b16bd video: tegra: host: dla: correct engine cmd timeout
- Correct engine cmd timeout which was set to earlier to high value.
  Use timeout in msec.
- Bundle data into struct and pass pointer of data to avoid sending
  multiple parameters. This should help to add additional parameter in
  future.
- Remove un-used MACRO defines

Change-Id: If6bd9686b4e2dd38c65ba81d9ed05cf0dedf9a8c
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: http://git-master/r/1286687
Reviewed-by: Prashant Gaikwad <pgaikwad@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-14 11:46:40 +00:00
Shridhar Rasal
3a1e6b396b video: tegra: host: dla: remove dynamic kernel task mem alloc
- nvhost_queue_task_pool_alloc() also allocates kcalloc based memory.
  Use this memory to keep kernel copy of task and get this memory
  assigned during task submission. Release memory during task cleanup
  along with dma alloc.
- Memory pool free'd while freeing queue on device close.
- Using preallocated memory should help to improve performance of job
  submission.
- memset for dma and kernel memory done from queue common code, so
  removing memset for task descriptor memory.
- Fix releasing queue refcnt and release it after free task memory.

DLA-271

Change-Id: I711b3181e742c05e934f1c621b3dc6e5cf94b67c
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: http://git-master/r/1285892
Reviewed-by: Prashant Gaikwad <pgaikwad@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-14 11:46:40 +00:00
Shridhar Rasal
b21abe34a7 video: tegra: host: dla: roundup task desc mem
Falcon requires IOVA to be 256 byte aligned.

task descriptor and command memory assigned from pre allocated pool,
which may not be correctly aligned.

Roundup task descriptor size to 256 to get correctly aligned address.
Keep max command size as 256.

Check alignment of IOVA after reserving from pool.

memset reserved memory to avoid corruption in case of re-use of pool
mem.

ALIGNED_DMA macro moved to include file and used for task submit
command.

Jira DLA-266

Change-Id: Id8a63ddad357a9ba905a975b565afca04e5d6806
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: http://git-master/r/1282878
Reviewed-by: Prashant Gaikwad <pgaikwad@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-14 11:46:40 +00:00
Rohit Khanna
a40bcd8183 Revert "video: tegra: host: dla: add more options to dla debugfs"
This reverts commit e78adaae5f7b7eb23c466008a8225235187ec116.

DLA-254
DLA-199

Change-Id: I92845b7efded1ed9a9fa6dbaa0f2219dfa4c8fd4
Reviewed-on: http://git-master/r/1288311
Tested-by: Rohit Khanna <rokhanna@nvidia.com>
Reviewed-by: Rohit Khanna <rokhanna@nvidia.com>
2023-04-14 11:46:40 +00:00
Rohit Khanna
71117eca2f Revert "video: tegra: host: dla: add support for trace event"
This reverts commit 2065a3e6f1c273f1a60fcee17feedab40e23f96e.

DLA-254

Change-Id: Ic8b62febac145369a06a7b53d893e5a5ef088698
Reviewed-on: http://git-master/r/1288310
Tested-by: Rohit Khanna <rokhanna@nvidia.com>
Reviewed-by: Rohit Khanna <rokhanna@nvidia.com>
2023-04-14 11:46:40 +00:00
Amit Sharma (SW-Tegra)
f652305725 video: tegra: host: dla: add support for trace event
Add support for sending set_debug command to configure
trace events in firmware.
- Add new interface: dla_debug_config
- command interface for trace_event configuration

DLA-254

Change-Id: I5a4bdd93882e3e167da165f1dc1e2495b9c327c3
Signed-off-by: Amit Sharma (SW-Tegra) <amisharma@nvidia.com>
Reviewed-on: http://git-master/r/1277594
Reviewed-by: Shridhar Rasal <srasal@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-14 11:46:40 +00:00
Amit Sharma (SW-Tegra)
0ee905be8e video: tegra: host: dla: add more options to dla debugfs
Add following details to dla debugfs:

1. To check firmware version
  - /d/nvdla*/firmware/version
2. To enable/disbale the dla firmware traces.
  - /d/nvdla*/firmware/trace/enable
3. To dump the data in readable format
  - /d/nvdla*/firmware/trace/text_trace
4. To dump the data in binary format
  - /d/nvdla*/firmware/trace/bin_trace
5. To set the categories of events
  - /d/nvdla*/firmware/trace/events/category
6. To get the help menu for setting the trace categories:
  - /d/nvdla*/firmware/trace/events/help

Rename API debug_dla_dump_show -> debug_dla_tracedump_show, and
move /d/nvdla0/fw_version -> /d/nvdla*/firmware/version.

DLA-254
DLA-199

Change-Id: Ia39c3af6a8d007504e28cd382ded886c4c713105
Signed-off-by: Amit Sharma (SW-Tegra) <amisharma@nvidia.com>
Reviewed-on: http://git-master/r/1277525
Reviewed-by: Shridhar Rasal <srasal@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-14 11:46:40 +00:00
Prashant Gaikwad
d25d2c1ab9 video: tegra: host: nvdla: update os interface
Firmware minor version updated to 5

- Renamed task status notifier
- Added commands for trace events

Change-Id: Ie272b018b557369e288a8780cedcf67a2e08c250
Signed-off-by: Prashant Gaikwad <pgaikwad@nvidia.com>
Reviewed-on: http://git-master/r/1286009
Reviewed-by: Shridhar Rasal <srasal@nvidia.com>
2023-04-14 11:46:40 +00:00
Vinod G
d249225115 video: tegra: pva: Remove Dynamic kmalloc
Removing the kmalloc calls from the ioctl calls.
The kernel memory needed for task is allocated in
nvhost_queue_task_pool_alloc() call and on
pva_submit_ioctl() call, the
preallocated memory is assigned for tasks
based on availability and clear them on task
completion for reusing for other tasks.

JIRA PVA-189

Change-Id: Id5834e341da01cbc3af7ecdb318b707d0651f2ba
Signed-off-by: Vinod G <vinodg@nvidia.com>
Reviewed-on: http://git-master/r/1275270
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Arto Merilainen <amerilainen@nvidia.com>
Reviewed-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-14 11:46:40 +00:00
Deepak Nibade
f8d356147e video: tegra: host: remove nvhost-18x include path
nvhost-18x path is deprecated, hence remove it's include path

Jira HOSTX-166

Change-Id: I41ccf34f86f7f8c8b23ef5f0d5fb101024becae3
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/1279478
Reviewed-by: Automatic_Commit_Validation_User
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
206d951aa1 video: tegra: host: dla: check buffer count per task
To avoid possible buffer overflow, add check for max number of buffers
count per task. Min buffer check count was already present.

Bug 1806862

CID 38902

Change-Id: I48ef974ed8cbc0972a758b79fc3c525aed2b8478
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: http://git-master/r/1281988
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
bf1ef90457 video: tegra: host: dla: fix coverity issues
fix coverity issue seen in ioctl argument usage.
Validate input arguments for arguments.
add missing error messages from pinning path.

Bug 1806862

CID 1806862
CID 38902

Change-Id: I025bedbd7060b7ffb7f908c0fb5e6f0d80710530
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: http://git-master/r/1280084
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
e8d89fcbf9 video: tegra: host: dla: add queue operations cmd
- define and add ioctl to set queue operations like, suspend and resume.
- on validating user argument, pass command to engine to suspend and
  resume.
- on receiving this command, firmware just update queue status as sent
  and doesn't interrupt ongoing task or queue work.

Jira DLA-218

Change-Id: I13f5d8822d920961277884c64534daaf64d812be
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: http://git-master/r/1278192
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Prashant Gaikwad <pgaikwad@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-14 11:46:40 +00:00
Shridhar Rasal
e1255dbab1 video: tegra: host: dla: use different structure for cmd mem
- use another structure for storing command memory pool params
- fix checkpatch errors

Jira DLA-243

Change-Id: I1ab92ce7a48a7345d1041fa995b2c884d2408683
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: http://git-master/r/1275943
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
d05b5d5d1c video: tegra: host: dla: fill input status after sem
- fill input task status notifier after filling prefence actions
- use function over macro for action updates as supporting different
  types GoS, status, semaphore through single macro would be difficult
- correct max action size calculation to include task status size

Jira DLA-62

Change-Id: Ia0a57e0325667e3b36d9b6d0fb8b76d8c8a6c35d
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: http://git-master/r/1275942
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
604084622a video: tegra: host: dla: support output task status
- rework postaction fill to support multiple action types

- output task status notifier used to send task status to downstream
  clients in CV pipeline usecases.
- this adds support for it : copy out task status user data and
  pass to engine after pinning
- unpin user memory on task free

Jira DLA-62

Change-Id: I0c7be5d0652896ad5d0279c898efb4dd555b2afe
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: http://git-master/r/1275540
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
bca87c76ba video: tegra: host: dla: add support for input task status
- input task status notifier added as preactions and if task status
  of preaction matches with task status then task can proceed for
  execution
- this adds support adding input status notifier: alloc memory for
  task and task descriptor, copy and pin user memory, send IOVA of
  status notifier user memory to engine

Jira DLA-62

Change-Id: Ibfa3ea0a15dd173fc279ac58b1ab85d2c2e77d82
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: http://git-master/r/1275539
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
6ce179357d video: tegra: host: nvdla: do not flush queue if empty
No need to send flush command to firmware if queue is
empty. It adds unnecessary latency to device close.

Change-Id: I5d40ad3f9840f1f0b74f5f252f26f27f41ba74e5
Signed-off-by: Prashant Gaikwad <pgaikwad@nvidia.com>
Reviewed-on: http://git-master/r/1275524
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
05077ef1d2 video: tegra: host: dla: add TIMESTAMP semaphore
- this adds TIMESTAMP semaphore for postactions
- TIMESTAMP semaphore is similar to default SEMAPHORE with added field
  to update timestamp

Jira DLA-197

Change-Id: I2e663c7bfcf5e75727c9ac3a1c41ce333e45cf15
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: http://git-master/r/1274611
Reviewed-by: Prashant Gaikwad <pgaikwad@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-14 11:46:40 +00:00
Shridhar Rasal
cc7e3c8d9b video: tegra: host: dla: add semaphore support for postfence
- this adds semaphore/memsignal support in postfences
- while updating task descriptor, does pinning of UMD semaphore
  handle and received dma_addr added as postaction

Jira DLA-161

Change-Id: I37a9cc38c30ce70cb817fb9dc682b36dc9962834
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: http://git-master/r/1274328
Reviewed-by: Prashant Gaikwad <pgaikwad@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-14 11:46:40 +00:00
Shridhar Rasal
0f0aa8f942 video: tegra: host: dla: add semaphore support for prefences
- this adds semaphore/memsignal support in prefences
- while updating task descriptor, does pinning of UMD semaphore
  handle and received dma_addr added as preaction

Jira DLA-161

Change-Id: If3695b0cca29d485c04b93a83848d50ad81dd9fd
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: http://git-master/r/1274302
Reviewed-by: Prashant Gaikwad <pgaikwad@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-14 11:46:40 +00:00
Shridhar Rasal
8e43147075 video: tegra: host: dla: get ping cmd mem from pool
- command memory allocated during init, get that memory for ping command
  from 'cmd mem pool' and release after send cmd complete

Jira DLA-243

Change-Id: I6738e995e1fef9c1f13a0032b9e4796c255ea6e9
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: http://git-master/r/1274301
Reviewed-by: Prashant Gaikwad <pgaikwad@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-14 11:46:40 +00:00
Shridhar Rasal
e819214492 video: tegra: host: dla: alloc cmd mem init time
- as per safety coding guidelines and for command path submission improvement,
  move memory allocation for engine cmds during device init
- allocate memory in pool, based on number of max commands supported
  and max memory requirement
- for memory request, use bitmap and based on available bit, get memory
  offset within pool

Jira DLA-243

Change-Id: I28c8c02b3d99b42128d1990e7f342952286e4eb3
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: http://git-master/r/1274300
Reviewed-by: Prashant Gaikwad <pgaikwad@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-14 11:46:40 +00:00
Shridhar Rasal
d5b7e277d0 video: tegra: host: dla: remove dynamic alloc for task desc
- task desc allocated dynamically while task submit time,
  instead that, use mem from pool allocated Q init time
- this makes inline with safety coding guideline specification
  requirement and helps in improving submit path performance
- use nvhost queue API's to pass task desc size, assign and release
  memory

Jira DLA-204

Change-Id: I0931090fcbd2e6e27ed61ed7c014344f3ae493fc
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: http://git-master/r/1274299
Reviewed-by: Amit Sharma (SW-TEGRA) <amisharma@nvidia.com>
Reviewed-by: Prashant Gaikwad <pgaikwad@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-14 11:46:40 +00:00
Shridhar Rasal
05a321c3d9 video: tegra: host: dla: alloc debug dump only once
- there is race allocating, use and freeing debug dump memory
- allocate debug dump only once instead every poweron and free it in
  remove path
- this helps in improving engine boot time
- fix poweron fails path to avoid duplicate calling of engine poweroff
- add only one return statement in function
- use nvdla debug prints instead dev_err
- add more debug message

Jira DLA-224

Change-Id: Ic6d3a236bd5cc0afd26e4fa03185a3c3cd4b11c9
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: http://git-master/r/1271785
Reviewed-by: Prashant Gaikwad <pgaikwad@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-14 11:46:40 +00:00
Shridhar Rasal
517ab02128 video: tegra: host: dla: add support for postfence sync FD
- this adds support sync FD for postfences
- if fence type specified as sync fd, create sync fd from postfence
  syncpoint and send postfence back to user

Jira DLA-132

Change-Id: I13a57fb1315e908a5b029f507436eaecb23a1e03
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: http://git-master/r/1274298
Reviewed-by: Prashant Gaikwad <pgaikwad@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-14 11:46:40 +00:00
Shridhar Rasal
4e914b83a8 video: tegra: host: dla: add sync fd support for preactions
- rework updating preactions to support addition for different types
  of actions
- add sync fd support for preaction list update
- get added fences from fd and convert them into preactions

Jira DLA-132

Change-Id: I0977c1ee449c77db56c8cf5dfe028f2a41f2c8dd
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: http://git-master/r/1274297
Reviewed-by: Prashant Gaikwad <pgaikwad@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-14 11:46:40 +00:00
Shridhar Rasal
8fd3a5f486 video: tegra: host: dla: don't pass user args
- rework task submit API's to make sure that user arguments
  aren't passed beyond more than one API level
- alloc memory for copying task data and fill it before referencing
- this helps to avoid, reuse of user data all over in code and user data
  can be validated in place.

Jira DLA-246

Change-Id: I2805501577a422ed832f1d66cf5d44e4c02dbb25
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: http://git-master/r/1269490
Reviewed-by: Prashant Gaikwad <pgaikwad@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-14 11:46:40 +00:00
Shridhar Rasal
5a033517c3 video: tegra: host: dla: rework task alloc
- add new API to calculate task descriptor size
- split task alloc and add new API for preaction and postaction filling.
- reserve max possible memory for post and preactions

Jira DLA-236

Change-Id: Ide5c4f909f093695f441622fb7709acbe2a25e87
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: http://git-master/r/1267518
Reviewed-by: Prashant Gaikwad <pgaikwad@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-14 11:46:40 +00:00
Shridhar Rasal
6b544422ad video: tegra: host: dla: simplify use of fences
- Currently user fences and kernel fences differs in structure,
  which requires updating prefences and postfences fields element wise.
- Use same fence structure both places for simplification
  until they really differs

Jira DLA-236

Change-Id: Ib7071a81ced489a339203b22f8eb0afce1426053
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: http://git-master/r/1266417
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Prashant Gaikwad <pgaikwad@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-14 11:46:40 +00:00
Prashant Gaikwad
7c0964a77f video: tegra: host: nvdla: increase firmware version
Increase minor version from 3 to 4

- Removed operation information from task descriptor
- Added network descriptor
- Replace enums with macros

Jira DLA-147
Jira DLA-148
Jira DLA-192
Jira DLA-201

Change-Id: Iddaf32cd21efb6911d6e8bdf8ff3467de16a46d3
Signed-off-by: Prashant Gaikwad <pgaikwad@nvidia.com>
Reviewed-on: http://git-master/r/1270212
Reviewed-by: Shridhar Rasal <srasal@nvidia.com>
2023-04-14 11:46:40 +00:00
Prashant Gaikwad
8f058d0dc9 video: tegra: host: nvdla: update OS interface
Replace enum with macros

Jira DLA-202

Change-Id: Id80a3bb99726287f45d12600874bc7c472b8d5ec
Signed-off-by: Prashant Gaikwad <pgaikwad@nvidia.com>
Reviewed-on: http://git-master/r/1267279
Reviewed-by: Automatic_Commit_Validation_User
2023-04-14 11:46:40 +00:00
Prashant Gaikwad
684e0c3b04 video: tegra: host: nvdla: update task descriptor
All network related information is now added to network
descriptor which is created by UMD and used by firmware.
Remove that information from task descriptor and keep
only address list in task descriptor for IOVA translation.

Jira DLA-148

Change-Id: Ie25e5297a58cd0320f8ae994c1bd1fa670306594
Signed-off-by: Prashant Gaikwad <pgaikwad@nvidia.com>
Reviewed-on: http://git-master/r/1267278
Reviewed-by: Automatic_Commit_Validation_User
2023-04-14 11:46:40 +00:00
Vinod G
fd7ba26524 video: tegra: pva: Remove dynamic memory for task
Removing the dynamic memory allocation done for
task in the submit call.
Allocate the fixed task memory array based on
maximum task that can be supported per queue during
nvhost_queue_alloc call.
On task submit call obtain a task memory from pool based on availability.
Free that memory when task is done.
Deallocate  task pool memory on nvhost_queue_free call.

JIRA PVA-189

Change-Id: I93e89325c1c35a46bdf579dce6aae18c2bfe7183
Signed-off-by: Vinod G <vinodg@nvidia.com>
Reviewed-on: http://git-master/r/1264027
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
5e6c70f583 video: tegra: host: dla: correct IOCTL parameters names
- this is cosmetic change to remove _ctrl_ from interface fields and
  params

Change-Id: Ibb2aad75755fea158015f9f756c5b844a8984ded
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: http://git-master/r/1263102
GVS: Gerrit_Virtual_Submit
Reviewed-by: Prashant Gaikwad <pgaikwad@nvidia.com>
2023-04-14 11:46:40 +00:00
Shridhar Rasal
e018a06107 video: tegra: host: dla: use 0x92 preaction
- PREACTION_SEM_GE i.e. 0x92 blocks processing of further task until
  value at given pointer becomes greater than equal to updating value
- use 0x92 (PREACTION_SEM_GE) as default action for processing syncpoint
  as to make inline with fence wait
- Use MACROS from interface file

Jira DLA-198

Change-Id: Ibc5dbf171fd9a62cfd1a74341753a094d2caeddd
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Signed-off-by: Prashant Gaikwad <pgaikwad@nvidia.com>
Reviewed-on: http://git-master/r/1257860
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
25eec664e7 video: tegra: host: nvdla: update firmware version
Increase firmware version as interface is changed significantly
after firmware integration from HW tree.

Also, include dla_fw_version.h directly instead of defining
version.

Jira DLA-216
Jira DLA-234

Change-Id: I63e40e4bb13d9932b9893b46724267790f6c3822
Signed-off-by: Prashant Gaikwad <pgaikwad@nvidia.com>
Reviewed-on: http://git-master/r/1258114
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
a9592c05f0 video: tegra: host: nvdla: update os interface
New interface includes
- GoS region
- GoS action
- Task status notifier
- Added macros for pre-actions and post-actions
- New error code defined for retry

Jira DLA-216

Change-Id: Ica300d84dfd32d2987193d72352e8eb5aa3031e0
Signed-off-by: Prashant Gaikwad <pgaikwad@nvidia.com>
Reviewed-on: http://git-master/r/1258599
Reviewed-by: Shridhar Rasal <srasal@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-14 11:46:40 +00:00
Shridhar Rasal
9e9c3fa71b video: tegra: host: use dla debug prints for falcon
- nvdla dla debug has built-in support for tracing
- debug prints dumped to trace if en_trace flag is set
- to capture falcon debug prints when kernel tracing enabled and
  to avoid override debug dump coming from falcon use kernel setting
  for dumping data

Change-Id: I7803e1fa588b8bc068c506cb1ce7b370cb8c322f
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: http://git-master/r/1260021
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