Johnny Liu
d171c817ec
drm/tegra: Correct icc cleanup logic
...
Since devm_of_icc_get is used, no need to call icc_put when device probe
fails or device driver is removed.
Bug 4222919
Signed-off-by: Johnny Liu <johnliu@nvidia.com >
Change-Id: Ide313c6f56e1bef83ffe3718cd434abbdaeec869
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2947933
Reviewed-by: svcacv <svcacv@nvidia.com >
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com >
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com >
2023-08-04 14:09:18 -07:00
Jon Hunter
9f2ed528c8
drm/tegra: Fix interconnect support for Linux v6.2+
...
Interconnect support for multimedia engines is disable for Linux v6.2
kernels. Rather than always disabling interconnect support for these
kernels, we just need to ensure the necessary upstream kernel patches
are in place for Linux v6.2 kernels. Therefore, enable interconnect
support for all kernels.
Bug 4097374
Change-Id: Ibceb866ba239454a131543cdff90e68007b28942
Signed-off-by: Jon Hunter <jonathanh@nvidia.com >
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2937758
Reviewed-by: Johnny Liu <johnliu@nvidia.com >
Reviewed-by: Sumit Gupta <sumitg@nvidia.com >
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com >
2023-07-20 01:16:09 -07:00
Johnny Liu
ff572997a3
drm/tegra: Wrap register init code in function
...
Put the actmon-related register initialization code in the function for
readability.
Bug 4183393
Signed-off-by: Johnny Liu <johnliu@nvidia.com >
Change-Id: Id68d128ae330105da0d3f76270fe38d57c12c740
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2931793
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com >
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com >
2023-07-10 10:05:47 -07:00
Johnny Liu
3264c9dfca
drm/tegra: Skip non-clock update in suspend mode
...
When the device is in suspend mode, There is no point to update
actmon count weight and send ICC request for the device.
If ICC request is sent for the device in suspend mode, in osidle state,
the default EMC frequency will be affected due to the accumulated ICC
bandwidth QoS constraint, and affect the overall osidle power.
Bug 4168788
Signed-off-by: Johnny Liu <johnliu@nvidia.com >
Change-Id: I8700b131b5f914d93feed9f8a9d792c2fdaa9b53
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2931905
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com >
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com >
2023-07-07 07:01:02 -07:00
Johnny Liu
da7cd1c546
drm/tegra: Enable disable actmon in RPM callbacks
...
Actmon should be enabled only when engines are active.
Bug 4168788
Signed-off-by: Johnny Liu <johnliu@nvidia.com >
Change-Id: Ifb4bfe67357402266080331ea18ae2a9af2d85ee
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2931890
Reviewed-by: Santosh BS <santoshb@nvidia.com >
Reviewed-by: Bibek Basu <bbasu@nvidia.com >
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com >
2023-07-07 07:00:52 -07:00
Johnny Liu
4241a7c976
drm/tegra: Export active signal to actmon
...
As long as the subcomponents in the engine are active, we consider the
engine as active and the engine should export active signal to the
actmon.
Bug 4179140
Signed-off-by: Johnny Liu <johnliu@nvidia.com >
Change-Id: Ic4cccf29e8ac87da24f6fe3bf1f1e93a11511762
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2930445
Reviewed-by: svcacv <svcacv@nvidia.com >
Reviewed-by: Rajkumar Kasirajan <rkasirajan@nvidia.com >
Reviewed-by: Bibek Basu <bbasu@nvidia.com >
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com >
2023-07-05 14:55:49 -07:00
Ankita Garg
1360c38cf4
drm/tegra: Fix compile errors with clang
...
Fix build errors encountered when building the modules with android
common kernel(ACK) using clang.
Bug 3974840
Change-Id: Ie12d5143c3c13a66dcd5f0ee06035593d5bec6a6
Signed-off-by: Bruce Xu <brucex@nvidia.com >
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2921068
Reviewed-by: svcacv <svcacv@nvidia.com >
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com >
Tested-by: Jian-Min Liu <jianminl@nvidia.com >
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com >
2023-06-19 06:55:39 -07:00
Johnny Liu
6fc7c1ad7c
drm/tegra: Enabling ICC for NVDEC
...
In order to avoid the NVDEC performance bottleneck from EMC,
NVDEC needs to ask for the required memory bandwidth for itself
according to its current frequency and load.
Bug 4097374
Signed-off-by: Johnny Liu <johnliu@nvidia.com >
Change-Id: I2daff5d3616db03d7576e8e9433aebbf3d566e86
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2914610
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com >
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com >
2023-06-10 19:35:27 -07:00
Johnny Liu
fa6b38eb2a
drm/tegra: Bridge tegra_wmark devfreq with host1x
...
To support actmon DFS for nvdec with tegra_wmark govenor, the nvdec
driver needs to provide interrupt handling callback function for host1x,
and watermark update callback for tegra_wmark govenor.
Bug 200493763
Signed-off-by: Johnny Liu <johnliu@nvidia.com >
Change-Id: I0cbf882da1ccb3243c48fc65dce6eec5f68f6abe
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2900038
Reviewed-by: svcacv <svcacv@nvidia.com >
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com >
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com >
2023-05-09 22:27:28 -07:00
Johnny Liu
4ed6734269
drm/tegra: Enable devfreq for the nvdec client
...
Enable devfreq for the nvdec client with userspace governor by default.
Bug 200493763
Signed-off-by: Johnny Liu <johnliu@nvidia.com >
Change-Id: Iee5da899b499da2c89c0e3fee5e2d616b1869d2b
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2895716
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com >
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com >
Reviewed-by: svcacv <svcacv@nvidia.com >
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com >
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com >
2023-05-02 09:19:51 -07:00
Johnny Liu
d5eff2f344
drm/tegra: Register actmon for the nvdec client
...
Register nvdec actmon to export the engine utilization information in
the debugfs.
Bug 200493763
Bug 3923137
Signed-off-by: Johnny Liu <johnliu@nvidia.com >
Change-Id: I6e445a4e4ce729f2a1af63ed95f4110916b1adb0
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2892036
Reviewed-by: svcacv <svcacv@nvidia.com >
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com >
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com >
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com >
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com >
2023-04-27 08:12:42 -07:00
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