[PATCH 4/4] vgaarb: Add user selectability of the number of GPUS in a system

Mike Travis
2010-01-18T18:35:07Z

[-- Attachment #1: update-vga-max-cards --]
[-- Type: text/plain, Size: 1906 bytes --]

Update the VGA Arbiter to allow the user to select the number
of GPU's supported in a system.

Signed-off-by: Mike Travis <travis@sgi.com>

Cc: Dave Airlie <airlied@redhat.com>
Cc: Alex Chiang <achiang@hp.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Cyrill Gorcunov <gorcunov@openvz.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Robin Holt <holt@sgi.com>
Cc: Rafael J. Wysocki <rjw@sisk.pl>
Cc: Adam Jackson <ajax@nwnk.net>
Cc: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Gaetan Nadon <memsize@videotron.ca>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Aaron Plattner <aplattner@nvidia.com>
Cc: Jack Steiner <steiner@sgi.com>
Cc: Tiago Vignatti <tiago.vignatti@nokia.com>
Cc: Cliff Wickman <cpw@sgi.com>
Cc: Matthew Wilcox <willy@linux.intel.com>
Cc: Christian Zander <chzander@nvidia.com>
Cc: Yu Zhao <yu.zhao@intel.com>

Cc: linux-kernel@vger.kernel.org
Cc: linux-pci@vger.kernel.org
Cc: x86@kernel.org
---
drivers/gpu/vga/Kconfig | 8 ++++++++
drivers/gpu/vga/vgaarb.c | 4 ++++
2 files changed, 12 insertions(+)

--- linux.orig/drivers/gpu/vga/Kconfig
+++ linux/drivers/gpu/vga/Kconfig
@@ -8,3 +8,11 @@
are accessed at same time they need some kind of coordination. Please
see Documentation/vgaarbiter.txt for more details. Select this to
enable VGA arbiter.
+
+config VGA_ARB_MAX_GPUS
+ int "Maximum number of GPUs"
+ default 64
+ depends on VGA_ARB
+ help
+ Reserves space in the kernel to maintain resource locking for
+ multiple GPUS. The overhead for each GPU is very small.
--- linux.orig/drivers/gpu/vga/vgaarb.c
+++ linux/drivers/gpu/vga/vgaarb.c
@@ -688,7 +688,11 @@
* the arbiter.
*/

+#ifdef CONFIG_VGA_ARB_MAX_GPUS
+#define MAX_USER_CARDS CONFIG_VGA_ARB_MAX_GPUS
+#else
#define MAX_USER_CARDS 16
+#endif
#define PCI_INVALID_CARD ((struct pci_dev *)-1UL)

/*

--