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-0451-drm-vc4-Refactor-mode-checking-logic.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-0451-drm-vc4-Refactor-mode-checking-logic.patch')
-rw-r--r-- | target/linux/bcm27xx/patches-5.15/950-0451-drm-vc4-Refactor-mode-checking-logic.patch | 85 |
1 files changed, 85 insertions, 0 deletions
diff --git a/target/linux/bcm27xx/patches-5.15/950-0451-drm-vc4-Refactor-mode-checking-logic.patch b/target/linux/bcm27xx/patches-5.15/950-0451-drm-vc4-Refactor-mode-checking-logic.patch new file mode 100644 index 0000000000..b41d088ad1 --- /dev/null +++ b/target/linux/bcm27xx/patches-5.15/950-0451-drm-vc4-Refactor-mode-checking-logic.patch @@ -0,0 +1,85 @@ +From cf8fe4bd58be368fc600fab4ea5aed2dd5dba138 Mon Sep 17 00:00:00 2001 +From: Mateusz Kwiatkowski <kfyatek+publicgit@gmail.com> +Date: Thu, 15 Jul 2021 01:08:05 +0200 +Subject: [PATCH] drm/vc4: Refactor mode checking logic + +Replace drm_encoder_helper_funcs::atomic_check with +drm_connector_helper_funcs::atomic_check - the former is not called +during drm_mode_obj_set_property_ioctl(). Set crtc_state->mode_changed +if TV norm changes even without explicit mode change. This makes things +like "xrandr --output Composite-1 --set mode PAL-M" work properly. + +Signed-off-by: Mateusz Kwiatkowski <kfyatek+publicgit@gmail.com> +--- + drivers/gpu/drm/vc4/vc4_vec.c | 42 ++++++++++++++++++++++------------- + 1 file changed, 26 insertions(+), 16 deletions(-) + +--- a/drivers/gpu/drm/vc4/vc4_vec.c ++++ b/drivers/gpu/drm/vc4/vc4_vec.c +@@ -415,6 +415,31 @@ static void vc4_vec_connector_reset(stru + connector->state->tv.mode = vc4_vec_get_default_mode(connector); + } + ++static int vc4_vec_connector_atomic_check(struct drm_connector *conn, ++ struct drm_atomic_state *state) ++{ ++ struct drm_connector_state *old_state = ++ drm_atomic_get_old_connector_state(state, conn); ++ struct drm_connector_state *new_state = ++ drm_atomic_get_new_connector_state(state, conn); ++ ++ const struct vc4_vec_tv_mode *vec_mode = ++ &vc4_vec_tv_modes[new_state->tv.mode]; ++ ++ if (new_state->crtc) { ++ struct drm_crtc_state *crtc_state = ++ drm_atomic_get_new_crtc_state(state, new_state->crtc); ++ ++ if (!drm_mode_equal(vec_mode->mode, &crtc_state->mode)) ++ return -EINVAL; ++ ++ if (old_state->tv.mode != new_state->tv.mode) ++ crtc_state->mode_changed = true; ++ } ++ ++ return 0; ++} ++ + static const struct drm_connector_funcs vc4_vec_connector_funcs = { + .detect = vc4_vec_connector_detect, + .fill_modes = drm_helper_probe_single_connector_modes, +@@ -426,6 +451,7 @@ static const struct drm_connector_funcs + + static const struct drm_connector_helper_funcs vc4_vec_connector_helper_funcs = { + .get_modes = vc4_vec_connector_get_modes, ++ .atomic_check = vc4_vec_connector_atomic_check, + }; + + static struct drm_connector *vc4_vec_connector_init(struct drm_device *dev, +@@ -563,26 +589,10 @@ static bool vc4_vec_encoder_mode_fixup(s + return true; + } + +-static int vc4_vec_encoder_atomic_check(struct drm_encoder *encoder, +- struct drm_crtc_state *crtc_state, +- struct drm_connector_state *conn_state) +-{ +- const struct vc4_vec_tv_mode *vec_mode; +- +- vec_mode = &vc4_vec_tv_modes[conn_state->tv.mode]; +- +- if (conn_state->crtc && +- !drm_mode_equal(vec_mode->mode, &crtc_state->adjusted_mode)) +- return -EINVAL; +- +- return 0; +-} +- + static const struct drm_encoder_helper_funcs vc4_vec_encoder_helper_funcs = { + .disable = vc4_vec_encoder_disable, + .enable = vc4_vec_encoder_enable, + .mode_fixup = vc4_vec_encoder_mode_fixup, +- .atomic_check = vc4_vec_encoder_atomic_check, + }; + + static const struct vc4_vec_variant bcm2835_vec_variant = { |