[2/6] fbdev: Use screen_buffer in fb_sys_{read,write}()

Sui Jingfeng 15330273260 at 189.cn
Wed Apr 26 09:47:56 UTC 2023


Tested-by: Sui Jingfeng <suijingfeng at loongson.cn>

On 2023/4/25 22:28, Thomas Zimmermann wrote:
> Use info->screen_buffer when reading and writing framebuffers in
> system memory. It's the correct pointer for this address space.
>
> Signed-off-by: Thomas Zimmermann <tzimmermann at suse.de>
> Reviewed-by: Javier Martinez Canillas <javierm at redhat.com>
> ---
>   drivers/video/fbdev/core/fb_sys_fops.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/video/fbdev/core/fb_sys_fops.c b/drivers/video/fbdev/core/fb_sys_fops.c
> index cefb77b9546d..6589123f4127 100644
> --- a/drivers/video/fbdev/core/fb_sys_fops.c
> +++ b/drivers/video/fbdev/core/fb_sys_fops.c
> @@ -39,7 +39,7 @@ ssize_t fb_sys_read(struct fb_info *info, char __user *buf, size_t count,
>   	if (count + p > total_size)
>   		count = total_size - p;
>   
> -	src = (void __force *)(info->screen_base + p);
> +	src = info->screen_buffer + p;
>   
>   	if (info->fbops->fb_sync)
>   		info->fbops->fb_sync(info);
> @@ -87,7 +87,7 @@ ssize_t fb_sys_write(struct fb_info *info, const char __user *buf,
>   		count = total_size - p;
>   	}
>   
> -	dst = (void __force *) (info->screen_base + p);
> +	dst = info->screen_buffer + p;
>   
>   	if (info->fbops->fb_sync)
>   		info->fbops->fb_sync(info);


More information about the dri-devel mailing list