[PATCH 2/9] fbdev: Put mmap for deferred I/O into drivers

Javier Martinez Canillas javierm at redhat.com
Tue Mar 8 14:03:05 UTC 2022


On 3/3/22 21:58, Thomas Zimmermann wrote:
> The fbdev mmap function fb_mmap() unconditionally overrides the
> driver's implementation if deferred I/O has been activated. This
> makes it hard to implement mmap with anything but a vmalloc()'ed
> software buffer. That is specifically a problem for DRM, where
> video memory is maintained by a memory manager.
> 
> Leave the mmap handling to drivers and expect them to call the
> helper for deferred I/O by thmeselves.
> 
> Signed-off-by: Thomas Zimmermann <tzimmermann at suse.de>
> ---

[snip]

>  
> +	/*
> +	 * FB deferred I/O want you to handle mmap in your drivers. At a
> +	 * minimum, point struct fb_ops.fb_mmap to fb_deferred_io_mmap().
> +	 */
> +	if (WARN_ON_ONCE(info->fbdefio))
> +		return -ENODEV;
> +

Maybe part of that comment could be printed as a WARN_ON_ONCE() message ?

Regardless, the patch looks good to me:

Reviewed-by: Javier Martinez Canillas <javierm at redhat.com>

-- 
Best regards,

Javier Martinez Canillas
Linux Engineering
Red Hat



More information about the dri-devel mailing list