Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9785b432 authored by Gerd Hoffmann's avatar Gerd Hoffmann
Browse files

drm/virtio: fix busid regression



Created by commit a3257256.
busid changes and userspace is upset.

Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
parent a6b5fac5
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
@@ -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);