rpms/kernel/devel drm-vga-arb.patch, 1.3, 1.4 kernel.spec, 1.1681, 1.1682 linux-2.6-vga-arb.patch, 1.4, 1.5

Dave Airlie airlied at fedoraproject.org
Mon Aug 3 06:03:09 UTC 2009


Author: airlied

Update of /cvs/pkgs/rpms/kernel/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv9371

Modified Files:
	drm-vga-arb.patch kernel.spec linux-2.6-vga-arb.patch 
Log Message:
* Mon Aug 03 2009 Dave Airlie <airlied at redhat.com>
- update VGA arb patches


drm-vga-arb.patch:
 drivers/gpu/drm/drm_irq.c              |   27 +++++++++++++++++++++++++++
 drivers/gpu/drm/i915/i915_dma.c        |   20 ++++++++++++++++++++
 drivers/gpu/drm/i915/i915_drv.h        |    1 +
 drivers/gpu/drm/i915/i915_reg.h        |    1 +
 drivers/gpu/drm/i915/intel_display.c   |   23 +++++++++++++++++++++++
 drivers/gpu/drm/i915/intel_drv.h       |    1 +
 drivers/gpu/drm/radeon/r100.c          |   14 ++++++++++++++
 drivers/gpu/drm/radeon/radeon.h        |    2 ++
 drivers/gpu/drm/radeon/radeon_asic.h   |    9 +++++++++
 drivers/gpu/drm/radeon/radeon_device.c |   20 +++++++++++++++++++-
 include/drm/drmP.h                     |    4 +++-
 11 files changed, 120 insertions(+), 2 deletions(-)

Index: drm-vga-arb.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/drm-vga-arb.patch,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -p -r1.3 -r1.4
--- drm-vga-arb.patch	29 Jul 2009 00:34:59 -0000	1.3
+++ drm-vga-arb.patch	3 Aug 2009 06:03:07 -0000	1.4
@@ -1,4 +1,4 @@
-From 7f8919f77fb703526f87b56d11e76cd46cc6da3f Mon Sep 17 00:00:00 2001
+From 189bef6a28e58cb31e5e3ebb88869cd0f0dcc7be Mon Sep 17 00:00:00 2001
 From: Dave Airlie <airlied at redhat.com>
 Date: Thu, 16 Jul 2009 14:33:58 +1000
 Subject: [PATCH] drm: add support to drm for VGA arbitration.


Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/kernel.spec,v
retrieving revision 1.1681
retrieving revision 1.1682
diff -u -p -r1.1681 -r1.1682
--- kernel.spec	1 Aug 2009 13:31:25 -0000	1.1681
+++ kernel.spec	3 Aug 2009 06:03:08 -0000	1.1682
@@ -1940,6 +1940,9 @@ fi
 # and build.
 
 %changelog
+* Mon Aug 03 2009 Dave Airlie <airlied at redhat.com>
+- update VGA arb patches
+
 * Sat Aug 01 2009 David Woodhouse <David.Woodhouse at intel.com> 2.6.31-0.118.rc5
 - Fix boot failures on ppc32 (#514010, #505071)
 

linux-2.6-vga-arb.patch:
 drivers/gpu/Makefile     |    2 
 drivers/gpu/vga/Kconfig  |   10 
 drivers/gpu/vga/Makefile |    1 
 drivers/gpu/vga/vgaarb.c | 1159 +++++++++++++++++++++++++++++++++++++++++++++++
 drivers/pci/pci.c        |   44 +
 drivers/video/Kconfig    |    2 
 include/linux/pci.h      |    2 
 include/linux/vgaarb.h   |  196 +++++++
 8 files changed, 1414 insertions(+), 2 deletions(-)

Index: linux-2.6-vga-arb.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/linux-2.6-vga-arb.patch,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -p -r1.4 -r1.5
--- linux-2.6-vga-arb.patch	29 Jul 2009 21:10:48 -0000	1.4
+++ linux-2.6-vga-arb.patch	3 Aug 2009 06:03:08 -0000	1.5
@@ -1,4 +1,4 @@
-From 61fc475f99444cf1ae1f417b55680f16ab510a00 Mon Sep 17 00:00:00 2001
+From 28a788c99a243050ab55e819e8e81c4ba019bb35 Mon Sep 17 00:00:00 2001
 From: Tiago Vignatti <tiago.vignatti at nokia.com>
 Date: Tue, 14 Jul 2009 15:57:29 +0300
 Subject: [PATCH] vga: implements VGA arbitration on Linux
@@ -11,18 +11,21 @@ on hw until first used. This worksaround
 X.org problem with older X servers which fail
 at detecting boot device if doesn't have the VGA
 bit enabled. Newer pciacccess + X server fix this.
+add default processing
+use hex for the target API to match the output API
+balance pci get/put
 
 Signed-off-by: Tiago Vignatti <tiago.vignatti at nokia.com>
 ---
  drivers/gpu/Makefile     |    2 +-
  drivers/gpu/vga/Kconfig  |   10 +
  drivers/gpu/vga/Makefile |    1 +
- drivers/gpu/vga/vgaarb.c | 1150 ++++++++++++++++++++++++++++++++++++++++++++++
+ drivers/gpu/vga/vgaarb.c | 1159 ++++++++++++++++++++++++++++++++++++++++++++++
  drivers/pci/pci.c        |   44 ++
  drivers/video/Kconfig    |    2 +
  include/linux/pci.h      |    2 +
  include/linux/vgaarb.h   |  195 ++++++++
- 8 files changed, 1405 insertions(+), 1 deletions(-)
+ 8 files changed, 1414 insertions(+), 1 deletions(-)
  create mode 100644 drivers/gpu/vga/Kconfig
  create mode 100644 drivers/gpu/vga/Makefile
  create mode 100644 drivers/gpu/vga/vgaarb.c
@@ -60,10 +63,10 @@ index 0000000..7cc8c1e
 +obj-$(CONFIG_VGA_ARB)  += vgaarb.o
 diff --git a/drivers/gpu/vga/vgaarb.c b/drivers/gpu/vga/vgaarb.c
 new file mode 100644
-index 0000000..3925e6c
+index 0000000..7383d00
 --- /dev/null
 +++ b/drivers/gpu/vga/vgaarb.c
-@@ -0,0 +1,1150 @@
+@@ -0,0 +1,1159 @@
 +/*
 + * vgaarb.c
 + *
@@ -195,9 +198,9 @@ index 0000000..3925e6c
 +   confused about the boot device not being VGA */
 +static void vga_check_first_use(void)
 +{
-+        /* we should inform all GPUs in the system that
-+         * VGA arb has occured and to try and disable resources
-+         * if they can */
++	/* we should inform all GPUs in the system that
++	 * VGA arb has occured and to try and disable resources
++	 * if they can */
 +	if (!vga_arbiter_used) {
 +		vga_arbiter_used = true;
 +		vga_arbiter_notify_clients();
@@ -289,7 +292,7 @@ index 0000000..3925e6c
 +			pci_bits |= PCI_COMMAND_MEMORY;
 +		if (lwants & (VGA_RSRC_LEGACY_IO|VGA_RSRC_NORMAL_IO))
 +			pci_bits |= PCI_COMMAND_IO;
-+		    
++
 +		pci_set_vga_state(conflict->pdev, false, pci_bits,
 +				  change_bridge);
 +		conflict->owns &= ~lwants;
@@ -507,7 +510,7 @@ index 0000000..3925e6c
 +
 +	/* By default, assume we decode everything */
 +	vgadev->decodes = VGA_RSRC_LEGACY_IO | VGA_RSRC_LEGACY_MEM |
-+		          VGA_RSRC_NORMAL_IO | VGA_RSRC_NORMAL_MEM;
++			  VGA_RSRC_NORMAL_IO | VGA_RSRC_NORMAL_MEM;
 +
 +	/* Mark that we "own" resources based on our enables, we will
 +	 * clear that below if the bridge isn't forwarding
@@ -551,7 +554,7 @@ index 0000000..3925e6c
 +		vga_iostate_to_str(vgadev->decodes),
 +		vga_iostate_to_str(vgadev->owns),
 +		vga_iostate_to_str(vgadev->locks));
-+	
++
 +	spin_unlock_irqrestore(&vga_lock, flags);
 +	return;
 +fail:
@@ -743,7 +746,8 @@ index 0000000..3925e6c
 +	int n;
 +	unsigned int slot, func;
 +
-+	n = sscanf(buf, "PCI:%d:%d:%d.%d", domain, bus, &slot, &func);
++
++	n = sscanf(buf, "PCI:%x:%x:%x.%x", domain, bus, &slot, &func);
 +	if (n != 4)
 +		return 0;
 +
@@ -795,7 +799,7 @@ index 0000000..3925e6c
 +
 +	/* Fill the buffer with infos */
 +	len = snprintf(lbuf, 1024,
-+		       "count:%d PCI:%s,decodes=%s,owns=%s,locks=%s (%d,%d)\n",
++		       "count:%d,PCI:%s,decodes=%s,owns=%s,locks=%s (%d,%d)\n",
 +		       vga_count, pci_name(pdev),
 +		       vga_iostate_to_str(vgadev->decodes),
 +		       vga_iostate_to_str(vgadev->owns),
@@ -906,7 +910,7 @@ index 0000000..3925e6c
 +
 +		pdev = priv->target;
 +		if (priv->target == NULL) {
-+				ret_val = -ENODEV;
++			ret_val = -ENODEV;
 +			goto done;
 +		}
 +		for (i = 0; i < MAX_USER_CARDS; i++) {
@@ -980,22 +984,28 @@ index 0000000..3925e6c
 +		curr_pos += 7;
 +		remaining -= 7;
 +		pr_devel("client 0x%X called 'target'\n", (int)priv);
-+		if (!vga_pci_str_to_vars(curr_pos, remaining,
-+					 &domain, &bus, &devfn)) {
-+			ret_val = -EPROTO;
-+			goto done;
-+		}
++		/* if target is default */
++		if (!strncmp(buf, "default", 7))
++			pdev = pci_dev_get(vga_default_device());
++		else {
++			if (!vga_pci_str_to_vars(curr_pos, remaining,
++						 &domain, &bus, &devfn)) {
++				ret_val = -EPROTO;
++				goto done;
++			}
 +
-+		pdev = pci_get_bus_and_slot(bus, devfn);
-+		if (!pdev) {
-+			pr_info("vgaarb: invalid PCI address!\n");
-+			ret_val = -ENODEV;
-+			goto done;
++			pdev = pci_get_bus_and_slot(bus, devfn);
++			if (!pdev) {
++				pr_info("vgaarb: invalid PCI address!\n");
++				ret_val = -ENODEV;
++				goto done;
++			}
 +		}
 +
 +		vgadev = vgadev_find(pdev);
 +		if (vgadev == NULL) {
 +			pr_info("vgaarb: this pci device is not a vga device\n");
++			pci_dev_put(pdev);
 +			ret_val = -ENODEV;
 +			goto done;
 +		}
@@ -1013,12 +1023,14 @@ index 0000000..3925e6c
 +		}
 +		if (i == MAX_USER_CARDS) {
 +			pr_err("vgaarb: maximum user cards number reached!\n");
++			pci_dev_put(pdev);
 +			/* XXX: which value to return? */
 +			ret_val =  -ENOMEM;
 +			goto done;
 +		}
 +
 +		ret_val = count;
++		pci_dev_put(pdev);
 +		goto done;
 +
 +




More information about the scm-commits mailing list