diff options
author | Álvaro Fernández Rojas <noltari@gmail.com> | 2022-05-16 23:40:32 +0200 |
---|---|---|
committer | Álvaro Fernández Rojas <noltari@gmail.com> | 2022-05-17 15:11:22 +0200 |
commit | 20ea6adbf199097c4f5f591ffee088340630dae4 (patch) | |
tree | d6719d95e136611a1c25bbf7789652d6d402779d /target/linux/bcm27xx/patches-5.15/950-0630-drm-vc4-hdmi-Move-clock-validation-to-its-own-functi.patch | |
parent | bca05bd072180dc38ef740b37ded9572a6db1981 (diff) | |
download | upstream-20ea6adbf199097c4f5f591ffee088340630dae4.tar.gz upstream-20ea6adbf199097c4f5f591ffee088340630dae4.tar.bz2 upstream-20ea6adbf199097c4f5f591ffee088340630dae4.zip |
bcm27xx: add support for linux v5.15
Build system: x86_64
Build-tested: bcm2708, bcm2709, bcm2710, bcm2711
Run-tested: bcm2708/RPiB+, bcm2709/RPi3B, bcm2710/RPi3B, bcm2711/RPi4B
Signed-off-by: Marty Jones <mj8263788@gmail.com>
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Diffstat (limited to 'target/linux/bcm27xx/patches-5.15/950-0630-drm-vc4-hdmi-Move-clock-validation-to-its-own-functi.patch')
-rw-r--r-- | target/linux/bcm27xx/patches-5.15/950-0630-drm-vc4-hdmi-Move-clock-validation-to-its-own-functi.patch | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/target/linux/bcm27xx/patches-5.15/950-0630-drm-vc4-hdmi-Move-clock-validation-to-its-own-functi.patch b/target/linux/bcm27xx/patches-5.15/950-0630-drm-vc4-hdmi-Move-clock-validation-to-its-own-functi.patch new file mode 100644 index 0000000000..c3222e51a4 --- /dev/null +++ b/target/linux/bcm27xx/patches-5.15/950-0630-drm-vc4-hdmi-Move-clock-validation-to-its-own-functi.patch @@ -0,0 +1,63 @@ +From ca4627ecd3f93cd28ba3ae75af44e28224989b6a Mon Sep 17 00:00:00 2001 +From: Maxime Ripard <maxime@cerno.tech> +Date: Thu, 2 Dec 2021 16:58:17 +0100 +Subject: [PATCH] drm/vc4: hdmi: Move clock validation to its own + function + +Our code is doing the same clock rate validation in multiple instances. +Let's create a helper to share the rate validation. + +Signed-off-by: Maxime Ripard <maxime@cerno.tech> +--- + drivers/gpu/drm/vc4/vc4_hdmi.c | 26 +++++++++++++++----------- + 1 file changed, 15 insertions(+), 11 deletions(-) + +--- a/drivers/gpu/drm/vc4/vc4_hdmi.c ++++ b/drivers/gpu/drm/vc4/vc4_hdmi.c +@@ -1250,6 +1250,19 @@ static void vc4_hdmi_encoder_atomic_mode + mutex_unlock(&vc4_hdmi->mutex); + } + ++static enum drm_mode_status ++vc4_hdmi_encoder_clock_valid(const struct vc4_hdmi *vc4_hdmi, ++ unsigned long long clock) ++{ ++ if (clock > vc4_hdmi->variant->max_pixel_clock) ++ return MODE_CLOCK_HIGH; ++ ++ if (vc4_hdmi->disable_4kp60 && clock > HDMI_14_MAX_TMDS_CLK) ++ return MODE_CLOCK_HIGH; ++ ++ return MODE_OK; ++} ++ + #define WIFI_2_4GHz_CH1_MIN_FREQ 2400000000ULL + #define WIFI_2_4GHz_CH1_MAX_FREQ 2422000000ULL + +@@ -1294,10 +1307,7 @@ static int vc4_hdmi_encoder_atomic_check + if (mode->flags & DRM_MODE_FLAG_DBLCLK) + pixel_rate = pixel_rate * 2; + +- if (pixel_rate > vc4_hdmi->variant->max_pixel_clock) +- return -EINVAL; +- +- if (vc4_hdmi->disable_4kp60 && (pixel_rate > HDMI_14_MAX_TMDS_CLK)) ++ if (vc4_hdmi_encoder_clock_valid(vc4_hdmi, pixel_rate) != MODE_OK) + return -EINVAL; + + vc4_state->pixel_rate = pixel_rate; +@@ -1317,13 +1327,7 @@ vc4_hdmi_encoder_mode_valid(struct drm_e + (mode->hsync_end % 2) || (mode->htotal % 2))) + return MODE_H_ILLEGAL; + +- if ((mode->clock * 1000) > vc4_hdmi->variant->max_pixel_clock) +- return MODE_CLOCK_HIGH; +- +- if (vc4_hdmi->disable_4kp60 && vc4_hdmi_mode_needs_scrambling(mode)) +- return MODE_CLOCK_HIGH; +- +- return MODE_OK; ++ return vc4_hdmi_encoder_clock_valid(vc4_hdmi, mode->clock * 1000); + } + + static const struct drm_encoder_helper_funcs vc4_hdmi_encoder_helper_funcs = { |