In Linux v6.12, commit 641bb4394f40 ("fs: move FMODE_UNSIGNED_OFFSET to
fop_flags") moves the setting of the FMODE_UNSIGNED_OFFSET into the
various drivers and renames this flag. This change is causing various
tests to fail because opening the DRM device is failing.
Use the presence of the new FOP_UNSIGNED_OFFSET flag in the kernel to
determine if we need to set this flag in the Tegra DRM driver.
Bug 4876974
Change-Id: Ie72a9340187b1c206f0cda6d7e3dab44d603a41c
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3269063
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
The following upstream commits have been back-ported to the out-of-tree
Tegra DRM driver to align with upstream to help pull in the latest
updates from upstream.
Changes from Linux v6.2:
7ad4384d53c6 drm/tegra: Add missing clk_disable_unprepare() in
tegra_dc_probe()
Changes from Linux v6.3:
3fb1f62f80a1 drm/fb-helper: Remove drm_fb_helper_unprepare() from
drm_fb_helper_fini()
Changes from Linux v6.4:
71ec16f45ef8 drm/tegra: Implement fbdev emulation as in-kernel client
25dda38e0b07 drm/tegra: Initialize fbdev DRM client
1ac45068af9d drm/tegra: Hide fbdev support behind config option
08263e91f260 drm/tegra: Removed fb from struct tegra_fbdev
434434608a91 drm/tegra: Remove struct tegra_fbdev
dc06f4a495df drm/tegra: Include <linux/i2c.h>
f68b63ebc433 drm/tegra: Include <linux/of.h>
437405403ab4 drm/tegra: rgb: Make tegra_dc_rgb_remove() return void
The changes have been back-ported to ensure that they build for all
kernel versions supported and utilise conftest as necessary to handle
kernel differences.
Bug 4876974
Change-Id: I6c8403325a7b4874f3ad1c6a0b1f662c1494c397
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3267798
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
In Linux v6.12, commit 446d0f4849b1 ("drm: Remove struct
drm_mode_config_funcs.output_poll_changed") removes
'output_poll_changed' function pointer from 'drm_mode_config_funcs'
structure and commit b5757a5be2fa ("drm: Remove struct
drm_driver.lastclose") removes 'lastclose' from the 'drm_driver'
structure. This is breaking build the Tegra DRM out-of-tree driver for
Linux v6.12.
Fix this by partially back-porting commit 71ec16f45ef8 ("drm/tegra:
Implement fbdev emulation as in-kernel client") from Linux v6.4 which
removed the use of the 'output_poll_changed' and 'lastclose' function
pointers from the Tegra DRM driver. Note that it is safe to partially
back-port this for now because we don't use the frame-buffer support in
the Tegra DRM driver for Tegra234+ devices.
To keep the Tegra DRM out-of-tree driver aligned with upstream, the
remaining parts of commit '71ec16f45ef8' will be back-ported in another
change that will be part of a bigger change to align the frame-buffer
support with the upstream driver. For now just fix the build for Linux
v6.12.
Bug 4876974
Change-Id: Idc9b1c198c067ccb59f1337866154c9a8f0a5623
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3267797
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
- Update Makefile to build the legacy chip related
files only when any of the below configs are set.
CONFIG_ARCH_TEGRA_2x_SOC
CONFIG_ARCH_TEGRA_3x_SOC
CONFIG_ARCH_TEGRA_114_SOC
CONFIG_ARCH_TEGRA_124_SOC
CONFIG_ARCH_TEGRA_132_SOC
CONFIG_ARCH_TEGRA_210_SOC
CONFIG_ARCH_TEGRA_186_SOC
CONFIG_ARCH_TEGRA_194_SOC
- Update drm.c/.h to build legacy chip specific
code portions for the respective configs accordingly.
Jira HOSTX-5727
Signed-off-by: Santosh BS <santoshb@nvidia.com>
Change-Id: I3d2235923011073d82dcfe6b1fd6618ae70d37bb
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3253132
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
In Linux v6.13, commit 689274a56c0c ("drm: Remove DRM aperture helpers")
removed the DRM aperture helper functions and drivers should simply use
the existing video helpers. Update the Tegra DRM driver to use
aperture_remove_all_conflicting_devices() if available to align with
upstream.
Bug 4991705
Change-Id: Ie4b78a4ea519ffcaaf972417ec2cbe7c436eb808
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3261694
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
Add a userspace interface for providing access to the memory syncpoint
shim through dma-buf file descriptors. Applications can pass references
to syncpoints to other devices that only support memory semaphores to
facilitate synchronization with syncpoints.
Only syncpoints allocated through the DRM file descriptor ("owned" by
the application) can be exported read-write. All syncpoints can be
exported read-only.
Jira HOSTX-5722
Bug 4919132
Change-Id: I4f5c007b7f9ba65780c418b4e22c5f59a11ef84d
Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3252026
Reviewed-by: Santosh BS <santoshb@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
The compiler option -Wmissing-prototypes is being enabled globally in
the upstream Linux kernel and this causes build failures for various
drivers. The build failures occur because either the driver is missing
an include file which has the prototype or because the function is not
declared statically when it should be (ie. there are no external users).
Fix the various build failures and enable -Wmissing-prototypes to
prevent any new instances from occurring. Note that the only driver that
is not fixed at the moment is rtl8822ce due to large number of failures
and so build this with '-Wno-missing-prototypes' for now, which is not
different to how it was being compiled prior to this change.
Bug 4404965
Change-Id: Ie5572d23659e0346fa035d645d9043b0a6da5fdc
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3027488
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
The functions for fd/handle conversion are unexported as it is
used internally to drm_prime based on following change:
---
Author: Thomas Zimmermann <tzimmermann@suse.de>
Date: Tue Jun 20 09:59:59 2023 +0200
drm/prime: Unexport helpers for fd/handle conversion
---
Remove the initialisation of these functions pointer.
Bug 4346767
Change-Id: I821f4e63663a7f35e5fa39ed84383765ed8599fa
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3008091
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
In Linux v6.5, commit 62aeaeaa1b26 ("drm/aperture: Remove primary
argument") removed the 'primary' argument from the function
drm_aperture_remove_framebuffers(). Update the test in conftest script
for drm_aperture_remove_framebuffers() to test for this and use the
generated definition accordlingly in the Tegra DRM driver to fix the
build for Linux v6.5.
Bug 4221847
Change-Id: I7a7bb3a029b236e0ce42c1a404085757d95374d1
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2990528
Instead of relying on kernel version to determine if certain functions
or structure are present in the kernel, use the conftest.sh script to
test which functions, structures, etc are present at compile time. This
is beneficial for working with 3rd party Linux kernels that may have
back-ported upstream changes into their kernel and so the kernel version
checks do not work.
Bug 4119327
Change-Id: If315b18af74c830e9ba3993208de3a3326c4187d
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2984415
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Upstream Linux commit ("1369459b2e21 iommu: Add a gfp parameter to
iommu_map()") adds a new parameter to the iommu_map function and this
breaks building the host1x driver with Linux v6.3.
Upstream Linux commit 2a81ada32f0e ("driver core: make struct
bus_type.uevent() take a const *") updates the uevent function pointer
type to make the device structure const which also breaks building the
host1x driver with Linux v6.3.
Address both of these issues to fix building the host1x driver with
Linux v6.3.
Bug 4014315
Change-Id: Ibd27f5e8442cc6970bcaac0dcfb9fc262860aee9
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2867136
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
When the OFA driver was added for Tegra234, the driver was not added to
the list of drivers registered by the Tegra DRM driver. This is breaking
support for Tegra DRM. Add the OFA driver to the lists of driver to fix
Tegra DRM support.
Bug 3819719
Bug 3845104
Change-Id: I023f2abe38f9249680358170e0bdd85547e0c4ba
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2797758
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
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>
When compiling the Tegra DRM driver for Linux v5.10 it is currently
failing and the following errors are seen ...
tegra/dc.c: In function 'tegra_crtc_atomic_begin':
tegra/dc.c:2278:43: error: 'state' undeclared (first use in this function)
tegra_crtc_update_memory_bandwidth(crtc, state, true);
^~~~~
tegra/dc.c:2524:18: error: initialization from incompatible pointer type
[-Werror=incompatible-pointer-types]
.atomic_check = tegra_crtc_atomic_check,
^~~~~~~~~~~~~~~~~~~~~~~
Upstream commit 04d5d5df9df7 ("drm/tegra: dc: Support memory bandwidth
management") added support for memory bandwidth and so disable this for
Linux kernel prior to v5.11 due to incompatibilty with these earlier
versions.
JIRA LS-410
Change-Id: Ic130a6e37cef597772b62be192f154a2681fe157
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2668675
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
GVS: Gerrit_Virtual_Submit
Upstream commit c1736b9008cb ("drm: IRQ midlayer is now legacy") moved
the 'irq_enabled' member of struct drm_device under CONFIG_DRM_LEGACY.
When compiling Linux v5.15 without CONFIG_DRM_LEGACY enabled, compiling
the Tegra DRM driver now fails because the 'irq_enabled' member is not
defined.
Upstream commit 14746211570b ("drm/tegra: Don't set struct
drm_device.irq_enabled") has now removed the setting of the
'irq_enabled' variable from the Tegra DRM driver and so fix this by
only setting this variable for kernels prior to Linux v5.15.
Change-Id: I27907494e6ca0c5c7f8bedc80eca4395428d4e1a
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2613510
(cherry picked from commit 1e4600fca6b4027e6f1dc6b8dcc28fc1c8c8767e)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2620155
Tested-by: mobile promotions <svcmobile_promotions@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
Upstream commit be4306ad928f ("drm/tegra: Don't set allow_fb_modifiers
explicitly") removed the setting of drm->mode_config.allow_fb_modifiers
from the Tegra DRM driver because this is now set by the core. However,
because this is still being set in the Tegra DRM out-of-tree module it
generates a WARNING on boot. Fix this by not setting
drm->mode_config.allow_fb_modifiers for Linux kernels v5.14 and greater.
Upstream commit 6cba3fe43341 ("drm/dp: Add backpointer to drm_device in
drm_dp_aux") added a backpointer that if missing generates another
WARNING on boot so fix this by ensuring the backpointer is populated for
Linux v5.14 kernels and greater.
Bug 200780535
Change-Id: I6092f09cf35f636c4cde0801526fdeab7a26daed
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2602684
(cherry picked from commit e3910b7d43971d7c72ab71b24fab3a234473f8d0)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2604802
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>
Commit 97c9bfe3f660 ("drm/aperture: Pass DRM driver structure instead
of driver name") updated the function drm_aperture_remove_framebuffers()
so that callers need to pass a DRM driver structure instead of a name.
This is causing the compilation of out-of-tree Tegra DRM driver to fail
for Linux v5.15 kernels. Update the out-of-tree Tegra DRM driver as
necessary to support v5.15 kernels.
Change-Id: I3cf5ce75032651a64115452b4ac1fd1e54d83f11
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2588211
Reviewed-by: Sachin Nikam <snikam@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
Commit 6848c291a54f ("drm/aperture: Convert drivers to aperture
interfaces") converted various drm_fb_helper_xxx functions to
drm_aperture_xxx functions for Linux v5.14. This breaks the compilation
of the out-of-tree Tegra DRM module and so fix this by updating the
out-of-tree module as necessary.
JIRA LS-115
Change-Id: Ice68b5f9ac6aded268ea4bb6db273d505db29af4
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2554714
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit