From 2cb14c86137d64fff2ed9862cf0a3af92b8a103f Mon Sep 17 00:00:00 2001 From: Thomas Zimmermann Date: Mon, 19 Dec 2022 17:05:15 +0100 Subject: fbdev/vga16fb: Do not use struct fb_info.apertures Acquire ownership of the firmware scanout buffer by calling Linux' aperture helpers. Remove the use of struct fb_info.apertures and do not set FBINFO_MISC_FIRMWARE; both of which previously configured buffer ownership. Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20221219160516.23436-18-tzimmermann@suse.de --- drivers/video/fbdev/vga16fb.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'drivers/video') diff --git a/drivers/video/fbdev/vga16fb.c b/drivers/video/fbdev/vga16fb.c index af47f8217095..1a8ffdb2be26 100644 --- a/drivers/video/fbdev/vga16fb.c +++ b/drivers/video/fbdev/vga16fb.c @@ -10,6 +10,7 @@ * archive for more details. */ +#include #include #include #include @@ -1324,11 +1325,6 @@ static int vga16fb_probe(struct platform_device *dev) ret = -ENOMEM; goto err_fb_alloc; } - info->apertures = alloc_apertures(1); - if (!info->apertures) { - ret = -ENOMEM; - goto err_ioremap; - } /* XXX share VGA_FB_PHYS_BASE and I/O region with vgacon and others */ info->screen_base = (void __iomem *)VGA_MAP_MEM(VGA_FB_PHYS_BASE, 0); @@ -1363,8 +1359,7 @@ static int vga16fb_probe(struct platform_device *dev) info->fix = vga16fb_fix; /* supports rectangles with widths of multiples of 8 */ info->pixmap.blit_x = 1 << 7 | 1 << 15 | 1 << 23 | 1 << 31; - info->flags = FBINFO_FLAG_DEFAULT | FBINFO_MISC_FIRMWARE | - FBINFO_HWACCEL_YPAN; + info->flags = FBINFO_FLAG_DEFAULT | FBINFO_HWACCEL_YPAN; i = (info->var.bits_per_pixel == 8) ? 256 : 16; ret = fb_alloc_cmap(&info->cmap, i, 0); @@ -1382,9 +1377,9 @@ static int vga16fb_probe(struct platform_device *dev) vga16fb_update_fix(info); - info->apertures->ranges[0].base = VGA_FB_PHYS_BASE; - info->apertures->ranges[0].size = VGA_FB_PHYS_SIZE; - + ret = devm_aperture_acquire_for_platform_device(dev, VGA_FB_PHYS_BASE, VGA_FB_PHYS_SIZE); + if (ret) + goto err_check_var; if (register_framebuffer(info) < 0) { printk(KERN_ERR "vga16fb: unable to register framebuffer\n"); ret = -EINVAL; -- cgit v1.2.3