]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.14.69/udlfb-set-optimal-write-delay.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 4.14.69 / udlfb-set-optimal-write-delay.patch
1 From bb24153a3f13dd0dbc1f8055ad97fe346d598f66 Mon Sep 17 00:00:00 2001
2 From: Mikulas Patocka <mpatocka@redhat.com>
3 Date: Wed, 25 Jul 2018 15:41:55 +0200
4 Subject: udlfb: set optimal write delay
5
6 From: Mikulas Patocka <mpatocka@redhat.com>
7
8 commit bb24153a3f13dd0dbc1f8055ad97fe346d598f66 upstream.
9
10 The default delay 5 jiffies is too much when the kernel is compiled with
11 HZ=100 - it results in jumpy cursor in Xwindow.
12
13 In order to find out the optimal delay, I benchmarked the driver on
14 1280x720x30fps video. I found out that with HZ=1000, 10ms is acceptable,
15 but with HZ=250 or HZ=300, we need 4ms, so that the video is played
16 without any frame skips.
17
18 This patch changes the delay to this value.
19
20 Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
21 Cc: stable@vger.kernel.org
22 Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
23 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
24
25 ---
26 include/video/udlfb.h | 2 +-
27 1 file changed, 1 insertion(+), 1 deletion(-)
28
29 --- a/include/video/udlfb.h
30 +++ b/include/video/udlfb.h
31 @@ -88,7 +88,7 @@ struct dlfb_data {
32 #define MIN_RAW_PIX_BYTES 2
33 #define MIN_RAW_CMD_BYTES (RAW_HEADER_BYTES + MIN_RAW_PIX_BYTES)
34
35 -#define DL_DEFIO_WRITE_DELAY 5 /* fb_deferred_io.delay in jiffies */
36 +#define DL_DEFIO_WRITE_DELAY msecs_to_jiffies(HZ <= 300 ? 4 : 10) /* optimal value for 720p video */
37 #define DL_DEFIO_WRITE_DISABLE (HZ*60) /* "disable" with long delay */
38
39 /* remove these once align.h patch is taken into kernel */