Commit Graph

16 Commits

Author SHA1 Message Date
Mikko Perttunen
f374e1804e drm/tegra: Add OFA support
Add support for the optical flow accelerator. Implementation is the
same as for other Falcons except that we omit some legacy things
since the engine only exists from T234 onwards, and the addition
of having to initialize the OFA's safety RAM before boot.

Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Change-Id: I9612e82a116cc76be492a0c533afce67c42f6a2c
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2784964
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-04-03 12:36:25 +00:00
Mikko Perttunen
5de571fe8d drm/tegra: Add NVENC/NVJPG support on Tegra234
Add NVENC/NVJPG support on Tegra234. These work similarly to the
ones on Tegra194, so no big changes.

Bug 3778105

Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Change-Id: I4a4b12d5625f927c69a6dc1c6b6bade1bca7b171
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2771770
(cherry picked from commit ee6576a1493dae1ddc5c8dc3b415d0987f670390)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2759062
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 12:36:25 +00:00
Mikko Perttunen
9cfe33dc68 gpu: host1x: Add stream ID register data for NVDEC on Tegra234
Add entries for NVDEC to the Tegra234 SID table.

Bug 3778105

Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Change-Id: Iff6c33795b74faf5e0aea72751ad6c4b43cf6bb2
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2771764
(cherry picked from commit 3e501a18ff2392292d19bc513db6f19d31f38227)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2768895
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 12:36:25 +00:00
Brad Griffis
ea0f4f6a26 gpu: host1x: ADD SID information for Tegra234 DLA
Add the SMMU SID information for the Tegra234 DLA devices to the
upstream host1x driver to ensure the SMMU is configured correctly.

Bug 3724727

Change-Id: I01edf2bc36f2b8a4b83077fc71f42463f9958a3d
Signed-off-by: Brad Griffis <bgriffis@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2754962
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
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 12:36:25 +00:00
Mikko Perttunen
994282e792 gpu: host1x: Tegra234 device data and headers
Add device data and chip headers for Tegra234.

Bug 3724727

Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Change-Id: Ide1c653abed06fb880b8222cb0a00d65a4886e27
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2745955
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 12:36:25 +00:00
Mikko Perttunen
3ce86b2740 gpu: host1x: Allow reset to be missing
Host1x on Tegra234 does not have a software-controllable reset line.
As such, don't bail out if we don't find one in the device tree.

Bug 3724727

Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Change-Id: I583492a11c6f6ce358f59728983ba31a06b63d2f
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2745953
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 12:36:25 +00:00
Mikko Perttunen
d801058ffc gpu: host1x: Program virtualization tables
Program virtualization tables specifying which VMs have access to which
Host1x hardware resources. Programming these has become mandatory in
Tegra234.

For now, since the driver does not operate as a Host1x hypervisor, we
basically allow access to everything to everyone.

Bug 3724727

Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Change-Id: I67e09e7d9c55128c40c54c078912cc38c7616eac
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2745952
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 12:36:25 +00:00
Mikko Perttunen
d9c7b1421d gpu: host1x: Simplify register mapping and add common aperture
Refactor 'regs' property loading using devm_platform_ioremap_*
and add loading of the 'common' region found on Tegra234.

Bug 3724727

Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Change-Id: I4652e4225ca72d1e61b4bdae122e5765eaa2455b
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2745951
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 12:36:25 +00:00
Mikko Perttunen
7b4206605d gpu: host1x: Add context device management code
Add code to register context devices from device tree, allocate them
out and manage their refcounts.

Bug 3724727

Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Change-Id: I1e50462fc07247faf4cb217f4ab75fb610b10024
2023-04-03 12:36:25 +00:00
Jon Hunter
9edef092b1 gpu: host1x: Update to Linux v5.19-rc1
Update the host1x driver to align with the latest upstream host1x
driver from Linux v5.19-rc1. Please note that the context bus support
is not included, because this needs to be built into the kernel.

Bug 3724727

Change-Id: Ic6fbe001462d160d1bb24f76038dd755c5550690
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2739538
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
2023-04-03 12:36:25 +00:00
Mikko Perttunen
65b76aee13 gpu: host1x: Merge upstream changes
Merge upstream changes from linux-next, including merged version
of new UAPI.

JIRA LS-128

Change-Id: I32c6745d2c17902e8216e9b376fd74d38a3b5904
Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2653092
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 12:36:25 +00:00
Jon Hunter
174f4e87f6 gpu: host1x: Add SMMU SID information for DLA
Add the SMMU SID information for the DLA devices to the upstream
host1x driver to ensure the SMMU is configured correctly.

JIRA LS-410

Change-Id: I6a7b89a94463aeeaa3532cd0aa4f363b5b809940
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2653098
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-03 12:36:25 +00:00
Jon Hunter
7df2aa44f2 drm/tegra: Add support for NVENC and NVJPG
Add support for the Host1x NVENC and NVJPG engines.

JIRA LS-411

Change-Id: Ied1c64c17d337e571512c053ef9552642faa430c
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2490297
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-03 12:36:25 +00:00
Thierry Reding
2a938c39ec drm/tegra: Implement buffer object cache
This cache is used to avoid mapping and unmapping buffer objects
unnecessarily. Mappings are cached per client and stay hot until
the buffer object is destroyed.

Bug 200768479

Signed-off-by: Thierry Reding <treding@nvidia.com>
Change-Id: Ia2efe2b77b5043b665bae403d9eba4698e6a5228
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2596399
(cherry picked from commit d23156d94fa9499256e8082250e3bc02559f9c8d)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2620152
Tested-by: Jonathan Hunter <jonathanh@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-03 12:36:25 +00:00
Mikko Perttunen
558557ab02 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 12:36:25 +00:00
Jon Hunter
cc5bcef3f6 gpu: host1x: Add upstream host1x driver
Add the upstream host1x driver with the 'Host1x/Tegra UAPI' series [0]
applied. This driver will be built as an external module for use with
the NVGPU driver on 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. Remove the tests to see if CONFIG_DRM_TEGRA_STAGING is enabled
3. Rename the include/linux/host1x.h to include/linux/host1x-next.h to
   avoid conflicts with upstream headers when building as an external
   module.
4. Rename the include/uapi/linux/host1x.h to
   include/uapi/linux/host1x-next.h to avoid conflicts with upstream
   headers when building as an external module.
5. Rename the module that is built to be host1x-next.ko instead of
   host1x.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: Ic60299546809097dd0e4a9a7157bce1491d9f794
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2435801
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: automaticguardword <automaticguardword@nvidia.com>
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-03 12:36:25 +00:00