aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/fbmem.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/fbmem.c')
-rw-r--r--drivers/video/fbmem.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c
index 7cfcd716fd5f..e08b7b5cb326 100644
--- a/drivers/video/fbmem.c
+++ b/drivers/video/fbmem.c
@@ -1500,19 +1500,26 @@ static bool fb_do_apertures_overlap(struct apertures_struct *gena,
1500 return false; 1500 return false;
1501} 1501}
1502 1502
1503void remove_conflicting_framebuffers(struct apertures_struct *a, const char *name) 1503#define VGA_FB_PHYS 0xA0000
1504void remove_conflicting_framebuffers(struct apertures_struct *a,
1505 const char *name, bool primary)
1504{ 1506{
1505 int i; 1507 int i;
1506 1508
1507 /* check all firmware fbs and kick off if the base addr overlaps */ 1509 /* check all firmware fbs and kick off if the base addr overlaps */
1508 for (i = 0 ; i < FB_MAX; i++) { 1510 for (i = 0 ; i < FB_MAX; i++) {
1511 struct apertures_struct *gen_aper;
1509 if (!registered_fb[i]) 1512 if (!registered_fb[i])
1510 continue; 1513 continue;
1511 1514
1512 if (!(registered_fb[i]->flags & FBINFO_MISC_FIRMWARE)) 1515 if (!(registered_fb[i]->flags & FBINFO_MISC_FIRMWARE))
1513 continue; 1516 continue;
1514 1517
1515 if (fb_do_apertures_overlap(registered_fb[i]->apertures, a)) { 1518 gen_aper = registered_fb[i]->apertures;
1519 if (fb_do_apertures_overlap(gen_aper, a) ||
1520 (primary && gen_aper && gen_aper->count &&
1521 gen_aper->ranges[0].base == VGA_FB_PHYS)) {
1522
1516 printk(KERN_ERR "fb: conflicting fb hw usage " 1523 printk(KERN_ERR "fb: conflicting fb hw usage "
1517 "%s vs %s - removing generic driver\n", 1524 "%s vs %s - removing generic driver\n",
1518 name, registered_fb[i]->fix.id); 1525 name, registered_fb[i]->fix.id);
@@ -1545,7 +1552,8 @@ register_framebuffer(struct fb_info *fb_info)
1545 if (fb_check_foreignness(fb_info)) 1552 if (fb_check_foreignness(fb_info))
1546 return -ENOSYS; 1553 return -ENOSYS;
1547 1554
1548 remove_conflicting_framebuffers(fb_info->apertures, fb_info->fix.id); 1555 remove_conflicting_framebuffers(fb_info->apertures, fb_info->fix.id,
1556 fb_is_primary_device(fb_info));
1549 1557
1550 num_registered_fb++; 1558 num_registered_fb++;
1551 for (i = 0 ; i < FB_MAX; i++) 1559 for (i = 0 ; i < FB_MAX; i++)