diff --git a/drivers/gpu/drm/tegra/sor.c b/drivers/gpu/drm/tegra/sor.c index ed7f5bbd..629db1c4 100644 --- a/drivers/gpu/drm/tegra/sor.c +++ b/drivers/gpu/drm/tegra/sor.c @@ -2152,11 +2152,15 @@ static void tegra_sor_hdmi_disable_scrambling(struct tegra_sor *sor) static void tegra_sor_hdmi_scdc_disable(struct tegra_sor *sor) { +#if defined(NV_DRM_SCDC_GET_SET_HAS_STRUCT_DRM_CONNECTOR_ARG) /* Linux v6.4 */ + drm_scdc_set_high_tmds_clock_ratio(&sor->output.connector, false); + drm_scdc_set_scrambling(&sor->output.connector, false); +#else struct i2c_adapter *ddc = sor->output.ddc; drm_scdc_set_high_tmds_clock_ratio(ddc, false); drm_scdc_set_scrambling(ddc, false); - +#endif tegra_sor_hdmi_disable_scrambling(sor); } @@ -2180,10 +2184,15 @@ static void tegra_sor_hdmi_enable_scrambling(struct tegra_sor *sor) static void tegra_sor_hdmi_scdc_enable(struct tegra_sor *sor) { +#if defined(NV_DRM_SCDC_GET_SET_HAS_STRUCT_DRM_CONNECTOR_ARG) /* Linux v6.4 */ + drm_scdc_set_high_tmds_clock_ratio(&sor->output.connector, true); + drm_scdc_set_scrambling(&sor->output.connector, true); +#else struct i2c_adapter *ddc = sor->output.ddc; drm_scdc_set_high_tmds_clock_ratio(ddc, true); drm_scdc_set_scrambling(ddc, true); +#endif tegra_sor_hdmi_enable_scrambling(sor); } @@ -2191,9 +2200,14 @@ static void tegra_sor_hdmi_scdc_enable(struct tegra_sor *sor) static void tegra_sor_hdmi_scdc_work(struct work_struct *work) { struct tegra_sor *sor = container_of(work, struct tegra_sor, scdc.work); + +#if defined(NV_DRM_SCDC_GET_SET_HAS_STRUCT_DRM_CONNECTOR_ARG) /* Linux v6.4 */ + if (!drm_scdc_get_scrambling_status(&sor->output.connector)) { +#else struct i2c_adapter *ddc = sor->output.ddc; if (!drm_scdc_get_scrambling_status(ddc)) { +#endif DRM_DEBUG_KMS("SCDC not scrambled\n"); tegra_sor_hdmi_scdc_enable(sor); } diff --git a/scripts/conftest/Makefile b/scripts/conftest/Makefile index ced9110e..e707fc57 100644 --- a/scripts/conftest/Makefile +++ b/scripts/conftest/Makefile @@ -100,6 +100,7 @@ NV_CONFTEST_FUNCTION_COMPILE_TESTS += drm_fb_helper_prepare_has_preferred_bpp_ar 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_mode_config_struct_has_fb_base_arg +NV_CONFTEST_FUNCTION_COMPILE_TESTS += drm_scdc_get_set_has_struct_drm_connector_arg NV_CONFTEST_FUNCTION_COMPILE_TESTS += ethtool_ops_get_set_coalesce_has_coal_and_extack_args NV_CONFTEST_FUNCTION_COMPILE_TESTS += ethtool_ops_get_set_ringparam_has_ringparam_and_extack_args NV_CONFTEST_FUNCTION_COMPILE_TESTS += iio_dev_opaque_has_mlock diff --git a/scripts/conftest/conftest.sh b/scripts/conftest/conftest.sh index d691d54f..4aaddbc8 100755 --- a/scripts/conftest/conftest.sh +++ b/scripts/conftest/conftest.sh @@ -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 + #else + #include + #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