drm/tegra: Fix build for Linux v6.4

In Linux v6.4, the various drm_scdc_get/set functions were updated to
take an argument of type 'struct drm_connector'. Add a new test to the
conftest script that checks if this argument is used and use the
definition created by conftest to select which version of the function
is used.

Bug 4221847

Change-Id: Id6b6396bbe875a0268f8fe2f68ae08f78a32c954
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2989035
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Jon Hunter
2023-10-02 12:25:59 +01:00
committed by mobile promotions
parent 5c6720246f
commit d021a4fbae
3 changed files with 39 additions and 1 deletions

View File

@@ -6517,6 +6517,29 @@ compile_test() {
compile_check_conftest "$CODE" "NV_DRM_MODE_CONFIG_STRUCT_HAS_FB_BASE_ARG" "" "types"
;;
drm_scdc_get_set_has_struct_drm_connector_arg)
#
# Determine if the functions drm_scdc_get_scrambling_status(),
# drm_scdc_set_scrambling() and drm_scdc_set_high_tmds_clock_ratio()
# have the 'struct drm_connector' argument.
#
# In Linux v6.4, commit 5d844091f237 ("drm/scdc-helper: Pimp SCDC debugs")
# updated these drm_scdc_get/set functions to take an argument on type
# 'struct drm_connector'.
CODE="
#if defined(NV_DRM_DISPLAY_DRM_SCDC_HELPER_H_PRESENT)
#include <drm/display/drm_scdc_helper.h>
#else
#include <drm/drm_scdc_helper.h>
#endif
bool conftest_drm_scdc_get_set_has_struct_drm_connector_arg(struct drm_connector *c) {
return drm_scdc_get_scrambling_status(c);
}"
compile_check_conftest "$CODE" \
"NV_DRM_SCDC_GET_SET_HAS_STRUCT_DRM_CONNECTOR_ARG" "" "types"
;;
ethtool_ops_get_set_coalesce_has_coal_and_extack_args)
#
# Determine if the 'get_coalesce' and 'set_coalesce' ethtool_ops