[PATCH 32/32] fbdev: Remove default file-I/O implementations

Javier Martinez Canillas javierm at redhat.com
Thu Nov 16 13:15:01 UTC 2023


Thomas Zimmermann <tzimmermann at suse.de> writes:

> Drop the default implementations for file read, write and mmap
> operations. Each fbdev driver must now provide an implementation
> and select any necessary helpers. If no implementation has been
> set, fbdev returns an errno code to user space. The code is the
> same as if the operation had not been set in the file_operations
> struct.
>
> This change makes the fbdev helpers for I/O memory optional. Most
> systems only use system-memory framebuffers via DRM's fbdev emulation.
>
> Signed-off-by: Thomas Zimmermann <tzimmermann at suse.de>
> ---

[...]

> @@ -34,13 +34,13 @@ static ssize_t fb_read(struct file *file, char __user *buf, size_t count, loff_t
>  	if (!info)
>  		return -ENODEV;
>  
> +	if (!info->fbops->fb_read)
> +		return -EINVAL;
> +

Can we also add a warn here? In case that it was missed to set a driver
callback. Probably can be figured out from the -EINVAL but better to be
explicit about the issue to make finding that easier.

And same for the other fops.

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

-- 
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat



More information about the dri-devel mailing list