gpu/drm: tegra: Fix support for Linux v6.12

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
(cherry picked from commit a680b4881fb8e6ace46f409c33307f3bc10366a4)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3338872
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
Tested-by: Ilies Chergui <ichergui@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Ilies Chergui <ichergui@nvidia.com>
This commit is contained in:
Jon Hunter
2024-08-09 12:38:56 +02:00
committed by mobile promotions
parent 785d9aa288
commit 3d806c0cd2
3 changed files with 22 additions and 0 deletions

View File

@@ -7286,6 +7286,24 @@ compile_test() {
compile_check_conftest "$CODE" "NV_FOLIO_ENTIRE_MAPCOUNT_PRESENT" "" "functions"
;;
fop_unsigned_offset)
#
# Determine if definition FOP_UNSIGNED_OFFSET is present.
#
# Commit 641bb4394f40 ("fs: move FMODE_UNSIGNED_OFFSET to fop_flags")
# added the definition FOP_UNSIGNED_OFFSET in Linux v6.12.
#
CODE="
#include <linux/fs.h>
int conftest(void)
{
return FOP_UNSIGNED_OFFSET;
}"
compile_check_conftest "$CODE" "NV_FOP_UNSIGNED_OFFSET_PRESENT" "" "types"
;;
genpd_xlate_t_has_const_of_phandle_args)
#
# Determine if genpd_xlate_t function pointer has a