Commit f6252114 authored by Dave Airlie's avatar Dave Airlie

vgaarb: a NULL bridge is acceptable for root devices.

I assumed all PCI buses had a bridge, but playing with qemu recently, I
discovered vgaarb bug where it wasn't detecting both devices shared a bridge
at the root level.

Don't check for NULL, if two buses have a NULL bridge, assume they share the
root bus.
Acked-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent d53dab3a
...@@ -465,31 +465,29 @@ static void vga_arbiter_check_bridge_sharing(struct vga_device *vgadev) ...@@ -465,31 +465,29 @@ static void vga_arbiter_check_bridge_sharing(struct vga_device *vgadev)
while (new_bus) { while (new_bus) {
new_bridge = new_bus->self; new_bridge = new_bus->self;
if (new_bridge) { /* go through list of devices already registered */
/* go through list of devices already registered */ list_for_each_entry(same_bridge_vgadev, &vga_list, list) {
list_for_each_entry(same_bridge_vgadev, &vga_list, list) { bus = same_bridge_vgadev->pdev->bus;
bus = same_bridge_vgadev->pdev->bus; bridge = bus->self;
bridge = bus->self;
/* see if the share a bridge with this device */
/* see if the share a bridge with this device */ if (new_bridge == bridge) {
if (new_bridge == bridge) { /* if their direct parent bridge is the same
/* if their direct parent bridge is the same as any bridge of this device then it can't be used
as any bridge of this device then it can't be used for that device */
for that device */ same_bridge_vgadev->bridge_has_one_vga = false;
same_bridge_vgadev->bridge_has_one_vga = false; }
}
/* now iterate the previous devices bridge hierarchy */ /* now iterate the previous devices bridge hierarchy */
/* if the new devices parent bridge is in the other devices /* if the new devices parent bridge is in the other devices
hierarchy then we can't use it to control this device */ hierarchy then we can't use it to control this device */
while (bus) { while (bus) {
bridge = bus->self; bridge = bus->self;
if (bridge) { if (bridge) {
if (bridge == vgadev->pdev->bus->self) if (bridge == vgadev->pdev->bus->self)
vgadev->bridge_has_one_vga = false; vgadev->bridge_has_one_vga = false;
}
bus = bus->parent;
} }
bus = bus->parent;
} }
} }
new_bus = new_bus->parent; new_bus = new_bus->parent;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment