Skip to contentSkip to conversation

vgaarb: Stub vga_set_legacy_decoding()

PATCH In review Alex Williamson 2 participants 3 messages Feb 24, 2015 – Mar 4, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vgaarb: Stub vga_set_legacy_decoding()

vga_set_legacy_decoding() is defined in drivers/gpu/vga/vgaarb.c, which is only compiled with CONFIG_VGA_ARB. A caller would therefore get an undefined symbol if the VGA arbiter is not enabled.

---

I'd like to use this function from vfio-pci to opt-out VGA devices from arbitration if vfio-pci VGA support is disabled. This helps to keep DRI2 enabled on the host if additional GPUs are installed for VMs and used without VGA support. I can pull this change in through my tree if someone wants to provide just an ack. Thanks!

 include/linux/vgaarb.h |    5 +++++
 1 file changed, 5 insertions(+)
include/linux/vgaarb.h +5 -0
index c37bd4d..8c3b412 100644
@@ -65,8 +65,13 @@ struct pci_dev;
  *     out of the arbitration process (and can be safe to take
  *     interrupts at any time.
  */
+#if defined(CONFIG_VGA_ARB)
 extern void vga_set_legacy_decoding(struct pci_dev *pdev,
 				    unsigned int decodes);
+#else
+static inline void vga_set_legacy_decoding(struct pci_dev *pdev,
+					   unsigned int decodes) { };
+#endif
 
 /**
  *     vga_get         - acquire & locks VGA resources

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 4 lines · Alex Williamson

vga_set_legacy_decoding() is defined in drivers/gpu/vga/vgaarb.c, which is only compiled with CONFIG_VGA_ARB. A caller would therefore get an undefined symbol if the VGA arbiter is not enabled.

Quoted 35 lines

---

I'd like to use this function from vfio-pci to opt-out VGA devices from arbitration if vfio-pci VGA support is disabled. This helps to keep DRI2 enabled on the host if additional GPUs are installed for VMs and used without VGA support. I can pull this change in through my tree if someone wants to provide just an ack. Thanks!

 include/linux/vgaarb.h |    5 +++++
 1 file changed, 5 insertions(+)
include/linux/vgaarb.h +5 -0
index c37bd4d..8c3b412 100644
@@ -65,8 +65,13 @@ struct pci_dev;
  *     out of the arbitration process (and can be safe to take
  *     interrupts at any time.
  */
+#if defined(CONFIG_VGA_ARB)
 extern void vga_set_legacy_decoding(struct pci_dev *pdev,
                                    unsigned int decodes);
+#else
+static inline void vga_set_legacy_decoding(struct pci_dev *pdev,
+                                          unsigned int decodes) { };
+#endif
 
 /**
  *     vga_get         - acquire & locks VGA resources

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#2 lore raw
Quoted 8 lines · Dave Airlie
Quoted 4 lines · Alex Williamson

vga_set_legacy_decoding() is defined in drivers/gpu/vga/vgaarb.c, which is only compiled with CONFIG_VGA_ARB. A caller would therefore get an undefined symbol if the VGA arbiter is not enabled.

Thanks Dave! I'll route this through my tree with the commit that uses it.

Quoted 28 lines
Quoted 28 lines

---

I'd like to use this function from vfio-pci to opt-out VGA devices from arbitration if vfio-pci VGA support is disabled. This helps to keep DRI2 enabled on the host if additional GPUs are installed for VMs and used without VGA support. I can pull this change in through my tree if someone wants to provide just an ack. Thanks!

 include/linux/vgaarb.h |    5 +++++
 1 file changed, 5 insertions(+)
include/linux/vgaarb.h +5 -0
index c37bd4d..8c3b412 100644
@@ -65,8 +65,13 @@ struct pci_dev;
  *     out of the arbitration process (and can be safe to take
  *     interrupts at any time.
  */
+#if defined(CONFIG_VGA_ARB)
 extern void vga_set_legacy_decoding(struct pci_dev *pdev,
                                    unsigned int decodes);
+#else
+static inline void vga_set_legacy_decoding(struct pci_dev *pdev,
+                                          unsigned int decodes) { };
+#endif
 
Quoted 7 lines
Quoted 7 lines
include/linux/vgaarb.h +0 -0
 /**
  *     vga_get         - acquire & locks VGA resources

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel