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.c29
1 files changed, 26 insertions, 3 deletions
diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c
index a15b44e9c003..03f2dc2470b5 100644
--- a/drivers/video/fbmem.c
+++ b/drivers/video/fbmem.c
@@ -1468,16 +1468,39 @@ static int fb_check_foreignness(struct fb_info *fi)
1468 return 0; 1468 return 0;
1469} 1469}
1470 1470
1471static bool fb_do_apertures_overlap(struct fb_info *gen, struct fb_info *hw) 1471static bool apertures_overlap(struct aperture *gen, struct aperture *hw)
1472{ 1472{
1473 /* is the generic aperture base the same as the HW one */ 1473 /* is the generic aperture base the same as the HW one */
1474 if (gen->aperture_base == hw->aperture_base) 1474 if (gen->base == hw->base)
1475 return true; 1475 return true;
1476 /* is the generic aperture base inside the hw base->hw base+size */ 1476 /* is the generic aperture base inside the hw base->hw base+size */
1477 if (gen->aperture_base > hw->aperture_base && gen->aperture_base <= hw->aperture_base + hw->aperture_size) 1477 if (gen->base > hw->base && gen->base <= hw->base + hw->size)
1478 return true; 1478 return true;
1479 return false; 1479 return false;
1480} 1480}
1481
1482static bool fb_do_apertures_overlap(struct fb_info *gen, struct fb_info *hw)
1483{
1484 int i, j;
1485 struct apertures_struct *hwa = hw->apertures;
1486 struct apertures_struct *gena = gen->apertures;
1487 if (!hwa || !gena)
1488 return false;
1489
1490 for (i = 0; i < hwa->count; ++i) {
1491 struct aperture *h = &hwa->ranges[i];
1492 for (j = 0; j < gena->count; ++j) {
1493 struct aperture *g = &gena->ranges[j];
1494 printk(KERN_DEBUG "checking generic (%llx %llx) vs hw (%llx %llx)\n",
1495 g->base, g->size, h->base, h->size);
1496 if (apertures_overlap(g, h))
1497 return true;
1498 }
1499 }
1500
1501 return false;
1502}
1503
1481/** 1504/**
1482 * register_framebuffer - registers a frame buffer device 1505 * register_framebuffer - registers a frame buffer device
1483 * @fb_info: frame buffer info structure 1506 * @fb_info: frame buffer info structure