From: Greg Kroah-Hartman Date: Mon, 28 Jan 2019 16:55:15 +0000 (+0100) Subject: 4.19-stable patches X-Git-Tag: v4.9.154~30 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a032a32238426a12ed988e6d7e9b4ff51c9b6f75;p=thirdparty%2Fkernel%2Fstable-queue.git 4.19-stable patches added patches: drm-meson-fix-atomic-mode-switching-regression.patch --- diff --git a/queue-4.19/drm-meson-fix-atomic-mode-switching-regression.patch b/queue-4.19/drm-meson-fix-atomic-mode-switching-regression.patch new file mode 100644 index 00000000000..6599a75cec7 --- /dev/null +++ b/queue-4.19/drm-meson-fix-atomic-mode-switching-regression.patch @@ -0,0 +1,113 @@ +From ce0210c12433031aba3bbacd75f4c02ab77f2004 Mon Sep 17 00:00:00 2001 +From: Neil Armstrong +Date: Mon, 14 Jan 2019 16:31:18 +0100 +Subject: drm/meson: Fix atomic mode switching regression + +From: Neil Armstrong + +commit ce0210c12433031aba3bbacd75f4c02ab77f2004 upstream. + +Since commit 2bcd3ecab773 when switching mode from X11 (ubuntu mate for +example) the display gets blurry, looking like an invalid framebuffer width. + +This commit fixed atomic crtc modesetting in a totally wrong way and +introduced a local unnecessary ->enabled crtc state. + +This commit reverts the crctc _begin() and _enable() changes and simply +adds drm_atomic_helper_commit_tail_rpm as helper. + +Reported-by: Tony McKahan +Suggested-by: Daniel Vetter +Fixes: 2bcd3ecab773 ("drm/meson: Fixes for drm_crtc_vblank_on/off support") +Signed-off-by: Neil Armstrong +Acked-by: Daniel Vetter +[narmstrong: fixed blank line issue from checkpatch] +Link: https://patchwork.freedesktop.org/patch/msgid/20190114153118.8024-1-narmstrong@baylibre.com +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/meson/meson_crtc.c | 23 ++--------------------- + drivers/gpu/drm/meson/meson_drv.c | 5 +++++ + 2 files changed, 7 insertions(+), 21 deletions(-) + +--- a/drivers/gpu/drm/meson/meson_crtc.c ++++ b/drivers/gpu/drm/meson/meson_crtc.c +@@ -45,7 +45,6 @@ struct meson_crtc { + struct drm_crtc base; + struct drm_pending_vblank_event *event; + struct meson_drm *priv; +- bool enabled; + }; + #define to_meson_crtc(x) container_of(x, struct meson_crtc, base) + +@@ -81,7 +80,8 @@ static const struct drm_crtc_funcs meson + + }; + +-static void meson_crtc_enable(struct drm_crtc *crtc) ++static void meson_crtc_atomic_enable(struct drm_crtc *crtc, ++ struct drm_crtc_state *old_state) + { + struct meson_crtc *meson_crtc = to_meson_crtc(crtc); + struct drm_crtc_state *crtc_state = crtc->state; +@@ -103,20 +103,6 @@ static void meson_crtc_enable(struct drm + + drm_crtc_vblank_on(crtc); + +- meson_crtc->enabled = true; +-} +- +-static void meson_crtc_atomic_enable(struct drm_crtc *crtc, +- struct drm_crtc_state *old_state) +-{ +- struct meson_crtc *meson_crtc = to_meson_crtc(crtc); +- struct meson_drm *priv = meson_crtc->priv; +- +- DRM_DEBUG_DRIVER("\n"); +- +- if (!meson_crtc->enabled) +- meson_crtc_enable(crtc); +- + priv->viu.osd1_enabled = true; + } + +@@ -142,8 +128,6 @@ static void meson_crtc_atomic_disable(st + + crtc->state->event = NULL; + } +- +- meson_crtc->enabled = false; + } + + static void meson_crtc_atomic_begin(struct drm_crtc *crtc, +@@ -152,9 +136,6 @@ static void meson_crtc_atomic_begin(stru + struct meson_crtc *meson_crtc = to_meson_crtc(crtc); + unsigned long flags; + +- if (crtc->state->enable && !meson_crtc->enabled) +- meson_crtc_enable(crtc); +- + if (crtc->state->event) { + WARN_ON(drm_crtc_vblank_get(crtc) != 0); + +--- a/drivers/gpu/drm/meson/meson_drv.c ++++ b/drivers/gpu/drm/meson/meson_drv.c +@@ -82,6 +82,10 @@ static const struct drm_mode_config_func + .fb_create = drm_gem_fb_create, + }; + ++static const struct drm_mode_config_helper_funcs meson_mode_config_helpers = { ++ .atomic_commit_tail = drm_atomic_helper_commit_tail_rpm, ++}; ++ + static irqreturn_t meson_irq(int irq, void *arg) + { + struct drm_device *dev = arg; +@@ -246,6 +250,7 @@ static int meson_drv_bind_master(struct + drm->mode_config.max_width = 3840; + drm->mode_config.max_height = 2160; + drm->mode_config.funcs = &meson_mode_config_funcs; ++ drm->mode_config.helper_private = &meson_mode_config_helpers; + + /* Hardware Initialization */ + diff --git a/queue-4.19/series b/queue-4.19/series index dfbae44dab1..c906d1a1c4f 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -82,3 +82,4 @@ can-flexcan-fix-null-pointer-exception-during-bringup.patch vt-make-vt_console_print-compatible-with-the-unicode-screen-buffer.patch vt-always-call-notifier-with-the-console-lock-held.patch vt-invoke-notifier-on-screen-size-change.patch +drm-meson-fix-atomic-mode-switching-regression.patch