aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-05-24 15:06:40 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-05-24 15:06:40 -0400
commit98b98d316349e9a028e632629fe813d07fa5afdd (patch)
treecaaf6a662a86c5e2a418f0929ca05f0748803ac5 /drivers/pci
parent0d66cba1ac3ad38614077443d604d6a09cec99de (diff)
parent931474c4c30633400ff0dff8fb452ae20e01d067 (diff)
Merge branch 'drm-core-next' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6
* 'drm-core-next' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6: (169 commits) drivers/gpu/drm/radeon/atom.c: fix warning drm/radeon/kms: bump kms version number drm/radeon/kms: properly set num banks for fusion asics drm/radeon/kms/atom: move dig phy init out of modesetting drm/radeon/kms/cayman: fix typo in register mask drm/radeon/kms: fix typo in spread spectrum code drm/radeon/kms: fix tile_config value reported to userspace on cayman. drm/radeon/kms: fix incorrect comparison in cayman setup code. drm/radeon/kms: add wait idle ioctl for eg->cayman drm/radeon/cayman: setup hdp to invalidate and flush when asked drm/radeon/evergreen/btc/fusion: setup hdp to invalidate and flush when asked agp/uninorth: Fix lockups with radeon KMS and >1x. drm/radeon/kms: the SS_Id field in the LCD table if for LVDS only drm/radeon/kms: properly set the CLK_REF bit for DCE3 devices drm/radeon/kms: fixup eDP connector handling drm/radeon/kms: bail early for eDP in hotplug callback drm/radeon/kms: simplify hotplug handler logic drm/radeon/kms: rewrite DP handling drm/radeon/kms/atom: add support for setting DP panel mode drm/radeon/kms: atombios.h updates for DP panel mode ...
Diffstat (limited to 'drivers/pci')
-rw-r--r--drivers/pci/pci.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 22c9b27fdd8d..56098b3e17c0 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -3284,31 +3284,34 @@ static int pci_set_vga_state_arch(struct pci_dev *dev, bool decode,
3284 * @dev: the PCI device 3284 * @dev: the PCI device
3285 * @decode: true = enable decoding, false = disable decoding 3285 * @decode: true = enable decoding, false = disable decoding
3286 * @command_bits: PCI_COMMAND_IO and/or PCI_COMMAND_MEMORY 3286 * @command_bits: PCI_COMMAND_IO and/or PCI_COMMAND_MEMORY
3287 * @change_bridge: traverse ancestors and change bridges 3287 * @change_bridge_flags: traverse ancestors and change bridges
3288 * CHANGE_BRIDGE_ONLY / CHANGE_BRIDGE
3288 */ 3289 */
3289int pci_set_vga_state(struct pci_dev *dev, bool decode, 3290int pci_set_vga_state(struct pci_dev *dev, bool decode,
3290 unsigned int command_bits, bool change_bridge) 3291 unsigned int command_bits, u32 flags)
3291{ 3292{
3292 struct pci_bus *bus; 3293 struct pci_bus *bus;
3293 struct pci_dev *bridge; 3294 struct pci_dev *bridge;
3294 u16 cmd; 3295 u16 cmd;
3295 int rc; 3296 int rc;
3296 3297
3297 WARN_ON(command_bits & ~(PCI_COMMAND_IO|PCI_COMMAND_MEMORY)); 3298 WARN_ON((flags & PCI_VGA_STATE_CHANGE_DECODES) & (command_bits & ~(PCI_COMMAND_IO|PCI_COMMAND_MEMORY)));
3298 3299
3299 /* ARCH specific VGA enables */ 3300 /* ARCH specific VGA enables */
3300 rc = pci_set_vga_state_arch(dev, decode, command_bits, change_bridge); 3301 rc = pci_set_vga_state_arch(dev, decode, command_bits, flags);
3301 if (rc) 3302 if (rc)
3302 return rc; 3303 return rc;
3303 3304
3304 pci_read_config_word(dev, PCI_COMMAND, &cmd); 3305 if (flags & PCI_VGA_STATE_CHANGE_DECODES) {
3305 if (decode == true) 3306 pci_read_config_word(dev, PCI_COMMAND, &cmd);
3306 cmd |= command_bits; 3307 if (decode == true)
3307 else 3308 cmd |= command_bits;
3308 cmd &= ~command_bits; 3309 else
3309 pci_write_config_word(dev, PCI_COMMAND, cmd); 3310 cmd &= ~command_bits;
3311 pci_write_config_word(dev, PCI_COMMAND, cmd);
3312 }
3310 3313
3311 if (change_bridge == false) 3314 if (!(flags & PCI_VGA_STATE_CHANGE_BRIDGE))
3312 return 0; 3315 return 0;
3313 3316
3314 bus = dev->bus; 3317 bus = dev->bus;