mirror of
https://github.com/Ysurac/openmptcprouter.git
synced 2025-03-09 15:40:20 +00:00
Add kernel 5.15 for RPI4 support
This commit is contained in:
parent
e961d478cd
commit
df88a19bbd
638 changed files with 239907 additions and 0 deletions
|
@ -0,0 +1,90 @@
|
|||
From 435dc64038e7bbc027d5f4de1c8df7f13a411d29 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 475/634] 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(-)
|
||||
|
||||
diff --git a/drivers/gpu/drm/vc4/vc4_vec.c b/drivers/gpu/drm/vc4/vc4_vec.c
|
||||
index fb4360c0d9e3..b684595a5d0b 100644
|
||||
--- 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(struct drm_connector *connector)
|
||||
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 vc4_vec_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(struct drm_encoder *encoder,
|
||||
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 = {
|
||||
--
|
||||
2.33.1
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue