mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 17:25:35 +03:00
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:
committed by
mobile promotions
parent
5c6720246f
commit
d021a4fbae
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user