This is a note to let you know that I've just added the patch titled

    drm/fb-helper: Mark screen buffers in system memory with FBINFO_VIRTFB

to the 5.17-stable tree which can be found at:
    
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     drm-fb-helper-mark-screen-buffers-in-system-memory-with-fbinfo_virtfb.patch
and it can be found in the queue-5.17 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <sta...@vger.kernel.org> know about it.


>From cd9f7f7ac5932129fe81b4c7559cfcb226ec7c5c Mon Sep 17 00:00:00 2001
From: Thomas Zimmermann <tzimmerm...@suse.de>
Date: Tue, 1 Feb 2022 12:53:05 +0100
Subject: drm/fb-helper: Mark screen buffers in system memory with FBINFO_VIRTFB

From: Thomas Zimmermann <tzimmerm...@suse.de>

commit cd9f7f7ac5932129fe81b4c7559cfcb226ec7c5c upstream.

Mark screen buffers in system memory with FBINFO_VIRTFB. Otherwise, fbdev
deferred I/O marks mmap'ed areas of system memory with VM_IO. (There's an
inverse relationship between the two flags.)

For shadow buffers, also set the FBINFO_READS_FAST hint.

v3:
        * change FB_ to FBINFO_ in commit description
v2:
        * updated commit description (Daniel)
        * added Fixes tag

Signed-off-by: Thomas Zimmermann <tzimmerm...@suse.de>
Fixes: d536540f304c ("drm/fb-helper: Add generic fbdev emulation .fb_probe 
function")
Reviewed-by: Daniel Vetter <daniel.vet...@ffwll.ch>
Cc: dri-devel@lists.freedesktop.org
Cc: <sta...@vger.kernel.org> # v4.19+
Link: 
https://patchwork.freedesktop.org/patch/msgid/20220201115305.9333-1-tzimmerm...@suse.de
Signed-off-by: Greg Kroah-Hartman <gre...@linuxfoundation.org>
---
 drivers/gpu/drm/drm_fb_helper.c |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

--- a/drivers/gpu/drm/drm_fb_helper.c
+++ b/drivers/gpu/drm/drm_fb_helper.c
@@ -2346,6 +2346,7 @@ static int drm_fb_helper_generic_probe(s
        fbi->fbops = &drm_fbdev_fb_ops;
        fbi->screen_size = sizes->surface_height * fb->pitches[0];
        fbi->fix.smem_len = fbi->screen_size;
+       fbi->flags = FBINFO_DEFAULT;
 
        drm_fb_helper_fill_info(fbi, fb_helper, sizes);
 
@@ -2353,19 +2354,21 @@ static int drm_fb_helper_generic_probe(s
                fbi->screen_buffer = vzalloc(fbi->screen_size);
                if (!fbi->screen_buffer)
                        return -ENOMEM;
+               fbi->flags |= FBINFO_VIRTFB | FBINFO_READS_FAST;
 
                fbi->fbdefio = &drm_fbdev_defio;
-
                fb_deferred_io_init(fbi);
        } else {
                /* buffer is mapped for HW framebuffer */
                ret = drm_client_buffer_vmap(fb_helper->buffer, &map);
                if (ret)
                        return ret;
-               if (map.is_iomem)
+               if (map.is_iomem) {
                        fbi->screen_base = map.vaddr_iomem;
-               else
+               } else {
                        fbi->screen_buffer = map.vaddr;
+                       fbi->flags |= FBINFO_VIRTFB;
+               }
 
                /*
                 * Shamelessly leak the physical address to user-space. As


Patches currently in stable-queue which might be from tzimmerm...@suse.de are

queue-5.17/fbdev-hot-unplug-firmware-fb-devices-on-forced-removal.patch
queue-5.17/drm-fb-helper-mark-screen-buffers-in-system-memory-with-fbinfo_virtfb.patch
queue-5.17/drm-simpledrm-add-panel-orientation-property-on-non-upright-mounted-lcd-panels.patch
queue-5.17/mgag200-fix-memmapsl-configuration-in-gctl6-register.patch

Reply via email to