diff options
author | Marcin Slusarz <marcin.slusarz@gmail.com> | 2010-05-16 11:27:03 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2010-05-18 02:19:27 -0400 |
commit | 1471ca9aa71cd37b6a7476bb6f06a3a8622ea1bd (patch) | |
tree | 3bf5ef9fea79b0b92220cfcc3842db7afb5cd63d /drivers/video/fbmem.c | |
parent | 3da1f33e79a5922c1a31077e7b33aba1cec19b94 (diff) |
fbdev: allow passing more than one aperture for handoff
It removes a hack from nouveau code which had to detect which
region to pass to kick vesafb/efifb.
Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Cc: Eric Anholt <eric@anholt.net>
Cc: Ben Skeggs <bskeggs@redhat.com>
Cc: Thomas Hellstrom <thellstrom@vmware.com>
Cc: Dave Airlie <airlied@redhat.com>
Cc: Peter Jones <pjones@redhat.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/video/fbmem.c')
-rw-r--r-- | drivers/video/fbmem.c | 29 |
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 | ||
1471 | static bool fb_do_apertures_overlap(struct fb_info *gen, struct fb_info *hw) | 1471 | static 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 | |||
1482 | static 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 |