Commit abc79a0e authored by Thomas Zimmermann's avatar Thomas Zimmermann

fbdev/deferred-io: Test screen_buffer for vmalloc'ed memory

Framebuffers in virtual memory are available via screen_buffer. Use
it instead of screen_base and avoid the type casting.
Signed-off-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: default avatarJavier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240419083331.7761-5-tzimmermann@suse.de
parent 28aea43c
......@@ -25,11 +25,11 @@
static struct page *fb_deferred_io_page(struct fb_info *info, unsigned long offs)
{
void *screen_base = (void __force *) info->screen_base;
const void *screen_buffer = info->screen_buffer;
struct page *page;
if (is_vmalloc_addr(screen_base + offs))
page = vmalloc_to_page(screen_base + offs);
if (is_vmalloc_addr(screen_buffer + offs))
page = vmalloc_to_page(screen_buffer + offs);
else
page = pfn_to_page((info->fix.smem_start + offs) >> PAGE_SHIFT);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment