From 2153e0b50fad9ecd86afad37e105ed15dcd3a883 Mon Sep 17 00:00:00 2001 From: Peter Robinson Date: Wed, 1 Mar 2017 13:31:29 +0000 Subject: [PATCH] Add patch to fix desktop lockups on RPi (vc4) RHBZ# 1389163 --- kernel.spec | 5 ++ vc4-fix-vblank-cursor-update-issue.patch | 59 ++++++++++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 vc4-fix-vblank-cursor-update-issue.patch diff --git a/kernel.spec b/kernel.spec index 983e8d377..247c931e9 100644 --- a/kernel.spec +++ b/kernel.spec @@ -538,6 +538,8 @@ Patch434: 0001-i2c-bcm2835-Debug-test-for-curr_msg.patch # Upstream fixes for i2c/serial/ethernet MAC addresses Patch435: bcm283x-fixes.patch +Patch436: vc4-fix-vblank-cursor-update-issue.patch + # http://www.spinics.net/lists/arm-kernel/msg552554.html Patch438: arm-imx6-hummingboard2.patch @@ -2179,6 +2181,9 @@ fi # # %changelog +* Wed Mar 1 2017 Peter Robinson +- Add patch to fix desktop lockups on RPi (vc4) RHBZ# 1389163 + * Tue Feb 28 2017 Justin M. Forbes - Fix kernel-devel virtual provide diff --git a/vc4-fix-vblank-cursor-update-issue.patch b/vc4-fix-vblank-cursor-update-issue.patch new file mode 100644 index 000000000..8537d67ca --- /dev/null +++ b/vc4-fix-vblank-cursor-update-issue.patch @@ -0,0 +1,59 @@ +From 6d24c1c5918907ab78a5729b78c0d165deb3cc2b Mon Sep 17 00:00:00 2001 +From: Michael Zoran +Date: Thu, 23 Feb 2017 17:54:31 -0800 +Subject: drm/vc4: Don't wait for vblank when updating the cursor + +Commonly used desktop environments such as xfce4 and gnome +on debian sid can flood the graphics drivers with cursor +updates. Because the current implementation is waiting +for a vblank between cursor updates, this will cause the +display to hang for a long time since a typical refresh +rate is only 60Hz. + +This is unnecessary and unexpected by user mode software, +so simply swap out the cursor frame buffer without waiting. + +Signed-off-by: Michael Zoran +Reviewed-by: Eric Anholt +Link: http://patchwork.freedesktop.org/patch/msgid/20170224015431.24583-1-mzoran@crowfest.net + +diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c +index f7a229d..110224c 100644 +--- a/drivers/gpu/drm/vc4/vc4_plane.c ++++ b/drivers/gpu/drm/vc4/vc4_plane.c +@@ -20,6 +20,7 @@ + + #include "vc4_drv.h" + #include "vc4_regs.h" ++#include "drm_atomic.h" + #include "drm_atomic_helper.h" + #include "drm_fb_cma_helper.h" + #include "drm_plane_helper.h" +@@ -769,12 +770,6 @@ vc4_update_plane(struct drm_plane *plane, + if (!plane_state) + goto out; + +- /* If we're changing the cursor contents, do that in the +- * normal vblank-synced atomic path. +- */ +- if (fb != plane_state->fb) +- goto out; +- + /* No configuring new scaling in the fast path. */ + if (crtc_w != plane_state->crtc_w || + crtc_h != plane_state->crtc_h || +@@ -783,6 +778,11 @@ vc4_update_plane(struct drm_plane *plane, + goto out; + } + ++ if (fb != plane_state->fb) { ++ drm_atomic_set_fb_for_plane(plane->state, fb); ++ vc4_plane_async_set_fb(plane, fb); ++ } ++ + /* Set the cursor's position on the screen. This is the + * expected change from the drm_mode_cursor_universal() + * helper. +-- +cgit v0.10.2 +