diff --git a/drivers/gpu/drm/tegra/drm.c b/drivers/gpu/drm/tegra/drm.c index f5885f02..4ce70d60 100644 --- a/drivers/gpu/drm/tegra/drm.c +++ b/drivers/gpu/drm/tegra/drm.c @@ -1300,7 +1300,9 @@ static int host1x_drm_probe(struct host1x_device *dev) drm_mode_config_reset(drm); if (drm->mode_config.num_crtc > 0) { -#if defined(NV_DRM_APERTURE_REMOVE_FRAMEBUFFERS_HAS_DRM_DRIVER_ARG) /* Linux v5.15 */ +#if defined(NV_DRM_APERTURE_REMOVE_FRAMEBUFFERS_HAS_NO_PRIMARY_ARG) /* Linux v6.5 */ + err = drm_aperture_remove_framebuffers(&tegra_drm_driver); +#elif defined(NV_DRM_APERTURE_REMOVE_FRAMEBUFFERS_HAS_DRM_DRIVER_ARG) /* Linux v5.15 */ err = drm_aperture_remove_framebuffers(false, &tegra_drm_driver); #else err = drm_aperture_remove_framebuffers(false, "tegradrmfb"); diff --git a/scripts/conftest/Makefile b/scripts/conftest/Makefile index 4dc4d140..a4981e95 100644 --- a/scripts/conftest/Makefile +++ b/scripts/conftest/Makefile @@ -93,7 +93,7 @@ NV_CONFTEST_FUNCTION_COMPILE_TESTS += class_create_has_no_owner_arg NV_CONFTEST_FUNCTION_COMPILE_TESTS += class_struct_devnode_has_const_dev_arg NV_CONFTEST_FUNCTION_COMPILE_TESTS += define_semaphore_has_number_arg NV_CONFTEST_FUNCTION_COMPILE_TESTS += devm_thermal_of_zone_register -NV_CONFTEST_FUNCTION_COMPILE_TESTS += drm_aperture_remove_framebuffers_has_drm_driver_arg +NV_CONFTEST_FUNCTION_COMPILE_TESTS += drm_aperture_remove_framebuffers NV_CONFTEST_FUNCTION_COMPILE_TESTS += drm_driver_struct_has_irq_enabled_arg NV_CONFTEST_FUNCTION_COMPILE_TESTS += drm_fb_helper_alloc_info NV_CONFTEST_FUNCTION_COMPILE_TESTS += drm_fb_helper_prepare_has_preferred_bpp_arg diff --git a/scripts/conftest/conftest.sh b/scripts/conftest/conftest.sh index a48db1a4..b7f8feb7 100755 --- a/scripts/conftest/conftest.sh +++ b/scripts/conftest/conftest.sh @@ -6419,24 +6419,38 @@ compile_test() { compile_check_conftest "$CODE" "NV_DEVM_THERMAL_OF_ZONE_REGISTER_PRESENT" "" "functions" ;; - drm_aperture_remove_framebuffers_has_drm_driver_arg) + drm_aperture_remove_framebuffers) # # Determine if the function 'drm_aperture_remove_framebuffers' # has the 'struct drm_driver' argument. # - # Commit 97c9bfe3f660 ("drm/aperture: Pass DRM driver structure - # instead of driver name") updated the arguments for the function - # drm_aperture_remove_framebuffers to pass 'struct drm_driver' in - # Linux v5.15. + # Conftest #1: In Linux v5.15, commit 97c9bfe3f660 ("drm/aperture: + # Pass DRM driver structure instead of driver name") updated the + # arguments for the function drm_aperture_remove_framebuffers to + # pass 'struct drm_driver'. # CODE=" #include - int conftest_drm_aperture_remove_framebuffers_has_drm_driver_arg( + int conftest_drm_aperture_remove_framebuffers( bool primary, const struct drm_driver *req_driver) { return drm_aperture_remove_framebuffers(primary, req_driver); }" compile_check_conftest "$CODE" "NV_DRM_APERTURE_REMOVE_FRAMEBUFFERS_HAS_DRM_DRIVER_ARG" "" "types" + + # + # Conftest #2: In Linux v6.5, commit 62aeaeaa1b26 ("drm/aperture: + # Remove primary argument") removed the 'primary' argument from the + # function drm_aperture_remove_framebuffers(). + # + CODE=" + #include + int conftest_drm_aperture_remove_framebuffers( + const struct drm_driver *req_driver) { + return drm_aperture_remove_framebuffers(req_driver); + }" + + compile_check_conftest "$CODE" "NV_DRM_APERTURE_REMOVE_FRAMEBUFFERS_HAS_NO_PRIMARY_ARG" "" "types" ;; drm_driver_struct_has_irq_enabled_arg)