* [PATCH] Provide control of active VGA device on PCI systems
@ 2005-02-20 5:50 Jon Smirl
2005-02-20 7:07 ` Jon Smirl
` (3 more replies)
0 siblings, 4 replies; 13+ messages in thread
From: Jon Smirl @ 2005-02-20 5:50 UTC (permalink / raw)
To: fbdev, Jesse Barnes
This patch adds a 'vga' attribute to each framebuffer device on PCI
systems. For non-PCI hardware it does nothing.
If you have multiple VGA cards loaded, and you have framebuffer
drivers loaded for each, you can then set 0/1 into the VGA attributes
to move VGA console around to the different screens.
This is almost everything needed to implement reset of secondary
cards. ROM access is already in the kernel. This code is needed to
make sure you don't end up with multiple VGA devices enabled. All that
is left is to construct the proper hotplug event and fix up my user
space reset program.
--
Jon Smirl
jonsmirl@gmail.com
diff -Nru a/arch/i386/pci/fixup.c b/arch/i386/pci/fixup.c
--- a/arch/i386/pci/fixup.c 2005-02-20 00:44:56 -05:00
+++ b/arch/i386/pci/fixup.c 2005-02-20 00:44:56 -05:00
@@ -375,6 +375,6 @@
}
bus = bus->parent;
}
- pdev->resource[PCI_ROM_RESOURCE].flags |= IORESOURCE_ROM_SHADOW;
+ pdev->resource[PCI_ROM_RESOURCE].flags |= IORESOURCE_ROM_SHADOW |
IORESOURCE_NO_RESET;
}
DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID, PCI_ANY_ID, pci_fixup_video);
diff -Nru a/drivers/video/Makefile b/drivers/video/Makefile
--- a/drivers/video/Makefile 2005-02-20 00:44:56 -05:00
+++ b/drivers/video/Makefile 2005-02-20 00:44:56 -05:00
@@ -13,6 +13,7 @@
# Only include macmodes.o if we have FB support and are PPC
ifneq ($(CONFIG_FB),n)
fb-$(CONFIG_PPC) += macmodes.o
+fb-$(CONFIG_PCI) += vga.o
endif
fb-objs := $(fb-y)
diff -Nru a/drivers/video/fbmem.c b/drivers/video/fbmem.c
--- a/drivers/video/fbmem.c 2005-02-20 00:44:56 -05:00
+++ b/drivers/video/fbmem.c 2005-02-20 00:44:56 -05:00
@@ -1067,6 +1067,7 @@
if (!registered_fb[i])
break;
fb_info->node = i;
+ fb_vga_add_device(fb_info->device);
fb_info->class_device = class_simple_device_add(fb_class, MKDEV(FB_MAJOR, i),
fb_info->device, "fb%d", i);
@@ -1130,6 +1131,7 @@
return -EINVAL;
devfs_remove("fb/%d", i);
+ fb_vga_remove_device(fb_info->device);
if (fb_info->pixmap.addr && (fb_info->pixmap.flags & FB_PIXMAP_DEFAULT))
kfree(fb_info->pixmap.addr);
fb_destroy_modelist(&fb_info->modelist);
diff -Nru a/drivers/video/vga.c b/drivers/video/vga.c
--- /dev/null Wed Dec 31 16:00:00 196900
+++ b/drivers/video/vga.c 2005-02-20 00:44:56 -05:00
@@ -0,0 +1,210 @@
+/*
+ * linux/drivers/pci/vga.c
+ *
+ * (C) Copyright 2004 Jon Smirl <jonsmirl@gmail.com>
+ *
+ * VGA control logic for ensuring only a single enabled VGA device
+ */
+
+#include <linux/init.h>
+#include <linux/fs.h>
+#include <linux/cdev.h>
+#include <linux/pci.h>
+#include <linux/major.h>
+
+static struct pci_dev *vga_active = NULL;
+
+static void bridge_yes(struct pci_dev *pdev)
+{
+ struct pci_dev *bridge;
+ struct pci_bus *bus;
+
+ /* Make sure the bridges route to us */
+ bus = pdev->bus;
+ while (bus) {
+ bridge = bus->self;
+ if (bridge) {
+ bus->bridge_ctl |= PCI_BRIDGE_CTL_VGA;
+ pci_write_config_word(bridge, PCI_BRIDGE_CONTROL, bus->bridge_ctl);
+ }
+ bus = bus->parent;
+ }
+}
+
+static void bridge_no(struct pci_dev *pdev)
+{
+ struct pci_dev *bridge;
+ struct pci_bus *bus;
+
+ /* Make sure the bridges don't route to us */
+ bus = pdev->bus;
+ while (bus) {
+ bridge = bus->self;
+ if (bridge) {
+ bus->bridge_ctl &= ~PCI_BRIDGE_CTL_VGA;
+ pci_write_config_word(bridge, PCI_BRIDGE_CONTROL, bus->bridge_ctl);
+ }
+ bus = bus->parent;
+ }
+}
+
+static void vga_enable(struct pci_dev *pdev, unsigned int enable)
+{
+ u16 command;
+
+ bridge_yes(pdev);
+
+ if (enable) {
+ pci_enable_device(pdev);
+ /* this assumes all other potential VGA devices are disabled */
+ outb(0x01 | inb(0x3C3), 0x3C3); /* 0 - enable */
+ outb(0x08 | inb(0x46e8), 0x46e8);
+ outb(0x01 | inb(0x102), 0x102);
+ vga_active = pdev;
+
+ /* return and leave the card enabled */
+ return;
+ }
+
+ pci_read_config_word(pdev, PCI_COMMAND, &command);
+ pci_write_config_word(pdev, PCI_COMMAND, command | PCI_COMMAND_IO |
PCI_COMMAND_MEMORY);
+
+ outb(~0x01 & inb(0x3C3), 0x3C3);
+ outb(~0x08 & inb(0x46e8), 0x46e8);
+ outb(~0x01 & inb(0x102), 0x102);
+ if (pdev == vga_active)
+ vga_active = NULL;
+ bridge_no(pdev);
+
+ pci_write_config_word(pdev, PCI_COMMAND, command);
+}
+
+/* echo these values to the sysfs vga attribute on a VGA device */
+enum eEnable {
+ VGA_DISABLE_THIS = 0, /* If this VGA is enabled, disable it. */
+ VGA_ENABLE_THIS = 1, /* Disable all VGAs then enable this VGA, mark
as active VGA */
+ /* Used while resetting a board, board being reset may not be the
active VGA */
+ VGA_DISABLE_ALL = 2, /* Remember active VGA then disable all VGAa
and devices */
+ VGA_ENABLE_ACTIVE = 3, /* Make sure all VGAs are disabled, then
reenable active VGA */
+ VGA_RESET = 4, /* Trigger a reset manually */
+ VGA_MAX = 5
+};
+
+static void set_state(struct pci_dev *pdev, enum eEnable enable)
+{
+ struct pci_dev *pcidev = NULL;
+ unsigned int class;
+
+ if (enable == VGA_DISABLE_THIS)
+ if (vga_active != pdev)
+ return;
+
+ if (enable == VGA_RESET) {
+ kobject_hotplug(&pdev->dev.kobj, KOBJ_ADD);
+ return;
+ }
+
+ vga_enable(vga_active, 0);
+
+ /* loop over all devices and make sure no multiple routings */
+ while ((pcidev = pci_get_subsys(PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
PCI_ANY_ID, pcidev)) != NULL) {
+ class = pcidev->class >> 8;
+
+ if (class == PCI_CLASS_DISPLAY_VGA)
+ bridge_no(pcidev);
+ }
+
+ /* loop over all devices and make sure everyone is disabled */
+ while ((pcidev = pci_get_subsys(PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
PCI_ANY_ID, pcidev)) != NULL) {
+ class = pcidev->class >> 8;
+
+ if (class == PCI_CLASS_DISPLAY_VGA)
+ vga_enable(pcidev, 0);
+ }
+
+ switch (enable) {
+ /* Mark us active if requested */
+ case VGA_ENABLE_THIS:
+ vga_enable(pdev, 1);
+ break;
+
+ /* Restore active device if requested */
+ case VGA_ENABLE_ACTIVE:
+ vga_enable(vga_active, 1);
+ break;
+
+ default:
+ break;
+ }
+}
+
+/* sysfs store for VGA device */
+static ssize_t vga_device_store(struct device *dev, const char *buf,
size_t count)
+{
+ char *last;
+ struct pci_dev *pdev = to_pci_dev(dev);
+ enum eEnable enable;
+
+ /* sysfs strings are terminated by \n */
+ enable = simple_strtoul(buf, &last, 0);
+ if (last == buf)
+ return -EINVAL;
+
+ if ((enable < VGA_DISABLE_THIS) || (enable >= VGA_MAX))
+ return -EINVAL;
+
+ set_state(pdev, enable);
+
+ return count;
+}
+
+/* sysfs show for VGA device */
+static ssize_t vga_device_show(struct device *dev, char *buf)
+{
+ struct pci_dev *pdev = to_pci_dev(dev);
+ return sprintf(buf, "%d\n", vga_active == pdev);
+}
+
+static struct device_attribute vga_device_attr = __ATTR(vga,
S_IRUGO|S_IWUSR, vga_device_show, vga_device_store);
+
+/* Add a VGA sysfs attribute */
+void fb_vga_add_device(struct device *device)
+{
+ struct pci_dev *pdev = to_pci_dev(device);
+ if (device) {
+ device_create_file(&pdev->dev, &vga_device_attr);
+
+ /* record the active boot device when located */
+ if ((!vga_active) && (pdev->resource[PCI_ROM_RESOURCE].flags &
IORESOURCE_ROM_SHADOW))
+ vga_active = pdev;
+ }
+}
+
+/* If the device is a VGA or a bridge, remove the VGA sysfs attribute */
+void fb_vga_remove_device(struct device *device)
+{
+ struct pci_dev *pdev = to_pci_dev(device);
+ struct pci_dev *pcidev = NULL;
+ int class = pdev->class >> 8;
+
+ if (device) {
+ device_remove_file(&pdev->dev, &vga_device_attr);
+
+ /* if the active VGA device is being removed, try to move VGA to
another device */
+ if (vga_active == pdev) {
+ while ((pcidev = pci_get_subsys(PCI_ANY_ID, PCI_ANY_ID,
PCI_ANY_ID, PCI_ANY_ID, pcidev)) != NULL) {
+ class = pcidev->class >> 8;
+ if (class != PCI_CLASS_DISPLAY_VGA)
+ continue;
+ if (pcidev == pdev)
+ continue;
+ set_state(pcidev, VGA_ENABLE_THIS);
+ break;
+ }
+ if (pcidev == NULL)
+ set_state(NULL, VGA_DISABLE_ALL);
+
+ }
+ }
+}
+
diff -Nru a/include/linux/fb.h b/include/linux/fb.h
--- a/include/linux/fb.h 2005-02-20 00:44:56 -05:00
+++ b/include/linux/fb.h 2005-02-20 00:44:56 -05:00
@@ -893,6 +893,15 @@
extern struct fb_cmap *fb_default_cmap(int len);
extern void fb_invert_cmaps(void);
+/* drivers/video/vga.c */
+#ifdef CONFIG_PCI
+extern void fb_vga_add_device(struct device *device);
+extern void fb_vga_remove_device(struct device *device);
+#else
+static inline void fb_vga_add_device(struct device *device){}
+static inline void fb_vga_remove_device(struct device *device){}
+#endif
+
struct fb_videomode {
const char *name; /* optional */
u32 refresh; /* optional */
diff -Nru a/include/linux/ioport.h b/include/linux/ioport.h
--- a/include/linux/ioport.h 2005-02-20 00:44:56 -05:00
+++ b/include/linux/ioport.h 2005-02-20 00:44:56 -05:00
@@ -86,6 +86,7 @@
#define IORESOURCE_ROM_ENABLE (1<<0) /* ROM is enabled, same as
PCI_ROM_ADDRESS_ENABLE */
#define IORESOURCE_ROM_SHADOW (1<<1) /* ROM is copy at C000:0 */
#define IORESOURCE_ROM_COPY (1<<2) /* ROM is alloc'd copy, resource
field overlaid */
+#define IORESOURCE_NO_RESET (1<<3) /* Don't reset this device */
/* PC/ISA/whatever - the normal PC address spaces: IO and memory */
extern struct resource ioport_resource;
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] Provide control of active VGA device on PCI systems
2005-02-20 5:50 [PATCH] Provide control of active VGA device on PCI systems Jon Smirl
@ 2005-02-20 7:07 ` Jon Smirl
2005-02-22 18:50 ` Jesse Barnes
2005-02-20 8:23 ` Benjamin Herrenschmidt
` (2 subsequent siblings)
3 siblings, 1 reply; 13+ messages in thread
From: Jon Smirl @ 2005-02-20 7:07 UTC (permalink / raw)
To: fbdev, Jesse Barnes
New version to previous patch. This one adds the hotplug event mentioned before.
To achieve secondary card reset:
Load a framebuffer driver.
Driver causes hotplug add event
reset=x environment parm indicates reset, primary cards is false
run user space reset program
read VBIOS content using existing API
turn off all VGA devices, sysfs vga=3
reset the card
restore original VGA devices. sysfs vga=4
set sysfs no_reset=1 to prevent further resets
Tomorrow I'll clean up a user space reset app and post it.
--
Jon Smirl
jonsmirl@gmail.com
diff -Nru a/arch/i386/pci/fixup.c b/arch/i386/pci/fixup.c
--- a/arch/i386/pci/fixup.c 2005-02-20 02:00:57 -05:00
+++ b/arch/i386/pci/fixup.c 2005-02-20 02:00:57 -05:00
@@ -375,6 +375,6 @@
}
bus = bus->parent;
}
- pdev->resource[PCI_ROM_RESOURCE].flags |= IORESOURCE_ROM_SHADOW;
+ pdev->resource[PCI_ROM_RESOURCE].flags |= IORESOURCE_ROM_SHADOW |
IORESOURCE_NO_RESET;
}
DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID, PCI_ANY_ID, pci_fixup_video);
diff -Nru a/drivers/video/Makefile b/drivers/video/Makefile
--- a/drivers/video/Makefile 2005-02-20 02:00:57 -05:00
+++ b/drivers/video/Makefile 2005-02-20 02:00:57 -05:00
@@ -13,6 +13,7 @@
# Only include macmodes.o if we have FB support and are PPC
ifneq ($(CONFIG_FB),n)
fb-$(CONFIG_PPC) += macmodes.o
+fb-$(CONFIG_PCI) += vga.o
endif
fb-objs := $(fb-y)
diff -Nru a/drivers/video/fbmem.c b/drivers/video/fbmem.c
--- a/drivers/video/fbmem.c 2005-02-20 02:00:57 -05:00
+++ b/drivers/video/fbmem.c 2005-02-20 02:00:57 -05:00
@@ -1067,6 +1067,7 @@
if (!registered_fb[i])
break;
fb_info->node = i;
+ fb_vga_add_device(fb_info->device);
fb_info->class_device = class_simple_device_add(fb_class, MKDEV(FB_MAJOR, i),
fb_info->device, "fb%d", i);
@@ -1130,6 +1131,7 @@
return -EINVAL;
devfs_remove("fb/%d", i);
+ fb_vga_remove_device(fb_info->device);
if (fb_info->pixmap.addr && (fb_info->pixmap.flags & FB_PIXMAP_DEFAULT))
kfree(fb_info->pixmap.addr);
fb_destroy_modelist(&fb_info->modelist);
@@ -1203,7 +1205,9 @@
if (IS_ERR(fb_class)) {
printk(KERN_WARNING "Unable to create fb class; errno = %ld\n",
PTR_ERR(fb_class));
fb_class = NULL;
- }
+ } else
+ class_simple_set_hotplug(fb_class, fb_hotplug);
+
return 0;
}
diff -Nru a/drivers/video/vga.c b/drivers/video/vga.c
--- /dev/null Wed Dec 31 16:00:00 196900
+++ b/drivers/video/vga.c 2005-02-20 02:00:57 -05:00
@@ -0,0 +1,301 @@
+/*
+ * linux/drivers/pci/vga.c
+ *
+ * (C) Copyright 2004 Jon Smirl <jonsmirl@gmail.com>
+ *
+ * VGA control logic for ensuring only a single enabled VGA device
+ */
+
+#include <linux/init.h>
+#include <linux/fs.h>
+#include <linux/cdev.h>
+#include <linux/pci.h>
+#include <linux/major.h>
+
+static struct pci_dev *vga_active = NULL;
+
+static void bridge_yes(struct pci_dev *pdev)
+{
+ struct pci_dev *bridge;
+ struct pci_bus *bus;
+
+ /* Make sure the bridges route to us */
+ bus = pdev->bus;
+ while (bus) {
+ bridge = bus->self;
+ if (bridge) {
+ bus->bridge_ctl |= PCI_BRIDGE_CTL_VGA;
+ pci_write_config_word(bridge, PCI_BRIDGE_CONTROL, bus->bridge_ctl);
+ }
+ bus = bus->parent;
+ }
+}
+
+static void bridge_no(struct pci_dev *pdev)
+{
+ struct pci_dev *bridge;
+ struct pci_bus *bus;
+
+ /* Make sure the bridges don't route to us */
+ bus = pdev->bus;
+ while (bus) {
+ bridge = bus->self;
+ if (bridge) {
+ bus->bridge_ctl &= ~PCI_BRIDGE_CTL_VGA;
+ pci_write_config_word(bridge, PCI_BRIDGE_CONTROL, bus->bridge_ctl);
+ }
+ bus = bus->parent;
+ }
+}
+
+static void vga_enable(struct pci_dev *pdev, unsigned int enable)
+{
+ u16 command;
+
+ bridge_yes(pdev);
+
+ if (enable) {
+ pci_enable_device(pdev);
+ /* this assumes all other potential VGA devices are disabled */
+ outb(0x01 | inb(0x3C3), 0x3C3); /* 0 - enable */
+ outb(0x08 | inb(0x46e8), 0x46e8);
+ outb(0x01 | inb(0x102), 0x102);
+ vga_active = pdev;
+
+ /* return and leave the card enabled */
+ return;
+ }
+
+ pci_read_config_word(pdev, PCI_COMMAND, &command);
+ pci_write_config_word(pdev, PCI_COMMAND, command | PCI_COMMAND_IO |
PCI_COMMAND_MEMORY);
+
+ outb(~0x01 & inb(0x3C3), 0x3C3);
+ outb(~0x08 & inb(0x46e8), 0x46e8);
+ outb(~0x01 & inb(0x102), 0x102);
+ if (pdev == vga_active)
+ vga_active = NULL;
+ bridge_no(pdev);
+
+ pci_write_config_word(pdev, PCI_COMMAND, command);
+}
+
+/* echo these values to the sysfs vga attribute on a VGA device */
+enum eEnable {
+ VGA_DISABLE_THIS = 0, /* If this VGA is enabled, disable it. */
+ VGA_ENABLE_THIS = 1, /* Disable all VGAs then enable this VGA, mark
as active VGA */
+ /* Used while resetting a board, board being reset may not be the
active VGA */
+ VGA_DISABLE_ALL = 2, /* Remember active VGA then disable all VGAa
and devices */
+ VGA_ENABLE_ACTIVE = 3, /* Make sure all VGAs are disabled, then
reenable active VGA */
+ VGA_RESET = 4, /* Trigger a reset manually */
+ VGA_MAX = 5
+};
+
+static void set_state(struct pci_dev *pdev, enum eEnable enable)
+{
+ struct pci_dev *pcidev = NULL;
+ unsigned int class;
+
+ if (enable == VGA_DISABLE_THIS)
+ if (vga_active != pdev)
+ return;
+
+ if (enable == VGA_RESET) {
+ kobject_hotplug(&pdev->dev.kobj, KOBJ_ADD);
+ return;
+ }
+
+ vga_enable(vga_active, 0);
+
+ /* loop over all devices and make sure no multiple routings */
+ while ((pcidev = pci_get_subsys(PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
PCI_ANY_ID, pcidev)) != NULL) {
+ class = pcidev->class >> 8;
+
+ if (class == PCI_CLASS_DISPLAY_VGA)
+ bridge_no(pcidev);
+ }
+
+ /* loop over all devices and make sure everyone is disabled */
+ while ((pcidev = pci_get_subsys(PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
PCI_ANY_ID, pcidev)) != NULL) {
+ class = pcidev->class >> 8;
+
+ if (class == PCI_CLASS_DISPLAY_VGA)
+ vga_enable(pcidev, 0);
+ }
+
+ switch (enable) {
+ /* Mark us active if requested */
+ case VGA_ENABLE_THIS:
+ vga_enable(pdev, 1);
+ break;
+
+ /* Restore active device if requested */
+ case VGA_ENABLE_ACTIVE:
+ vga_enable(vga_active, 1);
+ break;
+
+ default:
+ break;
+ }
+}
+
+/* sysfs store for VGA device */
+static ssize_t vga_device_store(struct device *dev, const char *buf,
size_t count)
+{
+ char *last;
+ struct pci_dev *pdev = to_pci_dev(dev);
+ enum eEnable enable;
+
+ /* sysfs strings are terminated by \n */
+ enable = simple_strtoul(buf, &last, 0);
+ if (last == buf)
+ return -EINVAL;
+
+ if ((enable < VGA_DISABLE_THIS) || (enable >= VGA_MAX))
+ return -EINVAL;
+
+ set_state(pdev, enable);
+
+ return count;
+}
+
+/* sysfs show for VGA device */
+static ssize_t vga_device_show(struct device *dev, char *buf)
+{
+ struct pci_dev *pdev = to_pci_dev(dev);
+ return sprintf(buf, "%d\n", vga_active == pdev);
+}
+
+static struct device_attribute vga_device_attr = __ATTR(vga, S_IRUGO|S_IWUSR,
+ vga_device_show, vga_device_store);
+
+
+static ssize_t no_reset_device_store(struct device *dev, const char
*buf, size_t count)
+{
+ char *last;
+ struct pci_dev *pdev = to_pci_dev(dev);
+
+
+ /* sysfs strings are terminated by \n */
+ if (simple_strtoul(buf, &last, 0))
+ pdev->resource[PCI_ROM_RESOURCE].flags |= IORESOURCE_NO_RESET;
+ else
+ pdev->resource[PCI_ROM_RESOURCE].flags &= ~IORESOURCE_NO_RESET;
+
+ return count;
+}
+
+/* sysfs show for VGA device */
+static ssize_t no_reset_device_show(struct device *dev, char *buf)
+{
+ struct pci_dev *pdev = to_pci_dev(dev);
+ return sprintf(buf, "%d\n", ((pdev->resource[PCI_ROM_RESOURCE].flags
& IORESOURCE_NO_RESET) ? 1 : 0));
+}
+
+static struct device_attribute no_reset_device_attr =
__ATTR(no_reset, S_IRUGO|S_IWUSR,
+ no_reset_device_show, no_reset_device_store);
+
+/* Add a VGA sysfs attribute */
+void fb_vga_add_device(struct device *device)
+{
+ struct pci_dev *pdev = to_pci_dev(device);
+ if (device) {
+ device_create_file(&pdev->dev, &vga_device_attr);
+ device_create_file(&pdev->dev, &no_reset_device_attr);
+
+ /* record the active boot device when located */
+ if ((!vga_active) && (pdev->resource[PCI_ROM_RESOURCE].flags &
IORESOURCE_ROM_SHADOW))
+ vga_active = pdev;
+ }
+}
+
+/* If the device is a VGA or a bridge, remove the VGA sysfs attribute */
+void fb_vga_remove_device(struct device *device)
+{
+ struct pci_dev *pdev = to_pci_dev(device);
+ struct pci_dev *pcidev = NULL;
+ int class = pdev->class >> 8;
+
+ if (device) {
+ device_remove_file(&pdev->dev, &vga_device_attr);
+ device_remove_file(&pdev->dev, &no_reset_device_attr);
+
+ /* if the active VGA device is being removed, try to move VGA to
another device */
+ if (vga_active == pdev) {
+ while ((pcidev = pci_get_subsys(PCI_ANY_ID, PCI_ANY_ID,
PCI_ANY_ID, PCI_ANY_ID, pcidev)) != NULL) {
+ class = pcidev->class >> 8;
+ if (class != PCI_CLASS_DISPLAY_VGA)
+ continue;
+ if (pcidev == pdev)
+ continue;
+ set_state(pcidev, VGA_ENABLE_THIS);
+ break;
+ }
+ if (pcidev == NULL)
+ set_state(NULL, VGA_DISABLE_ALL);
+
+ }
+ }
+}
+
+int fb_hotplug(struct class_device *dev, char **envp, int num_envp,
+ char *buffer, int buffer_size)
+{
+ struct pci_dev *pdev;
+ char *scratch;
+ int i = 0;
+ int length = 0;
+
+ if (!dev)
+ return -ENODEV;
+
+ pdev = to_pci_dev(dev->dev);
+ if (!pdev)
+ return -ENODEV;
+
+ scratch = buffer;
+
+ /* stuff we want to pass to /sbin/hotplug */
+ envp[i++] = scratch;
+ length += scnprintf (scratch, buffer_size - length, "PCI_CLASS=%04X",
+ pdev->class);
+ if ((buffer_size - length <= 0) || (i >= num_envp))
+ return -ENOMEM;
+ ++length;
+ scratch += length;
+
+ envp[i++] = scratch;
+ length += scnprintf (scratch, buffer_size - length, "PCI_ID=%04X:%04X",
+ pdev->vendor, pdev->device);
+ if ((buffer_size - length <= 0) || (i >= num_envp))
+ return -ENOMEM;
+ ++length;
+ scratch += length;
+
+ envp[i++] = scratch;
+ length += scnprintf (scratch, buffer_size - length,
+ "PCI_SUBSYS_ID=%04X:%04X", pdev->subsystem_vendor,
+ pdev->subsystem_device);
+ if ((buffer_size - length <= 0) || (i >= num_envp))
+ return -ENOMEM;
+ ++length;
+ scratch += length;
+
+ envp[i++] = scratch;
+ length += scnprintf (scratch, buffer_size - length, "PCI_SLOT_NAME=%s",
+ pci_name(pdev));
+ if ((buffer_size - length <= 0) || (i >= num_envp))
+ return -ENOMEM;
+ ++length;
+ scratch += length;
+
+ envp[i++] = scratch;
+ length += scnprintf (scratch, buffer_size - length, "RESET=%d",
+ ((pdev->resource[PCI_ROM_RESOURCE].flags &
IORESOURCE_NO_RESET) ? 0 : 1));
+ if ((buffer_size - length <= 0) || (i >= num_envp))
+ return -ENOMEM;
+
+
+ envp[i] = NULL;
+
+ return 0;
+}
diff -Nru a/include/linux/fb.h b/include/linux/fb.h
--- a/include/linux/fb.h 2005-02-20 02:00:57 -05:00
+++ b/include/linux/fb.h 2005-02-20 02:00:57 -05:00
@@ -893,6 +893,19 @@
extern struct fb_cmap *fb_default_cmap(int len);
extern void fb_invert_cmaps(void);
+/* drivers/video/vga.c */
+#ifdef CONFIG_PCI
+extern void fb_vga_add_device(struct device *device);
+extern void fb_vga_remove_device(struct device *device);
+extern int fb_hotplug(struct class_device *dev, char **envp, int num_envp,
+ char *buffer, int buffer_size);
+#else
+static inline void fb_vga_add_device(struct device *device){}
+static inline void fb_vga_remove_device(struct device *device){}
+static inline int fb_hotplug(struct class_device *dev, char **envp,
int num_envp,
+ char *buffer, int buffer_size){return 0;}
+#endif
+
struct fb_videomode {
const char *name; /* optional */
u32 refresh; /* optional */
diff -Nru a/include/linux/ioport.h b/include/linux/ioport.h
--- a/include/linux/ioport.h 2005-02-20 02:00:57 -05:00
+++ b/include/linux/ioport.h 2005-02-20 02:00:57 -05:00
@@ -86,6 +86,7 @@
#define IORESOURCE_ROM_ENABLE (1<<0) /* ROM is enabled, same as
PCI_ROM_ADDRESS_ENABLE */
#define IORESOURCE_ROM_SHADOW (1<<1) /* ROM is copy at C000:0 */
#define IORESOURCE_ROM_COPY (1<<2) /* ROM is alloc'd copy, resource
field overlaid */
+#define IORESOURCE_NO_RESET (1<<3) /* Don't reset this device */
/* PC/ISA/whatever - the normal PC address spaces: IO and memory */
extern struct resource ioport_resource;
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] Provide control of active VGA device on PCI systems
2005-02-20 5:50 [PATCH] Provide control of active VGA device on PCI systems Jon Smirl
2005-02-20 7:07 ` Jon Smirl
@ 2005-02-20 8:23 ` Benjamin Herrenschmidt
2005-02-20 16:35 ` Jon Smirl
2005-02-22 4:07 ` James Simmons
2005-02-22 4:13 ` James Simmons
3 siblings, 1 reply; 13+ messages in thread
From: Benjamin Herrenschmidt @ 2005-02-20 8:23 UTC (permalink / raw)
To: Linux Fbdev development list; +Cc: Jesse Barnes, Jon Smirl
On Sun, 2005-02-20 at 00:50 -0500, Jon Smirl wrote:
> This patch adds a 'vga' attribute to each framebuffer device on PCI
> systems. For non-PCI hardware it does nothing.
>
> If you have multiple VGA cards loaded, and you have framebuffer
> drivers loaded for each, you can then set 0/1 into the VGA attributes
> to move VGA console around to the different screens.
>
> This is almost everything needed to implement reset of secondary
> cards. ROM access is already in the kernel. This code is needed to
> make sure you don't end up with multiple VGA devices enabled. All that
> is left is to construct the proper hotplug event and fix up my user
> space reset program.
HI Jon !
Looks good, but in the grand scheme of thing, it would be nice to extend
the functionality to more than just userspace reset: that is proper
arbitration of VGA access between X, vgacon, etc...
(The goal is to have X stop messing around with PCI at all, just probe
things via sysfs or whatever new model we might provide, but not
actually play with PCI resources directly nor modify bridge VGA enables,
and have it properly arbitrate with anything else wanting to use the VGA
IOs, including kernel services like vgacon).
That would require at least a kernel-side API in addition to the
userland one you are proposing, plus eventually some arbitration between
clients...
I have no time at the moment to help you there unfortunately, and I
don't yet have a clear idea of what kind of API to provide for the
actual ownership control, maybe something like the DRM lock ?
Ben.
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] Provide control of active VGA device on PCI systems
2005-02-20 8:23 ` Benjamin Herrenschmidt
@ 2005-02-20 16:35 ` Jon Smirl
0 siblings, 0 replies; 13+ messages in thread
From: Jon Smirl @ 2005-02-20 16:35 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: Linux Fbdev development list, Jesse Barnes
On Sun, 20 Feb 2005 19:23:51 +1100, Benjamin Herrenschmidt
<benh@kernel.crashing.org> wrote:
> (The goal is to have X stop messing around with PCI at all, just probe
> things via sysfs or whatever new model we might provide, but not
> actually play with PCI resources directly nor modify bridge VGA enables,
> and have it properly arbitrate with anything else wanting to use the VGA
> IOs, including kernel services like vgacon).
That's the goal. Make X behave so that it will play nice with hotplug.
I also want to get it to run without needing root priv.
My goal is to provide a foundation for XGL/mesa-solo. That needs
support from fbdev for mode setting, cursors, reset, multiple heads.
Long term this provides a unified video driver model.
Check out the other thread about sysfs support for fbdev and let me
know what you think.
--
Jon Smirl
jonsmirl@gmail.com
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] Provide control of active VGA device on PCI systems
2005-02-20 5:50 [PATCH] Provide control of active VGA device on PCI systems Jon Smirl
2005-02-20 7:07 ` Jon Smirl
2005-02-20 8:23 ` Benjamin Herrenschmidt
@ 2005-02-22 4:07 ` James Simmons
2005-02-24 6:14 ` Jon Smirl
2005-02-22 4:13 ` James Simmons
3 siblings, 1 reply; 13+ messages in thread
From: James Simmons @ 2005-02-22 4:07 UTC (permalink / raw)
To: fbdev; +Cc: Jesse Barnes
> This patch adds a 'vga' attribute to each framebuffer device on PCI
> systems. For non-PCI hardware it does nothing.
>
> If you have multiple VGA cards loaded, and you have framebuffer
> drivers loaded for each, you can then set 0/1 into the VGA attributes
> to move VGA console around to the different screens.
>
> This is almost everything needed to implement reset of secondary
> cards. ROM access is already in the kernel. This code is needed to
> make sure you don't end up with multiple VGA devices enabled. All that
> is left is to construct the proper hotplug event and fix up my user
> space reset program.
This is not a bad patch but could you please merge that code into
vgastate.c and uses the vga io functions in include/video/vga.h
This way drivers can choose to link to the vga functions themselves.
The bonus is there is code in vgastate.c to save the state and restore
the vga text state with a fbdev device. You can for example with the
NVIDIA fbdev driver load it and do a open on /dev/fbX and it will go to
the graphics state. On the last close of /dev/fbX it will go back to the
vga text state it was in before the first open. With your code it would
make it even more functional.
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] Provide control of active VGA device on PCI systems
2005-02-20 5:50 [PATCH] Provide control of active VGA device on PCI systems Jon Smirl
` (2 preceding siblings ...)
2005-02-22 4:07 ` James Simmons
@ 2005-02-22 4:13 ` James Simmons
2005-02-22 4:47 ` Jon Smirl
3 siblings, 1 reply; 13+ messages in thread
From: James Simmons @ 2005-02-22 4:13 UTC (permalink / raw)
To: fbdev; +Cc: Jesse Barnes
> This patch adds a 'vga' attribute to each framebuffer device on PCI
> systems. For non-PCI hardware it does nothing.
>
> If you have multiple VGA cards loaded, and you have framebuffer
> drivers loaded for each, you can then set 0/1 into the VGA attributes
> to move VGA console around to the different screens.
>
> This is almost everything needed to implement reset of secondary
> cards. ROM access is already in the kernel. This code is needed to
> make sure you don't end up with multiple VGA devices enabled. All that
> is left is to construct the proper hotplug event and fix up my user
> space reset program.
Also please place the class_device for vga under /sys/class/graphics/ for
cleaness.
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] Provide control of active VGA device on PCI systems
2005-02-22 4:13 ` James Simmons
@ 2005-02-22 4:47 ` Jon Smirl
0 siblings, 0 replies; 13+ messages in thread
From: Jon Smirl @ 2005-02-22 4:47 UTC (permalink / raw)
To: linux-fbdev-devel; +Cc: Jesse Barnes
On Tue, 22 Feb 2005 04:13:02 +0000 (GMT), James Simmons
<jsimmons@www.infradead.org> wrote:
> Also please place the class_device for vga under /sys/class/graphics/ for
> cleaness.
Multiple head cards like the matrox create multiple entries in
/sys/class/graphics/. There can only be one 'vga' attribute that's why
it needs to go on the device.
As soon as I can get to it I'm post code that will activate the second
heads on radeon cards. It also creates another /sys/class/graphics/
entry like the matrox.
--
Jon Smirl
jonsmirl@gmail.com
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] Provide control of active VGA device on PCI systems
2005-02-20 7:07 ` Jon Smirl
@ 2005-02-22 18:50 ` Jesse Barnes
2005-02-22 20:57 ` Benjamin Herrenschmidt
0 siblings, 1 reply; 13+ messages in thread
From: Jesse Barnes @ 2005-02-22 18:50 UTC (permalink / raw)
To: Jon Smirl; +Cc: fbdev, benh
On Saturday, February 19, 2005 11:07 pm, Jon Smirl wrote:
> New version to previous patch. This one adds the hotplug event mentioned
> before.
>
> To achieve secondary card reset:
> Load a framebuffer driver.
> Driver causes hotplug add event
> reset=x environment parm indicates reset, primary cards is false
> run user space reset program
> read VBIOS content using existing API
> turn off all VGA devices, sysfs vga=3
> reset the card
> restore original VGA devices. sysfs vga=4
> set sysfs no_reset=1 to prevent further resets
>
> Tomorrow I'll clean up a user space reset app and post it.
Nice, if this is combined with Ben's suggestion of using a firmware loader
type model to deal with POSTing, it seems like we're in pretty good shape.
Can you add documentation for this API to
Documentation/filesystems/sysfs-<foo>.txt (maybe the pci file or a new file)
so that userspace people will be able to figure out how to use it?
Also, how does one know if a card is 'primary' or not? I.e. some BIOSes will
POST all cards, some will POST only one, and some will POST none...
Thanks,
Jesse
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] Provide control of active VGA device on PCI systems
2005-02-22 18:50 ` Jesse Barnes
@ 2005-02-22 20:57 ` Benjamin Herrenschmidt
2005-02-22 21:02 ` Jesse Barnes
2005-02-22 21:42 ` Jon Smirl
0 siblings, 2 replies; 13+ messages in thread
From: Benjamin Herrenschmidt @ 2005-02-22 20:57 UTC (permalink / raw)
To: Jesse Barnes; +Cc: Jon Smirl, fbdev
On Tue, 2005-02-22 at 10:50 -0800, Jesse Barnes wrote:
> Nice, if this is combined with Ben's suggestion of using a firmware loader
> type model to deal with POSTing, it seems like we're in pretty good shape.
> Can you add documentation for this API to
> Documentation/filesystems/sysfs-<foo>.txt (maybe the pci file or a new file)
> so that userspace people will be able to figure out how to use it?
>
> Also, how does one know if a card is 'primary' or not? I.e. some BIOSes will
> POST all cards, some will POST only one, and some will POST none...
Well, that's something we need to figure out... While I do think the
POSTing must be under driver control, as I explained, there is still
that nasty notion of who has the stuff at 0xc0000 ... and if your
firmware runs the x86 BIOS but doesn't keep the shadow around, then you
are toast with a good deal of laptop chips.
The problem is that on some cards (ATIs for example), the BIOS will
modify the image in RAM at c0000 and will put in there various infos,
like panel type, PLL infos, etc... that can't always be obtained from
the "hard" ROM (especially the panel infos). The driver (raeonfb or X,
strace X and see it mmap'ing /dev/mem at c0000...) need those things.
Ben.
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] Provide control of active VGA device on PCI systems
2005-02-22 20:57 ` Benjamin Herrenschmidt
@ 2005-02-22 21:02 ` Jesse Barnes
2005-02-22 21:27 ` Benjamin Herrenschmidt
2005-02-22 21:42 ` Jon Smirl
1 sibling, 1 reply; 13+ messages in thread
From: Jesse Barnes @ 2005-02-22 21:02 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: Jon Smirl, fbdev
On Tuesday, February 22, 2005 12:57 pm, Benjamin Herrenschmidt wrote:
> Well, that's something we need to figure out... While I do think the
> POSTing must be under driver control, as I explained, there is still
> that nasty notion of who has the stuff at 0xc0000 ... and if your
> firmware runs the x86 BIOS but doesn't keep the shadow around, then you
> are toast with a good deal of laptop chips.
Right, that's a big pain.
> The problem is that on some cards (ATIs for example), the BIOS will
> modify the image in RAM at c0000 and will put in there various infos,
> like panel type, PLL infos, etc... that can't always be obtained from
> the "hard" ROM (especially the panel infos). The driver (raeonfb or X,
> strace X and see it mmap'ing /dev/mem at c0000...) need those things.
Shouldn't the driver safe that stuff at suspend time for use at resume time?
Or do we expect to be able to resume with different hw attached?
Jesse
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] Provide control of active VGA device on PCI systems
2005-02-22 21:02 ` Jesse Barnes
@ 2005-02-22 21:27 ` Benjamin Herrenschmidt
0 siblings, 0 replies; 13+ messages in thread
From: Benjamin Herrenschmidt @ 2005-02-22 21:27 UTC (permalink / raw)
To: Jesse Barnes; +Cc: Jon Smirl, fbdev
> > The problem is that on some cards (ATIs for example), the BIOS will
> > modify the image in RAM at c0000 and will put in there various infos,
> > like panel type, PLL infos, etc... that can't always be obtained from
> > the "hard" ROM (especially the panel infos). The driver (raeonfb or X,
> > strace X and see it mmap'ing /dev/mem at c0000...) need those things.
>
> Shouldn't the driver safe that stuff at suspend time for use at resume time?
> Or do we expect to be able to resume with different hw attached?
That's even more complicated :)
Honestly, I don't know for sure... I suppose the stuff should not change
accross suspend/resume. If the BIOS is used to re-post the on
board/primary card, it will just put the same stuff back in there. BIOS
wrappers that POST secondary cards shouldn't touch the real c0000 area
but some kind of shadow elsewhere. The driver POSTing code should
definitely return the modified shadow area btw...
Another problem with suspend/resume is to re-post the chip on resume,
which is quit a nightmare too. One would think it would be possible to
just re-run the BIOS to re-POST, but that will not always work. On
laptops, the video chip tend not to have any ROM attached (the video
BIOS is somewhere stuffed with the main BIOS image). You can find the
stuff at 0xc0000 but it doesn't necessarily contain the full video BIOS
code...
The ATI driver for example in Windows has a library that "knows" how to
re-POST gazillion of chips, but they can't/won't really opensource this
last I asked.
Ben.
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] Provide control of active VGA device on PCI systems
2005-02-22 20:57 ` Benjamin Herrenschmidt
2005-02-22 21:02 ` Jesse Barnes
@ 2005-02-22 21:42 ` Jon Smirl
1 sibling, 0 replies; 13+ messages in thread
From: Jon Smirl @ 2005-02-22 21:42 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: Jesse Barnes, fbdev
On Wed, 23 Feb 2005 07:57:47 +1100, Benjamin Herrenschmidt
<benh@kernel.crashing.org> wrote:
> On Tue, 2005-02-22 at 10:50 -0800, Jesse Barnes wrote:
>
> > Nice, if this is combined with Ben's suggestion of using a firmware loader
> > type model to deal with POSTing, it seems like we're in pretty good shape.
> > Can you add documentation for this API to
> > Documentation/filesystems/sysfs-<foo>.txt (maybe the pci file or a new file)
> > so that userspace people will be able to figure out how to use it?
> >
> > Also, how does one know if a card is 'primary' or not? I.e. some BIOSes will
> > POST all cards, some will POST only one, and some will POST none...
>
> Well, that's something we need to figure out... While I do think the
> POSTing must be under driver control, as I explained, there is still
> that nasty notion of who has the stuff at 0xc0000 ... and if your
> firmware runs the x86 BIOS but doesn't keep the shadow around, then you
> are toast with a good deal of laptop chips.
With the ROM API code that is checked into the kernel on the x86 it
tracks the boot video device so that it knows which card C000 belongs
to. IORESOURCE_ROM_SHADOW is set in this case. If you do pci_map_rom()
on the boot device it returns you the contents of C000 not the actual
ROM.
>
> The problem is that on some cards (ATIs for example), the BIOS will
> modify the image in RAM at c0000 and will put in there various infos,
> like panel type, PLL infos, etc... that can't always be obtained from
> the "hard" ROM (especially the panel infos). The driver (raeonfb or X,
> strace X and see it mmap'ing /dev/mem at c0000...) need those things.
>
> Ben.
>
>
--
Jon Smirl
jonsmirl@gmail.com
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] Provide control of active VGA device on PCI systems
2005-02-22 4:07 ` James Simmons
@ 2005-02-24 6:14 ` Jon Smirl
0 siblings, 0 replies; 13+ messages in thread
From: Jon Smirl @ 2005-02-24 6:14 UTC (permalink / raw)
To: linux-fbdev-devel, James Simmons; +Cc: Jesse Barnes
On Tue, 22 Feb 2005 04:07:23 +0000 (GMT), James Simmons
<jsimmons@www.infradead.org> wrote:
> This is not a bad patch but could you please merge that code into
> vgastate.c and uses the vga io functions in include/video/vga.h
> This way drivers can choose to link to the vga functions themselves.
> The bonus is there is code in vgastate.c to save the state and restore
> the vga text state with a fbdev device. You can for example with the
> NVIDIA fbdev driver load it and do a open on /dev/fbX and it will go to
> the graphics state. On the last close of /dev/fbX it will go back to the
> vga text state it was in before the first open. With your code it would
> make it even more functional.
There are only three drivers linking in vgastate. This code has to run
for all cards with PCI class VGA. It is used by the code that supports
the VBIOS reset in user space. If I move it into vgastate.c I need to
bring vgastate.o into the core fb module.
The problem this code addresses:
boot video card is a VGA device
reseting secondary card will also enable it's VGA device
now we have two active VGA devices - this is bad since most archs only allow one
It fixes it like this:
boot video card is VGA
reset program uses sysfs to disable all VGA devices in system, write
vga=4 to any vga attrib
after secondary card is reset it will have active VGA
now reset program disables secondary VGA and restores the original
one, write vga=3 to any vga attrib
It has a neat side effect of letting you move the console around to
different VGA devices but that is not it's primary purpose. This code
needs to go into the core fb module. It has to deal with all VGA
devices in the system whether they have fb loaded or not.
I am going to remove the fb_hotplug function and IORESOURCE_NO_RESET
and use a different scheme for triggering the user space reset
program.
--
Jon Smirl
jonsmirl@gmail.com
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2005-02-24 6:14 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-02-20 5:50 [PATCH] Provide control of active VGA device on PCI systems Jon Smirl
2005-02-20 7:07 ` Jon Smirl
2005-02-22 18:50 ` Jesse Barnes
2005-02-22 20:57 ` Benjamin Herrenschmidt
2005-02-22 21:02 ` Jesse Barnes
2005-02-22 21:27 ` Benjamin Herrenschmidt
2005-02-22 21:42 ` Jon Smirl
2005-02-20 8:23 ` Benjamin Herrenschmidt
2005-02-20 16:35 ` Jon Smirl
2005-02-22 4:07 ` James Simmons
2005-02-24 6:14 ` Jon Smirl
2005-02-22 4:13 ` James Simmons
2005-02-22 4:47 ` Jon Smirl
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).