Commit Graph

15 Commits

Author SHA1 Message Date
Johnny Liu
f826f7efc3 drm/tegra: Register actmon for the vic client
Register vic actmon to export the engine utilization information in the
debugfs.

Bug 3788919

Signed-off-by: Johnny Liu <johnliu@nvidia.com>
Change-Id: I3bde644a7708d0b59f6e3a24fc40f4b95b6a6789
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2887424
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-04-19 10:49:38 -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
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
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
429e344bea drm/tegra: vic: Add Tegra234 support
Add Tegra234 support for VIC. It is backwards compatible with
Tegra194.

Bug 3724727

Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Change-Id: I4421906847f7097bfbde1d3cb1191ab6c2fd58e0
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2745965
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: Brad Griffis <bgriffis@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
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
Jon Hunter
1980c277ea drm/tegra: Drop support for pre-Linux v5.14 kernels
Drop support for Linux kernel earlier than v5.14 for the Tegra DRM
driver.

Bug 3724727

Change-Id: Id6467ed9abdfae8e134ea2e6f38540b1b6be88a8
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2739539
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
Mikko Perttunen
3f528cb16c UPSTREAM: drm/tegra: Bump VIC clock rate to Fmax
To get full performance out of this engine, bump their clock rate
to maximum. In the future we may want something smarter but this
should be fine for now.

Change-Id: I2b05bec99dc63f670b0d54cb71715dec2b8f57ee
Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2599710
(cherry picked from commit d9fc58e4a1e776993f039c7298a4cc3150704dc5)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2620154
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-03 09:18:59 +00:00
Mikko Perttunen
a2489aa01a UPSTREAM: drm/tegra: vic: Use autosuspend
When going idle, it's not unlikely that more work will follow.
As such, use autosuspend with a 500ms suspend delay.

JIRA LS-95

Change-Id: I4a12fa358da2b81eb46ef3d7c44ab854068eed1b
Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2584497
(cherry picked from commit a7836a45f4b6eb36c573bf75da745c12d173fa52)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2587387
Reviewed-by: David Ung <davidu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: David Ung <davidu@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-03 09:18:59 +00:00
Mikko Perttunen
d825474616 UPSTREAM: drm/tegra: vic: Add comments on STREAMID registers
Add comments clarifying use of the THI_STREAMID0 and THI_STREAMID1
registers.

Change-Id: I2da11187e2bea5b1947c334822cabee22b7de521
Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2545935
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-03 09:18:59 +00:00
Mikko Perttunen
9d055ca53b drm/tegra: Don't invoke SET_APPLICATION_ID on VIC boot
On new Tegra194 firmwares, this causes an error state in the firmware
which can cause job failures.

Change-Id: I20bba4875f760f7aa5d438b068dedba1deadcad5
Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2532485
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
Mikko Perttunen
e901dffc48 drm/tegra: falcon: Support newer VIC firmware
Support newer VIC firmware by accepting the new magic number 0x10fe,
loading the full code segment instead of just the first page at boot
time, and skipping FCE setup if the firmware header indicates that
FCE is handled internally by the firmware.

JIRA LS-34

Change-Id: I97c394ace6557a589901b2c4b2ad1b72619cbf66
Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2498819
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-03 09:18:59 +00:00
Jon Hunter
b8c2d943ed drm/tegra: Add upstream tegra-drm driver
Add the upstream tegra-drm driver with the 'Host1x/Tegra UAPI' series
[0] applied. This driver will be built as an external module for testing
and development with upstream Linux kernels.

The following modifications have been made to the series posted upstream
1. Update the Makefile to always build the driver as a module
2. Always enable the tegra_drm_ioctl_xxx in the tegra_drm_ioctls and
   remove the dependency on CONFIG_DRM_TEGRA_STAGING.
3. Rename the include/uapi/drm/tegra_drm.h to
   include/uapi/drm/tegra_drm_next.h to avoid conflicts with upstream
   headers when building as an external module.
5. Rename the module that is built to be tegra-drm-next.ko instead of
   tegra-drm.ko to avoid any depmod conflicts with the upstream driver.

[0] https://patchwork.ozlabs.org/project/linux-tegra/list/?series=215770

Bug 3156385

Change-Id: I19206f989325c9c6ff3c2b9301d964140d52234f
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2435802
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
2023-04-03 09:18:59 +00:00