Commit 4652905f authored by Thomas Zimmermann's avatar Thomas Zimmermann

video: Provide constants for VGA I/O range

Provide VGA_FB_ constants for the VGA framebuffer I/O range and convert
fbdev code. In the case of vga16fb, this is a rename of the existing
constants VGA_FB_PHYS and VGA_FB_PHYS_LEN.

v2:
	* clarify relationship with old constants in vga16fb (Javier)
Signed-off-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: default avatarJavier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220718072322.8927-9-tzimmermann@suse.de
parent 5e013761
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
#include <asm/fb.h> #include <asm/fb.h>
#include <video/vga.h>
/* /*
* Frame buffer device initialization and setup routines * Frame buffer device initialization and setup routines
...@@ -1561,7 +1562,6 @@ static bool fb_do_apertures_overlap(struct apertures_struct *gena, ...@@ -1561,7 +1562,6 @@ static bool fb_do_apertures_overlap(struct apertures_struct *gena,
static void do_unregister_framebuffer(struct fb_info *fb_info); static void do_unregister_framebuffer(struct fb_info *fb_info);
#define VGA_FB_PHYS 0xA0000
static void do_remove_conflicting_framebuffers(struct apertures_struct *a, static void do_remove_conflicting_framebuffers(struct apertures_struct *a,
const char *name, bool primary) const char *name, bool primary)
{ {
...@@ -1580,7 +1580,7 @@ static void do_remove_conflicting_framebuffers(struct apertures_struct *a, ...@@ -1580,7 +1580,7 @@ static void do_remove_conflicting_framebuffers(struct apertures_struct *a,
device = registered_fb[i]->device; device = registered_fb[i]->device;
if (fb_do_apertures_overlap(gen_aper, a) || if (fb_do_apertures_overlap(gen_aper, a) ||
(primary && gen_aper && gen_aper->count && (primary && gen_aper && gen_aper->count &&
gen_aper->ranges[0].base == VGA_FB_PHYS)) { gen_aper->ranges[0].base == VGA_FB_PHYS_BASE)) {
printk(KERN_INFO "fb%d: switching to %s from %s\n", printk(KERN_INFO "fb%d: switching to %s from %s\n",
i, name, registered_fb[i]->fix.id); i, name, registered_fb[i]->fix.id);
......
...@@ -25,9 +25,6 @@ ...@@ -25,9 +25,6 @@
#include <asm/io.h> #include <asm/io.h>
#include <video/vga.h> #include <video/vga.h>
#define VGA_FB_PHYS 0xA0000
#define VGA_FB_PHYS_LEN 65536
#define MODE_SKIP4 1 #define MODE_SKIP4 1
#define MODE_8BPP 2 #define MODE_8BPP 2
#define MODE_CFB 4 #define MODE_CFB 4
...@@ -87,8 +84,8 @@ static struct fb_var_screeninfo vga16fb_defined = { ...@@ -87,8 +84,8 @@ static struct fb_var_screeninfo vga16fb_defined = {
/* name should not depend on EGA/VGA */ /* name should not depend on EGA/VGA */
static const struct fb_fix_screeninfo vga16fb_fix = { static const struct fb_fix_screeninfo vga16fb_fix = {
.id = "VGA16 VGA", .id = "VGA16 VGA",
.smem_start = VGA_FB_PHYS, .smem_start = VGA_FB_PHYS_BASE,
.smem_len = VGA_FB_PHYS_LEN, .smem_len = VGA_FB_PHYS_SIZE,
.type = FB_TYPE_VGA_PLANES, .type = FB_TYPE_VGA_PLANES,
.type_aux = FB_AUX_VGA_PLANES_VGA4, .type_aux = FB_AUX_VGA_PLANES_VGA4,
.visual = FB_VISUAL_PSEUDOCOLOR, .visual = FB_VISUAL_PSEUDOCOLOR,
...@@ -1333,8 +1330,8 @@ static int vga16fb_probe(struct platform_device *dev) ...@@ -1333,8 +1330,8 @@ static int vga16fb_probe(struct platform_device *dev)
goto err_ioremap; goto err_ioremap;
} }
/* XXX share VGA_FB_PHYS and I/O region with vgacon and others */ /* 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, 0); info->screen_base = (void __iomem *)VGA_MAP_MEM(VGA_FB_PHYS_BASE, 0);
if (!info->screen_base) { if (!info->screen_base) {
printk(KERN_ERR "vga16fb: unable to map device\n"); printk(KERN_ERR "vga16fb: unable to map device\n");
...@@ -1385,8 +1382,8 @@ static int vga16fb_probe(struct platform_device *dev) ...@@ -1385,8 +1382,8 @@ static int vga16fb_probe(struct platform_device *dev)
vga16fb_update_fix(info); vga16fb_update_fix(info);
info->apertures->ranges[0].base = VGA_FB_PHYS; info->apertures->ranges[0].base = VGA_FB_PHYS_BASE;
info->apertures->ranges[0].size = VGA_FB_PHYS_LEN; info->apertures->ranges[0].size = VGA_FB_PHYS_SIZE;
if (register_framebuffer(info) < 0) { if (register_framebuffer(info) < 0) {
printk(KERN_ERR "vga16fb: unable to register framebuffer\n"); printk(KERN_ERR "vga16fb: unable to register framebuffer\n");
......
...@@ -22,6 +22,8 @@ ...@@ -22,6 +22,8 @@
#include <asm/vga.h> #include <asm/vga.h>
#include <asm/byteorder.h> #include <asm/byteorder.h>
#define VGA_FB_PHYS_BASE 0xA0000 /* VGA framebuffer I/O base */
#define VGA_FB_PHYS_SIZE 65536 /* VGA framebuffer I/O size */
/* Some of the code below is taken from SVGAlib. The original, /* Some of the code below is taken from SVGAlib. The original,
unmodified copyright notice for that code is below. */ unmodified copyright notice for that code is below. */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment