aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/bcm27xx/patches-5.15/950-0714-drm-vc4-Convert-vc4_dsi-to-use-atomic-enable-disable.patch
diff options
context:
space:
mode:
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
commit20ea6adbf199097c4f5f591ffee088340630dae4 (patch)
treed6719d95e136611a1c25bbf7789652d6d402779d /target/linux/bcm27xx/patches-5.15/950-0714-drm-vc4-Convert-vc4_dsi-to-use-atomic-enable-disable.patch
parentbca05bd072180dc38ef740b37ded9572a6db1981 (diff)
downloadupstream-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-0714-drm-vc4-Convert-vc4_dsi-to-use-atomic-enable-disable.patch')
-rw-r--r--target/linux/bcm27xx/patches-5.15/950-0714-drm-vc4-Convert-vc4_dsi-to-use-atomic-enable-disable.patch85
1 files changed, 85 insertions, 0 deletions
diff --git a/target/linux/bcm27xx/patches-5.15/950-0714-drm-vc4-Convert-vc4_dsi-to-use-atomic-enable-disable.patch b/target/linux/bcm27xx/patches-5.15/950-0714-drm-vc4-Convert-vc4_dsi-to-use-atomic-enable-disable.patch
new file mode 100644
index 0000000000..46027a4783
--- /dev/null
+++ b/target/linux/bcm27xx/patches-5.15/950-0714-drm-vc4-Convert-vc4_dsi-to-use-atomic-enable-disable.patch
@@ -0,0 +1,85 @@
+From 2a6dfa1110ab7d6d5fd4fcce0040219346e89498 Mon Sep 17 00:00:00 2001
+From: Dave Stevenson <dave.stevenson@raspberrypi.com>
+Date: Wed, 15 Dec 2021 17:47:14 +0000
+Subject: [PATCH] drm/vc4: Convert vc4_dsi to use atomic
+ enable/disable/mode_set.
+
+The atomic calls are preferred as the non-atomic ones
+are deprecated. In preparation for conversion to a bridge,
+switch to the atomic calls.
+
+Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
+---
+ drivers/gpu/drm/vc4/vc4_dsi.c | 23 +++++++++++++++--------
+ 1 file changed, 15 insertions(+), 8 deletions(-)
+
+--- a/drivers/gpu/drm/vc4/vc4_dsi.c
++++ b/drivers/gpu/drm/vc4/vc4_dsi.c
+@@ -792,7 +792,8 @@ dsi_esc_timing(u32 ns)
+ return DIV_ROUND_UP(ns, ESC_TIME_NS);
+ }
+
+-static void vc4_dsi_encoder_disable(struct drm_encoder *encoder)
++static void vc4_dsi_encoder_disable(struct drm_encoder *encoder,
++ struct drm_atomic_state *state)
+ {
+ struct vc4_dsi_encoder *vc4_encoder = to_vc4_dsi_encoder(encoder);
+ struct vc4_dsi *dsi = vc4_encoder->dsi;
+@@ -858,18 +859,19 @@ static bool vc4_dsi_encoder_mode_fixup(s
+ }
+
+ static void vc4_dsi_encoder_mode_set(struct drm_encoder *encoder,
+- struct drm_display_mode *user_mode,
+- struct drm_display_mode *adjusted_mode)
++ struct drm_crtc_state *crtc_state,
++ struct drm_connector_state *conn_state)
+ {
+ struct vc4_dsi_encoder *vc4_encoder = to_vc4_dsi_encoder(encoder);
+ struct vc4_dsi *dsi = vc4_encoder->dsi;
+ struct device *dev = &dsi->pdev->dev;
++ const struct drm_display_mode *mode;
+ bool debug_dump_regs = false;
+ unsigned long hs_clock;
+ u32 ui_ns;
+ /* Minimum LP state duration in escape clock cycles. */
+ u32 lpx = dsi_esc_timing(60);
+- unsigned long pixel_clock_hz = adjusted_mode->clock * 1000;
++ unsigned long pixel_clock_hz;
+ unsigned long dsip_clock;
+ unsigned long phy_clock;
+ int ret;
+@@ -886,6 +888,10 @@ static void vc4_dsi_encoder_mode_set(str
+ drm_print_regset32(&p, &dsi->regset);
+ }
+
++ mode = &crtc_state->adjusted_mode;
++
++ pixel_clock_hz = mode->clock * 1000;
++
+ /* Round up the clk_set_rate() request slightly, since
+ * PLLD_DSI1 is an integer divider and its rate selection will
+ * never round up.
+@@ -1098,7 +1104,8 @@ static void vc4_dsi_encoder_mode_set(str
+ vc4_dsi_ulps(dsi, false);
+ }
+
+-static void vc4_dsi_encoder_enable(struct drm_encoder *encoder)
++static void vc4_dsi_encoder_enable(struct drm_encoder *encoder,
++ struct drm_atomic_state *state)
+ {
+ struct vc4_dsi_encoder *vc4_encoder = to_vc4_dsi_encoder(encoder);
+ struct vc4_dsi *dsi = vc4_encoder->dsi;
+@@ -1355,10 +1362,10 @@ static const struct mipi_dsi_host_ops vc
+ };
+
+ static const struct drm_encoder_helper_funcs vc4_dsi_encoder_helper_funcs = {
+- .disable = vc4_dsi_encoder_disable,
+- .enable = vc4_dsi_encoder_enable,
++ .atomic_disable = vc4_dsi_encoder_disable,
++ .atomic_enable = vc4_dsi_encoder_enable,
+ .mode_fixup = vc4_dsi_encoder_mode_fixup,
+- .mode_set = vc4_dsi_encoder_mode_set,
++ .atomic_mode_set = vc4_dsi_encoder_mode_set,
+ };
+
+ static const struct vc4_dsi_variant bcm2711_dsi1_variant = {