[PATCH 3/4] drm/virtio: Fix virtio gpu fbdev deinitialization.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Module parameter virtio_gpu_fbdev is used to enable or disable fbdev in
virtio. It is checked during fbdev initialization, but is not checked
during deinitialization.

Moving fbdev destruction to virtgpu_kms.c instead of virtgpu_display.c
places deinitialization to the same file as initialization, and allows
checking for virtio_gpu_fbdev module parameter.

Signed-off-by: Damir Shaikhutdinov <damir.shaikhutdinov@xxxxxxxxxxxxxxx>
---
 drivers/gpu/drm/virtio/virtgpu_display.c | 1 -
 drivers/gpu/drm/virtio/virtgpu_kms.c     | 2 ++
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/virtio/virtgpu_display.c b/drivers/gpu/drm/virtio/virtgpu_display.c
index d211d4e98b46..d314e3c672f2 100644
--- a/drivers/gpu/drm/virtio/virtgpu_display.c
+++ b/drivers/gpu/drm/virtio/virtgpu_display.c
@@ -377,6 +377,5 @@ int virtio_gpu_modeset_init(struct virtio_gpu_device *vgdev)
 
 void virtio_gpu_modeset_fini(struct virtio_gpu_device *vgdev)
 {
-	virtio_gpu_fbdev_fini(vgdev);
 	drm_mode_config_cleanup(vgdev->ddev);
 }
diff --git a/drivers/gpu/drm/virtio/virtgpu_kms.c b/drivers/gpu/drm/virtio/virtgpu_kms.c
index 6400506a06b0..b994ecfdd378 100644
--- a/drivers/gpu/drm/virtio/virtgpu_kms.c
+++ b/drivers/gpu/drm/virtio/virtgpu_kms.c
@@ -259,6 +259,8 @@ void virtio_gpu_driver_unload(struct drm_device *dev)
 	flush_work(&vgdev->config_changed_work);
 	vgdev->vdev->config->del_vqs(vgdev->vdev);
 
+	if (virtio_gpu_fbdev)
+		virtio_gpu_fbdev_fini(vgdev);
 	virtio_gpu_modeset_fini(vgdev);
 	virtio_gpu_ttm_fini(vgdev);
 	virtio_gpu_free_vbufs(vgdev);
-- 
2.17.1

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux