Commit Graph

1917 Commits

Author SHA1 Message Date
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
Shridhar Rasal
3f12a94e06 video: tegra: host: dla: handle queue abort
- queue abort invoked by user releasing device
- send queue flush command to engine to handle queue abort callback
- fix checkpatch errors

Jira DLA-171

Change-Id: Ied5440af7519c6cc145de4d92fe1e0645d6a05bb
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: http://git-master/r/1257079
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
Amit Sharma (SW-Tegra)
b79f6e271a video: tegra: host: nvdla: add trace support
- Add debugfs to read the traces
    - Add support for trace buffer reading
    - Add DLA_REGION_TRACE region
    - Use Trace Buffer of size 1MB
    - Pass wait param to nvdla_send_cmd() for printf cmd
      and correct buffer freeing logic for it.

JIRA DLA-94

Change-Id: I42c0b1cb5b3cb1d4866deb80b7636964795d6de5
Signed-off-by: Amit Sharma (SW-Tegra) <amisharma@nvidia.com>
Reviewed-on: http://git-master/r/1229942
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Shridhar Rasal <srasal@nvidia.com>
2023-04-14 11:46:40 +00:00
Prashant Gaikwad
bc8bf342a7 video: tegra: host: dla: increase command timeout
Increase command timeout as in some cases command
execution may take more time, for example when we
have added debug prints in command execution path.

Change-Id: I5222f58d5cdbc79447679219970a3630e35b2a80
Signed-off-by: Prashant Gaikwad <pgaikwad@nvidia.com>
Reviewed-on: http://git-master/r/1249546
2023-04-14 11:46:40 +00:00
Shridhar Rasal
248a3e446f video: tegra: host: dla: add debugfs for fw version
- add debugfs to dump loaded firmware's version

Jira DLA-125

Change-Id: I0063aeaf52481543694b27f0c3212e5f11021118
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: http://git-master/r/1246377
Reviewed-by: Prashant Gaikwad <pgaikwad@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-14 11:46:40 +00:00
Shridhar Rasal
7cdb90c217 video: tegra: host: dla: add fw version checks
- check firmware version during engine poweron and return failure if
  expected firmware version doesn't match

Jira DLA-125

Change-Id: I7283655b914d30bed64478f50531f035976de85d
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: http://git-master/r/1246376
Reviewed-by: Prashant Gaikwad <pgaikwad@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-14 11:46:40 +00:00
Shridhar Rasal
f02bb00830 video: tegra: host: dla: use queue refcnt
- while submitting a task get a reference for queue and release
  reference on task completion.
- this is necessary to avoid freeing of queue on user instance close and
  also to avoid reuse of it for by next user

Jira DLA-207
Bug 200246031

Change-Id: If441ad4171acee3550fdbebc887043a971985c88
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: http://git-master/r/1244425
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
361e522423 video: tegra: host: add next and sequence fields to task desc
- task descriptor has two fields next and sequence which helps engine
  scheduler for tracking list of tasks from a given queue.
- 'next' pointer gives next task in queue
- 'sequence' number gives task number

Jira DLA-207

Change-Id: If80d38b01d0b10cea791767ec8d0a3a1787cf645
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: http://git-master/r/1244424
Reviewed-by: Prashant Gaikwad <pgaikwad@nvidia.com>
Tested-by: Prashant Gaikwad <pgaikwad@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-14 11:46:40 +00:00
Shridhar Rasal
ff414053c8 video: tegra: host: dla: add MSS syncpoint support
- adds syncpoint<->MSS support for DLA
- register dla enginges with MSS interface during init
- while task submission fetches dma address from interface for a given
  syncpoint
- removes temp hack added to use dma address
- remove temp slice syncpoint support added for verification without MSS
  support

Jira DLA-100

Change-Id: Iff5665f1aa2fce6f3bfa594e9909ebfc96a916bf
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: http://git-master/r/1242663
Reviewed-by: Prashant Gaikwad <pgaikwad@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-14 11:46:40 +00:00
Prashant Gaikwad
d783776311 video: tegra: host: nvdla: add more info to task
Add below information to task descriptor
- Address list
- LUT data
- Dynamic ROI

Jira DLA-176

Change-Id: I067025da34a68a2d81c5e3829ac76c516ed8754b
Signed-off-by: Prashant Gaikwad <pgaikwad@nvidia.com>
Reviewed-on: http://git-master/r/1221382
2023-04-14 11:46:40 +00:00
Prashant Gaikwad
fd0023d8df video: tegra: host: nvdla: add offset to memory handles
Use offset and memory handle to calculate IOVA address
for descriptors. It allows using single buffer in user
space for all descriptors.

Jira DLA-176

Change-Id: I141efa7fc8662be8aa4b5c3bd2ea7a369a90769a
Signed-off-by: Prashant Gaikwad <pgaikwad@nvidia.com>
Reviewed-on: http://git-master/r/1220956
2023-04-14 11:46:40 +00:00
Prashant Gaikwad
cbadc2aa0c video: tegra: host: nvdla: add protocol for command
Some commands need completion or error notification
from firmware to proceed ahead such as clearing some
resources or reading response from firmware.

Add mechanism to wait for command complete or error
notification from firmware. This add limitation of
handling only one command at a time as there is single
set of registers for command send and response.

Add locking for command send so that only one command
is processed at one time.

Remove wait for idle from ping command and instead
use waiting mechanism.

Clean up task resources if task submit command fails.

Jira DLA-127
Jira DLA-176

Change-Id: I92246c080c730dcae514bcea93b78372799bda4a
Signed-off-by: Prashant Gaikwad <pgaikwad@nvidia.com>
Reviewed-on: http://git-master/r/1219539
2023-04-14 11:46:40 +00:00
Shridhar Rasal
90ba91c011 video: tegra: host: dla: add api to free task
- updates syncpoints as per fence for task
- updates task free API's

Jira DLA-127
Jira DLA-176

Change-Id: I2a35a782294cb0d5f90f1b56a9ba6a44d14b5381
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Signed-off-by: Prashant Gaikwad <pgaikwad@nvidia.com>
Reviewed-on: http://git-master/r/1218313
Reviewed-by: Automatic_Commit_Validation_User
2023-04-14 11:46:40 +00:00
Shridhar Rasal
7f3a13acfc video: tegra: host: dla: manage operation desc
- pin mapped operation descriptor buffers during task submission
- get operation descriptors handle from user and pass its IOVA to engine
- pin API returns IOVA for given mem handle
- unpin operation descriptors buffers in task cleanup

Jira DLA-93

Change-Id: I78fb22301ab472685c3bae7c424d75140b814887
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: http://git-master/r/1213761
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
a53758ab10 video: tegra: host: dla: correct num task check
- fix boundary conditions for num tasks passed by user
- check for module power on return condition
- fix ioctl cmd check
- always send fence type to user after updating

- use nvdla debug prints

Bug 1806862

CID 38896
CID 38897
CID 442978
CID 442983

Change-Id: I57e70da99f7f6bcac111a10f8255428b433cec5a
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: http://git-master/r/1209580
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: Prashant Gaikwad <pgaikwad@nvidia.com>
2023-04-14 11:46:40 +00:00
Shridhar Rasal
7a65345fdd video: tegra: host: dla: add debug prints
- add debug prints for function tracing, register access, IOCTL,
  and task submit and completion handlers

Jira DLA-133

Change-Id: Ib7c18ff959431a1c7fd0cdc53e77793fba8feac6
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: http://git-master/r/1203697
Reviewed-by: Amit Sharma (SW-TEGRA) <amisharma@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Prashant Gaikwad <pgaikwad@nvidia.com>
2023-04-14 11:46:40 +00:00
Shridhar Rasal
d51249a8a7 video: tegra: host: dla: add debugging utils
- add debug macro functions for different debug levels like,
  info, function, register access etc.
- add option to print to either on console or trace
- add debugfs to set different debug levels and flag to choose
  trace

Jira DLA-134
Jira DLA-135
Jira DLA-136

Change-Id: I4cfbb463a2cf1a47d40dce911c86abb4542f957a
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: http://git-master/r/1203575
GVS: Gerrit_Virtual_Submit
Reviewed-by: Prashant Gaikwad <pgaikwad@nvidia.com>
2023-04-14 11:46:40 +00:00
Shridhar Rasal
2e07947262 video: tegra: host: dla: add basic tasklist support
- fix include files path in makefile
- fix ioctl include header file path
- update comments in doxygen format

add support to submit task to engine as per tasklist
  management protocol
- maintain list of tasks under assigned queue with ref counts
- allocates task to maintain list of fences and update them
- dma alloc task descriptor and action list and update them
- submit tasks one by one and send received fence back
  to application
- register for syncpoint notifier with nvhost for completion
  of fence
- on fence completion interrupt handler, cleanup task

Jira DLA-52

Change-Id: Ibe385f47dc9f17dda79cca3daf29b89218dc7289
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: http://git-master/r/1191495
Reviewed-by: Prashant Gaikwad <pgaikwad@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
2023-04-14 11:46:40 +00:00
Shridhar Rasal
4a791935cd video: tegra: host: dla: do not send cmd during poweroff
- as falcon may not be in a state to process any more request in poweroff
  path, do not send set region command

Jira DLA-19

Change-Id: I7ac858554f769b659d2738f7c8ed48b53cc8ec15
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: http://git-master/r/1197453
2023-04-14 11:46:40 +00:00
Shridhar Rasal
14a5a1d015 video: tegra: host: dla: move dla queue API's
- move queue related DLA API's to new file to include task API's
  along with

Jira DLA-19

Change-Id: I312e021314a3fb7d03dd31a557fb7cf6d6fc86ca
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: http://git-master/r/1191494
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
2023-04-14 11:46:40 +00:00
Shridhar Rasal
76148fdb14 video: tegra: host: dla: add submit IOCTL
- add initial task submit stub

Jira DLA-19

Change-Id: Iea249cfd14cf186b984d1f296373740f80429c3d
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: http://git-master/r/1191493
2023-04-14 11:46:40 +00:00
Shridhar Rasal
817230d68c video: tegra: host: dla: split IOCTL API's
- as core driver code is growing, split IOCTL related API's
  to new source file.

Jira DLA-19

Change-Id: I42ce24300671392e6ac99fcdae12e2525f74e57e
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: http://git-master/r/1191491
2023-04-14 11:46:40 +00:00