Guest User

Untitled

a guest
Dec 20th, 2020
58
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. From ff2cf2ed87119810fd3c6347cdd726a2371a60aa Mon Sep 17 00:00:00 2001
  2. From: x
  3. Date: x
  4. Subject: [PATCH] x
  5.  
  6. ---
  7. vgaarb.c | 30 ++++--------------------------
  8.  1 file changed, 4 insertions(+), 26 deletions(-)
  9.  
  10. diff --git a/vgaarb.c b/vgaarb.c
  11. index 5180c56..c770b5f 100644
  12. --- a/vgaarb.c
  13. +++ b/vgaarb.c
  14. @@ -1470,35 +1470,13 @@ static void __init vga_arb_select_default_device(void)
  15.  
  16.     list_for_each_entry(vgadev, &vga_list, list) {
  17.         struct device *dev = &vgadev->pdev->dev;
  18. -       /*
  19. -        * Override vga_arbiter_add_pci_device()'s I/O based detection
  20. -        * as it may take the wrong device (e.g. on Apple system under
  21. -        * EFI).
  22. -        *
  23. -        * Select the device owning the boot framebuffer if there is
  24. -        * one.
  25. -        */
  26. -
  27. -       /* Does firmware framebuffer belong to us? */
  28. -       for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
  29. -           flags = pci_resource_flags(vgadev->pdev, i);
  30. -
  31. -           if ((flags & IORESOURCE_MEM) == 0)
  32. -               continue;
  33. -
  34. -           start = pci_resource_start(vgadev->pdev, i);
  35. -           end  = pci_resource_end(vgadev->pdev, i);
  36.  
  37. -           if (!start || !end)
  38. -               continue;
  39. +#define NVIDIA_PCI_ADDR "0000:00:02.0"
  40.  
  41. -           if (base < start || limit >= end)
  42. -               continue;
  43. +       vgaarb_info(dev, "checking %s\n", pci_name(pdev));
  44.  
  45. -           if (!vga_default_device())
  46. -               vgaarb_info(dev, "setting as boot device\n");
  47. -           else if (vgadev->pdev != vga_default_device())
  48. -               vgaarb_info(dev, "overriding boot device\n");
  49. +       if (strcmp(pci_name(vgadev->pdev), NVIDIA_PCI_ADDR) == 0) {
  50. +           vgaarb_info(dev, "setting as boot device\n");
  51.             vga_set_default_device(vgadev->pdev);
  52.         }
  53.     }
  54. --
  55. 2.25.1
  56.  
  57.  
RAW Paste Data