Skip to contentSkip to conversation

drm & vgaarb: handle vgacon removal in vgaarb.

PATCH Superseded Gerd Hoffmann 2 participants 12 messages Feb 22, 2019 – Feb 28, 2019

Subsystems (5)

v4 of 7 Superseded Latest is v7 →

lore
Share & tools
lore

Gerd Hoffmann

author maintainer
#0 lore raw

v4 cover drm & vgaarb: handle vgacon removal in vgaarb.

Gerd Hoffmann (2):
drm: move i915_kick_out_vgacon to vgaarb drm/qxl: remove conflicting framebuffers earlier

 include/drm/drm_fb_helper.h     | 14 +++++++++++---
 include/linux/vgaarb.h          |  2 ++
 drivers/gpu/drm/i915/i915_drv.c | 43 -----------------------------------------
 drivers/gpu/drm/qxl/qxl_drv.c   |  5 ++++-
 drivers/gpu/vga/vgaarb.c        | 38 ++++++++++++++++++++++++++++++++++++
 5 files changed, 55 insertions(+), 47 deletions(-)
Signature · 6 lines
2.9.3

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

PATCH v4 1/2 drm: move i915_kick_out_vgacon to vgaarb

Also rename it and call it automatically from drm_fb_helper_remove_conflicting_pci_framebuffers()

---
 include/drm/drm_fb_helper.h     | 14 +++++++++++---
 include/linux/vgaarb.h          |  2 ++
 drivers/gpu/drm/i915/i915_drv.c | 43 -----------------------------------------
 drivers/gpu/vga/vgaarb.c        | 38 ++++++++++++++++++++++++++++++++++++
 4 files changed, 51 insertions(+), 46 deletions(-)
include/drm/drm_fb_helper.h +11 -3
index bb9acea61369..286d58efed5d 100644
@@ -36,6 +36,7 @@ struct drm_fb_helper;
 #include <drm/drm_crtc.h>
 #include <drm/drm_device.h>
 #include <linux/kgdb.h>
+#include <linux/vgaarb.h>
 
 enum mode_set_atomic {
 	LEAVE_ATOMIC_MODE_SET,
@@ -642,11 +643,18 @@ drm_fb_helper_remove_conflicting_pci_framebuffers(struct pci_dev *pdev,
 						  int resource_id,
 						  const char *name)
 {
+	int ret = 0;
+
+	/*
+	 * WARNING: Apparently we must kick fbdev drivers before vgacon,
+	 * otherwise the vga fbdev driver falls over.
+	 */
 #if IS_REACHABLE(CONFIG_FB)
-	return remove_conflicting_pci_framebuffers(pdev, resource_id, name);
-#else
-	return 0;
+	ret = remove_conflicting_pci_framebuffers(pdev, resource_id, name);
 #endif
+	if (ret == 0)
+		ret = vga_remove_vgacon(pdev);
+	return ret;
 }
 
 #endif
include/linux/vgaarb.h +2 -0
index ee162e3e879b..553b34c8b5f7 100644
@@ -125,9 +125,11 @@ extern void vga_put(struct pci_dev *pdev, unsigned int rsrc);
 #ifdef CONFIG_VGA_ARB
 extern struct pci_dev *vga_default_device(void);
 extern void vga_set_default_device(struct pci_dev *pdev);
+extern int vga_remove_vgacon(struct pci_dev *pdev);
 #else
 static inline struct pci_dev *vga_default_device(void) { return NULL; };
 static inline void vga_set_default_device(struct pci_dev *pdev) { };
+static inline int vga_remove_vgacon(struct pci_dev *pdev) { return 0; };
 #endif
 
 /*
drivers/gpu/drm/i915/i915_drv.c +0 -43

61 lines not on this page · raw message

drivers/gpu/vga/vgaarb.c +38 -0
index dc8e039bfab5..524092a43de6 100644
@@ -48,6 +48,8 @@
 #include <linux/miscdevice.h>
 #include <linux/slab.h>
 #include <linux/screen_info.h>
+#include <linux/vt.h>
+#include <linux/console.h>
 
 #include <linux/uaccess.h>
 
@@ -168,6 +170,42 @@ void vga_set_default_device(struct pci_dev *pdev)
 	vga_default = pci_dev_get(pdev);
 }
 
+#if !defined(CONFIG_VGA_CONSOLE)
+int vga_remove_vgacon(struct pci_dev *pdev)
+{
+        return 0;
+}
+#elif !defined(CONFIG_DUMMY_CONSOLE)
+int vga_remove_vgacon(struct pci_dev *pdev)
+{
+        return -ENODEV;
+}
+#else
+int vga_remove_vgacon(struct pci_dev *pdev)
+{
+        int ret = 0;
+
+	if (pdev != vga_default)
+		return 0;
+	vgaarb_info(&pdev->dev, "deactivate vga console\n");
+
+        console_lock();
+        if (con_is_bound(&vga_con))
+                ret = do_take_over_console(&dummy_con, 0, MAX_NR_CONSOLES - 1, 1);
+        if (ret == 0) {
+                ret = do_unregister_con_driver(&vga_con);
+
+                /* Ignore "already unregistered". */
+                if (ret == -ENODEV)
+                        ret = 0;
+        }
+        console_unlock();
+
+        return ret;
+}
+#endif
+EXPORT_SYMBOL(vga_remove_vgacon);
+
 static inline void vga_irq_set_state(struct vga_device *vgadev, bool state)
 {
 	if (vgadev->irq_set_state)
Signature · 6 lines
2.9.3

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on v4 1/2
#2 lore raw

Re: [PATCH v4 1/2] drm: move i915_kick_out_vgacon to vgaarb

Quoted 2 lines · Gerd Hoffmann

Also rename it and call it automatically from drm_fb_helper_remove_conflicting_pci_framebuffers()

Yeah this looks neat.

Quoted 103 lines
---
 include/drm/drm_fb_helper.h     | 14 +++++++++++---
 include/linux/vgaarb.h          |  2 ++
 drivers/gpu/drm/i915/i915_drv.c | 43 -----------------------------------------
 drivers/gpu/vga/vgaarb.c        | 38 ++++++++++++++++++++++++++++++++++++
 4 files changed, 51 insertions(+), 46 deletions(-)
include/drm/drm_fb_helper.h +11 -3
index bb9acea61369..286d58efed5d 100644
@@ -36,6 +36,7 @@ struct drm_fb_helper;
 #include <drm/drm_crtc.h>
 #include <drm/drm_device.h>
 #include <linux/kgdb.h>
+#include <linux/vgaarb.h>
 
 enum mode_set_atomic {
 	LEAVE_ATOMIC_MODE_SET,
@@ -642,11 +643,18 @@ drm_fb_helper_remove_conflicting_pci_framebuffers(struct pci_dev *pdev,
 						  int resource_id,
 						  const char *name)
 {
+	int ret = 0;
+
+	/*
+	 * WARNING: Apparently we must kick fbdev drivers before vgacon,
+	 * otherwise the vga fbdev driver falls over.
+	 */
 #if IS_REACHABLE(CONFIG_FB)
-	return remove_conflicting_pci_framebuffers(pdev, resource_id, name);
-#else
-	return 0;
+	ret = remove_conflicting_pci_framebuffers(pdev, resource_id, name);
 #endif
+	if (ret == 0)
+		ret = vga_remove_vgacon(pdev);
+	return ret;
 }
 
 #endif
include/linux/vgaarb.h +2 -0
index ee162e3e879b..553b34c8b5f7 100644
@@ -125,9 +125,11 @@ extern void vga_put(struct pci_dev *pdev, unsigned int rsrc);
 #ifdef CONFIG_VGA_ARB
 extern struct pci_dev *vga_default_device(void);
 extern void vga_set_default_device(struct pci_dev *pdev);
+extern int vga_remove_vgacon(struct pci_dev *pdev);
 #else
 static inline struct pci_dev *vga_default_device(void) { return NULL; };
 static inline void vga_set_default_device(struct pci_dev *pdev) { };
+static inline int vga_remove_vgacon(struct pci_dev *pdev) { return 0; };
 #endif
 
 /*
drivers/gpu/drm/i915/i915_drv.c +0 -33
index 6630212f2faf..0e87eef542da 100644
@@ -757,39 +757,6 @@ static int i915_kick_out_firmware_fb(struct drm_i915_private *dev_priv)
 	return ret;
 }
 
-#if !defined(CONFIG_VGA_CONSOLE)
-static int i915_kick_out_vgacon(struct drm_i915_private *dev_priv)
-{
-	return 0;
-}
-#elif !defined(CONFIG_DUMMY_CONSOLE)
-static int i915_kick_out_vgacon(struct drm_i915_private *dev_priv)
-{
-	return -ENODEV;
-}
-#else
-static int i915_kick_out_vgacon(struct drm_i915_private *dev_priv)
-{
-	int ret = 0;
-
-	DRM_INFO("Replacing VGA console driver\n");
-
-	console_lock();
-	if (con_is_bound(&vga_con))
-		ret = do_take_over_console(&dummy_con, 0, MAX_NR_CONSOLES - 1, 1);
-	if (ret == 0) {
-		ret = do_unregister_con_driver(&vga_con);
-
-		/* Ignore "already unregistered". */
-		if (ret == -ENODEV)
-			ret = 0;
-	}
-	console_unlock();
-
-	return ret;
-}
-#endif
-
 static void intel_init_dpio(struct drm_i915_private *dev_priv)
 {
 	/*

drivers/gpu/drm/i915/i915_drv.c static int i915_driver_init_hw(struct drm_i915_private *dev_priv) · line 1380

Quoted 8 lines
drivers/gpu/drm/i915/i915_drv.c +0 -4
@@ -1410,22 +1377,12 @@ static int i915_driver_init_hw(struct drm_i915_private *dev_priv)
 	if (ret)
 		goto err_perf;
 
-	/*
-	 * WARNING: Apparently we must kick fbdev drivers before vgacon,
-	 * otherwise the vga fbdev driver falls over.
-	 */
 	ret = i915_kick_out_firmware_fb(dev_priv);

This needs to be replaced with a call to drm_fb_helper_remove_conflicting_pci_framebuffers, because the above wrapper hasn't been converted yet. Otherwise you end up removing the vgacon unbind from i915.

Quoted 28 lines
drivers/gpu/drm/i915/i915_drv.c +0 -6
 	if (ret) {
 		DRM_ERROR("failed to remove conflicting framebuffer drivers\n");
 		goto err_ggtt;
 	}
 
-	ret = i915_kick_out_vgacon(dev_priv);
-	if (ret) {
-		DRM_ERROR("failed to remove conflicting VGA console\n");
-		goto err_ggtt;
-	}
-
 	ret = i915_ggtt_init_hw(dev_priv);
 	if (ret)
 		goto err_ggtt;
drivers/gpu/vga/vgaarb.c +2 -0
index dc8e039bfab5..524092a43de6 100644
@@ -48,6 +48,8 @@
 #include <linux/miscdevice.h>
 #include <linux/slab.h>
 #include <linux/screen_info.h>
+#include <linux/vt.h>
+#include <linux/console.h>
 
 #include <linux/uaccess.h>
 

drivers/gpu/vga/vgaarb.c void vga_set_default_device(struct pci_dev *pdev) · line 172

Quoted 3 lines
drivers/gpu/vga/vgaarb.c +0 -0
@@ -168,6 +170,42 @@ void vga_set_default_device(struct pci_dev *pdev)
 	vga_default = pci_dev_get(pdev);
 }
 

kerneldoc would be nice here.

Quoted 26 lines
drivers/gpu/vga/vgaarb.c +26 -0
+#if !defined(CONFIG_VGA_CONSOLE)
+int vga_remove_vgacon(struct pci_dev *pdev)
+{
+        return 0;
+}
+#elif !defined(CONFIG_DUMMY_CONSOLE)
+int vga_remove_vgacon(struct pci_dev *pdev)
+{
+        return -ENODEV;
+}
+#else
+int vga_remove_vgacon(struct pci_dev *pdev)
+{
+        int ret = 0;
+
+	if (pdev != vga_default)
+		return 0;
+	vgaarb_info(&pdev->dev, "deactivate vga console\n");
+
+        console_lock();
+        if (con_is_bound(&vga_con))
+                ret = do_take_over_console(&dummy_con, 0, MAX_NR_CONSOLES - 1, 1);
+        if (ret == 0) {
+                ret = do_unregister_con_driver(&vga_con);
+
+                /* Ignore "already unregistered". */

drivers/gpu/vga/vgaarb.c void vga_set_default_device(struct pci_dev *pdev) · line 208

Quoted 10 lines
drivers/gpu/vga/vgaarb.c +10 -0
+                if (ret == -ENODEV)
+                        ret = 0;
+        }
+        console_unlock();
+
+        return ret;
+}
+#endif
+EXPORT_SYMBOL(vga_remove_vgacon);
+

Asides from the comments, lgtm. Of course we'll need intel-gfx-ci to approve too :-) Please cc intel-gfx on the next version for the entire patcheset (our CI doesn't pick up incomplete patchesets).

Quoted 6 lines
drivers/gpu/vga/vgaarb.c +0 -0
 static inline void vga_irq_set_state(struct vga_device *vgadev, bool state)
 {
 	if (vgadev->irq_set_state)
Signature · 1 line
2.9.3
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
#3 lore raw

Re: [PATCH v4 1/2] drm: move i915_kick_out_vgacon to vgaarb

Hi,

Quoted 10 lines

drivers/gpu/drm/i915/i915_drv.c static int i915_driver_init_hw(struct drm_i915_private *dev_priv) · line 1380

Quoted 5 lines
drivers/gpu/drm/i915/i915_drv.c +0 -4
-	/*
-	 * WARNING: Apparently we must kick fbdev drivers before vgacon,
-	 * otherwise the vga fbdev driver falls over.
-	 */
 	ret = i915_kick_out_firmware_fb(dev_priv);

This needs to be replaced with a call to drm_fb_helper_remove_conflicting_pci_framebuffers, because the above wrapper hasn't been converted yet. Otherwise you end up removing the vgacon unbind from i915.

Ah, little but important difference I didn't notice on the first look. That wrapper calls the non-pci version. But seems it isn't that easy to switch over because the framebuffer is in stolen memory instead of a pci bar ...

Quoted 6 lines

drivers/gpu/drm/i915/i915_drv.c static int i915_driver_init_hw(struct drm_i915_private *dev_priv) · line 1423

Quoted 6 lines
drivers/gpu/drm/i915/i915_drv.c +0 -1
 	if (ret) {
 		DRM_ERROR("failed to remove conflicting framebuffer drivers\n");
 		goto err_ggtt;
 	}
 
-	ret = i915_kick_out_vgacon(dev_priv);

... but we can continue to just call vga_remove_vgacon() here.

Quoted 3 lines

Asides from the comments, lgtm. Of course we'll need intel-gfx-ci to approve too :-) Please cc intel-gfx on the next version for the entire patcheset (our CI doesn't pick up incomplete patchesets).

Ok, will do.

cheers,
Gerd

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#4 lore raw

Re: [PATCH v4 1/2] drm: move i915_kick_out_vgacon to vgaarb

Quoted 14 lines · Gerd Hoffmann

Hi,

Quoted 10 lines

drivers/gpu/drm/i915/i915_drv.c static int i915_driver_init_hw(struct drm_i915_private *dev_priv) · line 1380

Quoted 5 lines
drivers/gpu/drm/i915/i915_drv.c +0 -4
-   /*
-    * WARNING: Apparently we must kick fbdev drivers before vgacon,
-    * otherwise the vga fbdev driver falls over.
-    */
    ret = i915_kick_out_firmware_fb(dev_priv);

This needs to be replaced with a call to drm_fb_helper_remove_conflicting_pci_framebuffers, because the above wrapper hasn't been converted yet. Otherwise you end up removing the vgacon unbind from i915.

Quoted 4 lines

Ah, little but important difference I didn't notice on the first look. That wrapper calls the non-pci version. But seems it isn't that easy to switch over because the framebuffer is in stolen memory instead of a pci bar ...

stolen memory is where the fb physically resides. the pci bar is how you access it (as long as you take all the pci bars). From a quick look i915 and pci version of remove_conflicting_fb matched. -Daniel

Quoted 18 lines
Quoted 6 lines
Quoted 6 lines
    if (ret) {
            DRM_ERROR("failed to remove conflicting framebuffer drivers\n");
            goto err_ggtt;
    }

- ret = i915_kick_out_vgacon(dev_priv);

... but we can continue to just call vga_remove_vgacon() here.

Quoted 3 lines

Asides from the comments, lgtm. Of course we'll need intel-gfx-ci to approve too :-) Please cc intel-gfx on the next version for the entire patcheset (our CI doesn't pick up incomplete patchesets).

Ok, will do.

cheers,
Gerd

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
author maintainer
#5 lore raw

Re: [PATCH v4 1/2] drm: move i915_kick_out_vgacon to vgaarb

Quoted 15 lines · Daniel Vetter
Quoted 14 lines · Gerd Hoffmann

Hi,

Quoted 10 lines

drivers/gpu/drm/i915/i915_drv.c static int i915_driver_init_hw(struct drm_i915_private *dev_priv) · line 1380

Quoted 5 lines
drivers/gpu/drm/i915/i915_drv.c +0 -4
-   /*
-    * WARNING: Apparently we must kick fbdev drivers before vgacon,
-    * otherwise the vga fbdev driver falls over.
-    */
    ret = i915_kick_out_firmware_fb(dev_priv);

This needs to be replaced with a call to drm_fb_helper_remove_conflicting_pci_framebuffers, because the above wrapper hasn't been converted yet. Otherwise you end up removing the vgacon unbind from i915.

Quoted 8 lines
Quoted 4 lines

Ah, little but important difference I didn't notice on the first look. That wrapper calls the non-pci version. But seems it isn't that easy to switch over because the framebuffer is in stolen memory instead of a pci bar ...

stolen memory is where the fb physically resides. the pci bar is how you access it (as long as you take all the pci bars). From a quick look i915 and pci version of remove_conflicting_fb matched.

Well, it is

	ap->ranges[0].base = ggtt->gmadr.start;
	ap->ranges[0].size = ggtt->mappable_end;

vs.

	ap->ranges[0].base = pci_resource_start(pdev, res_id);
	ap->ranges[0].size = pci_resource_len(pdev, res_id);

So not obvious that they are the same. At least to me, maybe it is a different story for someone knowing the i915 driver better.

thanks,
Gerd

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#6 lore raw

Re: [PATCH v4 1/2] drm: move i915_kick_out_vgacon to vgaarb

Quoted 30 lines · Gerd Hoffmann
Quoted 15 lines · Daniel Vetter
Quoted 14 lines · Gerd Hoffmann

Hi,

Quoted 10 lines

drivers/gpu/drm/i915/i915_drv.c static int i915_driver_init_hw(struct drm_i915_private *dev_priv) · line 1380

Quoted 5 lines
drivers/gpu/drm/i915/i915_drv.c +0 -4
-   /*
-    * WARNING: Apparently we must kick fbdev drivers before vgacon,
-    * otherwise the vga fbdev driver falls over.
-    */
    ret = i915_kick_out_firmware_fb(dev_priv);

This needs to be replaced with a call to drm_fb_helper_remove_conflicting_pci_framebuffers, because the above wrapper hasn't been converted yet. Otherwise you end up removing the vgacon unbind from i915.

Quoted 8 lines
Quoted 4 lines

Ah, little but important difference I didn't notice on the first look. That wrapper calls the non-pci version. But seems it isn't that easy to switch over because the framebuffer is in stolen memory instead of a pci bar ...

stolen memory is where the fb physically resides. the pci bar is how you access it (as long as you take all the pci bars). From a quick look i915 and pci version of remove_conflicting_fb matched.

Well, it is

	ap->ranges[0].base = ggtt->gmadr.start;
	ap->ranges[0].size = ggtt->mappable_end;
Quoted 7 lines

vs.

	ap->ranges[0].base = pci_resource_start(pdev, res_id);
	ap->ranges[0].size = pci_resource_len(pdev, res_id);

So not obvious that they are the same. At least to me, maybe it is a different story for someone knowing the i915 driver better.

It's one of the pci bars, so amounts to the same. But yeah not obvious if you don't know that.
-Daniel

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
#7 lore raw

Re: [PATCH v4 1/2] drm: move i915_kick_out_vgacon to vgaarb

Quoted 11 lines
Quoted 11 lines
Quoted 3 lines

stolen memory is where the fb physically resides. the pci bar is how you access it (as long as you take all the pci bars). From a quick look i915 and pci version of remove_conflicting_fb matched.

Well, it is

	ap->ranges[0].base = ggtt->gmadr.start;
	ap->ranges[0].size = ggtt->mappable_end;

vs.

Quoted 8 lines
Quoted 5 lines
	ap->ranges[0].base = pci_resource_start(pdev, res_id);
	ap->ranges[0].size = pci_resource_len(pdev, res_id);

So not obvious that they are the same. At least to me, maybe it is a different story for someone knowing the i915 driver better.

It's one of the pci bars, so amounts to the same. But yeah not obvious if you don't know that.

On my system (kaby lake) it happens to be pci bar 2, is that true for all igd devices?

cheers,
Gerd

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

author maintainer
#8 lore raw

PATCH v4 2/2 drm/qxl: remove conflicting framebuffers earlier

In reply to Gerd Hoffmann

Add error checking while being at it.

---
 drivers/gpu/drm/qxl/qxl_drv.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/qxl/qxl_drv.c +4 -1
index bb81e310eb6d..578d867a81d5 100644
@@ -79,6 +79,10 @@ qxl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	if (ret)
 		goto free_dev;
 
+	ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, 0, "qxl");
+	if (ret)
+		goto disable_pci;
+
 	ret = qxl_device_init(qdev, &qxl_driver, pdev);
 	if (ret)
 		goto disable_pci;
@@ -94,7 +98,6 @@ qxl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	if (ret)
 		goto modeset_cleanup;
 
-	drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, 0, "qxl");
 	drm_fbdev_generic_setup(&qdev->ddev, 32);
 	return 0;
 
Signature · 1 line
2.9.3
Reviewed-by on v4 2/2
#9 lore raw

Re: [PATCH v4 2/2] drm/qxl: remove conflicting framebuffers earlier

Quoted 3 lines · Gerd Hoffmann

Add error checking while being at it.

Quoted 30 lines
---
 drivers/gpu/drm/qxl/qxl_drv.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/qxl/qxl_drv.c +4 -1
index bb81e310eb6d..578d867a81d5 100644
@@ -79,6 +79,10 @@ qxl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	if (ret)
 		goto free_dev;
 
+	ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, 0, "qxl");
+	if (ret)
+		goto disable_pci;
+
 	ret = qxl_device_init(qdev, &qxl_driver, pdev);
 	if (ret)
 		goto disable_pci;
@@ -94,7 +98,6 @@ qxl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	if (ret)
 		goto modeset_cleanup;
 
-	drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, 0, "qxl");
 	drm_fbdev_generic_setup(&qdev->ddev, 32);
 	return 0;
 
Signature · 1 line
2.9.3
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Spice-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/spice-devel
Reviewed-by on v4 2/2
#10 lore raw

Re: [PATCH v4 2/2] drm/qxl: remove conflicting framebuffers earlier

In reply to Gerd Hoffmann
Quoted 3 lines · Gerd Hoffmann

Add error checking while being at it.

Quoted 30 lines
---
 drivers/gpu/drm/qxl/qxl_drv.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/qxl/qxl_drv.c +4 -1
index bb81e310eb6d..578d867a81d5 100644
@@ -79,6 +79,10 @@ qxl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	if (ret)
 		goto free_dev;
 
+	ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, 0, "qxl");
+	if (ret)
+		goto disable_pci;
+
 	ret = qxl_device_init(qdev, &qxl_driver, pdev);
 	if (ret)
 		goto disable_pci;
@@ -94,7 +98,6 @@ qxl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	if (ret)
 		goto modeset_cleanup;
 
-	drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, 0, "qxl");
 	drm_fbdev_generic_setup(&qdev->ddev, 32);
 	return 0;
 
Signature · 1 line
2.9.3
Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
author maintainer
#11 lore raw

PATCH v4 2/2 drm/qxl: remove conflicting framebuffers earlier

In reply to Gerd Hoffmann

Add error checking while being at it.

---
 drivers/gpu/drm/qxl/qxl_drv.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/qxl/qxl_drv.c +4 -1
index bb81e310eb6d..578d867a81d5 100644
@@ -79,6 +79,10 @@ qxl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	if (ret)
 		goto free_dev;
 
+	ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, 0, "qxl");
+	if (ret)
+		goto disable_pci;
+
 	ret = qxl_device_init(qdev, &qxl_driver, pdev);
 	if (ret)
 		goto disable_pci;
@@ -94,7 +98,6 @@ qxl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	if (ret)
 		goto modeset_cleanup;
 
-	drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, 0, "qxl");
 	drm_fbdev_generic_setup(&qdev->ddev, 32);
 	return 0;
 
Signature · 1 line
2.9.3