public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] vgaarb: Stub vga_set_legacy_decoding()
@ 2015-02-24 16:16 Alex Williamson
  2015-03-04 23:43 ` Dave Airlie
  0 siblings, 1 reply; 3+ messages in thread
From: Alex Williamson @ 2015-02-24 16:16 UTC (permalink / raw)
  To: airlied, dri-devel; +Cc: alex.williamson, linux-kernel

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.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
---

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(+)

diff --git a/include/linux/vgaarb.h b/include/linux/vgaarb.h
index c37bd4d..8c3b412 100644
--- a/include/linux/vgaarb.h
+++ b/include/linux/vgaarb.h
@@ -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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-03-04 23:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-24 16:16 [PATCH] vgaarb: Stub vga_set_legacy_decoding() Alex Williamson
2015-03-04 23:43 ` Dave Airlie
2015-03-04 23:51   ` Alex Williamson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox