aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/bcm27xx/patches-5.10/950-0716-drm-gud-Add-async_flush-module-parameter.patch
diff options
context:
space:
mode:
authorÁlvaro Fernández Rojas <noltari@gmail.com>2021-08-21 10:54:34 +0200
committerÁlvaro Fernández Rojas <noltari@gmail.com>2021-08-21 19:07:07 +0200
commit8299d1f057439f94c6a4412e2e5c5082b82a30c9 (patch)
tree1bf678d61f11f7394493be464c7876e496f7faed /target/linux/bcm27xx/patches-5.10/950-0716-drm-gud-Add-async_flush-module-parameter.patch
parent33b6885975ce376ff075362b7f0890326043111b (diff)
downloadupstream-8299d1f057439f94c6a4412e2e5c5082b82a30c9.tar.gz
upstream-8299d1f057439f94c6a4412e2e5c5082b82a30c9.tar.bz2
upstream-8299d1f057439f94c6a4412e2e5c5082b82a30c9.zip
bcm27xx: add kernel 5.10 support
Rebased RPi foundation patches on linux 5.10.59, removed applied and reverted patches, wireless patches and defconfig patches. bcm2708: boot tested on RPi B+ v1.2 bcm2709: boot tested on RPi 4B v1.1 4G bcm2711: boot tested on RPi 4B v1.1 4G Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Diffstat (limited to 'target/linux/bcm27xx/patches-5.10/950-0716-drm-gud-Add-async_flush-module-parameter.patch')
-rw-r--r--target/linux/bcm27xx/patches-5.10/950-0716-drm-gud-Add-async_flush-module-parameter.patch55
1 files changed, 55 insertions, 0 deletions
diff --git a/target/linux/bcm27xx/patches-5.10/950-0716-drm-gud-Add-async_flush-module-parameter.patch b/target/linux/bcm27xx/patches-5.10/950-0716-drm-gud-Add-async_flush-module-parameter.patch
new file mode 100644
index 0000000000..d93e6945ed
--- /dev/null
+++ b/target/linux/bcm27xx/patches-5.10/950-0716-drm-gud-Add-async_flush-module-parameter.patch
@@ -0,0 +1,55 @@
+From e0eb7ca2dd07ca8878b67cc20e75f9d7e46d80f4 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= <noralf@tronnes.org>
+Date: Sat, 3 Jul 2021 16:13:21 +0200
+Subject: [PATCH] drm/gud: Add async_flush module parameter
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+[ drm-misc commit a0356899ebe8ecde0da9c5685cc47154db973a5e ]
+
+Provide a way for userspace to choose synchronous flushing/pageflips.
+This helps save CPU and power.
+
+It is also useful for test scripts since userspace can know when a flush
+has happended and wait before doing the next visual test.
+
+Cc: Linus Walleij <linus.walleij@linaro.org>
+Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
+Reviewed-by: Peter Stuge <peter@stuge.se>
+Link: https://patchwork.freedesktop.org/patch/msgid/20210703141321.35494-2-noralf@tronnes.org
+---
+ drivers/gpu/drm/gud/gud_pipe.c | 15 +++++++++++++++
+ 1 file changed, 15 insertions(+)
+
+--- a/drivers/gpu/drm/gud/gud_pipe.c
++++ b/drivers/gpu/drm/gud/gud_pipe.c
+@@ -24,6 +24,19 @@
+ #include "gud_internal.h"
+
+ /*
++ * Some userspace rendering loops runs all displays in the same loop.
++ * This means that a fast display will have to wait for a slow one.
++ * For this reason gud does flushing asynchronous by default.
++ * The down side is that in e.g. a single display setup userspace thinks
++ * the display is insanely fast since the driver reports back immediately
++ * that the flush/pageflip is done. This wastes CPU and power.
++ * Such users might want to set this module parameter to false.
++ */
++static bool gud_async_flush = true;
++module_param_named(async_flush, gud_async_flush, bool, 0644);
++MODULE_PARM_DESC(async_flush, "Enable asynchronous flushing [default=true]");
++
++/*
+ * FIXME: The driver is probably broken on Big Endian machines.
+ * See discussion:
+ * https://lore.kernel.org/dri-devel/CAKb7UvihLX0hgBOP3VBG7O+atwZcUVCPVuBdfmDMpg0NjXe-cQ@mail.gmail.com/
+@@ -577,6 +590,8 @@ void gud_pipe_update(struct drm_simple_d
+ if (gdrm->flags & GUD_DISPLAY_FLAG_FULL_UPDATE)
+ drm_rect_init(&damage, 0, 0, fb->width, fb->height);
+ gud_fb_queue_damage(gdrm, fb, &damage);
++ if (!gud_async_flush)
++ flush_work(&gdrm->work);
+ }
+
+ if (!crtc->state->enable)