Commit c2cbc38b authored by Laszlo Ersek's avatar Laszlo Ersek Committed by Dave Airlie

drm: virtio: reinstate drm_virtio_set_busid()

Before commit a3257256 ("drm: Lobotomize set_busid nonsense for !pci
drivers"), several DRM drivers for platform devices used to expose an
explicit "drm_driver.set_busid" callback, invariably backed by
drm_platform_set_busid().

Commit a3257256 removed drm_platform_set_busid(), along with the
referring .set_busid field initializations. This was justified because
interchangeable functionality had been implemented in drm_dev_alloc() /
drm_dev_init(), which DRM_IOCTL_SET_VERSION would rely on going forward.

However, commit a3257256 also removed drm_virtio_set_busid(), for
which the same consolidation was not appropriate: this .set_busid callback
had been implemented with drm_pci_set_busid(), and not
drm_platform_set_busid(). The error regressed Xorg/xserver on QEMU's
"virtio-vga" card; the drmGetBusid() function from libdrm would no longer
return stable PCI identifiers like "pci:0000:00:02.0", but rather unstable
platform ones like "virtio0".

Reinstate drm_virtio_set_busid() with judicious use of

  git checkout -p a3257256^ -- drivers/gpu/drm/virtio

Cc: Daniel Vetter <daniel.vetter@intel.com>
Cc: Emil Velikov <emil.l.velikov@gmail.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Joachim Frieben <jfrieben@hotmail.com>
Cc: stable@vger.kernel.org # v4.8
Reported-by: default avatarJoachim Frieben <jfrieben@hotmail.com>
Fixes: a3257256
Ref: https://bugzilla.redhat.com/show_bug.cgi?id=1366842Signed-off-by: default avatarLaszlo Ersek <lersek@redhat.com>
Reviewed-by: default avatarEmil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent 2adb29b1
...@@ -28,6 +28,16 @@ ...@@ -28,6 +28,16 @@
#include "virtgpu_drv.h" #include "virtgpu_drv.h"
int drm_virtio_set_busid(struct drm_device *dev, struct drm_master *master)
{
struct pci_dev *pdev = dev->pdev;
if (pdev) {
return drm_pci_set_busid(dev, master);
}
return 0;
}
static void virtio_pci_kick_out_firmware_fb(struct pci_dev *pci_dev) static void virtio_pci_kick_out_firmware_fb(struct pci_dev *pci_dev)
{ {
struct apertures_struct *ap; struct apertures_struct *ap;
......
...@@ -117,6 +117,7 @@ static const struct file_operations virtio_gpu_driver_fops = { ...@@ -117,6 +117,7 @@ static const struct file_operations virtio_gpu_driver_fops = {
static struct drm_driver driver = { static struct drm_driver driver = {
.driver_features = DRIVER_MODESET | DRIVER_GEM | DRIVER_PRIME | DRIVER_RENDER | DRIVER_ATOMIC, .driver_features = DRIVER_MODESET | DRIVER_GEM | DRIVER_PRIME | DRIVER_RENDER | DRIVER_ATOMIC,
.set_busid = drm_virtio_set_busid,
.load = virtio_gpu_driver_load, .load = virtio_gpu_driver_load,
.unload = virtio_gpu_driver_unload, .unload = virtio_gpu_driver_unload,
.open = virtio_gpu_driver_open, .open = virtio_gpu_driver_open,
......
...@@ -49,6 +49,7 @@ ...@@ -49,6 +49,7 @@
#define DRIVER_PATCHLEVEL 1 #define DRIVER_PATCHLEVEL 1
/* virtgpu_drm_bus.c */ /* virtgpu_drm_bus.c */
int drm_virtio_set_busid(struct drm_device *dev, struct drm_master *master);
int drm_virtio_init(struct drm_driver *driver, struct virtio_device *vdev); int drm_virtio_init(struct drm_driver *driver, struct virtio_device *vdev);
struct virtio_gpu_object { struct virtio_gpu_object {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment