Commit Graph

228 Commits

Author SHA1 Message Date
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
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
Mikko Perttunen
1fc707c805 drm/tegra: Use DMA API path for mapping if IOMMU is disabled
If IOMMU is disabled, imported DMA-BUF handles won't get the iova
property set in the BO. As such, we should use the SGT instead,
so use the DMA-API path which works transparently.

Change-Id: Ie79ba859eebc2d4438086cae6a5c00400f04f4b0
Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2505464
Reviewed-by: Jonathan Hunter <jonathanh@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
a4cfbdfb2c drm/tegra: Fix setting of blocklinear bit in relocations
The code to set the blocklinear swizzling bit 39 was completely broken.
Fix it.

Change-Id: I311714931f9b4e96f1cff1940aacdeb6a158bfe5
Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2505463
Reviewed-by: Jonathan Hunter <jonathanh@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
b4f2921807 drm/tegra: Remove the staging definitions
When building Tegra DRM as an out-of-tree module for upstream
development we always want to enable the STAGING ioctls and so
removing the STAGING definitions from Tegra DRM.

JIRA LS-34

Change-Id: Ie7c398e0f5f29d5ad2b07109b1b5d4c44eda880a
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2492589
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
Jon Hunter
11fff0c012 drm/tegra: Clean-up build for Tegra DRM
Trivial clean-up for building Tegra DRM by ...

1. Removing the Kconfig file because this is not needed for building
   as an external module and we only plan to build this as an external
   module.
2. Move the header file 'tegra_drm_next.h' under the Tegra DRM source
   directory so that we don't need to pass the path for finding the
   header when building Tegra DRM as an external module.
3. Remove the 'CONFIG_DRM_TEGRA_NEXT' variable because we always build
   Tegra DRM as a module.

Bug 200687525

Change-Id: I79661fa7eaf548646277e5e89adab198383bf466
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2485761
Reviewed-by: Mikko Perttunen <mperttunen@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
eeca7d7423 drm/tegra: Remove direct phys path for gather_bo
The Host1x driver will skip DMA API calls if the pin call for a
buffer returns a physical address directly. This is not desirable
even when the IOMMU is disabled, because then we don't get the
cache flushing done by DMA API. As such, remove the direct path.

This patch will be included as part of upstream v6 patch.

Change-Id: I0a7806ae550e548bb567427c327a0d5890718a1e
Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2488295
Reviewed-by: Jonathan Hunter <jonathanh@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
Jon Hunter
636389b442 drm/tegra: Update to support v5.11
For Linux v5.11, there are a some changes to the DRM APIs that require
updates to the Tegra DRM driver. These are:
1. Commit 6619ccf1bb1d ("dma-buf: Use struct dma_buf_map in
   dma_buf_vmap() interfaces") changes to the dma_buf_vmap() and
   dma_buf_vunmap() APIs to pass a new parameter of type
   'struct dma_buf_map'.
2. Commit 351f950db4ab ("drm/atomic: Pass the full state to CRTC atomic
   enable/disable) and commit f6ebe9f9c923 ("drm/atomic: Pass the full
   state to CRTC atomic begin and flush") changes the structure type
   passed to APIs referenced by the commits.

Finally, commit dd311c6fe8af ("drm/tegra: Introduce GEM object
functions") update the Tegra DRM driver to use GEM object functions.

Update the Tegra DRM driver to support these updated APIs for
Linux v5.11+ and align with the latest changes.

Bug 200687525

Change-Id: I7b11c3f4c4f03afe23563a3de12170c7543c28fe
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2469985
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
Jon Hunter
d3ea27d381 drm/tegra: Update to UAPI v5
Update the tegra-drm driver to the 'Host1x/Tegra UAPI v5' series [0].
This fixes a few minor bugs found in the previous series.

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

Bug 200687525

Change-Id: I270016756b6b689c1fada208896cee81223e7042
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2469984
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
Jon Hunter
d088bfa37d drm/tegra: Update Tegra DRM to align with v5.10
Update the Tegra DRM driver to Linux v5.10 with the 'Host1x/Tegra UAPI'
series [0] applied. This driver is built as an external module for
testing and development with upstream Linux kernels.

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

Bug 3205478

Change-Id: I901aa45779e56cbbef6c58fd9d3bb50ea6bfd472
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2460064
Reviewed-by: Shanker Donthineni <sdonthineni@nvidia.com>
Reviewed-by: Mikko Perttunen <mperttunen@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
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
Jon Hunter
46b9df5186 gpu: Remove unused host1x and tegra-drm drivers
The host1x and tegra-drm drivers located in the linux-nvidia repository
are not referenced by any upper level Makefile and so are never
compiled. Therefore, remove the unused host1x and tegra-drm drivers
from the linux-nvidia repository.

Bug 3156385

Change-Id: I770844f1255541628eb4fc962f1c19866cbae31b
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2435652
Reviewed-by: automaticguardword <automaticguardword@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>
GVS: Gerrit_Virtual_Submit
2023-04-03 09:18:59 +00:00
Bitan Biswas
0761c746f9 iommu: k5.9: remove archdata.iommu accesses
k5.9 build needs below changes:
read archdata.iommu replaced by iommu_get_domain_for_dev
write archdata.iommu removed as alternative implementation used.

k5.9 build error fixed by explicit include of header <linux/iommu.h>

Change-Id: I464fd4144e4317b10aaa5460482f35e46527339a
Signed-off-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2400862
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-03 09:18:59 +00:00
Stephen Warren
107b92c698 nvidia: use $(srctree.$(overlay))
Update all Makefiles to make use of the new srctree.$(overlay) variables
to remove hard-coding the path to any overlays. One direct reference
remains in a hard-coded include statement in drivers/misc/tegra-cec/.

Bug 1978395

Change-Id: I5cdce04e019567a9bbfffaf0e92a61bd16806e99
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1593800
Reviewed-by: Alexander Van Brunt <avanbrunt@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-by: Timo Alho <talho@nvidia.com>
Tested-by: Timo Alho <talho@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-03 09:18:59 +00:00
Stephen Warren
e9e22f3af8 nvidia: use kernel overlay features
Update all Kconfig files and Makefiles to rely on the kernel overlay
feature. In particular, don't include any Kconfig files or Makefiles
from other overlays. -I directives in CFLAGS are not yet cleaned up.

Bug 1978395

Change-Id: I425d37d55f8ea61fb3a082a1504f994ff30cec03
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1561187
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-03 09:18:59 +00:00
Ishan Mittal
ad28eb2f5c nvidia: Replace t18x/ in relative path with nvidia/
t18x repo will be discontinued and all code that
resides there is moved into nvidia/.
So, every reference to t18x/ should be corrected
to nvidia/

Bug 200295104

Change-Id: I01ca1118de043511edca829e1cb2b8b52fb398df
Signed-off-by: Vandana Salve <vsalve@nvidia.com>
2023-04-03 09:18:59 +00:00
Ishan Mittal
81a5163715 nvidia: Setting proper names to Makefiles & Kconfig
Makefiles and Kconfig files are picked up based
on project name being the extension.

Makefiles and Kconfig files brought over from
t18x have .t18x suffix.

Changed to .nvidia

Bug 200295104

Change-Id: Idade26f293c1faaf74f53b2ab20798c47652bdb9
Signed-off-by: Ishan Mittal <imittal@nvidia.com>
2023-04-03 09:18:59 +00:00
Laxman Dewangan
d37fe08e47 drm/tegra: nvdec: se soc/tegra/kfuse header for kfuse
Use the header <soc/tegra/kfuse.h> for kfuse defines instead of
legacy header <linux/platform/tegra/tegra_kfuse.h>.

The legacy header for kfuse <linux/platform/tegra/tegra_kfuse.h>
is going to be removed.

bug 200257381

Change-Id: I83b894e1d912b87fde7b24b78c54a633027e0c09
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: http://git-master/r/1291988
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
Reviewed-by: Shardar Mohammed <smohammed@nvidia.com>
Reviewed-by: Sujeet Baranwal <sbaranwal@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-03 09:18:59 +00:00
dmitry pervushin
a3207fc093 t18x: renaming KConfigs & Makefiles to add suffix
Bug 1783210

Signed-off-by: dmitry pervushin <dpervushin@nvidia.com>
Change-Id: I20c29b4dd5947d296a6ab1e83d47e569e386855b
Reviewed-on: http://git-master/r/1176347
Reviewed-on: http://git-master/r/1177303
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alexander Van Brunt <avanbrunt@nvidia.com>
Tested-by: Alexander Van Brunt <avanbrunt@nvidia.com>
Reviewed-on: http://git-master/r/1183017
2023-04-03 09:18:59 +00:00
Pritesh Raithatha
c79c8e5d6c kernel: t18x: change kernel path
All kernel versions are getting moved inside $TOP/kernel folder.
Changing kernel paths accordingly.

Bug 200190733

Change-Id: Ia0353dd4be3fb3d76bbfc82609be99546a217f92
Signed-off-by: Pritesh Raithatha <praithatha@nvidia.com>
Reviewed-on: http://git-master/r/1143409
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Tested-by: Bharat Nihalani <bnihalani@nvidia.com>
2023-04-03 09:18:59 +00:00
Deepak Nibade
37dfa4b276 drm/tegra: add T186 support to TSEC
Define tsec_t186_config/tsecb_t186_config and
tsec_t186_ops for TSEC

Define .load_regs = tsec_load_streamid_regs() for TSEC
streamid support

Bug 1704301

Change-Id: Ibf3219973627802ee4301c5a23e766d9953dbc3b
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/1029501
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Shridhar Rasal <srasal@nvidia.com>
2023-04-03 09:18:59 +00:00
Deepak Nibade
115fb9a93e drm/tegra: add T186 support to NVJPG
Define nvjpg_t186_config and nvjpg_t186_ops for NVJPG

Define .load_regs = nvjpg_load_streamid_regs() for NVJPG
streamid support

Bug 1704301

Change-Id: I7181a414ebe4ff5db3ce70592494cda13f03f784
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/1029499
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Arto Merilainen <amerilainen@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Shridhar Rasal <srasal@nvidia.com>
2023-04-03 09:18:59 +00:00
Deepak Nibade
61639b472d drm/tegra: add T186 support to NVDEC
Define nvdec_t186_config and nvenc_t186_ops for NVDEC

Define .load_regs = nvdec_load_streamid_regs() for NVDEC
streamid support

Define prepare_poweroff() and finalize_poweron()

Bug 1704301

Change-Id: Ibfbb9f40ca4646e7d3afa4a150f6303e0399299c
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/1029498
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Arto Merilainen <amerilainen@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Shridhar Rasal <srasal@nvidia.com>
2023-04-03 09:18:59 +00:00
Deepak Nibade
f430961408 drm/tegra: add T186 support to NVENC
Define nvenc_t186_config and nvenc_t186_ops for NVENC

Define .load_regs = nvenc_load_streamid_regs() for NVENC
streamid support.

Bug 1704301

Change-Id: I71efcfe4208568b5e4cbc463444d7d4a6ccfb96c
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/1026451
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Arto Merilainen <amerilainen@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Shridhar Rasal <srasal@nvidia.com>
2023-04-03 09:18:59 +00:00
Deepak Nibade
27cb8a37fc drm/tegra: add T186 support to VIC
Define vic_t186_config and vic_t186_ops for VIC

Define .load_regs = vic_load_streamid_regs() for VIC
streamid support

Bug 1704301

Change-Id: Ib364c773c6c340c30e2644ef0baca500d89de55c
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/1023439
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Arto Merilainen <amerilainen@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Shridhar Rasal <srasal@nvidia.com>
2023-04-03 09:18:59 +00:00
Laxman Dewangan
969bd376ed drm: Remove dummy Makefile
Preparing the drm/tegra folder for integrating the
drivers of drm from kernel/nvidia.

Change-Id: Ia15d4e31d951f7c04dd17f189106032146f47f6d
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
2023-04-03 09:17:32 +00:00
Laxman Dewangan
53115452ad drm: Copy source file from kernel/nvidia to build drm module
Copy the sources of drm module from kernel/nvidia to
kernel/nvidia-oot to build drm as OOT module.

Files get copied at build time.

Bug 3583645

Change-Id: I1f63c834368f178b36e9935a5bd5d8db77d10c60
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2718332
GVS: Gerrit_Virtual_Submit
2022-05-27 15:49:33 -07:00