Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 210914
b: refs/heads/master
c: 85a00d9
h: refs/heads/master
v: v3
  • Loading branch information
Peter Jones authored and Linus Torvalds committed Sep 23, 2010
1 parent 238e43c commit 3b9e8ec
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a0c42bac79731276c9b2f28d54f9e658fcf843a2
refs/heads/master: 85a00d9bbfb4704fbf368944b1cb9fed8f1598c5
6 changes: 6 additions & 0 deletions trunk/MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -2199,6 +2199,12 @@ W: http://acpi4asus.sf.net
S: Maintained
F: drivers/platform/x86/eeepc-laptop.c

EFIFB FRAMEBUFFER DRIVER
L: linux-fbdev@vger.kernel.org
M: Peter Jones <pjones@redhat.com>
S: Maintained
F: drivers/video/efifb.c

EFS FILESYSTEM
W: http://aeschi.ch.eu.org/efs/
S: Orphan
Expand Down
61 changes: 49 additions & 12 deletions trunk/drivers/video/efifb.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include <linux/platform_device.h>
#include <linux/screen_info.h>
#include <linux/dmi.h>

#include <linux/pci.h>
#include <video/vga.h>

static struct fb_var_screeninfo efifb_defined __devinitdata = {
Expand Down Expand Up @@ -116,26 +116,63 @@ static int set_system(const struct dmi_system_id *id)
{
struct efifb_dmi_info *info = id->driver_data;
if (info->base == 0)
return -ENODEV;
return 0;

printk(KERN_INFO "efifb: dmi detected %s - framebuffer at %p "
"(%dx%d, stride %d)\n", id->ident,
(void *)info->base, info->width, info->height,
info->stride);

/* Trust the bootloader over the DMI tables */
if (screen_info.lfb_base == 0)
if (screen_info.lfb_base == 0) {
#if defined(CONFIG_PCI)
struct pci_dev *dev = NULL;
int found_bar = 0;
#endif
screen_info.lfb_base = info->base;
if (screen_info.lfb_linelength == 0)
screen_info.lfb_linelength = info->stride;
if (screen_info.lfb_width == 0)
screen_info.lfb_width = info->width;
if (screen_info.lfb_height == 0)
screen_info.lfb_height = info->height;
if (screen_info.orig_video_isVGA == 0)
screen_info.orig_video_isVGA = VIDEO_TYPE_EFI;

return 0;
#if defined(CONFIG_PCI)
/* make sure that the address in the table is actually on a
* VGA device's PCI BAR */

for_each_pci_dev(dev) {
int i;
if ((dev->class >> 8) != PCI_CLASS_DISPLAY_VGA)
continue;
for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
resource_size_t start, end;

start = pci_resource_start(dev, i);
if (start == 0)
break;
end = pci_resource_end(dev, i);
if (screen_info.lfb_base >= start &&
screen_info.lfb_base < end) {
found_bar = 1;
}
}
}
if (!found_bar)
screen_info.lfb_base = 0;
#endif
}
if (screen_info.lfb_base) {
if (screen_info.lfb_linelength == 0)
screen_info.lfb_linelength = info->stride;
if (screen_info.lfb_width == 0)
screen_info.lfb_width = info->width;
if (screen_info.lfb_height == 0)
screen_info.lfb_height = info->height;
if (screen_info.orig_video_isVGA == 0)
screen_info.orig_video_isVGA = VIDEO_TYPE_EFI;
} else {
screen_info.lfb_linelength = 0;
screen_info.lfb_width = 0;
screen_info.lfb_height = 0;
screen_info.orig_video_isVGA = 0;
return 0;
}
return 1;
}

static int efifb_setcolreg(unsigned regno, unsigned red, unsigned green,
Expand Down

0 comments on commit 3b9e8ec

Please sign in to comment.