Skip to contentSkip to conversation

drm: some qemu driver unload fixes.

PATCH In review Gerd Hoffmann 3 participants 11 messages Apr 1, 2019 – Apr 2, 2019

Subsystems (4)
lore
Share & tools
lore

Gerd Hoffmann

author maintainer
#0 lore raw

cover drm: some qemu driver unload fixes.

Gerd Hoffmann (3):
drm/virtio: add missing drm_atomic_helper_shutdown() call. drm/bochs: add missing drm_atomic_helper_shutdown() call. drm/cirrus: add missing drm_helper_force_disable_all() call.

 drivers/gpu/drm/bochs/bochs_kms.c        | 1 +
 drivers/gpu/drm/cirrus/cirrus_mode.c     | 1 +
 drivers/gpu/drm/virtio/virtgpu_display.c | 1 +
 3 files changed, 3 insertions(+)
Signature · 6 lines
2.18.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
author maintainer
#1 lore raw

PATCH 1/3 drm/virtio: add missing drm_atomic_helper_shutdown() call.

---
 drivers/gpu/drm/virtio/virtgpu_display.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/virtio/virtgpu_display.c +1 -0
index 653ec7d0bf4d..86843a4d6102 100644
@@ -385,5 +385,6 @@ void virtio_gpu_modeset_fini(struct virtio_gpu_device *vgdev)
 
 	for (i = 0 ; i < vgdev->num_scanouts; ++i)
 		kfree(vgdev->outputs[i].edid);
+	drm_atomic_helper_shutdown(vgdev->ddev);
 	drm_mode_config_cleanup(vgdev->ddev);
 }
Signature · 1 line
2.18.1
#2 lore raw

Re: [PATCH 1/3] drm/virtio: add missing drm_atomic_helper_shutdown() call.

Please atleast mention here why it is required?

-Mukesh

Quoted 16 lines · Gerd Hoffmann
---
  drivers/gpu/drm/virtio/virtgpu_display.c | 1 +
  1 file changed, 1 insertion(+)
drivers/gpu/drm/virtio/virtgpu_display.c +1 -0
index 653ec7d0bf4d..86843a4d6102 100644
@@ -385,5 +385,6 @@ void virtio_gpu_modeset_fini(struct virtio_gpu_device *vgdev)
 
  	for (i = 0 ; i < vgdev->num_scanouts; ++i)
  		kfree(vgdev->outputs[i].edid);
+	drm_atomic_helper_shutdown(vgdev->ddev);
  	drm_mode_config_cleanup(vgdev->ddev);
  }
#3 lore raw

Re: [PATCH 1/3] drm/virtio: add missing drm_atomic_helper_shutdown() call.

In reply to Gerd Hoffmann

Please atleast mention here why it is required?

-Mukesh

Quoted 16 lines · Gerd Hoffmann
---
  drivers/gpu/drm/virtio/virtgpu_display.c | 1 +
  1 file changed, 1 insertion(+)
drivers/gpu/drm/virtio/virtgpu_display.c +1 -0
index 653ec7d0bf4d..86843a4d6102 100644
@@ -385,5 +385,6 @@ void virtio_gpu_modeset_fini(struct virtio_gpu_device *vgdev)
 
  	for (i = 0 ; i < vgdev->num_scanouts; ++i)
  		kfree(vgdev->outputs[i].edid);
+	drm_atomic_helper_shutdown(vgdev->ddev);
  	drm_mode_config_cleanup(vgdev->ddev);
  }
author maintainer
#4 lore raw

PATCH 1/3 drm/virtio: add missing drm_atomic_helper_shutdown() call.

In reply to Gerd Hoffmann
---
 drivers/gpu/drm/virtio/virtgpu_display.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/virtio/virtgpu_display.c +1 -0
index 653ec7d0bf4d..86843a4d6102 100644
@@ -385,5 +385,6 @@ void virtio_gpu_modeset_fini(struct virtio_gpu_device *vgdev)
 
 	for (i = 0 ; i < vgdev->num_scanouts; ++i)
 		kfree(vgdev->outputs[i].edid);
+	drm_atomic_helper_shutdown(vgdev->ddev);
 	drm_mode_config_cleanup(vgdev->ddev);
 }
Signature · 1 line
2.18.1
author maintainer
#5 lore raw

PATCH 2/3 drm/bochs: add missing drm_atomic_helper_shutdown() call.

In reply to Gerd Hoffmann
---
 drivers/gpu/drm/bochs/bochs_kms.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/bochs/bochs_kms.c +1 -0
index 9e7cd6b34106..93cb27f93d39 100644
@@ -293,6 +293,7 @@ int bochs_kms_init(struct bochs_device *bochs)
 void bochs_kms_fini(struct bochs_device *bochs)
 {
 	if (bochs->mode_config_initialized) {
+		drm_atomic_helper_shutdown(bochs->dev);
 		drm_mode_config_cleanup(bochs->dev);
 		bochs->mode_config_initialized = false;
 	}
Signature · 1 line
2.18.1
Reviewed-by on v1 2/3
#6 lore raw

Re: [PATCH 2/3] drm/bochs: add missing drm_atomic_helper_shutdown() call.

drivers/gpu/drm/bochs/bochs_kms.c int bochs_kms_init(struct bochs_device *bochs) · line 295

Quoted 13 lines · Gerd Hoffmann
---
 drivers/gpu/drm/bochs/bochs_kms.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/bochs/bochs_kms.c +0 -0
index 9e7cd6b34106..93cb27f93d39 100644
@@ -293,6 +293,7 @@ int bochs_kms_init(struct bochs_device *bochs)
 void bochs_kms_fini(struct bochs_device *bochs)
 {
 	if (bochs->mode_config_initialized) {

This mode_config_initialized is hilarious. I think (from looking at git history and all) this started in radeon, back when kms was an add-on, and radeon.ko still supported ums. Then it was dutifully copypasted into cirrus, bochs, mgag200, hisilicon and also amdgpu.

Afaict none of these drivers need this (but I didn't bother to review amdgpu and radeon fully). Would be nice little cleanup to follow up with.

Anyway, on your 3 patches here:

Quoted 7 lines
drivers/gpu/drm/bochs/bochs_kms.c +1 -0
+		drm_atomic_helper_shutdown(bochs->dev);
 		drm_mode_config_cleanup(bochs->dev);
 		bochs->mode_config_initialized = false;
 	}
Signature · 1 line
2.18.1
Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
Reviewed-by on v1 2/3
#7 lore raw

Re: [PATCH 2/3] drm/bochs: add missing drm_atomic_helper_shutdown() call.

In reply to Gerd Hoffmann

drivers/gpu/drm/bochs/bochs_kms.c int bochs_kms_init(struct bochs_device *bochs) · line 295

Quoted 13 lines · Gerd Hoffmann
---
 drivers/gpu/drm/bochs/bochs_kms.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/bochs/bochs_kms.c +0 -0
index 9e7cd6b34106..93cb27f93d39 100644
@@ -293,6 +293,7 @@ int bochs_kms_init(struct bochs_device *bochs)
 void bochs_kms_fini(struct bochs_device *bochs)
 {
 	if (bochs->mode_config_initialized) {

This mode_config_initialized is hilarious. I think (from looking at git history and all) this started in radeon, back when kms was an add-on, and radeon.ko still supported ums. Then it was dutifully copypasted into cirrus, bochs, mgag200, hisilicon and also amdgpu.

Afaict none of these drivers need this (but I didn't bother to review amdgpu and radeon fully). Would be nice little cleanup to follow up with.

Anyway, on your 3 patches here:

Quoted 7 lines
drivers/gpu/drm/bochs/bochs_kms.c +1 -0
+		drm_atomic_helper_shutdown(bochs->dev);
 		drm_mode_config_cleanup(bochs->dev);
 		bochs->mode_config_initialized = false;
 	}
Signature · 1 line
2.18.1
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
author maintainer
#8 lore raw

PATCH 2/3 drm/bochs: add missing drm_atomic_helper_shutdown() call.

In reply to Gerd Hoffmann
---
 drivers/gpu/drm/bochs/bochs_kms.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/bochs/bochs_kms.c +1 -0
index 9e7cd6b34106..93cb27f93d39 100644
@@ -293,6 +293,7 @@ int bochs_kms_init(struct bochs_device *bochs)
 void bochs_kms_fini(struct bochs_device *bochs)
 {
 	if (bochs->mode_config_initialized) {
+		drm_atomic_helper_shutdown(bochs->dev);
 		drm_mode_config_cleanup(bochs->dev);
 		bochs->mode_config_initialized = false;
 	}
Signature · 1 line
2.18.1
author maintainer
#9 lore raw

PATCH 3/3 drm/cirrus: add missing drm_helper_force_disable_all() call.

In reply to Gerd Hoffmann
---
 drivers/gpu/drm/cirrus/cirrus_mode.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/cirrus/cirrus_mode.c +1 -0
index 7f9bc32af685..32ce2c1040b4 100644
@@ -615,6 +615,7 @@ void cirrus_modeset_fini(struct cirrus_device *cdev)
 	cirrus_fbdev_fini(cdev);
 
 	if (cdev->mode_info.mode_config_initialized) {
+		drm_helper_force_disable_all(cdev->dev);
 		drm_mode_config_cleanup(cdev->dev);
 		cdev->mode_info.mode_config_initialized = false;
 	}
Signature · 1 line
2.18.1
author maintainer
#10 lore raw

PATCH 3/3 drm/cirrus: add missing drm_helper_force_disable_all() call.

In reply to Gerd Hoffmann
---
 drivers/gpu/drm/cirrus/cirrus_mode.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/cirrus/cirrus_mode.c +1 -0
index 7f9bc32af685..32ce2c1040b4 100644
@@ -615,6 +615,7 @@ void cirrus_modeset_fini(struct cirrus_device *cdev)
 	cirrus_fbdev_fini(cdev);
 
 	if (cdev->mode_info.mode_config_initialized) {
+		drm_helper_force_disable_all(cdev->dev);
 		drm_mode_config_cleanup(cdev->dev);
 		cdev->mode_info.mode_config_initialized = false;
 	}
Signature · 1 line
2.18.1