diff options
author | Dave Airlie <airlied@redhat.com> | 2011-10-10 04:29:18 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2011-11-14 05:03:15 -0500 |
commit | f6252114cbb7edabc1c92bf794153922ee0ea46d (patch) | |
tree | d4fc856af59dc962a7af5117eff0587de97edfbc /drivers/gpu/vga | |
parent | d53dab3ae1a3c6b438738c3792c98ac63f0061f4 (diff) |
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: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/vga')
-rw-r--r-- | drivers/gpu/vga/vgaarb.c | 44 |
1 files changed, 21 insertions, 23 deletions
diff --git a/drivers/gpu/vga/vgaarb.c b/drivers/gpu/vga/vgaarb.c index c72f1c0b5e63..bdde899af72e 100644 --- a/drivers/gpu/vga/vgaarb.c +++ b/drivers/gpu/vga/vgaarb.c | |||
@@ -465,31 +465,29 @@ static void vga_arbiter_check_bridge_sharing(struct vga_device *vgadev) | |||
465 | while (new_bus) { | 465 | while (new_bus) { |
466 | new_bridge = new_bus->self; | 466 | new_bridge = new_bus->self; |
467 | 467 | ||
468 | if (new_bridge) { | 468 | /* go through list of devices already registered */ |
469 | /* go through list of devices already registered */ | 469 | list_for_each_entry(same_bridge_vgadev, &vga_list, list) { |
470 | list_for_each_entry(same_bridge_vgadev, &vga_list, list) { | 470 | bus = same_bridge_vgadev->pdev->bus; |
471 | bus = same_bridge_vgadev->pdev->bus; | 471 | bridge = bus->self; |
472 | bridge = bus->self; | 472 | |
473 | 473 | /* see if the share a bridge with this device */ | |
474 | /* see if the share a bridge with this device */ | 474 | if (new_bridge == bridge) { |
475 | if (new_bridge == bridge) { | 475 | /* if their direct parent bridge is the same |
476 | /* if their direct parent bridge is the same | 476 | as any bridge of this device then it can't be used |
477 | as any bridge of this device then it can't be used | 477 | for that device */ |
478 | for that device */ | 478 | same_bridge_vgadev->bridge_has_one_vga = false; |
479 | same_bridge_vgadev->bridge_has_one_vga = false; | 479 | } |
480 | } | ||
481 | 480 | ||
482 | /* now iterate the previous devices bridge hierarchy */ | 481 | /* now iterate the previous devices bridge hierarchy */ |
483 | /* if the new devices parent bridge is in the other devices | 482 | /* if the new devices parent bridge is in the other devices |
484 | hierarchy then we can't use it to control this device */ | 483 | hierarchy then we can't use it to control this device */ |
485 | while (bus) { | 484 | while (bus) { |
486 | bridge = bus->self; | 485 | bridge = bus->self; |
487 | if (bridge) { | 486 | if (bridge) { |
488 | if (bridge == vgadev->pdev->bus->self) | 487 | if (bridge == vgadev->pdev->bus->self) |
489 | vgadev->bridge_has_one_vga = false; | 488 | vgadev->bridge_has_one_vga = false; |
490 | } | ||
491 | bus = bus->parent; | ||
492 | } | 489 | } |
490 | bus = bus->parent; | ||
493 | } | 491 | } |
494 | } | 492 | } |
495 | new_bus = new_bus->parent; | 493 | new_bus = new_bus->parent; |