summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/virtio
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2016-10-04 11:19:08 +0200
committerGerd Hoffmann <kraxel@redhat.com>2016-11-15 09:45:30 +0100
commit9785b4321b0bd701f8d21d3d3c676a7739a5cf22 (patch)
tree98578dcbd629763cff49a917910219977f7a14b1 /drivers/gpu/drm/virtio
parenta6b5fac59cb216ac906f02300d3630c24520d9ef (diff)
downloadlinux-9785b4321b0bd701f8d21d3d3c676a7739a5cf22.tar.bz2
drm/virtio: fix busid regression
Created by commit a325725633c26aa66ab940f762a6b0778edf76c0. busid changes and userspace is upset. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/virtio')
-rw-r--r--drivers/gpu/drm/virtio/virtgpu_drm_bus.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/gpu/drm/virtio/virtgpu_drm_bus.c b/drivers/gpu/drm/virtio/virtgpu_drm_bus.c
index 49e5996cb9f2..8534a99e1aea 100644
--- a/drivers/gpu/drm/virtio/virtgpu_drm_bus.c
+++ b/drivers/gpu/drm/virtio/virtgpu_drm_bus.c
@@ -71,13 +71,22 @@ int drm_virtio_init(struct drm_driver *driver, struct virtio_device *vdev)
if (strcmp(vdev->dev.parent->bus->name, "pci") == 0) {
struct pci_dev *pdev = to_pci_dev(vdev->dev.parent);
+ const char *pname = dev_name(&pdev->dev);
bool vga = (pdev->class >> 8) == PCI_CLASS_DISPLAY_VGA;
+ char unique[20];
- DRM_INFO("pci: %s detected\n",
- vga ? "virtio-vga" : "virtio-gpu-pci");
+ DRM_INFO("pci: %s detected at %s\n",
+ vga ? "virtio-vga" : "virtio-gpu-pci",
+ pname);
dev->pdev = pdev;
if (vga)
virtio_pci_kick_out_firmware_fb(pdev);
+
+ snprintf(unique, sizeof(unique), "pci:%s", pname);
+ ret = drm_dev_set_unique(dev, unique);
+ if (ret)
+ goto err_free;
+
}
ret = drm_dev_register(dev, 0);