drm/tegra: Fix build for Linux v6.17

The arguments to the function drm_helper_mode_fill_fb_struct() and
function pointer fb_create() have been updated in the Linux v6.17. Add
the necessary conftest tests to check for the new variants of these
functions and update the Tegra DRM driver accordingly.

Bug 5420210

Change-Id: Ie1470df199d154d3f94f5f7773dcc1ba138e23da
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3423828
(cherry picked from commit dde42d012e4187e798d5d7c3cfa974f49059d0a1)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3462462
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Jon Hunter
2025-07-25 11:47:09 +01:00
committed by mobile promotions
parent 2800fd5f4b
commit d814c113bb
5 changed files with 68 additions and 1 deletions

View File

@@ -139,7 +139,9 @@ NV_CONFTEST_FUNCTION_COMPILE_TESTS += drm_fb_helper_alloc_info
NV_CONFTEST_FUNCTION_COMPILE_TESTS += drm_fb_helper_prepare_has_preferred_bpp_arg
NV_CONFTEST_FUNCTION_COMPILE_TESTS += drm_fb_helper_unregister_info
NV_CONFTEST_FUNCTION_COMPILE_TESTS += drm_fb_helper_struct_has_info_arg
NV_CONFTEST_FUNCTION_COMPILE_TESTS += drm_helper_mode_fill_fb_struct_has_info_arg
NV_CONFTEST_FUNCTION_COMPILE_TESTS += drm_mode_config_struct_has_fb_base_arg
NV_CONFTEST_FUNCTION_COMPILE_TESTS += drm_mode_config_funcs_struct_fb_create_has_info_arg
NV_CONFTEST_FUNCTION_COMPILE_TESTS += drm_plane_helper_funcs_struct_atomic_async_check_has_bool_arg
NV_CONFTEST_FUNCTION_COMPILE_TESTS += drm_scdc_get_set_has_struct_drm_connector_arg
NV_CONFTEST_FUNCTION_COMPILE_TESTS += ethtool_keee_struct_present

View File

@@ -7442,6 +7442,27 @@ compile_test() {
compile_check_conftest "$CODE" "NV_DRM_FB_HELPER_UNREGISTER_INFO_PRESENT" "" "functions"
;;
drm_helper_mode_fill_fb_struct_has_info_arg)
#
# Determine if the function 'drm_helper_mode_fill_fb_struct' has the
# argument 'info'.
#
# Commit a34cc7bf1034 ("drm: Allow the caller to pass in the format
# info to drm_helper_mode_fill_fb_struct()") made this change in
# Linux v6.17.
#
CODE="
#undef CONFIG_ACPI
#include <drm/drm_modeset_helper.h>
void conftest(struct drm_device *dev, struct drm_framebuffer *fb,
const struct drm_format_info *info,
const struct drm_mode_fb_cmd2 *mode_cmd) {
drm_helper_mode_fill_fb_struct(dev, fb, info, mode_cmd);
}"
compile_check_conftest "$CODE" "NV_DRM_HELPER_MODE_FILL_FB_STRUCT_HAS_INFO_ARG" "" "types"
;;
drm_mode_config_struct_has_fb_base_arg)
#
# Determine if the 'drm_mode_config' structure has the 'fb_base' argument.
@@ -7458,6 +7479,24 @@ compile_test() {
compile_check_conftest "$CODE" "NV_DRM_MODE_CONFIG_STRUCT_HAS_FB_BASE_ARG" "" "types"
;;
drm_mode_config_funcs_struct_fb_create_has_info_arg)
#
# Determine if the 'fb_create' function pointer has an 'info' argument.
#
# Commit 81112eaac559 ("drm: Pass the format info to .fb_create()")
# made this change in Linux v6.17.
#
CODE="
#include <drm/drm_mode_config.h>
void conftest(struct drm_mode_config_funcs *f) {
struct drm_framebuffer *(*fn)(struct drm_device *, struct drm_file *,
const struct drm_format_info *,
const struct drm_mode_fb_cmd2 *) = f->fb_create;
}"
compile_check_conftest "$CODE" "NV_DRM_MODE_CONFIG_FUNCS_STRUCT_FB_CREATE_HAS_INFO_ARG" "" "types"
;;
drm_plane_helper_funcs_struct_atomic_async_check_has_bool_arg)
#
# Determine if the 'atomic_async_check' function pointer has a bool argument.