virtio: fix build for configs without dma-bufs
authorDavid Stevens <stevensd@chromium.org>
Wed, 19 Aug 2020 03:10:11 +0000 (12:10 +0900)
committerGerd Hoffmann <kraxel@redhat.com>
Wed, 19 Aug 2020 04:43:28 +0000 (06:43 +0200)
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: David Stevens <stevensd@chromium.org>
Link: http://patchwork.freedesktop.org/patch/msgid/20200819031011.310180-1-stevensd@chromium.org
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
drivers/gpu/drm/virtio/Kconfig
drivers/virtio/Kconfig
drivers/virtio/Makefile
drivers/virtio/virtio_dma_buf.c

index eff3047052d4818d9bbede7c4b7b115fe7d1d62a..67624423013a1e919c63a74334c5aa9fc28ef8e1 100644 (file)
@@ -4,6 +4,7 @@ config DRM_VIRTIO_GPU
        depends on DRM && VIRTIO && MMU
        select DRM_KMS_HELPER
        select DRM_GEM_SHMEM_HELPER
+       select VIRTIO_DMA_SHARED_BUFFER
        help
           This is the virtual GPU driver for virtio.  It can be used with
           QEMU based VMMs (like KVM or Xen).
index 5c92e4a50882dffe145fb21c3a6372560aa266c5..e76e9b9ba93cad564064de2073f37da08863fd2e 100644 (file)
@@ -126,4 +126,11 @@ config VIRTIO_MMIO_CMDLINE_DEVICES
 
         If unsure, say 'N'.
 
+config VIRTIO_DMA_SHARED_BUFFER
+       tristate
+       depends on DMA_SHARED_BUFFER
+       help
+        This option adds a flavor of dma buffers that are backed by
+        virtio resources.
+
 endif # VIRTIO_MENU
index 49da768ee7fde98bb63d15a8207937699477bcf9..591e6f72aa542dae402a186bdad952ed79af62f1 100644 (file)
@@ -1,5 +1,5 @@
 # SPDX-License-Identifier: GPL-2.0
-obj-$(CONFIG_VIRTIO) += virtio.o virtio_ring.o virtio_dma_buf.o
+obj-$(CONFIG_VIRTIO) += virtio.o virtio_ring.o
 obj-$(CONFIG_VIRTIO_MMIO) += virtio_mmio.o
 obj-$(CONFIG_VIRTIO_PCI) += virtio_pci.o
 virtio_pci-y := virtio_pci_modern.o virtio_pci_common.o
@@ -8,3 +8,4 @@ obj-$(CONFIG_VIRTIO_BALLOON) += virtio_balloon.o
 obj-$(CONFIG_VIRTIO_INPUT) += virtio_input.o
 obj-$(CONFIG_VIRTIO_VDPA) += virtio_vdpa.o
 obj-$(CONFIG_VIRTIO_MEM) += virtio_mem.o
+obj-$(CONFIG_VIRTIO_DMA_SHARED_BUFFER) += virtio_dma_buf.o
index 45d6e8647dcf1200d45ff828622f5c3c6000f98d..5127a2f0c986e6904bfdb2cd1866c04d37165b4f 100644 (file)
@@ -5,6 +5,7 @@
  * Copyright (C) 2020 Google, Inc.
  */
 
+#include <linux/module.h>
 #include <linux/virtio_dma_buf.h>
 
 /**
@@ -83,3 +84,5 @@ int virtio_dma_buf_get_uuid(struct dma_buf *dma_buf,
        return ops->get_uuid(dma_buf, uuid);
 }
 EXPORT_SYMBOL(virtio_dma_buf_get_uuid);
+
+MODULE_LICENSE("GPL");