Skip to content

Commit 6ca4926

Browse files
committed
fbdev/smscufx: Use struct fb_info.screen_buffer
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
1 parent bdb6164 commit 6ca4926

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

drivers/video/fbdev/smscufx.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1150,7 +1150,7 @@ static void ufx_free_framebuffer(struct ufx_data *dev)
11501150
fb_dealloc_cmap(&info->cmap);
11511151
if (info->monspecs.modedb)
11521152
fb_destroy_modedb(info->monspecs.modedb);
1153-
vfree(info->screen_base);
1153+
vfree(info->screen_buffer);
11541154

11551155
fb_destroy_modelist(&info->modelist);
11561156

@@ -1257,7 +1257,7 @@ static int ufx_ops_set_par(struct fb_info *info)
12571257

12581258
if ((result == 0) && (dev->fb_count == 0)) {
12591259
/* paint greenscreen */
1260-
pix_framebuffer = (u16 *) info->screen_base;
1260+
pix_framebuffer = (u16 *)info->screen_buffer;
12611261
for (i = 0; i < info->fix.smem_len / 2; i++)
12621262
pix_framebuffer[i] = 0x37e6;
12631263

@@ -1303,7 +1303,7 @@ static int ufx_realloc_framebuffer(struct ufx_data *dev, struct fb_info *info)
13031303
{
13041304
int old_len = info->fix.smem_len;
13051305
int new_len;
1306-
unsigned char *old_fb = info->screen_base;
1306+
unsigned char *old_fb = info->screen_buffer;
13071307
unsigned char *new_fb;
13081308

13091309
pr_debug("Reallocating framebuffer. Addresses will change!");
@@ -1318,12 +1318,12 @@ static int ufx_realloc_framebuffer(struct ufx_data *dev, struct fb_info *info)
13181318
if (!new_fb)
13191319
return -ENOMEM;
13201320

1321-
if (info->screen_base) {
1321+
if (info->screen_buffer) {
13221322
memcpy(new_fb, old_fb, old_len);
1323-
vfree(info->screen_base);
1323+
vfree(info->screen_buffer);
13241324
}
13251325

1326-
info->screen_base = new_fb;
1326+
info->screen_buffer = new_fb;
13271327
info->fix.smem_len = PAGE_ALIGN(new_len);
13281328
info->fix.smem_start = (unsigned long) new_fb;
13291329
info->flags = smscufx_info_flags;
@@ -1746,7 +1746,7 @@ static int ufx_usb_probe(struct usb_interface *interface,
17461746
atomic_set(&dev->usb_active, 0);
17471747
setup_modes:
17481748
fb_destroy_modedb(info->monspecs.modedb);
1749-
vfree(info->screen_base);
1749+
vfree(info->screen_buffer);
17501750
fb_destroy_modelist(&info->modelist);
17511751
error:
17521752
fb_dealloc_cmap(&info->cmap);

0 commit comments

Comments
 (0)