aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/vga
diff options
context:
space:
mode:
authorAlex Williamson <alex.williamson@redhat.com>2013-08-15 18:37:53 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2013-09-03 13:17:58 -0400
commitf22d776f3e280e605819fc09fc35db0d802d36ce (patch)
treec4b30acc190c8b0f6faa675917b9663a7be34fbb /drivers/gpu/vga
parent5cfacdedb1a94efd29faeaab53f939554a3f5943 (diff)
vgaarb: Don't disable resources that are not owned
If a device does not own a resource then we don't need to disable it. This resolves the case where an Intel IGD device can be configured to disable decode of VGA memory but we still need the arbiter to handle VGA I/O port routing. When the IGD device is in conflict, only PCI_COMMAND_IO should be disabled since VGA memory does not require arbitration on this device. Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Cc: Dave Airlie <airlied@redhat.com> Acked-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/vga')
-rw-r--r--drivers/gpu/vga/vgaarb.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/gpu/vga/vgaarb.c b/drivers/gpu/vga/vgaarb.c
index e893f6e1937d..ea564711bb80 100644
--- a/drivers/gpu/vga/vgaarb.c
+++ b/drivers/gpu/vga/vgaarb.c
@@ -257,9 +257,9 @@ static struct vga_device *__vga_tryget(struct vga_device *vgadev,
257 if (!conflict->bridge_has_one_vga) { 257 if (!conflict->bridge_has_one_vga) {
258 vga_irq_set_state(conflict, false); 258 vga_irq_set_state(conflict, false);
259 flags |= PCI_VGA_STATE_CHANGE_DECODES; 259 flags |= PCI_VGA_STATE_CHANGE_DECODES;
260 if (lwants & (VGA_RSRC_LEGACY_MEM|VGA_RSRC_NORMAL_MEM)) 260 if (match & (VGA_RSRC_LEGACY_MEM|VGA_RSRC_NORMAL_MEM))
261 pci_bits |= PCI_COMMAND_MEMORY; 261 pci_bits |= PCI_COMMAND_MEMORY;
262 if (lwants & (VGA_RSRC_LEGACY_IO|VGA_RSRC_NORMAL_IO)) 262 if (match & (VGA_RSRC_LEGACY_IO|VGA_RSRC_NORMAL_IO))
263 pci_bits |= PCI_COMMAND_IO; 263 pci_bits |= PCI_COMMAND_IO;
264 } 264 }
265 265
@@ -267,11 +267,11 @@ static struct vga_device *__vga_tryget(struct vga_device *vgadev,
267 flags |= PCI_VGA_STATE_CHANGE_BRIDGE; 267 flags |= PCI_VGA_STATE_CHANGE_BRIDGE;
268 268
269 pci_set_vga_state(conflict->pdev, false, pci_bits, flags); 269 pci_set_vga_state(conflict->pdev, false, pci_bits, flags);
270 conflict->owns &= ~lwants; 270 conflict->owns &= ~match;
271 /* If he also owned non-legacy, that is no longer the case */ 271 /* If he also owned non-legacy, that is no longer the case */
272 if (lwants & VGA_RSRC_LEGACY_MEM) 272 if (match & VGA_RSRC_LEGACY_MEM)
273 conflict->owns &= ~VGA_RSRC_NORMAL_MEM; 273 conflict->owns &= ~VGA_RSRC_NORMAL_MEM;
274 if (lwants & VGA_RSRC_LEGACY_IO) 274 if (match & VGA_RSRC_LEGACY_IO)
275 conflict->owns &= ~VGA_RSRC_NORMAL_IO; 275 conflict->owns &= ~VGA_RSRC_NORMAL_IO;
276 } 276 }
277 277