Skip to content

Commit

Permalink
BACKPORT: FROMGIT: virtio: fix build for configs without dma-bufs
Browse files Browse the repository at this point in the history
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>
(cherry picked from commit 9fe2f89
 git://anongit.freedesktop.org/drm/drm-misc drm-misc-next)

Conflicts: trivial rebase conflicts in with virtwl build config

BUG=b:142423916
TEST=builds

Change-Id: If6f93dcdd52db5d02142ad13d872909d3d782d80
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/2405752
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Guenter Roeck <groeck@chromium.org>
Commit-Queue: Guenter Roeck <groeck@chromium.org>
Tested-by: Guenter Roeck <groeck@chromium.org>
  • Loading branch information
David Stevens authored and Commit Bot committed Sep 13, 2020
1 parent 4e561eb commit 7c5e019
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions drivers/gpu/drm/virtio/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ config DRM_VIRTIO_GPU
depends on PCI
select DRM_KMS_HELPER
select DRM_TTM
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).
Expand Down
7 changes: 7 additions & 0 deletions drivers/virtio/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,13 @@ 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.

config VIRTIO_WL
bool "Virtio Wayland driver"
depends on VIRTIO
Expand Down
3 changes: 2 additions & 1 deletion drivers/virtio/Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# 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
virtio_pci-$(CONFIG_VIRTIO_PCI_LEGACY) += virtio_pci_legacy.o
obj-$(CONFIG_VIRTIO_BALLOON) += virtio_balloon.o
obj-$(CONFIG_VIRTIO_INPUT) += virtio_input.o
obj-$(CONFIG_VIRTIO_WL) += virtio_wl.o
obj-$(CONFIG_VIRTIO_DMA_SHARED_BUFFER) += virtio_dma_buf.o
3 changes: 3 additions & 0 deletions drivers/virtio/virtio_dma_buf.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* Copyright (C) 2020 Google, Inc.
*/

#include <linux/module.h>
#include <linux/virtio_dma_buf.h>

/**
Expand Down Expand Up @@ -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");

0 comments on commit 7c5e019

Please sign in to comment.