Commit Graph

14 Commits

Author SHA1 Message Date
Mikko Perttunen
5395e466bf drm/tegra: Job hardware timestamping support
Add support for emitting ftrace events for job submissions with
hardware timestamps, including configuring engines to capture
timestamps when execution starts and ends.

Bug 3829397

Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Change-Id: I3a3f6fcf931d7f8fb337f029af7729ffc2cbb972
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2891349
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-26 20:08:33 -07:00
Mikko Perttunen
63901a1066 drm/tegra: Enable runtime PM during probe
Currently, engine drivers only enable runtime PM during the host1x
init callback. This can happen slightly later than the probe, which
can cause the power domain to intermittently not be turned off after
probe.

My hypothesis is that there is a race condition between the post-probe
power domain poweroff that is done from a queued work, and the
pm_runtime_enable call happening in the host1x init callback.
If the pm_runtime_enable call happens first, everything is OK and
the power off work can disable the power domain as PM runtime is
enabled and the device is runtime suspended. If power off work runs
first, PM runtime is still disabled for the device and the domain
must be kept powered.

Resolve the issue by moving the runtime PM enablement to the
probe function.

Bug 3982357

Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Change-Id: I3e028bc03c8ff05d18e63039ac9e590c4557e268
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2859475
Reviewed-by: Santosh BS <santoshb@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-04-03 09:18:59 +00:00
Mikko Perttunen
e1ae7a73d5 drm/tegra: HACK: Avoid core kernel changes for NVDEC boot
To allow NVDEC boot on T234 before core kernel changes are upstreamed,
apply hacks to directly read MC registers and hardcode firmware
descriptor information.

Bug 3778105

Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Change-Id: I5a26e33f656dfababc17a3443c721ba0d327defb
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2771771
(cherry picked from commit e404fef7d0824b7620dd6307755e57cc6cdd40d7)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2768897
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Tested-by: Jonathan Hunter <jonathanh@nvidia.com>
2023-04-03 09:18:59 +00:00
Mikko Perttunen
79282354d0 drm/tegra: Add Tegra234 support to NVDEC driver
Add support for the Tegra234 version of NVDEC to the NVDEC driver.
This version sports a RISC-V controller and requires a few additional
clocks. After firmware has been loaded, the behavior is, however,
backwards compatible.

Bug 3778105

Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Change-Id: I87f851875253efbc1768a87e7ee241f64ba681a5
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2771769
(cherry picked from commit 55200e3b3a4f7a3b6e2d6b1adbfd28ba26b9372d)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2759061
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
Tested-by: Jonathan Hunter <jonathanh@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-04-03 09:18:59 +00:00
Mikko Perttunen
f535883c6a drm/tegra: Introduce program_iommu_regs helper
The VIC and NVDEC drivers contain some duplicated code. Start chipping
away at that by introducing a helper for programming the TRANSCFG
and STREAMID registers.

Bug 3778105

Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Change-Id: I30f9cf3fb8fb89fa5abf5f5e17ba41649a42097e
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2771766
(cherry picked from commit 27872b2f90d66d8706594f5903cff4d2b1e88be4)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2759058
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Tested-by: Jonathan Hunter <jonathanh@nvidia.com>
2023-04-03 09:18:59 +00:00
Mikko Perttunen
e906f87373 drm/tegra: nvdec: Support multiple clocks
NVDEC on Tegra234 requires multiple clocks. Add support for that.

Bug 3778105

Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Change-Id: I7c6ac2a2567e03a148deb86c5328e709a6b164bb
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2771765
(cherry picked from commit 91ab71267a2ecc7be9fea64118836264bfe5071f)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2768896
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Tested-by: Jonathan Hunter <jonathanh@nvidia.com>
2023-04-03 09:18:59 +00:00
Jon Hunter
437bb539be drm/tegra: Update to Linux v6.0-rc5
Update the Tegra-DRM driver to align with the latest upstream driver
from Linux v6.0-rc5.

Bug 3767126

Change-Id: Iaadc3b6a616b327fea5dab9acfba9c1d174557d3
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2776688
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-04-03 09:18:59 +00:00
Mikko Perttunen
88c0b67c1d drm/tegra: Implement stream ID related callbacks on engines
Implement the get_streamid_offset and can_use_memory_ctx callbacks
required for supporting context isolation. Since old firmware on VIC
cannot support context isolation without hacks that we don't want to
implement, check the firmware binary to see if context isolation
should be enabled.

Bug 3724727

Change-Id: Ie4c952987f2a5ae660257194b43c18829ac707c4
2023-04-03 09:18:59 +00:00
Mikko Perttunen
250d164381 drm/tegra: nvdec: Fix TRANSCFG register offset
NVDEC's TRANSCFG register is at a different offset than VIC.
This becomes a problem now when context isolation is enabled and
the reset value of the register is no longer sufficient.

Bug 3724727

Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Change-Id: Ic83043dcc49a3739fe310cfb5b143b42d9aa259b
2023-04-03 09:18:59 +00:00
Jon Hunter
57b7756289 drm/tegra: Update to Linux v5.19-rc1
Update the Tegra DRM driver to align with the latest upstream Tegra DRM
driver from Linux v5.19-rc1.

Bug 3724727

Change-Id: I5dc54eee6cd2c5c62832e1844cd3df59fcabe976
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2739541
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
2023-04-03 09:18:59 +00:00
Mikko Perttunen
02b028d02a drm/tegra: Merge upstream changes
Merge upstream changes from linux-next, including merged version
of new UAPI.

Change-Id: I4f591d39e51ac6ab6877a0bd428adf166eca3c55
Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2653095
Tested-by: Jonathan Hunter <jonathanh@nvidia.com>
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-03 09:18:59 +00:00
Jon Hunter
f1ec6fabaf drm/tegra: Update device-tree property for NVDEC
The device-tree property for identifying the NVDEC instance has been
updated and so update the NVDEC driver to align with upstream.

JIRA LS-96

Change-Id: I7bcb074601049a3ac81c0069a865c467008a7846
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2602720
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
(cherry picked from commit 81fcabc1c77c79a345a443e99aadf279d1fb6586)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2615189
Reviewed-by: David Ung <davidu@nvidia.com>
Tested-by: David Ung <davidu@nvidia.com>
2023-04-03 09:18:59 +00:00
Jon Hunter
254980dab4 UPSTREAM: drm/tegra: Update NVDEC driver to latest upstream version
Update the NVDEC driver to the latest version that is being upstreamed.
Main notable updates are ...

1. Remove reset handling, done by power domain code
2. Add pm-runtime autosuspend support to improve performance
3. Update device-tree property name for the NVDEC instance

JIRA LS-96

Change-Id: Ibe980fe0c71408fd7754b2c75d979bce12b10602
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2584498
(cherry picked from commit 6c04abe593cfbd7c2a07b07ecb4a38fd1cfdcf60)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2587388
Reviewed-by: David Ung <davidu@nvidia.com>
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: David Ung <davidu@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-03 09:18:59 +00:00
Mikko Perttunen
cc014ee851 drm/tegra: Add NVDEC support
Support NVDEC (both instances on Tegra194).

Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Change-Id: I8f6c841a16103fbf37bff3a3440d69059f2644f0
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2532426
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-03 09:18:59 +00:00