]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
fbdev/smscufx: Use struct fb_info.screen_buffer
authorThomas Zimmermann <tzimmermann@suse.de>
Fri, 28 Apr 2023 12:24:43 +0000 (14:24 +0200)
committerThomas Zimmermann <tzimmermann@suse.de>
Mon, 8 May 2023 13:28:33 +0000 (15:28 +0200)
Use info->screen_buffer when reading and writing framebuffers in
system memory. It's the correct pointer for this address space.

The struct fb_info has a union to store the framebuffer memory. This can
either be info->screen_base if the framebuffer is stored in I/O memory,
or info->screen_buffer if the framebuffer is stored in system memory.

As the driver operates on the latter address space, it is wrong to use
.screen_base and .screen_buffer must be used instead.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230428122452.4856-11-tzimmermann@suse.de
drivers/video/fbdev/smscufx.c

index 2ad6e98ce10d5cc83200398f8c9fa62e59ba4b32..17cec62cc65db584f97a572281d7003de1090a48 100644 (file)
@@ -1150,7 +1150,7 @@ static void ufx_free_framebuffer(struct ufx_data *dev)
                fb_dealloc_cmap(&info->cmap);
        if (info->monspecs.modedb)
                fb_destroy_modedb(info->monspecs.modedb);
-       vfree(info->screen_base);
+       vfree(info->screen_buffer);
 
        fb_destroy_modelist(&info->modelist);
 
@@ -1257,7 +1257,7 @@ static int ufx_ops_set_par(struct fb_info *info)
 
        if ((result == 0) && (dev->fb_count == 0)) {
                /* paint greenscreen */
-               pix_framebuffer = (u16 *) info->screen_base;
+               pix_framebuffer = (u16 *)info->screen_buffer;
                for (i = 0; i < info->fix.smem_len / 2; i++)
                        pix_framebuffer[i] = 0x37e6;
 
@@ -1303,7 +1303,7 @@ static int ufx_realloc_framebuffer(struct ufx_data *dev, struct fb_info *info)
 {
        int old_len = info->fix.smem_len;
        int new_len;
-       unsigned char *old_fb = info->screen_base;
+       unsigned char *old_fb = info->screen_buffer;
        unsigned char *new_fb;
 
        pr_debug("Reallocating framebuffer. Addresses will change!");
@@ -1318,12 +1318,12 @@ static int ufx_realloc_framebuffer(struct ufx_data *dev, struct fb_info *info)
                if (!new_fb)
                        return -ENOMEM;
 
-               if (info->screen_base) {
+               if (info->screen_buffer) {
                        memcpy(new_fb, old_fb, old_len);
-                       vfree(info->screen_base);
+                       vfree(info->screen_buffer);
                }
 
-               info->screen_base = new_fb;
+               info->screen_buffer = new_fb;
                info->fix.smem_len = PAGE_ALIGN(new_len);
                info->fix.smem_start = (unsigned long) new_fb;
                info->flags = smscufx_info_flags;
@@ -1746,7 +1746,7 @@ reset_active:
        atomic_set(&dev->usb_active, 0);
 setup_modes:
        fb_destroy_modedb(info->monspecs.modedb);
-       vfree(info->screen_base);
+       vfree(info->screen_buffer);
        fb_destroy_modelist(&info->modelist);
 error:
        fb_dealloc_cmap(&info->cmap);