rpms/kernel/F-11 linux-2.6.29.3-boot-vga.patch, NONE, 1.1 kernel.spec, 1.1611, 1.1612

Adam Jackson ajax at fedoraproject.org
Mon May 18 17:44:15 UTC 2009


Author: ajax

Update of /cvs/pkgs/rpms/kernel/F-11
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv17649

Modified Files:
	kernel.spec 
Added Files:
	linux-2.6.29.3-boot-vga.patch 
Log Message:
* Mon May 18 2009 Adam Jackson <ajax at redhat.com>
- Expose whether VGA devices were active at boot or not in sysfs.


linux-2.6.29.3-boot-vga.patch:

--- NEW FILE linux-2.6.29.3-boot-vga.patch ---
commit 217f45de3d2f68b6d0b646bb4f2a155a71648396
Author: Dave Airlie <airlied at linux.ie>
Date:   Wed Mar 4 05:57:05 2009 +0000

    PCI: expose boot VGA device via sysfs.
    
    X really would like to know which VGA device was considered the boot
    device by the system. The x86 PCI fixups have support for discovering
    this but we provide no way to expose it to userspace.
    
    This adds a sysfs file per VGA class device which has the value 0 for
    non the boot device or unknown, and 1 if the VGA device is the boot
    device.
    
    Acked-by: Greg Kroah-Hartman <gregkh at suse.de>
    Signed-off-by: Dave Airlie <airlied at redhat.com>
    Signed-off-by: Jesse Barnes <jbarnes at virtuousgeek.org>

diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c
index 1c89298..ec7a175 100644
--- a/drivers/pci/pci-sysfs.c
+++ b/drivers/pci/pci-sysfs.c
@@ -241,6 +241,17 @@ struct device_attribute pci_dev_attrs[] = {
 };
 
 static ssize_t
+boot_vga_show(struct device *dev, struct device_attribute *attr, char *buf)
+{
+	struct pci_dev *pdev = to_pci_dev(dev);
+
+	return sprintf(buf, "%u\n",
+		!!(pdev->resource[PCI_ROM_RESOURCE].flags &
+		   IORESOURCE_ROM_SHADOW));
+}
+struct device_attribute vga_attr = __ATTR_RO(boot_vga);
+
+static ssize_t
 pci_read_config(struct kobject *kobj, struct bin_attribute *bin_attr,
 		char *buf, loff_t off, size_t count)
 {
@@ -899,18 +910,27 @@ int __must_check pci_create_sysfs_dev_files (struct pci_dev *pdev)
 		pdev->rom_attr = attr;
 	}
 
+	if ((pdev->class >> 8) == PCI_CLASS_DISPLAY_VGA) {
+		retval = device_create_file(&pdev->dev, &vga_attr);
+		if (retval)
+			goto err_rom_file;
+	}
+
 	/* add platform-specific attributes */
 	retval = pcibios_add_platform_entries(pdev);
 	if (retval)
-		goto err_rom_file;
+		goto err_vga_file;
 
 	/* add sysfs entries for various capabilities */
 	retval = pci_create_capabilities_sysfs(pdev);
 	if (retval)
-		goto err_rom_file;
+		goto err_vga_file;
 
 	return 0;
 
+err_vga_file:
+	if ((pdev->class >> 8) == PCI_CLASS_DISPLAY_VGA)
+		device_remove_file(&pdev->dev, &vga_attr);
 err_rom_file:
 	if (rom_size) {
 		sysfs_remove_bin_file(&pdev->dev.kobj, pdev->rom_attr);


Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-11/kernel.spec,v
retrieving revision 1.1611
retrieving revision 1.1612
diff -u -p -r1.1611 -r1.1612
--- kernel.spec	18 May 2009 17:43:03 -0000	1.1611
+++ kernel.spec	18 May 2009 17:43:45 -0000	1.1612
@@ -699,6 +699,7 @@ Patch1825: drm-intel-tiling-transition.p
 Patch1826: drm-intel-next.patch
 Patch1828: drm-intel-debugfs-ringbuffer.patch
 Patch1829: drm-edid-ignore-tiny-modes.patch
+Patch1830: linux-2.6.29.3-boot-vga.patch
 
 # kludge to make ich9 e1000 work
 Patch2000: linux-2.6-e1000-ich9.patch
@@ -1365,6 +1366,7 @@ ApplyPatch drm-intel-tiling-transition.p
 ApplyPatch drm-intel-next.patch
 ApplyPatch drm-intel-debugfs-ringbuffer.patch
 ApplyPatch drm-edid-ignore-tiny-modes.patch
+ApplyPatch linux-2.6.29.3-boot-vga.patch
 
 # linux1394 git patches
 ApplyPatch linux-2.6-firewire-git-update.patch
@@ -1989,6 +1991,9 @@ fi
 # and build.
 
 %changelog
+* Mon May 18 2009 Adam Jackson <ajax at redhat.com>
+- Expose whether VGA devices were active at boot or not in sysfs.
+
 * Mon May 18 2009 Justin M. Forbes <jforbes at redhat.com>
 - Disable GB pages for Xen guests BZ# 499592
 




More information about the scm-commits mailing list