Commit Graph

1805 Commits

Author SHA1 Message Date
Shridhar Rasal
540da62cf1 video: tegra: host: nvdla: add DLA2 fw version check
- Adds DLA2 firmware version interface for version
  verification
- Include DLA driver's t23x build path
- For firmware verification with multi-chip support,
  - Use nvhost_device_data's "version" param which distinguishes
    chip specific data at compile time
  - So encode fw version into "version" param.
- Inline function can't be used at compile so use available macro

Jira DLA-3182

Change-Id: Id9185c98ae924faea7a16d5f88d30c9b183c94f2
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-t23x/+/2359968
Reviewed-by: Praveen K <kpraveen@nvidia.com>
Reviewed-by: Amit Sharma (SW-TEGRA) <amisharma@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: Bharat Nihalani <bnihalani@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-14 11:46:41 +00:00
Bitan Biswas
4176935c35 kernel: nvidia: use k5.4 fuse APIs
Selected k4.14 fuse API mapping to k5.4 fuse API used is:
	tegra_read_chipid()		->	tegra_read_chipid()
	enum tegra_chipid tegra_get_chipid() ->	u8 tegra_get_chip_id()
	u8 tegra_get_chip_id()		->	u8 tegra_get_chip_id()
	tegra_get_platform()		->	tegra_get_platform()
	tegra_hidrev_get_chipid(chipid) ->	u8 tegra_get_chip_id()
	enum tegra_revision tegra_chip_get_revision() ->
				enum tegra_revision tegra_chip_get_revision()
		(Note: chip specific revision enum removed in k5.4,
		hence chip_id and revision comparison needed now.)
	u32 tegra_get_sku_id()		->	u32 tegra_get_sku_id()

Below downstream fuse data types are no longer used in k5.4:
	enum tegra_chipid

K5.4 specific T210b01 check is done using is_t210b01_sku().

bug 200591811

Change-Id: I2a259669802cb22bccafd435fa9fb7027ee0a9d3
Signed-off-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2335855
Reviewed-by: automaticguardword <automaticguardword@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-14 11:46:41 +00:00
Shridhar Rasal
e5d321cc10 video: tegra: host: nvdla: fix fw reloading
- Engine hang like issue causes device power reference
  count to go out of sync
- So forcefully put device into idle before firmware reload
- Reset device after firmware reload to make sure engine
  in clean state

Jira DLA-3147

Change-Id: I22c825065cb9157c85b8fd5ad4fcaac764383a9f
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2329686
Reviewed-by: automaticguardword <automaticguardword@nvidia.com>
Reviewed-by: Ken Adams <kadams@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-14 11:46:41 +00:00
Sudeshna
e793ebb2f8 video: tegra: nvdla: Bring Kernel Mode Driver up for Orin
Add new device node support for NVDLA in Kernel Mode Driver.

Change-Id: I050b5cbfd83b366b848bc92628deed83d43f0896
Jira: DLA-3099
Signed-off-by: Sudeshna <sguha@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2322119
Reviewed-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-14 11:46:41 +00:00
Shridhar Rasal
bd8b6299e5 video: tegra: host: nvdla: update dma mask
- update dma mask to set to 39 bit for allow dma address as per POR.

Bug 200565560

Change-Id: I86fd470b46089347958c44174ed535a6a55ef2f9
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2283414
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Anup Mahindre <amahindre@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: automaticguardword <automaticguardword@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-14 11:46:41 +00:00
Shridhar Rasal
aaf11d61f1 video: tegra: host: nvdla: set EMC rate on device open
Currently,
 - On device node close, nvhost ACM updates clock rate
   to default rate.
 - DLA default rate is set to UINT_MAX.
 - These causes max rate requests from DLA on device node close.

Fix,
 - Set default rate for DLA as zero. On device node close, aggregrate
   requests capped.
 - On device node open, keep EMC requests to max.
   so DLA inference doesn't impact for perf.

Bug 2769574

Change-Id: Icdaa8943ee143a5fa8c7310db9b7fac636c5be50
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Signed-off-by: nmalwade <nmalwade@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2255718
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-14 11:46:41 +00:00
Amit Sharma
70734cedf3 host: nvdla: Update dla_os_interface header
In order to make DLA Firmware code MISRA-C compliant there are
some changes in dla_os_interface.h to correctly align the data types.
Therefore update the KMD dla_os_interface.h.

Jira DLA-2716

Change-Id: Id519fb99d8a779d8363fab7140fb0b6a5142b00e
Signed-off-by: Amit Sharma <amisharma@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2241429
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-14 11:46:41 +00:00
Gunjan Mehta
59fe8f5aef dla: linux: add speculation barrieir in linux driver
Bug 200483495

Add speculation barriers for if and for loops to prevent spectre variant
1-S type attacks

Change-Id: If44a2c96047899accecf9604f3893daf681656c7
Signed-off-by: Gunjan Mehta <gmehta@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2230039
Reviewed-by: Arvind M <am@nvidia.com>
Tested-by: Arvind M <am@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@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
Arvind M
31a4285b17 video: tegra: host: pin with specific permission
[1] Facilitate pinning of buffer with user requested access
    permission
[2] This feature allows to restrict access to buffers shared
    with the device.

Jira DLA-2502

Change-Id: I175ad10922480689de57eb832040a7d59b29b9bd
Signed-off-by: Arvind M <am@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2209415
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Ken Adams <kadams@nvidia.com>
Reviewed-by: Prashant Gaikwad <pgaikwad@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-14 11:46:41 +00:00
Anup Mahindre
9343525fd1 video: tegra: host: dla: Remove tag debugfs node
The tag debugfs node is used to keep track of status of HEAD of the
firmware repo when binary was built. As we plan to move to using tmake
and building of firmware with the OS, this feature will not be useful
anymore.

Jira DLA-2381

Change-Id: I703ff74f2767be2169c7a2ca9ed77370401ade3c
Signed-off-by: Anup Mahindre <amahindre@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2178911
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-by: Mikko Perttunen <mperttunen@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
Anup Mahindre
0dd1143961 video: tegra: host: dla: Update headers from firmware
Update dla_os_interface.h and dla_fw_version.h to reflect changes
from firmware.

Jira DLA-2461

Change-Id: I4b948e75f94e2d5f7368585d8f27c56f45cc4705
Signed-off-by: Anup Mahindre <amahindre@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2179915
Reviewed-by: Arvind M <am@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@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:41 +00:00
Arvind M
c6ec7bcb20 video: tegra: host: restores sof/eof, TS feature
This commit restores the following,
[1] 890be46 video: tegra: host: dla: refactor and cleanup code
[2] 109f8e8 video: tegra: host: add prefence signal support
[3] 6f683c8 video: tegra: host: add sof/eof taskstatus support
[4] a9cb0c9 video: tegra: host: add sof/eof timestamp support
[5] dcdb0d6 video: tegra: host: increase fw minor version

Jira DLA-1992
Jira DLA-1993

Change-Id: I9844b141b72fc553ba7d886e706e340160586129
Signed-off-by: Arvind M <am@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2135092
Tested-by: Mitch Harwell <mharwell@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Prashant Gaikwad <pgaikwad@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-14 11:46:41 +00:00
Sachin Jadhav
fccb639c36 Revert "video: tegra: host: dla: refactor and cleanup code"
This reverts commit 890be4695779114b3cd459bb5779ce39aecec9cd.

Change-Id: Ibcfe4594a479a28a18fa9fbd07ec4f675e93f319
Signed-off-by: Sachin Jadhav <sachinj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2133509
2023-04-14 11:46:41 +00:00
Sachin Jadhav
f9f2c6598d Revert "video: tegra: host: add prefence signal support"
This reverts commit 109f8e8c53e5296ea8c782086500c2e78d99cfbd.

Change-Id: I4fd6f37e271c52f4a1c1b6870c0b1355118a301d
Signed-off-by: Sachin Jadhav <sachinj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2133502
2023-04-14 11:46:41 +00:00
Sachin Jadhav
ef831a5207 Revert "video: tegra: host: add sof/eof taskstatus support"
This reverts commit 6f683c8a174b0a937ea6324e017c46df81398f25.

Change-Id: Ic7527e007b608c43245250343101ceee2aeaf742
Signed-off-by: Sachin Jadhav <sachinj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2133504
2023-04-14 11:46:41 +00:00
Sachin Jadhav
84786d578b Revert "video: tegra: host: increase fw minor version"
This reverts commit dcdb0d68cf87c064d2e80c001272cc88f26371ac.

Change-Id: I9266d95a855ea6a4baae2e5061d00d7661c6f576
Signed-off-by: Sachin Jadhav <sachinj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2133506
2023-04-14 11:46:41 +00:00
Sachin Jadhav
1d37583a5f Revert "video: tegra: host: add sof/eof timestamp support"
This reverts commit a9cb0c9ef7710387683f0449f9054a4409a789bc.

Change-Id: Iff17331654a9055527ab2074fee4a6ae67acb80f
Signed-off-by: Sachin Jadhav <sachinj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2133505
2023-04-14 11:46:41 +00:00
Arvind M
42a53a0cde video: tegra: host: increase fw minor version
Increase minor version of firmware from 0 to 1

Jira DLA-1992
Jira DLA-1993

Change-Id: I81041122af8f206e29eb779da734056fd5b698c6
Signed-off-by: Arvind M <am@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2131337
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@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
Arvind M
6e76995152 video: tegra: host: add sof/eof timestamp support
[1] Fills SOF/EOF timestamp buffer action before SOF/EOF
    signal actions.
[2] Adds action opcode ACTION_WRITE_TIMESTAMP to inform
    firmware for scribbling timestamp buffer.
[3] Decrement MAX_TASKS_PER_SUBMIT from 24 to 16, since existing
    results in stack size > 2048 byts (overflow).

Jira DLA-1992
Jira DLA-1993
Jira DLA-251

Change-Id: Ie16292a963a97fbea68ad6860dcfc39b85c4b55b
Signed-off-by: Arvind M <am@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2121532
Reviewed-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@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
Arvind M
971fe01893 video: tegra: host: add sof/eof taskstatus support
[1] Adds sof_task_status field which is written before
    start of task execution. (i.e before SOF signals)
[2] eof_task_status feature already exists in form of
    output_task_status (field renamed for clarity)

Jira DLA-1992
Jira DLA-1993

Change-Id: Icc26a7a40f18bb2af1caaff054641c45b9772945
Signed-off-by: Arvind M <am@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2121531
Reviewed-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@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
Arvind M
ccfa8a0b47 video: tegra: host: add prefence signal support
[1] Adds support for prefence signal support
[2] Facilitates handling of SOF feature request from higher
    levels
[3] Update ioctl structure for emu_submit to allow prefence
    with signal action

Jira DLA-1992
Jira DLA-1993

Change-Id: Id0fe8a7a3ff46227121ec5342197b1da2a3f346d
Signed-off-by: Arvind M <am@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2121530
Reviewed-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@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
Arvind M
67863abdbe video: tegra: host: dla: refactor and cleanup code
[1] Action op code macros has been renamed for better
    representation
[2] It has been categorized based on control (ACTION_TERMINATE),
    read (ACTION_*_[GE|EQ]) and write actions (ACTION_WRITE_*)
[3] Extract different functions from nvdla_fill_preactions and
    nvdla_fill_postactions
        - nvdla_fill_wait_fence_action
        - nvdla_fill_signal_fence_action
        - nvdla_fill_taskstatus_read_action
        - nvdla_fill_taskstatus_write_action
    This is useful if some functions are used by both fill_preactions
    and fill_postactions

Jira DLA-2027

Change-Id: Iddac852cee7d491be18982c97f930401dd41f855
Signed-off-by: Arvind M <am@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2121529
Reviewed-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@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
Ken Adams
29990e14ce video: tegra: host: dla: use nvdla_queue
enables prior changes in make

Jira DLA-1536

Change-Id: I14147bbb406f25e52e9c9100ef6f7a29fb449032
Signed-off-by: Ken Adams <kadams@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2129678
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Tested-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-14 11:46:41 +00:00
Ken Adams
948891a5dc video: tegra: host: dla: switch to nvdla_buffer
Jira DLA-1536

Change-Id: I5e9a91187819ad2bb6adfc199de8a4adba70e90f
Signed-off-by: Ken Adams <kadams@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2129677
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Tested-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-14 11:46:41 +00:00
Ken Adams
32b8fe3ec7 video: tegra: host: dla: factor out nvhost queue
Jira DLA-1536

Change-Id: I843e8d86916ebf2e48a820f2e6d1b12a624ccce3
Signed-off-by: Ken Adams <kadams@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2127556
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Tested-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-14 11:46:41 +00:00
Ken Adams
869e7c5d5d video: tegra: host: dla: factor out nvhost buffer
Jira DLA-1536

Change-Id: Ida656cb69043955037a2b1533c52f59494383d20
Signed-off-by: Ken Adams <kadams@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2127555
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Tested-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-14 11:46:41 +00:00
Shridhar Rasal
09d20ace24 video: tegra: host: dla: addresslist alignment to 256
- addresslist start address and size aligned to 8.
  So falcon dma can fetch upto 8 bytes.
- For better perf optimizations make both aligned 256.
- update firmware os interface
- update firmware version

Jira DLA-946

Change-Id: Id928018be43e3d3d9283f4cf62b59f993854fef0
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2107410
Reviewed-by: Prashant Gaikwad <pgaikwad@nvidia.com>
Reviewed-by: Arvind M <am@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Tested-by: Bharat Nihalani <bnihalani@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
Bharat Nihalani
b33381e221 video: tegra: host: dla: disable GOS again
This reverts commit 7bf041f6877c792c80d997d66e8a65d5f28ec095
since GOS failure prints are still seen on D5L platform.

Bug 2275471

Change-Id: I320d7bee535fb9ac09f56632e92c24aceea62732
Signed-off-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2088442
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:41 +00:00
Amit Sharma
ff46f4fd95 video: tegra: host: update fw version interface
- update firmware version for 0.12.a

Jira DLA-1885
Bug 200505794

Change-Id: I22a11f86b7896d2539f35408632d89bb4603d168
Signed-off-by: Amit Sharma <amisharma@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2086686
Reviewed-by: Shridhar Rasal <srasal@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:41 +00:00
Shridhar Rasal
0388beef0b video: tegra: host: update os and fw version interface
- Update newly added SDL EQL mismatch error code through dla os
  interface
- update firmware version for 0.12.9

Jira DLA-1793

Change-Id: I664f2c7c23ad2983865486c7063f3f869a5aa4a8
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2079095
Reviewed-by: Prashant Gaikwad <pgaikwad@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-14 11:46:41 +00:00
Puneet Saxena
e7f1d14fd3 Revert "video: tegra: host: dla: disable GOS"
This reverts commit f5d151d4d06a426af8cb1a2b1a3c53a826b7e811.

The change is not needed. GoS regresses due to
switch from NVMAP to NVMAP_V2.

With the change  https://git-master.nvidia.com/r/2032545
NVMAP is resumed hence the change is not needed.

Bug 200497310

Change-Id: Idabdef3591b0320438fe03c40c36826db4c2b7b9
Signed-off-by: Puneet Saxena <puneets@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2032551
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@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
Shridhar Rasal
e9ecc84ce2 video: tegra: host: dla: disable GOS
GOS is not working with kernel 4.14 and is hence disabled until GOS
issue is fixed.

Bug 200497310

Change-Id: Ie14bfa92e8af659f2192bf4f8f9b488013bbcc64
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2030013
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: Bharat Nihalani <bnihalani@nvidia.com>
Tested-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-14 11:46:41 +00:00
Dmitry Antipov
55902dfb1e video: tegra: host: nvdla: use narrower types for DLA task data
Since all of MAX_NUM_NVDLA_PREFENCES, MAX_NUM_NVDLA_POSTFENCES,
MAX_NUM_NVDLA_IN_TASK_STATUS and MAX_NUM_NVDLA_OUT_TASK_STATUS are 32,
it is possible to use narrower 'u8' type for appropriate counters.

This is similar to what we have in PVA and also fixes some annoying
warnings issued by automatic validators.

Signed-off-by: Dmitry Antipov <dantipov@nvidia.com>
Change-Id: Ia99ecb7daed7b60336254b18acaab31fab157ad4
Reviewed-on: https://git-master.nvidia.com/r/1980368
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
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