Skip to contentSkip to conversation

remove_conflicting_framebuffers() cleanup

PATCH Superseded Michał Mirosław 19 participants 115 messages Nov 24, 2017 – Sep 5, 2018 10 messages not in the archive

Subsystems (15)
lore
Share & tools
lore
#0 lore raw

cover remove_conflicting_framebuffers() cleanup

This series cleans up duplicated code for replacing firmware FB driver with proper DRI driver and adds handover support to Tegra driver.

The last patch is here because it uses new semantics of remove_conflicting_framebuffers() from this series. This can be considered independently, though.

---

Michał Mirosław (13):
fbdev: show fbdev number for debugging
fbdev: add remove_conflicting_pci_framebuffers() drm/amdgpu: use simpler remove_conflicting_pci_framebuffers() drm/bochs: use simpler remove_conflicting_pci_framebuffers() drm/cirrus: use simpler remove_conflicting_pci_framebuffers() drm/mgag200: use simpler remove_conflicting_pci_framebuffers() drm/radeon: use simpler remove_conflicting_pci_framebuffers() drm/virtio: use simpler remove_conflicting_pci_framebuffers()
staging: sm750fb: use simpler remove_conflicting_pci_framebuffers()
fbdev: allow apertures == NULL in remove_conflicting_framebuffers() drm/vc4: use simpler remove_conflicting_framebuffers(NULL) drm/sun4i: use simpler remove_conflicting_framebuffers(NULL) drm/tegra: kick out simplefb

 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c  | 23 +-----------------
 drivers/gpu/drm/bochs/bochs_drv.c        | 18 +-------------
 drivers/gpu/drm/cirrus/cirrus_drv.c      | 23 +-----------------
 drivers/gpu/drm/mgag200/mgag200_drv.c    | 21 +----------------
 drivers/gpu/drm/mgag200/mgag200_main.c   |  9 -------
 drivers/gpu/drm/radeon/radeon_drv.c      | 23 +-----------------
 drivers/gpu/drm/sun4i/sun4i_drv.c        | 18 +-------------
 drivers/gpu/drm/tegra/drm.c              |  4 ++++
 drivers/gpu/drm/vc4/vc4_drv.c            | 20 +---------------
 drivers/gpu/drm/virtio/virtgpu_drm_bus.c | 24 +++----------------
 drivers/staging/sm750fb/sm750.c          | 22 +-----------------
 drivers/video/fbdev/core/fbmem.c         | 40 ++++++++++++++++++++++++++++++--
 include/drm/drm_fb_helper.h              | 12 ++++++++++
 include/linux/fb.h                       |  2 ++
 14 files changed, 67 insertions(+), 192 deletions(-)
Signature · 6 lines
2.11.0

_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
#1 lore raw

PATCH 1/13 fbdev: show fbdev number for debugging

---
 drivers/video/fbdev/core/fbmem.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/video/fbdev/core/fbmem.c +2 -2
index f741ba8df01b..30a18d4c9de4 100644
@@ -1618,8 +1618,8 @@ static int do_remove_conflicting_framebuffers(struct apertures_struct *a,
 			(primary && gen_aper && gen_aper->count &&
 			 gen_aper->ranges[0].base == VGA_FB_PHYS)) {
 
-			printk(KERN_INFO "fb: switching to %s from %s\n",
-			       name, registered_fb[i]->fix.id);
+			printk(KERN_INFO "fb%d: switching to %s from %s\n",
+			       i, name, registered_fb[i]->fix.id);
 			ret = do_unregister_framebuffer(registered_fb[i]);
 			if (ret)
 				return ret;
Signature · 6 lines
2.11.0

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

A message that is not in the archive (sent off-list or not yet received): cover.1511544782.git.mirq-linux-CoA6ZxLDdyEEUmgCuDUIdw@public.gmane.org

#3 lore raw

PATCH 3/13 drm/amdgpu: use simpler remove_conflicting_pci_framebuffers()

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 23 +----------------------
 1 file changed, 1 insertion(+), 22 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +1 -22
index dd2f060d62a8..b726222b7dd4 100644
@@ -537,27 +537,6 @@ MODULE_DEVICE_TABLE(pci, pciidlist);
 
 static struct drm_driver kms_driver;
 
-static int amdgpu_kick_out_firmware_fb(struct pci_dev *pdev)
-{
-	struct apertures_struct *ap;
-	bool primary = false;
-
-	ap = alloc_apertures(1);
-	if (!ap)
-		return -ENOMEM;
-
-	ap->ranges[0].base = pci_resource_start(pdev, 0);
-	ap->ranges[0].size = pci_resource_len(pdev, 0);
-
-#ifdef CONFIG_X86
-	primary = pdev->resource[PCI_ROM_RESOURCE].flags & IORESOURCE_ROM_SHADOW;
-#endif
-	drm_fb_helper_remove_conflicting_framebuffers(ap, "amdgpudrmfb", primary);
-	kfree(ap);
-
-	return 0;
-}
-
 static int amdgpu_pci_probe(struct pci_dev *pdev,
 			    const struct pci_device_id *ent)
 {
@@ -580,7 +559,7 @@ static int amdgpu_pci_probe(struct pci_dev *pdev,
 		return ret;
 
 	/* Get rid of things like offb */
-	ret = amdgpu_kick_out_firmware_fb(pdev);
+	ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, 0, "amdgpudrmfb");
 	if (ret)
 		return ret;
 
Signature · 6 lines
2.11.0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Acked-by on v1 3/13
#4 lore raw

Re: [PATCH 03/13] drm/amdgpu: use simpler remove_conflicting_pci_framebuffers()

Quoted 1 line · Michał Mirosław

radeon and amdgpu patches (3 and 7) are:

Quoted 48 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 23 +----------------------
 1 file changed, 1 insertion(+), 22 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +1 -23
index dd2f060d62a8..b726222b7dd4 100644
@@ -537,27 +537,6 @@ MODULE_DEVICE_TABLE(pci, pciidlist);
 
 static struct drm_driver kms_driver;
 
-static int amdgpu_kick_out_firmware_fb(struct pci_dev *pdev)
-{
-       struct apertures_struct *ap;
-       bool primary = false;
-
-       ap = alloc_apertures(1);
-       if (!ap)
-               return -ENOMEM;
-
-       ap->ranges[0].base = pci_resource_start(pdev, 0);
-       ap->ranges[0].size = pci_resource_len(pdev, 0);
-
-#ifdef CONFIG_X86
-       primary = pdev->resource[PCI_ROM_RESOURCE].flags & IORESOURCE_ROM_SHADOW;
-#endif
-       drm_fb_helper_remove_conflicting_framebuffers(ap, "amdgpudrmfb", primary);
-       kfree(ap);
-
-       return 0;
-}
-
 static int amdgpu_pci_probe(struct pci_dev *pdev,
                            const struct pci_device_id *ent)
 {
@@ -580,7 +559,7 @@ static int amdgpu_pci_probe(struct pci_dev *pdev,
                return ret;
 
        /* Get rid of things like offb */
-       ret = amdgpu_kick_out_firmware_fb(pdev);
+       ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, 0, "amdgpudrmfb");
        if (ret)
                return ret;
 
--

2.11.0

Quoted 4 lines

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

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

#5 lore raw

PATCH 7/13 drm/radeon: use simpler remove_conflicting_pci_framebuffers()

In reply to a message not in the archive
---
 drivers/gpu/drm/radeon/radeon_drv.c | 23 +----------------------
 1 file changed, 1 insertion(+), 22 deletions(-)
drivers/gpu/drm/radeon/radeon_drv.c +1 -22
index 31dd04f6baa1..49f51b17ae81 100644
@@ -311,27 +311,6 @@ static struct drm_driver kms_driver;
 
 bool radeon_device_is_virtual(void);
 
-static int radeon_kick_out_firmware_fb(struct pci_dev *pdev)
-{
-	struct apertures_struct *ap;
-	bool primary = false;
-
-	ap = alloc_apertures(1);
-	if (!ap)
-		return -ENOMEM;
-
-	ap->ranges[0].base = pci_resource_start(pdev, 0);
-	ap->ranges[0].size = pci_resource_len(pdev, 0);
-
-#ifdef CONFIG_X86
-	primary = pdev->resource[PCI_ROM_RESOURCE].flags & IORESOURCE_ROM_SHADOW;
-#endif
-	drm_fb_helper_remove_conflicting_framebuffers(ap, "radeondrmfb", primary);
-	kfree(ap);
-
-	return 0;
-}
-
 static int radeon_pci_probe(struct pci_dev *pdev,
 			    const struct pci_device_id *ent)
 {
@@ -341,7 +320,7 @@ static int radeon_pci_probe(struct pci_dev *pdev,
 		return -EPROBE_DEFER;
 
 	/* Get rid of things like offb */
-	ret = radeon_kick_out_firmware_fb(pdev);
+	ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, 0, "radeondrmfb");
 	if (ret)
 		return ret;
 
Signature · 6 lines
2.11.0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#6 lore raw

PATCH 10/13 fbdev: allow apertures == NULL in remove_conflicting_framebuffers()

In reply to a message not in the archive

Interpret (otherwise-invalid) NULL apertures argument to mean all-memory range. This will allow to remove several duplicates of this code from drivers in following patches.

---
 drivers/video/fbdev/core/fbmem.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
drivers/video/fbdev/core/fbmem.c +14 -0
index 5ea980e5d3b7..927e016487e9 100644
@@ -1780,11 +1780,25 @@ int remove_conflicting_framebuffers(struct apertures_struct *a,
 				    const char *name, bool primary)
 {
 	int ret;
+	bool do_free = false;
+
+	if (!a) {
+		a = alloc_apertures(1);
+		if (!a)
+			return -ENOMEM;
+
+		a->ranges[0].base = 0;
+		a->ranges[0].size = ~0;
+		do_free = true;
+	}
 
 	mutex_lock(&registration_lock);
 	ret = do_remove_conflicting_framebuffers(a, name, primary);
 	mutex_unlock(&registration_lock);
 
+	if (do_free)
+		kfree(a);
+
 	return ret;
 }
 EXPORT_SYMBOL(remove_conflicting_framebuffers);
Signature · 1 line
2.11.0

A message that is not in the archive (sent off-list or not yet received): 13240c59cafec988cdda37cc4d48252ff56f0d04.1511544782.git.mirq-linux-CoA6ZxLDdyEEUmgCuDUIdw@public.gmane.org

#8 lore raw

Re: [PATCH 10/13] fbdev: allow apertures == NULL in remove_conflicting_framebuffers()

Quoted 29 lines · Michał Mirosław

Interpret (otherwise-invalid) NULL apertures argument to mean all-memory range. This will allow to remove several duplicates of this code from drivers in following patches.

---
 drivers/video/fbdev/core/fbmem.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
drivers/video/fbdev/core/fbmem.c +11 -0
index 5ea980e5d3b7..927e016487e9 100644
@@ -1780,11 +1780,25 @@ int remove_conflicting_framebuffers(struct apertures_struct *a,
 				    const char *name, bool primary)
 {
 	int ret;
+	bool do_free = false;
+
+	if (!a) {
+		a = alloc_apertures(1);
+		if (!a)
+			return -ENOMEM;
+
+		a->ranges[0].base = 0;
+		a->ranges[0].size = ~0;
+		do_free = true;
+	}
 

drivers/video/fbdev/core/fbmem.c int remove_conflicting_framebuffers(struct apertures_struct *a, · line 1804

Quoted 10 lines
drivers/video/fbdev/core/fbmem.c +3 -0
 	mutex_lock(&registration_lock);
 	ret = do_remove_conflicting_framebuffers(a, name, primary);
 	mutex_unlock(&registration_lock);
 
+	if (do_free)
+		kfree(a);
+
 	return ret;
 }
 EXPORT_SYMBOL(remove_conflicting_framebuffers);

Please also update the kerneldoc for the varios drm wrappers and explain that passing NULL means to remove all fbdev drivers.
-Daniel

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
#9 lore raw

PATCH 13/13 drm/tegra: kick out simplefb

In reply to a message not in the archive

Kick out firmware fb when loading tegra driver.

---
 drivers/gpu/drm/tegra/drm.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/gpu/drm/tegra/drm.c +4 -0
index 943bdf88c4a2..1ec66ae29839 100644
@@ -1239,6 +1239,10 @@ static int host1x_drm_probe(struct host1x_device *dev)
 
 	dev_set_drvdata(&dev->dev, drm);
 
+	err = drm_fb_helper_remove_conflicting_framebuffers(NULL, "tegradrmfb", false);
+	if (err < 0)
+		goto unref;
+
 	err = drm_dev_register(drm, 0);
 	if (err < 0)
 		goto unref;
Signature · 1 line
2.11.0

A message that is not in the archive (sent off-list or not yet received): 89e22ee1c026b40a5bfa91de282d658b56dc8ee8.1511544782.git.mirq-linux-CoA6ZxLDdyEEUmgCuDUIdw@public.gmane.org

#11 lore raw

Re: [PATCH 13/13] drm/tegra: kick out simplefb

Quoted 6 lines · Michał Mirosław

Kick out firmware fb when loading tegra driver.

---
 drivers/gpu/drm/tegra/drm.c | 4 ++++
 1 file changed, 4 insertions(+)

Cool. Can you provide some background on how you tested this? What is your firmware FB? That'd be useful information to put in the commit message. Also, nit: "tegra driver" -> "Tegra driver".

Thierry

#12 lore raw

Re: [PATCH 13/13] drm/tegra: kick out simplefb

Quoted 5 lines · Thierry Reding
Quoted 1 line · Michał Mirosław

Kick out firmware fb when loading tegra driver.

Cool. Can you provide some background on how you tested this? What is your firmware FB? That'd be useful information to put in the commit message. Also, nit: "tegra driver" -> "Tegra driver".

I checked this on my Asus TF300T, as I use simplefb for initial boot messages. simplefb uses framebuffer set up by the bootloader.

Best Regards,
Michał Mirosław

#13 lore raw

PATCH 2/13 fbdev: add remove_conflicting_pci_framebuffers()

In reply to Michał Mirosław

Almost all drivers using remove_conflicting_framebuffers() wrap it with the same code. Extract common part from PCI drivers into separate remove_conflicting_pci_framebuffers().

---
 drivers/video/fbdev/core/fbmem.c | 22 ++++++++++++++++++++++
 include/drm/drm_fb_helper.h      | 12 ++++++++++++
 include/linux/fb.h               |  2 ++
 3 files changed, 36 insertions(+)
drivers/video/fbdev/core/fbmem.c +22 -0
index 30a18d4c9de4..5ea980e5d3b7 100644
@@ -34,6 +34,7 @@
 #include <linux/fb.h>
 #include <linux/fbcon.h>
 #include <linux/mem_encrypt.h>
+#include <linux/pci.h>
 
 #include <asm/fb.h>
 
@@ -1788,6 +1789,27 @@ int remove_conflicting_framebuffers(struct apertures_struct *a,
 }
 EXPORT_SYMBOL(remove_conflicting_framebuffers);
 
+int remove_conflicting_pci_framebuffers(struct pci_dev *pdev, int res_id, const char *name)
+{
+	struct apertures_struct *ap;
+	bool primary = false;
+
+	ap = alloc_apertures(1);
+	if (!ap)
+		return -ENOMEM;
+
+	ap->ranges[0].base = pci_resource_start(pdev, res_id);
+	ap->ranges[0].size = pci_resource_len(pdev, res_id);
+#ifdef CONFIG_X86
+	primary = pdev->resource[PCI_ROM_RESOURCE].flags &
+					IORESOURCE_ROM_SHADOW;
+#endif
+	remove_conflicting_framebuffers(ap, name, primary);
+	kfree(ap);
+	return 0;
+}
+EXPORT_SYMBOL(remove_conflicting_pci_framebuffers);
+
 /**
  *	register_framebuffer - registers a frame buffer device
  *	@fb_info: frame buffer info structure
include/drm/drm_fb_helper.h +12 -0
index 33fe95927742..ac3412290289 100644
@@ -520,4 +520,16 @@ drm_fb_helper_remove_conflicting_framebuffers(struct apertures_struct *a,
 #endif
 }
 
+static inline int
+drm_fb_helper_remove_conflicting_pci_framebuffers(struct pci_dev *pdev,
+						  int resource_id,
+						  const char *name)
+{
+#if IS_REACHABLE(CONFIG_FB)
+	return remove_conflicting_pci_framebuffers(pdev, resource_id, name);
+#else
+	return 0;
+#endif
+}
+
 #endif
include/linux/fb.h +2 -0
index f4386b0ccf40..4196cb09e58e 100644
@@ -624,6 +624,8 @@ extern ssize_t fb_sys_write(struct fb_info *info, const char __user *buf,
 extern int register_framebuffer(struct fb_info *fb_info);
 extern int unregister_framebuffer(struct fb_info *fb_info);
 extern int unlink_framebuffer(struct fb_info *fb_info);
+extern int remove_conflicting_pci_framebuffers(struct pci_dev *pdev, int res_id,
+					       const char *name);
 extern int remove_conflicting_framebuffers(struct apertures_struct *a,
 					   const char *name, bool primary);
 extern int fb_prepare_logo(struct fb_info *fb_info, int rotate);
Signature · 6 lines
2.11.0

_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

A message that is not in the archive (sent off-list or not yet received): 1738dbed0239bffc886f126fd3091daa39cd14c9.1511544782.git.mirq-linux-CoA6ZxLDdyEEUmgCuDUIdw@public.gmane.org

#15 lore raw

Re: [PATCH 02/13] fbdev: add remove_conflicting_pci_framebuffers()

Quoted 5 lines · Michał Mirosław

Almost all drivers using remove_conflicting_framebuffers() wrap it with the same code. Extract common part from PCI drivers into separate remove_conflicting_pci_framebuffers().

Since the only driver that seems to use this is the staging one, which imo is a DOA project, not sure it's worth to bother with this here. -Daniel

Quoted 87 lines
---
 drivers/video/fbdev/core/fbmem.c | 22 ++++++++++++++++++++++
 include/drm/drm_fb_helper.h      | 12 ++++++++++++
 include/linux/fb.h               |  2 ++
 3 files changed, 36 insertions(+)
drivers/video/fbdev/core/fbmem.c +22 -0
index 30a18d4c9de4..5ea980e5d3b7 100644
@@ -34,6 +34,7 @@
 #include <linux/fb.h>
 #include <linux/fbcon.h>
 #include <linux/mem_encrypt.h>
+#include <linux/pci.h>
 
 #include <asm/fb.h>
 
@@ -1788,6 +1789,27 @@ int remove_conflicting_framebuffers(struct apertures_struct *a,
 }
 EXPORT_SYMBOL(remove_conflicting_framebuffers);
 
+int remove_conflicting_pci_framebuffers(struct pci_dev *pdev, int res_id, const char *name)
+{
+	struct apertures_struct *ap;
+	bool primary = false;
+
+	ap = alloc_apertures(1);
+	if (!ap)
+		return -ENOMEM;
+
+	ap->ranges[0].base = pci_resource_start(pdev, res_id);
+	ap->ranges[0].size = pci_resource_len(pdev, res_id);
+#ifdef CONFIG_X86
+	primary = pdev->resource[PCI_ROM_RESOURCE].flags &
+					IORESOURCE_ROM_SHADOW;
+#endif
+	remove_conflicting_framebuffers(ap, name, primary);
+	kfree(ap);
+	return 0;
+}
+EXPORT_SYMBOL(remove_conflicting_pci_framebuffers);
+
 /**
  *	register_framebuffer - registers a frame buffer device
  *	@fb_info: frame buffer info structure
include/drm/drm_fb_helper.h +12 -0
index 33fe95927742..ac3412290289 100644
@@ -520,4 +520,16 @@ drm_fb_helper_remove_conflicting_framebuffers(struct apertures_struct *a,
 #endif
 }
 
+static inline int
+drm_fb_helper_remove_conflicting_pci_framebuffers(struct pci_dev *pdev,
+						  int resource_id,
+						  const char *name)
+{
+#if IS_REACHABLE(CONFIG_FB)
+	return remove_conflicting_pci_framebuffers(pdev, resource_id, name);
+#else
+	return 0;
+#endif
+}
+
 #endif
include/linux/fb.h +2 -0
index f4386b0ccf40..4196cb09e58e 100644
@@ -624,6 +624,8 @@ extern ssize_t fb_sys_write(struct fb_info *info, const char __user *buf,
 extern int register_framebuffer(struct fb_info *fb_info);
 extern int unregister_framebuffer(struct fb_info *fb_info);
 extern int unlink_framebuffer(struct fb_info *fb_info);
+extern int remove_conflicting_pci_framebuffers(struct pci_dev *pdev, int res_id,
+					       const char *name);
 extern int remove_conflicting_framebuffers(struct apertures_struct *a,
 					   const char *name, bool primary);
 extern int fb_prepare_logo(struct fb_info *fb_info, int rotate);
Signature · 6 lines
2.11.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
maintainer
#16 lore raw

Re: [PATCH 02/13] fbdev: add remove_conflicting_pci_framebuffers()

Quoted 9 lines · Daniel Vetter
Quoted 5 lines · Michał Mirosław

Almost all drivers using remove_conflicting_framebuffers() wrap it with the same code. Extract common part from PCI drivers into separate remove_conflicting_pci_framebuffers().

Since the only driver that seems to use this is the staging one, which imo is a DOA project, not sure it's worth to bother with this here.

afaik, this device is used in production by few manufacturers and it is usefull for them to have it in the tree and the only reason it is still in staging is because Tomi announced he will not take any new drivers in fbdev. And, so I have not taken the initiative to properly move it out of staging. I think Bartlomiej will also not accept new drivers in fbdev.

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

#17 lore raw

Re: [PATCH 02/13] fbdev: add remove_conflicting_pci_framebuffers()

Quoted 8 lines · Sudip Mukherjee
Quoted 7 lines · Daniel Vetter
Quoted 5 lines · Michał Mirosław

Almost all drivers using remove_conflicting_framebuffers() wrap it with the same code. Extract common part from PCI drivers into separate remove_conflicting_pci_framebuffers().

Quoted 8 lines
Quoted 2 lines

Since the only driver that seems to use this is the staging one, which imo is a DOA project, not sure it's worth to bother with this here.

afaik, this device is used in production by few manufacturers and it is usefull for them to have it in the tree and the only reason it is still in staging is because Tomi announced he will not take any new drivers in fbdev. And, so I have not taken the initiative to properly move it out of staging. I think Bartlomiej will also not accept new drivers in fbdev.

Imo, if no one cares about porting it to kms (which will give you an fbdev driver for free), then we should throw it out. At least I thought staging was only for stuff that had a reasonable chance to get mainlined. Not as a dumping ground for drivers that people use, but don't bother to get ready for mainline.

Greg?
-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
maintainer
#18 lore raw

Re: [PATCH 02/13] fbdev: add remove_conflicting_pci_framebuffers()

Quoted 18 lines · Daniel Vetter
Quoted 8 lines · Sudip Mukherjee
Quoted 7 lines · Daniel Vetter
Quoted 5 lines · Michał Mirosław

Almost all drivers using remove_conflicting_framebuffers() wrap it with the same code. Extract common part from PCI drivers into separate remove_conflicting_pci_framebuffers().

Quoted 8 lines
Quoted 2 lines

Since the only driver that seems to use this is the staging one, which imo is a DOA project, not sure it's worth to bother with this here.

afaik, this device is used in production by few manufacturers and it is usefull for them to have it in the tree and the only reason it is still in staging is because Tomi announced he will not take any new drivers in fbdev. And, so I have not taken the initiative to properly move it out of staging. I think Bartlomiej will also not accept new drivers in fbdev.

Quoted 7 lines

Imo, if no one cares about porting it to kms (which will give you an fbdev driver for free), then we should throw it out. At least I thought staging was only for stuff that had a reasonable chance to get mainlined. Not as a dumping ground for drivers that people use, but don't bother to get ready for mainline.

Greg?

Yes, if no one is working to get it out of staging, that means no one cares about it, and it needs to be removed from the tree.

thanks,

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

maintainer
#19 lore raw

Re: [PATCH 02/13] fbdev: add remove_conflicting_pci_framebuffers()

Quoted 25 lines · Greg KH
Quoted 24 lines · Daniel Vetter
Quoted 8 lines · Sudip Mukherjee
Quoted 7 lines · Daniel Vetter
Quoted 5 lines · Michał Mirosław

Almost all drivers using remove_conflicting_framebuffers() wrap it with the same code. Extract common part from PCI drivers into separate remove_conflicting_pci_framebuffers().

Quoted 8 lines
Quoted 2 lines

Since the only driver that seems to use this is the staging one, which imo is a DOA project, not sure it's worth to bother with this here.

afaik, this device is used in production by few manufacturers and it is usefull for them to have it in the tree and the only reason it is still in staging is because Tomi announced he will not take any new drivers in fbdev. And, so I have not taken the initiative to properly move it out of staging. I think Bartlomiej will also not accept new drivers in fbdev.

Imo, if no one cares about porting it to kms (which will give you an fbdev driver for free), then we should throw it out. At least I thought staging was only for stuff that had a reasonable chance to get mainlined. Not as a dumping ground for drivers that people use, but don't bother to get ready for mainline.

Quoted 4 lines
Quoted 1 line

Greg?

Yes, if no one is working to get it out of staging, that means no one cares about it, and it needs to be removed from the tree.

Agreed. I was not working on getting it out of staging as there is no place for it to go.
But, Teddy Wang told me that they have a working drm driver for it, but it is not atomic like Daniel was asking for. If it is ok, then I can send in a patch to remove the existing sm750 from staging and add the new sm750 drm driver to staging. And after it is ready, we can go ahead with moving it out of staging to drm.

Greg? Daniel?

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

maintainer
#20 lore raw

Re: [PATCH 02/13] fbdev: add remove_conflicting_pci_framebuffers()

Quoted 39 lines · Sudip Mukherjee
Quoted 25 lines · Greg KH
Quoted 24 lines · Daniel Vetter
Quoted 8 lines · Sudip Mukherjee
Quoted 7 lines · Daniel Vetter
Quoted 5 lines · Michał Mirosław

Almost all drivers using remove_conflicting_framebuffers() wrap it with the same code. Extract common part from PCI drivers into separate remove_conflicting_pci_framebuffers().

Quoted 8 lines
Quoted 2 lines

Since the only driver that seems to use this is the staging one, which imo is a DOA project, not sure it's worth to bother with this here.

afaik, this device is used in production by few manufacturers and it is usefull for them to have it in the tree and the only reason it is still in staging is because Tomi announced he will not take any new drivers in fbdev. And, so I have not taken the initiative to properly move it out of staging. I think Bartlomiej will also not accept new drivers in fbdev.

Imo, if no one cares about porting it to kms (which will give you an fbdev driver for free), then we should throw it out. At least I thought staging was only for stuff that had a reasonable chance to get mainlined. Not as a dumping ground for drivers that people use, but don't bother to get ready for mainline.

Quoted 4 lines
Quoted 1 line

Greg?

Yes, if no one is working to get it out of staging, that means no one cares about it, and it needs to be removed from the tree.

Agreed. I was not working on getting it out of staging as there is no place for it to go.
But, Teddy Wang told me that they have a working drm driver for it, but it is not atomic like Daniel was asking for. If it is ok, then I can send in a patch to remove the existing sm750 from staging and add the new sm750 drm driver to staging. And after it is ready, we can go ahead with moving it out of staging to drm.

Quoted 1 line

Greg? Daniel?

I'll always take patches that delete code from staging :)
_______________________________________________
Virtualization mailing list [email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

#21 lore raw

Re: [PATCH 02/13] fbdev: add remove_conflicting_pci_framebuffers()

In reply to Sudip Mukherjee
Quoted 31 lines · Sudip Mukherjee
Quoted 25 lines · Greg KH
Quoted 24 lines · Daniel Vetter
Quoted 8 lines · Sudip Mukherjee
Quoted 7 lines · Daniel Vetter
Quoted 5 lines · Michał Mirosław

Almost all drivers using remove_conflicting_framebuffers() wrap it with the same code. Extract common part from PCI drivers into separate remove_conflicting_pci_framebuffers().

Quoted 8 lines
Quoted 2 lines

Since the only driver that seems to use this is the staging one, which imo is a DOA project, not sure it's worth to bother with this here.

afaik, this device is used in production by few manufacturers and it is usefull for them to have it in the tree and the only reason it is still in staging is because Tomi announced he will not take any new drivers in fbdev. And, so I have not taken the initiative to properly move it out of staging. I think Bartlomiej will also not accept new drivers in fbdev.

Imo, if no one cares about porting it to kms (which will give you an fbdev driver for free), then we should throw it out. At least I thought staging was only for stuff that had a reasonable chance to get mainlined. Not as a dumping ground for drivers that people use, but don't bother to get ready for mainline.

Quoted 4 lines
Quoted 1 line

Greg?

Yes, if no one is working to get it out of staging, that means no one cares about it, and it needs to be removed from the tree.

Quoted 7 lines

Agreed. I was not working on getting it out of staging as there is no place for it to go.
But, Teddy Wang told me that they have a working drm driver for it, but it is not atomic like Daniel was asking for. If it is ok, then I can send in a patch to remove the existing sm750 from staging and add the new sm750 drm driver to staging. And after it is ready, we can go ahead with moving it out of staging to drm.

Please keep the todo item that it needs to be converted to atomic. And tbh, it's probably faster if you just submit it to dri-devel, assuming you have time to work on it. For small drivers we tend to be fairly quick in getting them into good enough shape.

Staging is also a major pain for drm subsystem refactorings, I really, really, really prefer we don't add more than the vbox pain we have already.
-Daniel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
maintainer
#22 lore raw

Re: [PATCH 02/13] fbdev: add remove_conflicting_pci_framebuffers()

Hi Daniel,

Quoted 10 lines · Daniel Vetter
Quoted 9 lines · Sudip Mukherjee
Quoted 8 lines · Greg KH
Quoted 7 lines · Daniel Vetter
Quoted 6 lines · Sudip Mukherjee
Quoted 5 lines · Daniel Vetter
Quoted 4 lines · Michał Mirosław

Almost all drivers using remove_conflicting_framebuffers() wrap it with the same code. Extract common part from PCI drivers into separate remove_conflicting_pci_framebuffers().

<snip>

Quoted 14 lines
Quoted 6 lines
Quoted 5 lines
Quoted 2 lines

Greg?

Yes, if no one is working to get it out of staging, that means no one cares about it, and it needs to be removed from the tree.

Quoted 7 lines

Agreed. I was not working on getting it out of staging as there is no place for it to go.
But, Teddy Wang told me that they have a working drm driver for it, but it is not atomic like Daniel was asking for. If it is ok, then I can send in a patch to remove the existing sm750 from staging and add the new sm750 drm driver to staging. And after it is ready, we can go ahead with moving it out of staging to drm.

Quoted 4 lines

Please keep the todo item that it needs to be converted to atomic. And tbh, it's probably faster if you just submit it to dri-devel, assuming you have time to work on it. For small drivers we tend to be fairly quick in getting them into good enough shape.

I have received the driver from Teddy and pushed it to
https://github.com/sudipm-mukherjee/parport/tree/drm_smi for your first look into it. It is not even building with next-20171130 and has lots of build warnings. I will have to do a lot of work on it before I can even submit it to dri-devel.

Time will be the problem, as this is not part of my day job.

Quoted 4 lines

Staging is also a major pain for drm subsystem refactorings, I really, really, really prefer we don't add more than the vbox pain we have already.

I am hoping that after seeing it, you will agree to have it in staging. :)

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

#23 lore raw

Re: [PATCH 02/13] fbdev: add remove_conflicting_pci_framebuffers()

Quoted 41 lines · Sudip Mukherjee

Hi Daniel,

Quoted 10 lines · Daniel Vetter
Quoted 9 lines · Sudip Mukherjee
Quoted 8 lines · Greg KH
Quoted 7 lines · Daniel Vetter
Quoted 6 lines · Sudip Mukherjee
Quoted 5 lines · Daniel Vetter
Quoted 4 lines · Michał Mirosław

Almost all drivers using remove_conflicting_framebuffers() wrap it with the same code. Extract common part from PCI drivers into separate remove_conflicting_pci_framebuffers().

<snip>

Quoted 14 lines
Quoted 6 lines
Quoted 5 lines
Quoted 2 lines

Greg?

Yes, if no one is working to get it out of staging, that means no one cares about it, and it needs to be removed from the tree.

Quoted 7 lines

Agreed. I was not working on getting it out of staging as there is no place for it to go.
But, Teddy Wang told me that they have a working drm driver for it, but it is not atomic like Daniel was asking for. If it is ok, then I can send in a patch to remove the existing sm750 from staging and add the new sm750 drm driver to staging. And after it is ready, we can go ahead with moving it out of staging to drm.

Quoted 4 lines

Please keep the todo item that it needs to be converted to atomic. And tbh, it's probably faster if you just submit it to dri-devel, assuming you have time to work on it. For small drivers we tend to be fairly quick in getting them into good enough shape.

I have received the driver from Teddy and pushed it to
https://github.com/sudipm-mukherjee/parport/tree/drm_smi for your first look into it. It is not even building with next-20171130 and has lots of build warnings. I will have to do a lot of work on it before I can even submit it to dri-devel.

Quoted 8 lines

Time will be the problem, as this is not part of my day job.

Quoted 4 lines

Staging is also a major pain for drm subsystem refactorings, I really, really, really prefer we don't add more than the vbox pain we have already.

I am hoping that after seeing it, you will agree to have it in staging. :)

So I know Greg is willing to take anything into staging, but I'm no fan. We refactor and improve drm a lot, with a lot of cross-driver changes necessary to move things forward. We can do that since we have a generally rather active development community, and we try hard to keep most drivers in reasonable good shape and so easy to maintain.

If you know throw a pile of unmaintainable stuff into staging, but without working on it, then that's just cost, no benefit to the dri-devel community. On top, staging tree is separate from drm trees, so more pain to synchronize trees (and we have to do that a few times per release cycle or drivers simply stop compiling). Where's the upside of taking this driver into staging?

One is users, but ime for soc display drivers usually everything else is in worse shape (e.g. even great drivers like the one for qualcom must be tested on some vendor tree because critical core bits are missing in upstream), so "more users" is not the good reason. And it's clearly not "more developers", because no time to clean things up. So what exactly is the good reason to put this into staging instead of just waiting until someone has the time to clean it up quickly?

Thanks, Daniel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
maintainer
#24 lore raw

Re: [PATCH 02/13] fbdev: add remove_conflicting_pci_framebuffers()

Quoted 52 lines · Daniel Vetter
Quoted 29 lines · Sudip Mukherjee

Hi Daniel,

<snip>

Quoted 14 lines
Quoted 6 lines
Quoted 5 lines
Quoted 2 lines

Greg?

Yes, if no one is working to get it out of staging, that means no one cares about it, and it needs to be removed from the tree.

Quoted 7 lines

Agreed. I was not working on getting it out of staging as there is no place for it to go.
But, Teddy Wang told me that they have a working drm driver for it, but it is not atomic like Daniel was asking for. If it is ok, then I can send in a patch to remove the existing sm750 from staging and add the new sm750 drm driver to staging. And after it is ready, we can go ahead with moving it out of staging to drm.

Quoted 4 lines

Please keep the todo item that it needs to be converted to atomic. And tbh, it's probably faster if you just submit it to dri-devel, assuming you have time to work on it. For small drivers we tend to be fairly quick in getting them into good enough shape.

I have received the driver from Teddy and pushed it to
https://github.com/sudipm-mukherjee/parport/tree/drm_smi for your first look into it. It is not even building with next-20171130 and has lots of build warnings. I will have to do a lot of work on it before I can even submit it to dri-devel.

Quoted 8 lines

Time will be the problem, as this is not part of my day job.

Quoted 4 lines

Staging is also a major pain for drm subsystem refactorings, I really, really, really prefer we don't add more than the vbox pain we have already.

I am hoping that after seeing it, you will agree to have it in staging. :)

So I know Greg is willing to take anything into staging, but I'm no fan. We refactor and improve drm a lot, with a lot of cross-driver changes necessary to move things forward. We can do that since we have a generally rather active development community, and we try hard to keep most drivers in reasonable good shape and so easy to maintain.

If you know throw a pile of unmaintainable stuff into staging, but without working on it, then that's just cost, no benefit to the dri-devel community. On top, staging tree is separate from drm trees, so more pain to synchronize trees (and we have to do that a few times per release cycle or drivers simply stop compiling). Where's the upside of taking this driver into staging?

Quoted 7 lines

One is users, but ime for soc display drivers usually everything else is in worse shape (e.g. even great drivers like the one for qualcom must be tested on some vendor tree because critical core bits are missing in upstream), so "more users" is not the good reason. And it's clearly not "more developers", because no time to clean things up. So what exactly is the good reason to put this into staging instead of just waiting until someone has the time to clean it up quickly?

Ok, I will not try to give any more reasons now. :)

I will cleanup the basic things I can and then submit it to dri-devel.

Greg - Please keep the SM750 driver in staging for now. I will send a patch later to add in TODO the git location where the drm driver is being developed. And when that drm driver is ready, I will send a patch to remove the sm750fb driver from staging.

--
Regards
Sudip

#25 lore raw

Re: [PATCH 02/13] fbdev: add remove_conflicting_pci_framebuffers()

In reply to Sudip Mukherjee
Quoted 41 lines · Sudip Mukherjee

Hi Daniel,

Quoted 10 lines · Daniel Vetter
Quoted 9 lines · Sudip Mukherjee
Quoted 8 lines · Greg KH
Quoted 7 lines · Daniel Vetter
Quoted 6 lines · Sudip Mukherjee
Quoted 5 lines · Daniel Vetter
Quoted 4 lines · Michał Mirosław

Almost all drivers using remove_conflicting_framebuffers() wrap it with the same code. Extract common part from PCI drivers into separate remove_conflicting_pci_framebuffers().

<snip>

Quoted 14 lines
Quoted 6 lines
Quoted 5 lines
Quoted 2 lines

Greg?

Yes, if no one is working to get it out of staging, that means no one cares about it, and it needs to be removed from the tree.

Quoted 7 lines

Agreed. I was not working on getting it out of staging as there is no place for it to go.
But, Teddy Wang told me that they have a working drm driver for it, but it is not atomic like Daniel was asking for. If it is ok, then I can send in a patch to remove the existing sm750 from staging and add the new sm750 drm driver to staging. And after it is ready, we can go ahead with moving it out of staging to drm.

Quoted 4 lines

Please keep the todo item that it needs to be converted to atomic. And tbh, it's probably faster if you just submit it to dri-devel, assuming you have time to work on it. For small drivers we tend to be fairly quick in getting them into good enough shape.

I have received the driver from Teddy and pushed it to
https://github.com/sudipm-mukherjee/parport/tree/drm_smi for your first look into it. It is not even building with next-20171130 and has lots of build warnings. I will have to do a lot of work on it before I can even submit it to dri-devel.

Quoted 8 lines

Time will be the problem, as this is not part of my day job.

Quoted 4 lines

Staging is also a major pain for drm subsystem refactorings, I really, really, really prefer we don't add more than the vbox pain we have already.

I am hoping that after seeing it, you will agree to have it in staging. :)

So I know Greg is willing to take anything into staging, but I'm no fan. We refactor and improve drm a lot, with a lot of cross-driver changes necessary to move things forward. We can do that since we have a generally rather active development community, and we try hard to keep most drivers in reasonable good shape and so easy to maintain.

If you know throw a pile of unmaintainable stuff into staging, but without working on it, then that's just cost, no benefit to the dri-devel community. On top, staging tree is separate from drm trees, so more pain to synchronize trees (and we have to do that a few times per release cycle or drivers simply stop compiling). Where's the upside of taking this driver into staging?

One is users, but ime for soc display drivers usually everything else is in worse shape (e.g. even great drivers like the one for qualcom must be tested on some vendor tree because critical core bits are missing in upstream), so "more users" is not the good reason. And it's clearly not "more developers", because no time to clean things up. So what exactly is the good reason to put this into staging instead of just waiting until someone has the time to clean it up quickly?

Thanks, Daniel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
#26 lore raw

Re: [PATCH 02/13] fbdev: add remove_conflicting_pci_framebuffers()

In reply to Sudip Mukherjee
Quoted 35 lines · Sudip Mukherjee

Hi Daniel,

Quoted 10 lines · Daniel Vetter
Quoted 9 lines · Sudip Mukherjee
Quoted 8 lines · Greg KH
Quoted 7 lines · Daniel Vetter
Quoted 6 lines · Sudip Mukherjee
Quoted 5 lines · Daniel Vetter
Quoted 4 lines · Michał Mirosław

Almost all drivers using remove_conflicting_framebuffers() wrap it with the same code. Extract common part from PCI drivers into separate remove_conflicting_pci_framebuffers().

<snip>

Quoted 14 lines
Quoted 6 lines
Quoted 5 lines
Quoted 2 lines

Greg?

Yes, if no one is working to get it out of staging, that means no one cares about it, and it needs to be removed from the tree.

Quoted 7 lines

Agreed. I was not working on getting it out of staging as there is no place for it to go.
But, Teddy Wang told me that they have a working drm driver for it, but it is not atomic like Daniel was asking for. If it is ok, then I can send in a patch to remove the existing sm750 from staging and add the new sm750 drm driver to staging. And after it is ready, we can go ahead with moving it out of staging to drm.

Quoted 4 lines

Please keep the todo item that it needs to be converted to atomic. And tbh, it's probably faster if you just submit it to dri-devel, assuming you have time to work on it. For small drivers we tend to be fairly quick in getting them into good enough shape.

Quoted 6 lines

I have received the driver from Teddy and pushed it to
https://github.com/sudipm-mukherjee/parport/tree/drm_smi for your first look into it. It is not even building with next-20171130 and has lots of build warnings. I will have to do a lot of work on it before I can even submit it to dri-devel.

A crazy idea, mostly towards Tedd and Sudip:

Start small and build gradually. An example split for separate patch series:

- one HW, basic setup + atomic KMS
- add second HW
- more KMS features
- fancy memory management
- 2D/3D/other acceleration

The driver as seen above tries to do all of the above (almost, it's not atomic) at once - 40k loc.

Someone familiar with the code can quickly split it up and while doing so, feed it through checkpatch.
Current code is _very_ far from kernel coding style, plus the copyright blurp is very disturbing:

* All rights are reserved. Reproduction or in part is prohibited
* without the written consent of the copyright owner.

HTH
Emil
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

maintainer
#27 lore raw

Re: [PATCH 02/13] fbdev: add remove_conflicting_pci_framebuffers()

Hi Emil,

Quoted 5 lines · Emil Velikov
Quoted 3 lines · Sudip Mukherjee

Hi Daniel,

On Wed, Nov 29, 2017 at 10:56:34AM +0100, Daniel Vetter wrote:

<snip>

Quoted 12 lines
Quoted 2 lines

submit it to dri-devel.

A crazy idea, mostly towards Tedd and Sudip:

Start small and build gradually. An example split for separate patch series:

- one HW, basic setup + atomic KMS
- add second HW
- more KMS features
- fancy memory management
- 2D/3D/other acceleration

Quoted 5 lines

The driver as seen above tries to do all of the above (almost, it's not atomic) at once - 40k loc.

Someone familiar with the code can quickly split it up and while doing so, feed it through checkpatch.

I can try but will be very tough since I have to go through the code to get familiar with it and, as mentioned before, its not part of my dayjob, so time will be a problem. Developing from scratch takes much more time than fixing something.

Quoted 2 lines

Current code is _very_ far from kernel coding style, plus the copyright blurp is very disturbing:

I will fix the coding style before my first submission to dri-devel, which should be in January after I have setup my desktop with the hardware for testing.

The copyright thing - I am sure Teddy can talk to his company and will confirm that we can change it to the way kernel code is done.

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

maintainer
#28 lore raw

Re: [PATCH 02/13] fbdev: add remove_conflicting_pci_framebuffers()

In reply to Emil Velikov

Hi Emil,

Quoted 5 lines · Emil Velikov
Quoted 3 lines · Sudip Mukherjee

Hi Daniel,

On Wed, Nov 29, 2017 at 10:56:34AM +0100, Daniel Vetter wrote:

<snip>

Quoted 12 lines
Quoted 2 lines

submit it to dri-devel.

A crazy idea, mostly towards Tedd and Sudip:

Start small and build gradually. An example split for separate patch series:

- one HW, basic setup + atomic KMS
- add second HW
- more KMS features
- fancy memory management
- 2D/3D/other acceleration

Quoted 5 lines

The driver as seen above tries to do all of the above (almost, it's not atomic) at once - 40k loc.

Someone familiar with the code can quickly split it up and while doing so, feed it through checkpatch.

I can try but will be very tough since I have to go through the code to get familiar with it and, as mentioned before, its not part of my dayjob, so time will be a problem. Developing from scratch takes much more time than fixing something.

Quoted 2 lines

Current code is _very_ far from kernel coding style, plus the copyright blurp is very disturbing:

I will fix the coding style before my first submission to dri-devel, which should be in January after I have setup my desktop with the hardware for testing.

The copyright thing - I am sure Teddy can talk to his company and will confirm that we can change it to the way kernel code is done.

--
Regards
Sudip

#29 lore raw

Re: [PATCH 02/13] fbdev: add remove_conflicting_pci_framebuffers()

In reply to Sudip Mukherjee
Quoted 35 lines · Sudip Mukherjee

Hi Daniel,

Quoted 10 lines · Daniel Vetter
Quoted 9 lines · Sudip Mukherjee
Quoted 8 lines · Greg KH
Quoted 7 lines · Daniel Vetter
Quoted 6 lines · Sudip Mukherjee
Quoted 5 lines · Daniel Vetter
Quoted 4 lines · Michał Mirosław

Almost all drivers using remove_conflicting_framebuffers() wrap it with the same code. Extract common part from PCI drivers into separate remove_conflicting_pci_framebuffers().

<snip>

Quoted 14 lines
Quoted 6 lines
Quoted 5 lines
Quoted 2 lines

Greg?

Yes, if no one is working to get it out of staging, that means no one cares about it, and it needs to be removed from the tree.

Quoted 7 lines

Agreed. I was not working on getting it out of staging as there is no place for it to go.
But, Teddy Wang told me that they have a working drm driver for it, but it is not atomic like Daniel was asking for. If it is ok, then I can send in a patch to remove the existing sm750 from staging and add the new sm750 drm driver to staging. And after it is ready, we can go ahead with moving it out of staging to drm.

Quoted 4 lines

Please keep the todo item that it needs to be converted to atomic. And tbh, it's probably faster if you just submit it to dri-devel, assuming you have time to work on it. For small drivers we tend to be fairly quick in getting them into good enough shape.

Quoted 6 lines

I have received the driver from Teddy and pushed it to
https://github.com/sudipm-mukherjee/parport/tree/drm_smi for your first look into it. It is not even building with next-20171130 and has lots of build warnings. I will have to do a lot of work on it before I can even submit it to dri-devel.

A crazy idea, mostly towards Tedd and Sudip:

Start small and build gradually. An example split for separate patch series:

- one HW, basic setup + atomic KMS
- add second HW
- more KMS features
- fancy memory management
- 2D/3D/other acceleration

The driver as seen above tries to do all of the above (almost, it's not atomic) at once - 40k loc.

Someone familiar with the code can quickly split it up and while doing so, feed it through checkpatch.
Current code is _very_ far from kernel coding style, plus the copyright blurp is very disturbing:

* All rights are reserved. Reproduction or in part is prohibited
* without the written consent of the copyright owner.

HTH
Emil
_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

maintainer
#30 lore raw

Re: [PATCH 02/13] fbdev: add remove_conflicting_pci_framebuffers()

In reply to Daniel Vetter

Hi Daniel,

Quoted 10 lines · Daniel Vetter
Quoted 9 lines · Sudip Mukherjee
Quoted 8 lines · Greg KH
Quoted 7 lines · Daniel Vetter
Quoted 6 lines · Sudip Mukherjee
Quoted 5 lines · Daniel Vetter
Quoted 4 lines · Michał Mirosław

Almost all drivers using remove_conflicting_framebuffers() wrap it with the same code. Extract common part from PCI drivers into separate remove_conflicting_pci_framebuffers().

<snip>

Quoted 14 lines
Quoted 6 lines
Quoted 5 lines
Quoted 2 lines

Greg?

Yes, if no one is working to get it out of staging, that means no one cares about it, and it needs to be removed from the tree.

Quoted 7 lines

Agreed. I was not working on getting it out of staging as there is no place for it to go.
But, Teddy Wang told me that they have a working drm driver for it, but it is not atomic like Daniel was asking for. If it is ok, then I can send in a patch to remove the existing sm750 from staging and add the new sm750 drm driver to staging. And after it is ready, we can go ahead with moving it out of staging to drm.

Quoted 4 lines

Please keep the todo item that it needs to be converted to atomic. And tbh, it's probably faster if you just submit it to dri-devel, assuming you have time to work on it. For small drivers we tend to be fairly quick in getting them into good enough shape.

I have received the driver from Teddy and pushed it to
https://github.com/sudipm-mukherjee/parport/tree/drm_smi for your first look into it. It is not even building with next-20171130 and has lots of build warnings. I will have to do a lot of work on it before I can even submit it to dri-devel.

Time will be the problem, as this is not part of my day job.

Quoted 4 lines

Staging is also a major pain for drm subsystem refactorings, I really, really, really prefer we don't add more than the vbox pain we have already.

I am hoping that after seeing it, you will agree to have it in staging. :)

--
Regards
Sudip
_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

#31 lore raw

Re: [PATCH 02/13] fbdev: add remove_conflicting_pci_framebuffers()

In reply to Sudip Mukherjee
Quoted 31 lines · Sudip Mukherjee
Quoted 25 lines · Greg KH
Quoted 24 lines · Daniel Vetter
Quoted 8 lines · Sudip Mukherjee
Quoted 7 lines · Daniel Vetter
Quoted 5 lines · Michał Mirosław

Almost all drivers using remove_conflicting_framebuffers() wrap it with the same code. Extract common part from PCI drivers into separate remove_conflicting_pci_framebuffers().

Quoted 8 lines
Quoted 2 lines

Since the only driver that seems to use this is the staging one, which imo is a DOA project, not sure it's worth to bother with this here.

afaik, this device is used in production by few manufacturers and it is usefull for them to have it in the tree and the only reason it is still in staging is because Tomi announced he will not take any new drivers in fbdev. And, so I have not taken the initiative to properly move it out of staging. I think Bartlomiej will also not accept new drivers in fbdev.

Imo, if no one cares about porting it to kms (which will give you an fbdev driver for free), then we should throw it out. At least I thought staging was only for stuff that had a reasonable chance to get mainlined. Not as a dumping ground for drivers that people use, but don't bother to get ready for mainline.

Quoted 4 lines
Quoted 1 line

Greg?

Yes, if no one is working to get it out of staging, that means no one cares about it, and it needs to be removed from the tree.

Quoted 7 lines

Agreed. I was not working on getting it out of staging as there is no place for it to go.
But, Teddy Wang told me that they have a working drm driver for it, but it is not atomic like Daniel was asking for. If it is ok, then I can send in a patch to remove the existing sm750 from staging and add the new sm750 drm driver to staging. And after it is ready, we can go ahead with moving it out of staging to drm.

Please keep the todo item that it needs to be converted to atomic. And tbh, it's probably faster if you just submit it to dri-devel, assuming you have time to work on it. For small drivers we tend to be fairly quick in getting them into good enough shape.

Staging is also a major pain for drm subsystem refactorings, I really, really, really prefer we don't add more than the vbox pain we have already.
-Daniel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
maintainer
#32 lore raw

Re: [PATCH 02/13] fbdev: add remove_conflicting_pci_framebuffers()

In reply to Greg KH
Quoted 25 lines · Greg KH
Quoted 24 lines · Daniel Vetter
Quoted 8 lines · Sudip Mukherjee
Quoted 7 lines · Daniel Vetter
Quoted 5 lines · Michał Mirosław

Almost all drivers using remove_conflicting_framebuffers() wrap it with the same code. Extract common part from PCI drivers into separate remove_conflicting_pci_framebuffers().

Quoted 8 lines
Quoted 2 lines

Since the only driver that seems to use this is the staging one, which imo is a DOA project, not sure it's worth to bother with this here.

afaik, this device is used in production by few manufacturers and it is usefull for them to have it in the tree and the only reason it is still in staging is because Tomi announced he will not take any new drivers in fbdev. And, so I have not taken the initiative to properly move it out of staging. I think Bartlomiej will also not accept new drivers in fbdev.

Imo, if no one cares about porting it to kms (which will give you an fbdev driver for free), then we should throw it out. At least I thought staging was only for stuff that had a reasonable chance to get mainlined. Not as a dumping ground for drivers that people use, but don't bother to get ready for mainline.

Quoted 4 lines
Quoted 1 line

Greg?

Yes, if no one is working to get it out of staging, that means no one cares about it, and it needs to be removed from the tree.

Agreed. I was not working on getting it out of staging as there is no place for it to go.
But, Teddy Wang told me that they have a working drm driver for it, but it is not atomic like Daniel was asking for. If it is ok, then I can send in a patch to remove the existing sm750 from staging and add the new sm750 drm driver to staging. And after it is ready, we can go ahead with moving it out of staging to drm.

Greg? Daniel?

--
Regards
Sudip
_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

maintainer
#33 lore raw

Re: [PATCH 02/13] fbdev: add remove_conflicting_pci_framebuffers()

In reply to Daniel Vetter
Quoted 18 lines · Daniel Vetter
Quoted 8 lines · Sudip Mukherjee
Quoted 7 lines · Daniel Vetter
Quoted 5 lines · Michał Mirosław

Almost all drivers using remove_conflicting_framebuffers() wrap it with the same code. Extract common part from PCI drivers into separate remove_conflicting_pci_framebuffers().

Quoted 8 lines
Quoted 2 lines

Since the only driver that seems to use this is the staging one, which imo is a DOA project, not sure it's worth to bother with this here.

afaik, this device is used in production by few manufacturers and it is usefull for them to have it in the tree and the only reason it is still in staging is because Tomi announced he will not take any new drivers in fbdev. And, so I have not taken the initiative to properly move it out of staging. I think Bartlomiej will also not accept new drivers in fbdev.

Quoted 7 lines

Imo, if no one cares about porting it to kms (which will give you an fbdev driver for free), then we should throw it out. At least I thought staging was only for stuff that had a reasonable chance to get mainlined. Not as a dumping ground for drivers that people use, but don't bother to get ready for mainline.

Greg?

Yes, if no one is working to get it out of staging, that means no one cares about it, and it needs to be removed from the tree.

thanks,

greg k-h
_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

#34 lore raw

Re: [PATCH 02/13] fbdev: add remove_conflicting_pci_framebuffers()

In reply to Sudip Mukherjee
Quoted 8 lines · Sudip Mukherjee
Quoted 7 lines · Daniel Vetter
Quoted 5 lines · Michał Mirosław

Almost all drivers using remove_conflicting_framebuffers() wrap it with the same code. Extract common part from PCI drivers into separate remove_conflicting_pci_framebuffers().

Quoted 8 lines
Quoted 2 lines

Since the only driver that seems to use this is the staging one, which imo is a DOA project, not sure it's worth to bother with this here.

afaik, this device is used in production by few manufacturers and it is usefull for them to have it in the tree and the only reason it is still in staging is because Tomi announced he will not take any new drivers in fbdev. And, so I have not taken the initiative to properly move it out of staging. I think Bartlomiej will also not accept new drivers in fbdev.

Imo, if no one cares about porting it to kms (which will give you an fbdev driver for free), then we should throw it out. At least I thought staging was only for stuff that had a reasonable chance to get mainlined. Not as a dumping ground for drivers that people use, but don't bother to get ready for mainline.

Greg?
-Daniel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
maintainer
#35 lore raw

Re: [PATCH 02/13] fbdev: add remove_conflicting_pci_framebuffers()

In reply to Daniel Vetter
Quoted 9 lines · Daniel Vetter
Quoted 5 lines · Michał Mirosław

Almost all drivers using remove_conflicting_framebuffers() wrap it with the same code. Extract common part from PCI drivers into separate remove_conflicting_pci_framebuffers().

Since the only driver that seems to use this is the staging one, which imo is a DOA project, not sure it's worth to bother with this here.

afaik, this device is used in production by few manufacturers and it is usefull for them to have it in the tree and the only reason it is still in staging is because Tomi announced he will not take any new drivers in fbdev. And, so I have not taken the initiative to properly move it out of staging. I think Bartlomiej will also not accept new drivers in fbdev.

--
Regards
Sudip
_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

#36 lore raw

Re: [PATCH 02/13] fbdev: add remove_conflicting_pci_framebuffers()

In reply to Michał Mirosław
Quoted 5 lines · Michał Mirosław

Almost all drivers using remove_conflicting_framebuffers() wrap it with the same code. Extract common part from PCI drivers into separate remove_conflicting_pci_framebuffers().

Since the only driver that seems to use this is the staging one, which imo is a DOA project, not sure it's worth to bother with this here. -Daniel

Quoted 87 lines
---
 drivers/video/fbdev/core/fbmem.c | 22 ++++++++++++++++++++++
 include/drm/drm_fb_helper.h      | 12 ++++++++++++
 include/linux/fb.h               |  2 ++
 3 files changed, 36 insertions(+)
drivers/video/fbdev/core/fbmem.c +22 -0
index 30a18d4c9de4..5ea980e5d3b7 100644
@@ -34,6 +34,7 @@
 #include <linux/fb.h>
 #include <linux/fbcon.h>
 #include <linux/mem_encrypt.h>
+#include <linux/pci.h>
 
 #include <asm/fb.h>
 
@@ -1788,6 +1789,27 @@ int remove_conflicting_framebuffers(struct apertures_struct *a,
 }
 EXPORT_SYMBOL(remove_conflicting_framebuffers);
 
+int remove_conflicting_pci_framebuffers(struct pci_dev *pdev, int res_id, const char *name)
+{
+	struct apertures_struct *ap;
+	bool primary = false;
+
+	ap = alloc_apertures(1);
+	if (!ap)
+		return -ENOMEM;
+
+	ap->ranges[0].base = pci_resource_start(pdev, res_id);
+	ap->ranges[0].size = pci_resource_len(pdev, res_id);
+#ifdef CONFIG_X86
+	primary = pdev->resource[PCI_ROM_RESOURCE].flags &
+					IORESOURCE_ROM_SHADOW;
+#endif
+	remove_conflicting_framebuffers(ap, name, primary);
+	kfree(ap);
+	return 0;
+}
+EXPORT_SYMBOL(remove_conflicting_pci_framebuffers);
+
 /**
  *	register_framebuffer - registers a frame buffer device
  *	@fb_info: frame buffer info structure
include/drm/drm_fb_helper.h +12 -0
index 33fe95927742..ac3412290289 100644
@@ -520,4 +520,16 @@ drm_fb_helper_remove_conflicting_framebuffers(struct apertures_struct *a,
 #endif
 }
 
+static inline int
+drm_fb_helper_remove_conflicting_pci_framebuffers(struct pci_dev *pdev,
+						  int resource_id,
+						  const char *name)
+{
+#if IS_REACHABLE(CONFIG_FB)
+	return remove_conflicting_pci_framebuffers(pdev, resource_id, name);
+#else
+	return 0;
+#endif
+}
+
 #endif
include/linux/fb.h +2 -0
index f4386b0ccf40..4196cb09e58e 100644
@@ -624,6 +624,8 @@ extern ssize_t fb_sys_write(struct fb_info *info, const char __user *buf,
 extern int register_framebuffer(struct fb_info *fb_info);
 extern int unregister_framebuffer(struct fb_info *fb_info);
 extern int unlink_framebuffer(struct fb_info *fb_info);
+extern int remove_conflicting_pci_framebuffers(struct pci_dev *pdev, int res_id,
+					       const char *name);
 extern int remove_conflicting_framebuffers(struct apertures_struct *a,
 					   const char *name, bool primary);
 extern int fb_prepare_logo(struct fb_info *fb_info, int rotate);
Signature · 6 lines
2.11.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
#37 lore raw

PATCH 4/13 drm/bochs: use simpler remove_conflicting_pci_framebuffers()

In reply to Michał Mirosław
---
 drivers/gpu/drm/bochs/bochs_drv.c | 18 +-----------------
 1 file changed, 1 insertion(+), 17 deletions(-)
drivers/gpu/drm/bochs/bochs_drv.c +1 -17
index 7b20318483e4..c61b40c72b62 100644
@@ -143,22 +143,6 @@ static const struct dev_pm_ops bochs_pm_ops = {
 /* ---------------------------------------------------------------------- */
 /* pci interface                                                          */
 
-static int bochs_kick_out_firmware_fb(struct pci_dev *pdev)
-{
-	struct apertures_struct *ap;
-
-	ap = alloc_apertures(1);
-	if (!ap)
-		return -ENOMEM;
-
-	ap->ranges[0].base = pci_resource_start(pdev, 0);
-	ap->ranges[0].size = pci_resource_len(pdev, 0);
-	drm_fb_helper_remove_conflicting_framebuffers(ap, "bochsdrmfb", false);
-	kfree(ap);
-
-	return 0;
-}
-
 static int bochs_pci_probe(struct pci_dev *pdev,
 			   const struct pci_device_id *ent)
 {
@@ -171,7 +155,7 @@ static int bochs_pci_probe(struct pci_dev *pdev,
 		return -ENOMEM;
 	}
 
-	ret = bochs_kick_out_firmware_fb(pdev);
+	ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, 0, "bochsdrmfb");
 	if (ret)
 		return ret;
 
Signature · 6 lines
2.11.0

_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
#38 lore raw

PATCH 5/13 drm/cirrus: use simpler remove_conflicting_pci_framebuffers()

In reply to Michał Mirosław
---
 drivers/gpu/drm/cirrus/cirrus_drv.c | 23 +----------------------
 1 file changed, 1 insertion(+), 22 deletions(-)
drivers/gpu/drm/cirrus/cirrus_drv.c +1 -22
index 69c4e352dd78..85ed8657c862 100644
@@ -42,33 +42,12 @@ static const struct pci_device_id pciidlist[] = {
 };
 
 
-static int cirrus_kick_out_firmware_fb(struct pci_dev *pdev)
-{
-	struct apertures_struct *ap;
-	bool primary = false;
-
-	ap = alloc_apertures(1);
-	if (!ap)
-		return -ENOMEM;
-
-	ap->ranges[0].base = pci_resource_start(pdev, 0);
-	ap->ranges[0].size = pci_resource_len(pdev, 0);
-
-#ifdef CONFIG_X86
-	primary = pdev->resource[PCI_ROM_RESOURCE].flags & IORESOURCE_ROM_SHADOW;
-#endif
-	drm_fb_helper_remove_conflicting_framebuffers(ap, "cirrusdrmfb", primary);
-	kfree(ap);
-
-	return 0;
-}
-
 static int cirrus_pci_probe(struct pci_dev *pdev,
 			    const struct pci_device_id *ent)
 {
 	int ret;
 
-	ret = cirrus_kick_out_firmware_fb(pdev);
+	ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, 0, "cirrusdrmfb");
 	if (ret)
 		return ret;
 
Signature · 6 lines
2.11.0

_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
#39 lore raw

PATCH 6/13 drm/mgag200: use simpler remove_conflicting_pci_framebuffers()

In reply to Michał Mirosław

Remove duplicated call, while at it.

---
 drivers/gpu/drm/mgag200/mgag200_drv.c  | 21 +--------------------
 drivers/gpu/drm/mgag200/mgag200_main.c |  9 ---------
 2 files changed, 1 insertion(+), 29 deletions(-)
drivers/gpu/drm/mgag200/mgag200_drv.c +1 -20
index 74cdde2ee474..ac6af4bd9df6 100644
@@ -42,29 +42,10 @@ static const struct pci_device_id pciidlist[] = {
 
 MODULE_DEVICE_TABLE(pci, pciidlist);
 
-static void mgag200_kick_out_firmware_fb(struct pci_dev *pdev)
-{
-	struct apertures_struct *ap;
-	bool primary = false;
-
-	ap = alloc_apertures(1);
-	if (!ap)
-		return;
-
-	ap->ranges[0].base = pci_resource_start(pdev, 0);
-	ap->ranges[0].size = pci_resource_len(pdev, 0);
-
-#ifdef CONFIG_X86
-	primary = pdev->resource[PCI_ROM_RESOURCE].flags & IORESOURCE_ROM_SHADOW;
-#endif
-	drm_fb_helper_remove_conflicting_framebuffers(ap, "mgag200drmfb", primary);
-	kfree(ap);
-}
-
 
 static int mga_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 {
-	mgag200_kick_out_firmware_fb(pdev);
+	drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, 0, "mgag200drmfb");
 
 	return drm_get_pci_dev(pdev, ent, &driver);
 }
drivers/gpu/drm/mgag200/mgag200_main.c +0 -9
index 780f983b0294..79d54103d470 100644
@@ -124,20 +124,11 @@ static int mga_probe_vram(struct mga_device *mdev, void __iomem *mem)
 static int mga_vram_init(struct mga_device *mdev)
 {
 	void __iomem *mem;
-	struct apertures_struct *aper = alloc_apertures(1);
-	if (!aper)
-		return -ENOMEM;
 
 	/* BAR 0 is VRAM */
 	mdev->mc.vram_base = pci_resource_start(mdev->dev->pdev, 0);
 	mdev->mc.vram_window = pci_resource_len(mdev->dev->pdev, 0);
 
-	aper->ranges[0].base = mdev->mc.vram_base;
-	aper->ranges[0].size = mdev->mc.vram_window;
-
-	drm_fb_helper_remove_conflicting_framebuffers(aper, "mgafb", true);
-	kfree(aper);
-
 	if (!devm_request_mem_region(mdev->dev->dev, mdev->mc.vram_base, mdev->mc.vram_window,
 				"mgadrmfb_vram")) {
 		DRM_ERROR("can't reserve VRAM\n");
Signature · 6 lines
2.11.0

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

PATCH 8/13 drm/virtio: use simpler remove_conflicting_pci_framebuffers()

In reply to Michał Mirosław
---
 drivers/gpu/drm/virtio/virtgpu_drm_bus.c | 24 +++---------------------
 1 file changed, 3 insertions(+), 21 deletions(-)
drivers/gpu/drm/virtio/virtgpu_drm_bus.c +3 -21
index 7df8d0c9026a..115ed546ca4e 100644
@@ -28,26 +28,6 @@
 
 #include "virtgpu_drv.h"
 
-static void virtio_pci_kick_out_firmware_fb(struct pci_dev *pci_dev)
-{
-	struct apertures_struct *ap;
-	bool primary;
-
-	ap = alloc_apertures(1);
-	if (!ap)
-		return;
-
-	ap->ranges[0].base = pci_resource_start(pci_dev, 0);
-	ap->ranges[0].size = pci_resource_len(pci_dev, 0);
-
-	primary = pci_dev->resource[PCI_ROM_RESOURCE].flags
-		& IORESOURCE_ROM_SHADOW;
-
-	drm_fb_helper_remove_conflicting_framebuffers(ap, "virtiodrmfb", primary);
-
-	kfree(ap);
-}
-
 int drm_virtio_init(struct drm_driver *driver, struct virtio_device *vdev)
 {
 	struct drm_device *dev;
@@ -69,7 +49,9 @@ int drm_virtio_init(struct drm_driver *driver, struct virtio_device *vdev)
 			 pname);
 		dev->pdev = pdev;
 		if (vga)
-			virtio_pci_kick_out_firmware_fb(pdev);
+			drm_fb_helper_remove_conflicting_pci_framebuffers(pdev,
+									  0,
+									  "virtiodrmfb");
 
 		snprintf(unique, sizeof(unique), "pci:%s", pname);
 		ret = drm_dev_set_unique(dev, unique);
Signature · 6 lines
2.11.0

_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
#41 lore raw

PATCH 9/13 staging: sm750fb: use simpler remove_conflicting_pci_framebuffers()

In reply to Michał Mirosław
---
 drivers/staging/sm750fb/sm750.c | 22 +---------------------
 1 file changed, 1 insertion(+), 21 deletions(-)
drivers/staging/sm750fb/sm750.c +1 -21
index 67207b0554cd..0590fc45c493 100644
@@ -1053,26 +1053,6 @@ static int sm750fb_frambuffer_alloc(struct sm750_dev *sm750_dev, int fbidx)
 	return err;
 }
 
-static int lynxfb_kick_out_firmware_fb(struct pci_dev *pdev)
-{
-	struct apertures_struct *ap;
-	bool primary = false;
-
-	ap = alloc_apertures(1);
-	if (!ap)
-		return -ENOMEM;
-
-	ap->ranges[0].base = pci_resource_start(pdev, 0);
-	ap->ranges[0].size = pci_resource_len(pdev, 0);
-#ifdef CONFIG_X86
-	primary = pdev->resource[PCI_ROM_RESOURCE].flags &
-					IORESOURCE_ROM_SHADOW;
-#endif
-	remove_conflicting_framebuffers(ap, "sm750_fb1", primary);
-	kfree(ap);
-	return 0;
-}
-
 static int lynxfb_pci_probe(struct pci_dev *pdev,
 			    const struct pci_device_id *ent)
 {
@@ -1081,7 +1061,7 @@ static int lynxfb_pci_probe(struct pci_dev *pdev,
 	int fbidx;
 	int err;
 
-	err = lynxfb_kick_out_firmware_fb(pdev);
+	err = remove_conflicting_pci_framebuffers(pdev, 0, "sm750_fb1");
 	if (err)
 		return err;
 
Signature · 6 lines
2.11.0

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

Re: [PATCH 09/13] staging: sm750fb: use simpler remove_conflicting_pci_framebuffers()

Quoted 2 lines · Michał Mirosław

---

Why exactly do we have an fbdev driver in staging? Afaiui fbdev is entirely closed for new drivers (pls convert to an atomic drm driver instead, it likely will be smaller even).

That's even worse than having a non-atomic drm driver in staging ... -Daniel

Quoted 50 lines
 drivers/staging/sm750fb/sm750.c | 22 +---------------------
 1 file changed, 1 insertion(+), 21 deletions(-)
drivers/staging/sm750fb/sm750.c +1 -21
index 67207b0554cd..0590fc45c493 100644
@@ -1053,26 +1053,6 @@ static int sm750fb_frambuffer_alloc(struct sm750_dev *sm750_dev, int fbidx)
 	return err;
 }
 
-static int lynxfb_kick_out_firmware_fb(struct pci_dev *pdev)
-{
-	struct apertures_struct *ap;
-	bool primary = false;
-
-	ap = alloc_apertures(1);
-	if (!ap)
-		return -ENOMEM;
-
-	ap->ranges[0].base = pci_resource_start(pdev, 0);
-	ap->ranges[0].size = pci_resource_len(pdev, 0);
-#ifdef CONFIG_X86
-	primary = pdev->resource[PCI_ROM_RESOURCE].flags &
-					IORESOURCE_ROM_SHADOW;
-#endif
-	remove_conflicting_framebuffers(ap, "sm750_fb1", primary);
-	kfree(ap);
-	return 0;
-}
-
 static int lynxfb_pci_probe(struct pci_dev *pdev,
 			    const struct pci_device_id *ent)
 {
@@ -1081,7 +1061,7 @@ static int lynxfb_pci_probe(struct pci_dev *pdev,
 	int fbidx;
 	int err;
 
-	err = lynxfb_kick_out_firmware_fb(pdev);
+	err = remove_conflicting_pci_framebuffers(pdev, 0, "sm750_fb1");
 	if (err)
 		return err;
 
Signature · 6 lines
2.11.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
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
maintainer
#43 lore raw

Re: [PATCH 09/13] staging: sm750fb: use simpler remove_conflicting_pci_framebuffers()

Quoted 7 lines · Daniel Vetter
Quoted 2 lines · Michał Mirosław

---

Why exactly do we have an fbdev driver in staging? Afaiui fbdev is entirely closed for new drivers (pls convert to an atomic drm driver instead, it likely will be smaller even).

This is in staging for many days now, it was added to staging even before Tomi announced that he will not accept any new drivers in fbdev.

Converting it to drm driver is the plan and I will have a look into it.

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

#44 lore raw

PATCH 11/13 drm/vc4: use simpler remove_conflicting_framebuffers(NULL)

In reply to Michał Mirosław

Use remove_conflicting_framebuffers(NULL) instead of open-coding it.

---
 drivers/gpu/drm/vc4/vc4_drv.c | 20 +-------------------
 1 file changed, 1 insertion(+), 19 deletions(-)
drivers/gpu/drm/vc4/vc4_drv.c +1 -19
index e3c29729da2e..b65cddb775bb 100644
@@ -227,24 +227,6 @@ static void vc4_match_add_drivers(struct device *dev,
 	}
 }
 
-static void vc4_kick_out_firmware_fb(void)
-{
-	struct apertures_struct *ap;
-
-	ap = alloc_apertures(1);
-	if (!ap)
-		return;
-
-	/* Since VC4 is a UMA device, the simplefb node may have been
-	 * located anywhere in memory.
-	 */
-	ap->ranges[0].base = 0;
-	ap->ranges[0].size = ~0;
-
-	drm_fb_helper_remove_conflicting_framebuffers(ap, "vc4drmfb", false);
-	kfree(ap);
-}
-
 static int vc4_drm_bind(struct device *dev)
 {
 	struct platform_device *pdev = to_platform_device(dev);
@@ -277,7 +259,7 @@ static int vc4_drm_bind(struct device *dev)
 	if (ret)
 		goto gem_destroy;
 
-	vc4_kick_out_firmware_fb();
+	drm_fb_helper_remove_conflicting_framebuffers(NULL, "vc4drmfb", false);
 
 	ret = drm_dev_register(drm, 0);
 	if (ret < 0)
Signature · 6 lines
2.11.0

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

PATCH 12/13 drm/sun4i: use simpler remove_conflicting_framebuffers(NULL)

In reply to Michał Mirosław

Use remove_conflicting_framebuffers(NULL) instead of duplicating it.

---
 drivers/gpu/drm/sun4i/sun4i_drv.c | 18 +-----------------
 1 file changed, 1 insertion(+), 17 deletions(-)
drivers/gpu/drm/sun4i/sun4i_drv.c +1 -17
index 75c76cdd82bc..febc591e9c17 100644
@@ -66,22 +66,6 @@ static struct drm_driver sun4i_drv_driver = {
 	/* Frame Buffer Operations */
 };
 
-static void sun4i_remove_framebuffers(void)
-{
-	struct apertures_struct *ap;
-
-	ap = alloc_apertures(1);
-	if (!ap)
-		return;
-
-	/* The framebuffer can be located anywhere in RAM */
-	ap->ranges[0].base = 0;
-	ap->ranges[0].size = ~0;
-
-	drm_fb_helper_remove_conflicting_framebuffers(ap, "sun4i-drm-fb", false);
-	kfree(ap);
-}
-
 static int sun4i_drv_bind(struct device *dev)
 {
 	struct drm_device *drm;
@@ -123,7 +107,7 @@ static int sun4i_drv_bind(struct device *dev)
 	drm->irq_enabled = true;
 
 	/* Remove early framebuffers (ie. simplefb) */
-	sun4i_remove_framebuffers();
+	drm_fb_helper_remove_conflicting_framebuffers(NULL, "sun4i-drm-fb", false);
 
 	/* Create our framebuffer */
 	drv->fbdev = sun4i_framebuffer_init(drm);
Signature · 6 lines
2.11.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Acked-by on v1 12/13
#47 lore raw

Re: [PATCH 12/13] drm/sun4i: use simpler remove_conflicting_framebuffers(NULL)

Quoted 3 lines · Michał Mirosław

Use remove_conflicting_framebuffers(NULL) instead of duplicating it.

Thanks!
Maxime

Signature · 3 lines
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

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

Acked-by on the v1 series
#48 lore raw
In reply to Michał Mirosław
Quoted 7 lines · Michał Mirosław

This series cleans up duplicated code for replacing firmware FB driver with proper DRI driver and adds handover support to Tegra driver.

The last patch is here because it uses new semantics of remove_conflicting_framebuffers() from this series. This can be considered independently, though.

Except for that patches I've commented on:

Since this is for tegra and Thierry has drm-misc commit rights, it's probably simplest when Thierry pushes this all to drm-misc once driver maintainers had a chance to look at it. Also needs and ack from Bart for the fbdev sides.
-Daniel

Quoted 41 lines

---

Michał Mirosław (13):
fbdev: show fbdev number for debugging
fbdev: add remove_conflicting_pci_framebuffers() drm/amdgpu: use simpler remove_conflicting_pci_framebuffers() drm/bochs: use simpler remove_conflicting_pci_framebuffers() drm/cirrus: use simpler remove_conflicting_pci_framebuffers() drm/mgag200: use simpler remove_conflicting_pci_framebuffers() drm/radeon: use simpler remove_conflicting_pci_framebuffers() drm/virtio: use simpler remove_conflicting_pci_framebuffers()
staging: sm750fb: use simpler remove_conflicting_pci_framebuffers()
fbdev: allow apertures == NULL in remove_conflicting_framebuffers() drm/vc4: use simpler remove_conflicting_framebuffers(NULL) drm/sun4i: use simpler remove_conflicting_framebuffers(NULL) drm/tegra: kick out simplefb

 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c  | 23 +-----------------
 drivers/gpu/drm/bochs/bochs_drv.c        | 18 +-------------
 drivers/gpu/drm/cirrus/cirrus_drv.c      | 23 +-----------------
 drivers/gpu/drm/mgag200/mgag200_drv.c    | 21 +----------------
 drivers/gpu/drm/mgag200/mgag200_main.c   |  9 -------
 drivers/gpu/drm/radeon/radeon_drv.c      | 23 +-----------------
 drivers/gpu/drm/sun4i/sun4i_drv.c        | 18 +-------------
 drivers/gpu/drm/tegra/drm.c              |  4 ++++
 drivers/gpu/drm/vc4/vc4_drv.c            | 20 +---------------
 drivers/gpu/drm/virtio/virtgpu_drm_bus.c | 24 +++----------------
 drivers/staging/sm750fb/sm750.c          | 22 +-----------------
 drivers/video/fbdev/core/fbmem.c         | 40 ++++++++++++++++++++++++++++++--
 include/drm/drm_fb_helper.h              | 12 ++++++++++
 include/linux/fb.h                       |  2 ++
 14 files changed, 67 insertions(+), 192 deletions(-)
Signature · 6 lines
2.11.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
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

A message that is not in the archive (sent off-list or not yet received): 20171127103044.faakzch7ehlkc3or-dv86pmgwkMBes7Z6vYuT8azUEOm+Xw19@public.gmane.org

#50 lore raw
Quoted 9 lines · Daniel Vetter
Quoted 7 lines · Michał Mirosław

This series cleans up duplicated code for replacing firmware FB driver with proper DRI driver and adds handover support to Tegra driver.

The last patch is here because it uses new semantics of remove_conflicting_framebuffers() from this series. This can be considered independently, though.

Quoted 7 lines

Except for that patches I've commented on:

Since this is for tegra and Thierry has drm-misc commit rights, it's probably simplest when Thierry pushes this all to drm-misc once driver maintainers had a chance to look at it.

Will do.

Thierry

#51 lore raw
In reply to a message not in the archive
Quoted 4 lines · Daniel Vetter
Quoted 3 lines · Michał Mirosław

This series cleans up duplicated code for replacing firmware FB driver with proper DRI driver and adds handover support to Tegra driver.

Please Cc: me on and linux-fbdev ML on fbdev related patches (I was Cc:-ed only on the cover letter and patch #10, linux-fbdev was not Cc:-ed at all).

Quoted 4 lines
Quoted 3 lines

The last patch is here because it uses new semantics of remove_conflicting_framebuffers() from this series. This can be considered independently, though.

Quoted 8 lines

Except for that patches I've commented on:

Since this is for tegra and Thierry has drm-misc commit rights, it's probably simplest when Thierry pushes this all to drm-misc once driver maintainers had a chance to look at it. Also needs and ack from Bart for the fbdev sides.

For fbdev changes:

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics

#52 lore raw
In reply to Daniel Vetter
Quoted 9 lines · Daniel Vetter
Quoted 7 lines · Michał Mirosław

This series cleans up duplicated code for replacing firmware FB driver with proper DRI driver and adds handover support to Tegra driver.

The last patch is here because it uses new semantics of remove_conflicting_framebuffers() from this series. This can be considered independently, though.

Quoted 7 lines

Except for that patches I've commented on:

Since this is for tegra and Thierry has drm-misc commit rights, it's probably simplest when Thierry pushes this all to drm-misc once driver maintainers had a chance to look at it.

Will do.

Thierry

_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

#53 lore raw
In reply to Daniel Vetter
Quoted 4 lines · Daniel Vetter
Quoted 3 lines · Michał Mirosław

This series cleans up duplicated code for replacing firmware FB driver with proper DRI driver and adds handover support to Tegra driver.

Please Cc: me on and linux-fbdev ML on fbdev related patches (I was Cc:-ed only on the cover letter and patch #10, linux-fbdev was not Cc:-ed at all).

Quoted 4 lines
Quoted 3 lines

The last patch is here because it uses new semantics of remove_conflicting_framebuffers() from this series. This can be considered independently, though.

Quoted 8 lines

Except for that patches I've commented on:

Since this is for tegra and Thierry has drm-misc commit rights, it's probably simplest when Thierry pushes this all to drm-misc once driver maintainers had a chance to look at it. Also needs and ack from Bart for the fbdev sides.

For fbdev changes:

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics

_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Acked-by on the v1 series
#54 lore raw
In reply to Michał Mirosław
Quoted 7 lines · Michał Mirosław

This series cleans up duplicated code for replacing firmware FB driver with proper DRI driver and adds handover support to Tegra driver.

The last patch is here because it uses new semantics of remove_conflicting_framebuffers() from this series. This can be considered independently, though.

Except for that patches I've commented on:

Since this is for tegra and Thierry has drm-misc commit rights, it's probably simplest when Thierry pushes this all to drm-misc once driver maintainers had a chance to look at it. Also needs and ack from Bart for the fbdev sides.
-Daniel

Quoted 41 lines

---

Michał Mirosław (13):
fbdev: show fbdev number for debugging
fbdev: add remove_conflicting_pci_framebuffers() drm/amdgpu: use simpler remove_conflicting_pci_framebuffers() drm/bochs: use simpler remove_conflicting_pci_framebuffers() drm/cirrus: use simpler remove_conflicting_pci_framebuffers() drm/mgag200: use simpler remove_conflicting_pci_framebuffers() drm/radeon: use simpler remove_conflicting_pci_framebuffers() drm/virtio: use simpler remove_conflicting_pci_framebuffers()
staging: sm750fb: use simpler remove_conflicting_pci_framebuffers()
fbdev: allow apertures == NULL in remove_conflicting_framebuffers() drm/vc4: use simpler remove_conflicting_framebuffers(NULL) drm/sun4i: use simpler remove_conflicting_framebuffers(NULL) drm/tegra: kick out simplefb

 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c  | 23 +-----------------
 drivers/gpu/drm/bochs/bochs_drv.c        | 18 +-------------
 drivers/gpu/drm/cirrus/cirrus_drv.c      | 23 +-----------------
 drivers/gpu/drm/mgag200/mgag200_drv.c    | 21 +----------------
 drivers/gpu/drm/mgag200/mgag200_main.c   |  9 -------
 drivers/gpu/drm/radeon/radeon_drv.c      | 23 +-----------------
 drivers/gpu/drm/sun4i/sun4i_drv.c        | 18 +-------------
 drivers/gpu/drm/tegra/drm.c              |  4 ++++
 drivers/gpu/drm/vc4/vc4_drv.c            | 20 +---------------
 drivers/gpu/drm/virtio/virtgpu_drm_bus.c | 24 +++----------------
 drivers/staging/sm750fb/sm750.c          | 22 +-----------------
 drivers/video/fbdev/core/fbmem.c         | 40 ++++++++++++++++++++++++++++++--
 include/drm/drm_fb_helper.h              | 12 ++++++++++
 include/linux/fb.h                       |  2 ++
 14 files changed, 67 insertions(+), 192 deletions(-)
Signature · 6 lines
2.11.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
#55 lore raw

v2 cover remove_conflicting_framebuffers() cleanup

In reply to Michał Mirosław

This series cleans up duplicated code for replacing firmware FB driver with proper DRI driver and adds handover support to Tegra driver.

This is a sligtly updated version of a series sent on 24 Nov 2017.

v2:
- rebased on current drm-next
- dropped staging/sm750fb changes
- added kernel docs for DRM helpers

Michał Mirosław (12):
fbdev: show fbdev number for debugging
fbdev: allow apertures == NULL in remove_conflicting_framebuffers()
fbdev: add remove_conflicting_pci_framebuffers() drm/amdgpu: use simpler remove_conflicting_pci_framebuffers() drm/bochs: use simpler remove_conflicting_pci_framebuffers() drm/cirrus: use simpler remove_conflicting_pci_framebuffers() drm/mgag200: use simpler remove_conflicting_pci_framebuffers() drm/radeon: use simpler remove_conflicting_pci_framebuffers() drm/virtio: use simpler remove_conflicting_pci_framebuffers() drm/vc4: use simpler remove_conflicting_framebuffers(NULL) drm/sun4i: use simpler remove_conflicting_framebuffers(NULL) drm/tegra: kick out simplefb

 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c  | 24 +-------------
 drivers/gpu/drm/bochs/bochs_drv.c        | 18 +----------
 drivers/gpu/drm/cirrus/cirrus_drv.c      | 23 +-------------
 drivers/gpu/drm/mgag200/mgag200_drv.c    | 21 +------------
 drivers/gpu/drm/mgag200/mgag200_main.c   |  9 ------
 drivers/gpu/drm/radeon/radeon_drv.c      | 23 +-------------
 drivers/gpu/drm/sun4i/sun4i_drv.c        | 18 +----------
 drivers/gpu/drm/tegra/drm.c              |  4 +++
 drivers/gpu/drm/vc4/vc4_drv.c            | 20 +-----------
 drivers/gpu/drm/virtio/virtgpu_drm_bus.c | 24 ++------------
 drivers/video/fbdev/core/fbmem.c         | 40 ++++++++++++++++++++++--
 include/drm/drm_fb_helper.h              | 34 ++++++++++++++++++++
 include/linux/fb.h                       |  2 ++
 13 files changed, 88 insertions(+), 172 deletions(-)
Signature · 7 lines
2.18.0


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#56 lore raw

PATCH v2 1/12 fbdev: show fbdev number for debugging

---
 drivers/video/fbdev/core/fbmem.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/video/fbdev/core/fbmem.c +2 -2
index f741ba8df01b..30a18d4c9de4 100644
@@ -1618,8 +1618,8 @@ static int do_remove_conflicting_framebuffers(struct apertures_struct *a,
 			(primary && gen_aper && gen_aper->count &&
 			 gen_aper->ranges[0].base == VGA_FB_PHYS)) {
 
-			printk(KERN_INFO "fb: switching to %s from %s\n",
-			       name, registered_fb[i]->fix.id);
+			printk(KERN_INFO "fb%d: switching to %s from %s\n",
+			       i, name, registered_fb[i]->fix.id);
 			ret = do_unregister_framebuffer(registered_fb[i]);
 			if (ret)
 				return ret;
Signature · 7 lines
2.18.0


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#57 lore raw

PATCH v2 1/12 fbdev: show fbdev number for debugging

In reply to Michał Mirosław
---
 drivers/video/fbdev/core/fbmem.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/video/fbdev/core/fbmem.c +2 -2
index f741ba8df01b..30a18d4c9de4 100644
@@ -1618,8 +1618,8 @@ static int do_remove_conflicting_framebuffers(struct apertures_struct *a,
 			(primary && gen_aper && gen_aper->count &&
 			 gen_aper->ranges[0].base == VGA_FB_PHYS)) {
 
-			printk(KERN_INFO "fb: switching to %s from %s\n",
-			       name, registered_fb[i]->fix.id);
+			printk(KERN_INFO "fb%d: switching to %s from %s\n",
+			       i, name, registered_fb[i]->fix.id);
 			ret = do_unregister_framebuffer(registered_fb[i]);
 			if (ret)
 				return ret;
Signature · 6 lines
2.18.0

_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
#58 lore raw

PATCH v2 2/12 fbdev: allow apertures == NULL in remove_conflicting_framebuffers()

In reply to Michał Mirosław

Interpret (otherwise-invalid) NULL apertures argument to mean all-memory range. This will allow to remove several duplicates of this code from drivers in following patches.

---
v2: added kerneldoc to corresponding DRM helper

---
 drivers/video/fbdev/core/fbmem.c | 14 ++++++++++++++
 include/drm/drm_fb_helper.h      | 10 ++++++++++
 2 files changed, 24 insertions(+)
drivers/video/fbdev/core/fbmem.c +14 -0
index 30a18d4c9de4..0df148eb4699 100644
@@ -1779,11 +1779,25 @@ int remove_conflicting_framebuffers(struct apertures_struct *a,
 				    const char *name, bool primary)
 {
 	int ret;
+	bool do_free = false;
+
+	if (!a) {
+		a = alloc_apertures(1);
+		if (!a)
+			return -ENOMEM;
+
+		a->ranges[0].base = 0;
+		a->ranges[0].size = ~0;
+		do_free = true;
+	}
 
 	mutex_lock(&registration_lock);
 	ret = do_remove_conflicting_framebuffers(a, name, primary);
 	mutex_unlock(&registration_lock);
 
+	if (do_free)
+		kfree(a);
+
 	return ret;
 }
 EXPORT_SYMBOL(remove_conflicting_framebuffers);
include/drm/drm_fb_helper.h +10 -0
index b069433e7fc1..1c1e53abb25d 100644
@@ -566,6 +566,16 @@ static inline void drm_fb_helper_output_poll_changed(struct drm_device *dev)
 
 #endif
 
+/**
+ * drm_fb_helper_remove_conflicting_framebuffers - remove firmware framebuffers
+ * @a: memory range, users of which are to be removed
+ * @name: requesting driver name
+ * @primary: also kick vga16fb if present
+ *
+ * This function removes framebuffer devices (eg. initialized by firmware)
+ * which use memory range described by @a. If @a is NULL all such devices are
+ * removed.
+ */
 static inline int
 drm_fb_helper_remove_conflicting_framebuffers(struct apertures_struct *a,
 					      const char *name, bool primary)
Signature · 7 lines
2.18.0


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#59 lore raw

Re: [PATCH v2 02/12] fbdev: allow apertures == NULL in remove_conflicting_framebuffers()

Quoted 53 lines · Michał Mirosław

Interpret (otherwise-invalid) NULL apertures argument to mean all-memory range. This will allow to remove several duplicates of this code from drivers in following patches.

---
v2: added kerneldoc to corresponding DRM helper

---
 drivers/video/fbdev/core/fbmem.c | 14 ++++++++++++++
 include/drm/drm_fb_helper.h      | 10 ++++++++++
 2 files changed, 24 insertions(+)
drivers/video/fbdev/core/fbmem.c +14 -0
index 30a18d4c9de4..0df148eb4699 100644
@@ -1779,11 +1779,25 @@ int remove_conflicting_framebuffers(struct apertures_struct *a,
 				    const char *name, bool primary)
 {
 	int ret;
+	bool do_free = false;
+
+	if (!a) {
+		a = alloc_apertures(1);
+		if (!a)
+			return -ENOMEM;
+
+		a->ranges[0].base = 0;
+		a->ranges[0].size = ~0;
+		do_free = true;
+	}
 
 	mutex_lock(&registration_lock);
 	ret = do_remove_conflicting_framebuffers(a, name, primary);
 	mutex_unlock(&registration_lock);
 
+	if (do_free)
+		kfree(a);
+
 	return ret;
 }
 EXPORT_SYMBOL(remove_conflicting_framebuffers);
include/drm/drm_fb_helper.h +0 -0
index b069433e7fc1..1c1e53abb25d 100644
@@ -566,6 +566,16 @@ static inline void drm_fb_helper_output_poll_changed(struct drm_device *dev)
 
 #endif
 

include/drm/drm_fb_helper.h static inline void drm_fb_helper_output_poll_changed(struct drm_device *dev) · line 578

Quoted 10 lines
include/drm/drm_fb_helper.h +10 -0
+/**
+ * drm_fb_helper_remove_conflicting_framebuffers - remove firmware framebuffers
+ * @a: memory range, users of which are to be removed
+ * @name: requesting driver name
+ * @primary: also kick vga16fb if present
+ *
+ * This function removes framebuffer devices (eg. initialized by firmware)
+ * which use memory range described by @a. If @a is NULL all such devices are
+ * removed.
+ */

This looks like misplaced copypasta. You only need this once I think. -Daniel

Quoted 10 lines
include/drm/drm_fb_helper.h +0 -0
 static inline int
 drm_fb_helper_remove_conflicting_framebuffers(struct apertures_struct *a,
 					      const char *name, bool primary)
Signature · 6 lines
2.18.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

A message that is not in the archive (sent off-list or not yet received): 20180831085656.GR21634-dv86pmgwkMBes7Z6vYuT8azUEOm+Xw19@public.gmane.org

#61 lore raw

Re: [PATCH v2 02/12] fbdev: allow apertures == NULL in remove_conflicting_framebuffers()

Quoted 54 lines · Daniel Vetter
Quoted 53 lines · Michał Mirosław

Interpret (otherwise-invalid) NULL apertures argument to mean all-memory range. This will allow to remove several duplicates of this code from drivers in following patches.

---
v2: added kerneldoc to corresponding DRM helper

---
 drivers/video/fbdev/core/fbmem.c | 14 ++++++++++++++
 include/drm/drm_fb_helper.h      | 10 ++++++++++
 2 files changed, 24 insertions(+)
drivers/video/fbdev/core/fbmem.c +14 -0
index 30a18d4c9de4..0df148eb4699 100644
@@ -1779,11 +1779,25 @@ int remove_conflicting_framebuffers(struct apertures_struct *a,
 				    const char *name, bool primary)
 {
 	int ret;
+	bool do_free = false;
+
+	if (!a) {
+		a = alloc_apertures(1);
+		if (!a)
+			return -ENOMEM;
+
+		a->ranges[0].base = 0;
+		a->ranges[0].size = ~0;
+		do_free = true;
+	}
 
 	mutex_lock(&registration_lock);
 	ret = do_remove_conflicting_framebuffers(a, name, primary);
 	mutex_unlock(&registration_lock);
 
+	if (do_free)
+		kfree(a);
+
 	return ret;
 }
 EXPORT_SYMBOL(remove_conflicting_framebuffers);
include/drm/drm_fb_helper.h +0 -0
index b069433e7fc1..1c1e53abb25d 100644
@@ -566,6 +566,16 @@ static inline void drm_fb_helper_output_poll_changed(struct drm_device *dev)
 
 #endif
 
Quoted 12 lines

include/drm/drm_fb_helper.h static inline void drm_fb_helper_output_poll_changed(struct drm_device *dev) · line 578

Quoted 10 lines
include/drm/drm_fb_helper.h +10 -0
+/**
+ * drm_fb_helper_remove_conflicting_framebuffers - remove firmware framebuffers
+ * @a: memory range, users of which are to be removed
+ * @name: requesting driver name
+ * @primary: also kick vga16fb if present
+ *
+ * This function removes framebuffer devices (eg. initialized by firmware)
+ * which use memory range described by @a. If @a is NULL all such devices are
+ * removed.
+ */

This looks like misplaced copypasta. You only need this once I think.

Ah no, just a fixup for the lack of kerneldoc we have. Can you pls split this out into a separate patch?

Thanks, Daniel

Quoted 17 lines

-Daniel

Quoted 10 lines
include/drm/drm_fb_helper.h +0 -0
 static inline int
 drm_fb_helper_remove_conflicting_framebuffers(struct apertures_struct *a,
 					      const char *name, bool primary)
Signature · 6 lines
2.18.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#62 lore raw

Re: [PATCH v2 02/12] fbdev: allow apertures == NULL in remove_conflicting_framebuffers()

In reply to Daniel Vetter
Quoted 54 lines · Daniel Vetter
Quoted 53 lines · Michał Mirosław

Interpret (otherwise-invalid) NULL apertures argument to mean all-memory range. This will allow to remove several duplicates of this code from drivers in following patches.

---
v2: added kerneldoc to corresponding DRM helper

---
 drivers/video/fbdev/core/fbmem.c | 14 ++++++++++++++
 include/drm/drm_fb_helper.h      | 10 ++++++++++
 2 files changed, 24 insertions(+)
drivers/video/fbdev/core/fbmem.c +14 -0
index 30a18d4c9de4..0df148eb4699 100644
@@ -1779,11 +1779,25 @@ int remove_conflicting_framebuffers(struct apertures_struct *a,
 				    const char *name, bool primary)
 {
 	int ret;
+	bool do_free = false;
+
+	if (!a) {
+		a = alloc_apertures(1);
+		if (!a)
+			return -ENOMEM;
+
+		a->ranges[0].base = 0;
+		a->ranges[0].size = ~0;
+		do_free = true;
+	}
 
 	mutex_lock(&registration_lock);
 	ret = do_remove_conflicting_framebuffers(a, name, primary);
 	mutex_unlock(&registration_lock);
 
+	if (do_free)
+		kfree(a);
+
 	return ret;
 }
 EXPORT_SYMBOL(remove_conflicting_framebuffers);
include/drm/drm_fb_helper.h +0 -0
index b069433e7fc1..1c1e53abb25d 100644
@@ -566,6 +566,16 @@ static inline void drm_fb_helper_output_poll_changed(struct drm_device *dev)
 
 #endif
 
Quoted 12 lines

include/drm/drm_fb_helper.h static inline void drm_fb_helper_output_poll_changed(struct drm_device *dev) · line 578

Quoted 10 lines
include/drm/drm_fb_helper.h +10 -0
+/**
+ * drm_fb_helper_remove_conflicting_framebuffers - remove firmware framebuffers
+ * @a: memory range, users of which are to be removed
+ * @name: requesting driver name
+ * @primary: also kick vga16fb if present
+ *
+ * This function removes framebuffer devices (eg. initialized by firmware)
+ * which use memory range described by @a. If @a is NULL all such devices are
+ * removed.
+ */

This looks like misplaced copypasta. You only need this once I think.

Ah no, just a fixup for the lack of kerneldoc we have. Can you pls split this out into a separate patch?

Thanks, Daniel

Quoted 17 lines

-Daniel

Quoted 10 lines
include/drm/drm_fb_helper.h +0 -0
 static inline int
 drm_fb_helper_remove_conflicting_framebuffers(struct apertures_struct *a,
 					      const char *name, bool primary)
Signature · 6 lines
2.18.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
#63 lore raw

PATCH v2 2/12 fbdev: allow apertures == NULL in remove_conflicting_framebuffers()

In reply to Michał Mirosław

Interpret (otherwise-invalid) NULL apertures argument to mean all-memory range. This will allow to remove several duplicates of this code from drivers in following patches.

---
v2: added kerneldoc to corresponding DRM helper

---
 drivers/video/fbdev/core/fbmem.c | 14 ++++++++++++++
 include/drm/drm_fb_helper.h      | 10 ++++++++++
 2 files changed, 24 insertions(+)
drivers/video/fbdev/core/fbmem.c +14 -0
index 30a18d4c9de4..0df148eb4699 100644
@@ -1779,11 +1779,25 @@ int remove_conflicting_framebuffers(struct apertures_struct *a,
 				    const char *name, bool primary)
 {
 	int ret;
+	bool do_free = false;
+
+	if (!a) {
+		a = alloc_apertures(1);
+		if (!a)
+			return -ENOMEM;
+
+		a->ranges[0].base = 0;
+		a->ranges[0].size = ~0;
+		do_free = true;
+	}
 
 	mutex_lock(&registration_lock);
 	ret = do_remove_conflicting_framebuffers(a, name, primary);
 	mutex_unlock(&registration_lock);
 
+	if (do_free)
+		kfree(a);
+
 	return ret;
 }
 EXPORT_SYMBOL(remove_conflicting_framebuffers);
include/drm/drm_fb_helper.h +10 -0
index b069433e7fc1..1c1e53abb25d 100644
@@ -566,6 +566,16 @@ static inline void drm_fb_helper_output_poll_changed(struct drm_device *dev)
 
 #endif
 
+/**
+ * drm_fb_helper_remove_conflicting_framebuffers - remove firmware framebuffers
+ * @a: memory range, users of which are to be removed
+ * @name: requesting driver name
+ * @primary: also kick vga16fb if present
+ *
+ * This function removes framebuffer devices (eg. initialized by firmware)
+ * which use memory range described by @a. If @a is NULL all such devices are
+ * removed.
+ */
 static inline int
 drm_fb_helper_remove_conflicting_framebuffers(struct apertures_struct *a,
 					      const char *name, bool primary)
Signature · 6 lines
2.18.0

_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
#64 lore raw

PATCH v2 3/12 fbdev: add remove_conflicting_pci_framebuffers()

In reply to Michał Mirosław

Almost all PCI drivers using remove_conflicting_framebuffers() wrap it with the same code.

---
v2: add kerneldoc for DRM helper

---
 drivers/video/fbdev/core/fbmem.c | 22 ++++++++++++++++++++++
 include/drm/drm_fb_helper.h      | 24 ++++++++++++++++++++++++
 include/linux/fb.h               |  2 ++
 3 files changed, 48 insertions(+)
drivers/video/fbdev/core/fbmem.c +22 -0
index 0df148eb4699..927e016487e9 100644
@@ -34,6 +34,7 @@
 #include <linux/fb.h>
 #include <linux/fbcon.h>
 #include <linux/mem_encrypt.h>
+#include <linux/pci.h>
 
 #include <asm/fb.h>
 
@@ -1802,6 +1803,27 @@ int remove_conflicting_framebuffers(struct apertures_struct *a,
 }
 EXPORT_SYMBOL(remove_conflicting_framebuffers);
 
+int remove_conflicting_pci_framebuffers(struct pci_dev *pdev, int res_id, const char *name)
+{
+	struct apertures_struct *ap;
+	bool primary = false;
+
+	ap = alloc_apertures(1);
+	if (!ap)
+		return -ENOMEM;
+
+	ap->ranges[0].base = pci_resource_start(pdev, res_id);
+	ap->ranges[0].size = pci_resource_len(pdev, res_id);
+#ifdef CONFIG_X86
+	primary = pdev->resource[PCI_ROM_RESOURCE].flags &
+					IORESOURCE_ROM_SHADOW;
+#endif
+	remove_conflicting_framebuffers(ap, name, primary);
+	kfree(ap);
+	return 0;
+}
+EXPORT_SYMBOL(remove_conflicting_pci_framebuffers);
+
 /**
  *	register_framebuffer - registers a frame buffer device
  *	@fb_info: frame buffer info structure
include/drm/drm_fb_helper.h +24 -0
index 1c1e53abb25d..6e1fc52d1b1b 100644
@@ -587,4 +587,28 @@ drm_fb_helper_remove_conflicting_framebuffers(struct apertures_struct *a,
 #endif
 }
 
+/**
+ * drm_fb_helper_remove_conflicting_framebuffers - remove firmware framebuffers for PCI devices
+ * @pdev: PCI device being driven
+ * @resource_id: index of PCI BAR configuring framebuffer memory
+ * @name: requesting driver name
+ *
+ * This function removes framebuffer devices (eg. initialized by firmware)
+ * using memory range configured for @pdev's BAR @resource_id.
+ *
+ * The function assumes that PCI device with shadowed ROM is drives a primary
+ * display and so kicks out vga16fb.
+ */
+static inline int
+drm_fb_helper_remove_conflicting_pci_framebuffers(struct pci_dev *pdev,
+						  int resource_id,
+						  const char *name)
+{
+#if IS_REACHABLE(CONFIG_FB)
+	return remove_conflicting_pci_framebuffers(pdev, resource_id, name);
+#else
+	return 0;
+#endif
+}
+
 #endif
include/linux/fb.h +2 -0
index aa74a228bb92..abeffd55b66a 100644
@@ -632,6 +632,8 @@ extern ssize_t fb_sys_write(struct fb_info *info, const char __user *buf,
 extern int register_framebuffer(struct fb_info *fb_info);
 extern int unregister_framebuffer(struct fb_info *fb_info);
 extern int unlink_framebuffer(struct fb_info *fb_info);
+extern int remove_conflicting_pci_framebuffers(struct pci_dev *pdev, int res_id,
+					       const char *name);
 extern int remove_conflicting_framebuffers(struct apertures_struct *a,
 					   const char *name, bool primary);
 extern int fb_prepare_logo(struct fb_info *fb_info, int rotate);
Signature · 7 lines
2.18.0


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#65 lore raw

PATCH v2 3/12 fbdev: add remove_conflicting_pci_framebuffers()

In reply to Michał Mirosław

Almost all PCI drivers using remove_conflicting_framebuffers() wrap it with the same code.

---
v2: add kerneldoc for DRM helper

---
 drivers/video/fbdev/core/fbmem.c | 22 ++++++++++++++++++++++
 include/drm/drm_fb_helper.h      | 24 ++++++++++++++++++++++++
 include/linux/fb.h               |  2 ++
 3 files changed, 48 insertions(+)
drivers/video/fbdev/core/fbmem.c +22 -0
index 0df148eb4699..927e016487e9 100644
@@ -34,6 +34,7 @@
 #include <linux/fb.h>
 #include <linux/fbcon.h>
 #include <linux/mem_encrypt.h>
+#include <linux/pci.h>
 
 #include <asm/fb.h>
 
@@ -1802,6 +1803,27 @@ int remove_conflicting_framebuffers(struct apertures_struct *a,
 }
 EXPORT_SYMBOL(remove_conflicting_framebuffers);
 
+int remove_conflicting_pci_framebuffers(struct pci_dev *pdev, int res_id, const char *name)
+{
+	struct apertures_struct *ap;
+	bool primary = false;
+
+	ap = alloc_apertures(1);
+	if (!ap)
+		return -ENOMEM;
+
+	ap->ranges[0].base = pci_resource_start(pdev, res_id);
+	ap->ranges[0].size = pci_resource_len(pdev, res_id);
+#ifdef CONFIG_X86
+	primary = pdev->resource[PCI_ROM_RESOURCE].flags &
+					IORESOURCE_ROM_SHADOW;
+#endif
+	remove_conflicting_framebuffers(ap, name, primary);
+	kfree(ap);
+	return 0;
+}
+EXPORT_SYMBOL(remove_conflicting_pci_framebuffers);
+
 /**
  *	register_framebuffer - registers a frame buffer device
  *	@fb_info: frame buffer info structure
include/drm/drm_fb_helper.h +24 -0
index 1c1e53abb25d..6e1fc52d1b1b 100644
@@ -587,4 +587,28 @@ drm_fb_helper_remove_conflicting_framebuffers(struct apertures_struct *a,
 #endif
 }
 
+/**
+ * drm_fb_helper_remove_conflicting_framebuffers - remove firmware framebuffers for PCI devices
+ * @pdev: PCI device being driven
+ * @resource_id: index of PCI BAR configuring framebuffer memory
+ * @name: requesting driver name
+ *
+ * This function removes framebuffer devices (eg. initialized by firmware)
+ * using memory range configured for @pdev's BAR @resource_id.
+ *
+ * The function assumes that PCI device with shadowed ROM is drives a primary
+ * display and so kicks out vga16fb.
+ */
+static inline int
+drm_fb_helper_remove_conflicting_pci_framebuffers(struct pci_dev *pdev,
+						  int resource_id,
+						  const char *name)
+{
+#if IS_REACHABLE(CONFIG_FB)
+	return remove_conflicting_pci_framebuffers(pdev, resource_id, name);
+#else
+	return 0;
+#endif
+}
+
 #endif
include/linux/fb.h +2 -0
index aa74a228bb92..abeffd55b66a 100644
@@ -632,6 +632,8 @@ extern ssize_t fb_sys_write(struct fb_info *info, const char __user *buf,
 extern int register_framebuffer(struct fb_info *fb_info);
 extern int unregister_framebuffer(struct fb_info *fb_info);
 extern int unlink_framebuffer(struct fb_info *fb_info);
+extern int remove_conflicting_pci_framebuffers(struct pci_dev *pdev, int res_id,
+					       const char *name);
 extern int remove_conflicting_framebuffers(struct apertures_struct *a,
 					   const char *name, bool primary);
 extern int fb_prepare_logo(struct fb_info *fb_info, int rotate);
Signature · 6 lines
2.18.0

_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
#66 lore raw

PATCH v2 4/12 drm/amdgpu: use simpler remove_conflicting_pci_framebuffers()

In reply to Michał Mirosław
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 24 +-----------------------
 1 file changed, 1 insertion(+), 23 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +1 -23
index 0b19482b36b8..9b6e037719db 100644
@@ -560,28 +560,6 @@ MODULE_DEVICE_TABLE(pci, pciidlist);
 
 static struct drm_driver kms_driver;
 
-static int amdgpu_kick_out_firmware_fb(struct pci_dev *pdev)
-{
-	struct apertures_struct *ap;
-	bool primary = false;
-
-	ap = alloc_apertures(1);
-	if (!ap)
-		return -ENOMEM;
-
-	ap->ranges[0].base = pci_resource_start(pdev, 0);
-	ap->ranges[0].size = pci_resource_len(pdev, 0);
-
-#ifdef CONFIG_X86
-	primary = pdev->resource[PCI_ROM_RESOURCE].flags & IORESOURCE_ROM_SHADOW;
-#endif
-	drm_fb_helper_remove_conflicting_framebuffers(ap, "amdgpudrmfb", primary);
-	kfree(ap);
-
-	return 0;
-}
-
-
 static int amdgpu_pci_probe(struct pci_dev *pdev,
 			    const struct pci_device_id *ent)
 {
@@ -609,7 +587,7 @@ static int amdgpu_pci_probe(struct pci_dev *pdev,
 		return ret;
 
 	/* Get rid of things like offb */
-	ret = amdgpu_kick_out_firmware_fb(pdev);
+	ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, 0, "amdgpudrmfb");
 	if (ret)
 		return ret;
 
Signature · 7 lines
2.18.0


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#67 lore raw

PATCH v2 4/12 drm/amdgpu: use simpler remove_conflicting_pci_framebuffers()

In reply to Michał Mirosław
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 24 +-----------------------
 1 file changed, 1 insertion(+), 23 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +1 -23
index 0b19482b36b8..9b6e037719db 100644
@@ -560,28 +560,6 @@ MODULE_DEVICE_TABLE(pci, pciidlist);
 
 static struct drm_driver kms_driver;
 
-static int amdgpu_kick_out_firmware_fb(struct pci_dev *pdev)
-{
-	struct apertures_struct *ap;
-	bool primary = false;
-
-	ap = alloc_apertures(1);
-	if (!ap)
-		return -ENOMEM;
-
-	ap->ranges[0].base = pci_resource_start(pdev, 0);
-	ap->ranges[0].size = pci_resource_len(pdev, 0);
-
-#ifdef CONFIG_X86
-	primary = pdev->resource[PCI_ROM_RESOURCE].flags & IORESOURCE_ROM_SHADOW;
-#endif
-	drm_fb_helper_remove_conflicting_framebuffers(ap, "amdgpudrmfb", primary);
-	kfree(ap);
-
-	return 0;
-}
-
-
 static int amdgpu_pci_probe(struct pci_dev *pdev,
 			    const struct pci_device_id *ent)
 {
@@ -609,7 +587,7 @@ static int amdgpu_pci_probe(struct pci_dev *pdev,
 		return ret;
 
 	/* Get rid of things like offb */
-	ret = amdgpu_kick_out_firmware_fb(pdev);
+	ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, 0, "amdgpudrmfb");
 	if (ret)
 		return ret;
 
Signature · 6 lines
2.18.0

_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
#68 lore raw

PATCH v2 5/12 drm/bochs: use simpler remove_conflicting_pci_framebuffers()

In reply to Michał Mirosław
---
 drivers/gpu/drm/bochs/bochs_drv.c | 18 +-----------------
 1 file changed, 1 insertion(+), 17 deletions(-)
drivers/gpu/drm/bochs/bochs_drv.c +1 -17
index 7b20318483e4..c61b40c72b62 100644
@@ -143,22 +143,6 @@ static const struct dev_pm_ops bochs_pm_ops = {
 /* ---------------------------------------------------------------------- */
 /* pci interface                                                          */
 
-static int bochs_kick_out_firmware_fb(struct pci_dev *pdev)
-{
-	struct apertures_struct *ap;
-
-	ap = alloc_apertures(1);
-	if (!ap)
-		return -ENOMEM;
-
-	ap->ranges[0].base = pci_resource_start(pdev, 0);
-	ap->ranges[0].size = pci_resource_len(pdev, 0);
-	drm_fb_helper_remove_conflicting_framebuffers(ap, "bochsdrmfb", false);
-	kfree(ap);
-
-	return 0;
-}
-
 static int bochs_pci_probe(struct pci_dev *pdev,
 			   const struct pci_device_id *ent)
 {
@@ -171,7 +155,7 @@ static int bochs_pci_probe(struct pci_dev *pdev,
 		return -ENOMEM;
 	}
 
-	ret = bochs_kick_out_firmware_fb(pdev);
+	ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, 0, "bochsdrmfb");
 	if (ret)
 		return ret;
 
Signature · 7 lines
2.18.0


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#69 lore raw

PATCH v2 5/12 drm/bochs: use simpler remove_conflicting_pci_framebuffers()

In reply to Michał Mirosław
---
 drivers/gpu/drm/bochs/bochs_drv.c | 18 +-----------------
 1 file changed, 1 insertion(+), 17 deletions(-)
drivers/gpu/drm/bochs/bochs_drv.c +1 -17
index 7b20318483e4..c61b40c72b62 100644
@@ -143,22 +143,6 @@ static const struct dev_pm_ops bochs_pm_ops = {
 /* ---------------------------------------------------------------------- */
 /* pci interface                                                          */
 
-static int bochs_kick_out_firmware_fb(struct pci_dev *pdev)
-{
-	struct apertures_struct *ap;
-
-	ap = alloc_apertures(1);
-	if (!ap)
-		return -ENOMEM;
-
-	ap->ranges[0].base = pci_resource_start(pdev, 0);
-	ap->ranges[0].size = pci_resource_len(pdev, 0);
-	drm_fb_helper_remove_conflicting_framebuffers(ap, "bochsdrmfb", false);
-	kfree(ap);
-
-	return 0;
-}
-
 static int bochs_pci_probe(struct pci_dev *pdev,
 			   const struct pci_device_id *ent)
 {
@@ -171,7 +155,7 @@ static int bochs_pci_probe(struct pci_dev *pdev,
 		return -ENOMEM;
 	}
 
-	ret = bochs_kick_out_firmware_fb(pdev);
+	ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, 0, "bochsdrmfb");
 	if (ret)
 		return ret;
 
Signature · 6 lines
2.18.0

_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
#70 lore raw

PATCH v2 6/12 drm/cirrus: use simpler remove_conflicting_pci_framebuffers()

In reply to Michał Mirosław
---
 drivers/gpu/drm/cirrus/cirrus_drv.c | 23 +----------------------
 1 file changed, 1 insertion(+), 22 deletions(-)
drivers/gpu/drm/cirrus/cirrus_drv.c +1 -22
index 69c4e352dd78..85ed8657c862 100644
@@ -42,33 +42,12 @@ static const struct pci_device_id pciidlist[] = {
 };
 
 
-static int cirrus_kick_out_firmware_fb(struct pci_dev *pdev)
-{
-	struct apertures_struct *ap;
-	bool primary = false;
-
-	ap = alloc_apertures(1);
-	if (!ap)
-		return -ENOMEM;
-
-	ap->ranges[0].base = pci_resource_start(pdev, 0);
-	ap->ranges[0].size = pci_resource_len(pdev, 0);
-
-#ifdef CONFIG_X86
-	primary = pdev->resource[PCI_ROM_RESOURCE].flags & IORESOURCE_ROM_SHADOW;
-#endif
-	drm_fb_helper_remove_conflicting_framebuffers(ap, "cirrusdrmfb", primary);
-	kfree(ap);
-
-	return 0;
-}
-
 static int cirrus_pci_probe(struct pci_dev *pdev,
 			    const struct pci_device_id *ent)
 {
 	int ret;
 
-	ret = cirrus_kick_out_firmware_fb(pdev);
+	ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, 0, "cirrusdrmfb");
 	if (ret)
 		return ret;
 
Signature · 7 lines
2.18.0


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#71 lore raw

PATCH v2 6/12 drm/cirrus: use simpler remove_conflicting_pci_framebuffers()

In reply to Michał Mirosław
---
 drivers/gpu/drm/cirrus/cirrus_drv.c | 23 +----------------------
 1 file changed, 1 insertion(+), 22 deletions(-)
drivers/gpu/drm/cirrus/cirrus_drv.c +1 -22
index 69c4e352dd78..85ed8657c862 100644
@@ -42,33 +42,12 @@ static const struct pci_device_id pciidlist[] = {
 };
 
 
-static int cirrus_kick_out_firmware_fb(struct pci_dev *pdev)
-{
-	struct apertures_struct *ap;
-	bool primary = false;
-
-	ap = alloc_apertures(1);
-	if (!ap)
-		return -ENOMEM;
-
-	ap->ranges[0].base = pci_resource_start(pdev, 0);
-	ap->ranges[0].size = pci_resource_len(pdev, 0);
-
-#ifdef CONFIG_X86
-	primary = pdev->resource[PCI_ROM_RESOURCE].flags & IORESOURCE_ROM_SHADOW;
-#endif
-	drm_fb_helper_remove_conflicting_framebuffers(ap, "cirrusdrmfb", primary);
-	kfree(ap);
-
-	return 0;
-}
-
 static int cirrus_pci_probe(struct pci_dev *pdev,
 			    const struct pci_device_id *ent)
 {
 	int ret;
 
-	ret = cirrus_kick_out_firmware_fb(pdev);
+	ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, 0, "cirrusdrmfb");
 	if (ret)
 		return ret;
 
Signature · 6 lines
2.18.0

_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
#72 lore raw

PATCH v2 7/12 drm/mgag200: use simpler remove_conflicting_pci_framebuffers()

In reply to Michał Mirosław

Remove duplicated call, while at it.

---
 drivers/gpu/drm/mgag200/mgag200_drv.c  | 21 +--------------------
 drivers/gpu/drm/mgag200/mgag200_main.c |  9 ---------
 2 files changed, 1 insertion(+), 29 deletions(-)
drivers/gpu/drm/mgag200/mgag200_drv.c +1 -20
index 74cdde2ee474..ac6af4bd9df6 100644
@@ -42,29 +42,10 @@ static const struct pci_device_id pciidlist[] = {
 
 MODULE_DEVICE_TABLE(pci, pciidlist);
 
-static void mgag200_kick_out_firmware_fb(struct pci_dev *pdev)
-{
-	struct apertures_struct *ap;
-	bool primary = false;
-
-	ap = alloc_apertures(1);
-	if (!ap)
-		return;
-
-	ap->ranges[0].base = pci_resource_start(pdev, 0);
-	ap->ranges[0].size = pci_resource_len(pdev, 0);
-
-#ifdef CONFIG_X86
-	primary = pdev->resource[PCI_ROM_RESOURCE].flags & IORESOURCE_ROM_SHADOW;
-#endif
-	drm_fb_helper_remove_conflicting_framebuffers(ap, "mgag200drmfb", primary);
-	kfree(ap);
-}
-
 
 static int mga_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 {
-	mgag200_kick_out_firmware_fb(pdev);
+	drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, 0, "mgag200drmfb");
 
 	return drm_get_pci_dev(pdev, ent, &driver);
 }
drivers/gpu/drm/mgag200/mgag200_main.c +0 -9
index 780f983b0294..79d54103d470 100644
@@ -124,20 +124,11 @@ static int mga_probe_vram(struct mga_device *mdev, void __iomem *mem)
 static int mga_vram_init(struct mga_device *mdev)
 {
 	void __iomem *mem;
-	struct apertures_struct *aper = alloc_apertures(1);
-	if (!aper)
-		return -ENOMEM;
 
 	/* BAR 0 is VRAM */
 	mdev->mc.vram_base = pci_resource_start(mdev->dev->pdev, 0);
 	mdev->mc.vram_window = pci_resource_len(mdev->dev->pdev, 0);
 
-	aper->ranges[0].base = mdev->mc.vram_base;
-	aper->ranges[0].size = mdev->mc.vram_window;
-
-	drm_fb_helper_remove_conflicting_framebuffers(aper, "mgafb", true);
-	kfree(aper);
-
 	if (!devm_request_mem_region(mdev->dev->dev, mdev->mc.vram_base, mdev->mc.vram_window,
 				"mgadrmfb_vram")) {
 		DRM_ERROR("can't reserve VRAM\n");
Signature · 7 lines
2.18.0


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#73 lore raw

PATCH v2 7/12 drm/mgag200: use simpler remove_conflicting_pci_framebuffers()

In reply to Michał Mirosław

Remove duplicated call, while at it.

---
 drivers/gpu/drm/mgag200/mgag200_drv.c  | 21 +--------------------
 drivers/gpu/drm/mgag200/mgag200_main.c |  9 ---------
 2 files changed, 1 insertion(+), 29 deletions(-)
drivers/gpu/drm/mgag200/mgag200_drv.c +1 -20
index 74cdde2ee474..ac6af4bd9df6 100644
@@ -42,29 +42,10 @@ static const struct pci_device_id pciidlist[] = {
 
 MODULE_DEVICE_TABLE(pci, pciidlist);
 
-static void mgag200_kick_out_firmware_fb(struct pci_dev *pdev)
-{
-	struct apertures_struct *ap;
-	bool primary = false;
-
-	ap = alloc_apertures(1);
-	if (!ap)
-		return;
-
-	ap->ranges[0].base = pci_resource_start(pdev, 0);
-	ap->ranges[0].size = pci_resource_len(pdev, 0);
-
-#ifdef CONFIG_X86
-	primary = pdev->resource[PCI_ROM_RESOURCE].flags & IORESOURCE_ROM_SHADOW;
-#endif
-	drm_fb_helper_remove_conflicting_framebuffers(ap, "mgag200drmfb", primary);
-	kfree(ap);
-}
-
 
 static int mga_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 {
-	mgag200_kick_out_firmware_fb(pdev);
+	drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, 0, "mgag200drmfb");
 
 	return drm_get_pci_dev(pdev, ent, &driver);
 }
drivers/gpu/drm/mgag200/mgag200_main.c +0 -9
index 780f983b0294..79d54103d470 100644
@@ -124,20 +124,11 @@ static int mga_probe_vram(struct mga_device *mdev, void __iomem *mem)
 static int mga_vram_init(struct mga_device *mdev)
 {
 	void __iomem *mem;
-	struct apertures_struct *aper = alloc_apertures(1);
-	if (!aper)
-		return -ENOMEM;
 
 	/* BAR 0 is VRAM */
 	mdev->mc.vram_base = pci_resource_start(mdev->dev->pdev, 0);
 	mdev->mc.vram_window = pci_resource_len(mdev->dev->pdev, 0);
 
-	aper->ranges[0].base = mdev->mc.vram_base;
-	aper->ranges[0].size = mdev->mc.vram_window;
-
-	drm_fb_helper_remove_conflicting_framebuffers(aper, "mgafb", true);
-	kfree(aper);
-
 	if (!devm_request_mem_region(mdev->dev->dev, mdev->mc.vram_base, mdev->mc.vram_window,
 				"mgadrmfb_vram")) {
 		DRM_ERROR("can't reserve VRAM\n");
Signature · 6 lines
2.18.0

_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
#74 lore raw

PATCH v2 8/12 drm/radeon: use simpler remove_conflicting_pci_framebuffers()

In reply to Michał Mirosław
---
 drivers/gpu/drm/radeon/radeon_drv.c | 23 +----------------------
 1 file changed, 1 insertion(+), 22 deletions(-)
drivers/gpu/drm/radeon/radeon_drv.c +1 -22
index b28288a781ef..36c98a0ec991 100644
@@ -311,27 +311,6 @@ static struct drm_driver kms_driver;
 
 bool radeon_device_is_virtual(void);
 
-static int radeon_kick_out_firmware_fb(struct pci_dev *pdev)
-{
-	struct apertures_struct *ap;
-	bool primary = false;
-
-	ap = alloc_apertures(1);
-	if (!ap)
-		return -ENOMEM;
-
-	ap->ranges[0].base = pci_resource_start(pdev, 0);
-	ap->ranges[0].size = pci_resource_len(pdev, 0);
-
-#ifdef CONFIG_X86
-	primary = pdev->resource[PCI_ROM_RESOURCE].flags & IORESOURCE_ROM_SHADOW;
-#endif
-	drm_fb_helper_remove_conflicting_framebuffers(ap, "radeondrmfb", primary);
-	kfree(ap);
-
-	return 0;
-}
-
 static int radeon_pci_probe(struct pci_dev *pdev,
 			    const struct pci_device_id *ent)
 {
@@ -341,7 +320,7 @@ static int radeon_pci_probe(struct pci_dev *pdev,
 		return -EPROBE_DEFER;
 
 	/* Get rid of things like offb */
-	ret = radeon_kick_out_firmware_fb(pdev);
+	ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, 0, "radeondrmfb");
 	if (ret)
 		return ret;
 
Signature · 6 lines
2.18.0

_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
#75 lore raw

PATCH v2 9/12 drm/virtio: use simpler remove_conflicting_pci_framebuffers()

In reply to Michał Mirosław
---
 drivers/gpu/drm/virtio/virtgpu_drm_bus.c | 24 +++---------------------
 1 file changed, 3 insertions(+), 21 deletions(-)
drivers/gpu/drm/virtio/virtgpu_drm_bus.c +3 -21
index 7df8d0c9026a..115ed546ca4e 100644
@@ -28,26 +28,6 @@
 
 #include "virtgpu_drv.h"
 
-static void virtio_pci_kick_out_firmware_fb(struct pci_dev *pci_dev)
-{
-	struct apertures_struct *ap;
-	bool primary;
-
-	ap = alloc_apertures(1);
-	if (!ap)
-		return;
-
-	ap->ranges[0].base = pci_resource_start(pci_dev, 0);
-	ap->ranges[0].size = pci_resource_len(pci_dev, 0);
-
-	primary = pci_dev->resource[PCI_ROM_RESOURCE].flags
-		& IORESOURCE_ROM_SHADOW;
-
-	drm_fb_helper_remove_conflicting_framebuffers(ap, "virtiodrmfb", primary);
-
-	kfree(ap);
-}
-
 int drm_virtio_init(struct drm_driver *driver, struct virtio_device *vdev)
 {
 	struct drm_device *dev;
@@ -69,7 +49,9 @@ int drm_virtio_init(struct drm_driver *driver, struct virtio_device *vdev)
 			 pname);
 		dev->pdev = pdev;
 		if (vga)
-			virtio_pci_kick_out_firmware_fb(pdev);
+			drm_fb_helper_remove_conflicting_pci_framebuffers(pdev,
+									  0,
+									  "virtiodrmfb");
 
 		snprintf(unique, sizeof(unique), "pci:%s", pname);
 		ret = drm_dev_set_unique(dev, unique);
Signature · 6 lines
2.18.0

_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
#76 lore raw

PATCH v2 10/12 drm/vc4: use simpler remove_conflicting_framebuffers(NULL)

In reply to Michał Mirosław

Use remove_conflicting_framebuffers(NULL) instead of open-coding it.

---
 drivers/gpu/drm/vc4/vc4_drv.c | 20 +-------------------
 1 file changed, 1 insertion(+), 19 deletions(-)
drivers/gpu/drm/vc4/vc4_drv.c +1 -19
index 94b99c90425a..96bb90325995 100644
@@ -246,24 +246,6 @@ static void vc4_match_add_drivers(struct device *dev,
 	}
 }
 
-static void vc4_kick_out_firmware_fb(void)
-{
-	struct apertures_struct *ap;
-
-	ap = alloc_apertures(1);
-	if (!ap)
-		return;
-
-	/* Since VC4 is a UMA device, the simplefb node may have been
-	 * located anywhere in memory.
-	 */
-	ap->ranges[0].base = 0;
-	ap->ranges[0].size = ~0;
-
-	drm_fb_helper_remove_conflicting_framebuffers(ap, "vc4drmfb", false);
-	kfree(ap);
-}
-
 static int vc4_drm_bind(struct device *dev)
 {
 	struct platform_device *pdev = to_platform_device(dev);
@@ -296,7 +278,7 @@ static int vc4_drm_bind(struct device *dev)
 	if (ret)
 		goto gem_destroy;
 
-	vc4_kick_out_firmware_fb();
+	drm_fb_helper_remove_conflicting_framebuffers(NULL, "vc4drmfb", false);
 
 	ret = drm_dev_register(drm, 0);
 	if (ret < 0)
Signature · 7 lines
2.18.0


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#77 lore raw

PATCH v2 10/12 drm/vc4: use simpler remove_conflicting_framebuffers(NULL)

In reply to Michał Mirosław

Use remove_conflicting_framebuffers(NULL) instead of open-coding it.

---
 drivers/gpu/drm/vc4/vc4_drv.c | 20 +-------------------
 1 file changed, 1 insertion(+), 19 deletions(-)
drivers/gpu/drm/vc4/vc4_drv.c +1 -19
index 94b99c90425a..96bb90325995 100644
@@ -246,24 +246,6 @@ static void vc4_match_add_drivers(struct device *dev,
 	}
 }
 
-static void vc4_kick_out_firmware_fb(void)
-{
-	struct apertures_struct *ap;
-
-	ap = alloc_apertures(1);
-	if (!ap)
-		return;
-
-	/* Since VC4 is a UMA device, the simplefb node may have been
-	 * located anywhere in memory.
-	 */
-	ap->ranges[0].base = 0;
-	ap->ranges[0].size = ~0;
-
-	drm_fb_helper_remove_conflicting_framebuffers(ap, "vc4drmfb", false);
-	kfree(ap);
-}
-
 static int vc4_drm_bind(struct device *dev)
 {
 	struct platform_device *pdev = to_platform_device(dev);
@@ -296,7 +278,7 @@ static int vc4_drm_bind(struct device *dev)
 	if (ret)
 		goto gem_destroy;
 
-	vc4_kick_out_firmware_fb();
+	drm_fb_helper_remove_conflicting_framebuffers(NULL, "vc4drmfb", false);
 
 	ret = drm_dev_register(drm, 0);
 	if (ret < 0)
Signature · 6 lines
2.18.0

_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
#78 lore raw

PATCH v2 11/12 drm/sun4i: use simpler remove_conflicting_framebuffers(NULL)

In reply to Michał Mirosław

Use remove_conflicting_framebuffers(NULL) instead of duplicating it.

---
 drivers/gpu/drm/sun4i/sun4i_drv.c | 18 +-----------------
 1 file changed, 1 insertion(+), 17 deletions(-)
drivers/gpu/drm/sun4i/sun4i_drv.c +1 -17
index 50d19605c38f..555b5db8036f 100644
@@ -60,22 +60,6 @@ static struct drm_driver sun4i_drv_driver = {
 	/* Frame Buffer Operations */
 };
 
-static void sun4i_remove_framebuffers(void)
-{
-	struct apertures_struct *ap;
-
-	ap = alloc_apertures(1);
-	if (!ap)
-		return;
-
-	/* The framebuffer can be located anywhere in RAM */
-	ap->ranges[0].base = 0;
-	ap->ranges[0].size = ~0;
-
-	drm_fb_helper_remove_conflicting_framebuffers(ap, "sun4i-drm-fb", false);
-	kfree(ap);
-}
-
 static int sun4i_drv_bind(struct device *dev)
 {
 	struct drm_device *drm;
@@ -118,7 +102,7 @@ static int sun4i_drv_bind(struct device *dev)
 	drm->irq_enabled = true;
 
 	/* Remove early framebuffers (ie. simplefb) */
-	sun4i_remove_framebuffers();
+	drm_fb_helper_remove_conflicting_framebuffers(NULL, "sun4i-drm-fb", false);
 
 	/* Create our framebuffer */
 	ret = sun4i_framebuffer_init(drm);
Signature · 7 lines
2.18.0


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#79 lore raw

PATCH v2 11/12 drm/sun4i: use simpler remove_conflicting_framebuffers(NULL)

In reply to Michał Mirosław

Use remove_conflicting_framebuffers(NULL) instead of duplicating it.

---
 drivers/gpu/drm/sun4i/sun4i_drv.c | 18 +-----------------
 1 file changed, 1 insertion(+), 17 deletions(-)
drivers/gpu/drm/sun4i/sun4i_drv.c +1 -17
index 50d19605c38f..555b5db8036f 100644
@@ -60,22 +60,6 @@ static struct drm_driver sun4i_drv_driver = {
 	/* Frame Buffer Operations */
 };
 
-static void sun4i_remove_framebuffers(void)
-{
-	struct apertures_struct *ap;
-
-	ap = alloc_apertures(1);
-	if (!ap)
-		return;
-
-	/* The framebuffer can be located anywhere in RAM */
-	ap->ranges[0].base = 0;
-	ap->ranges[0].size = ~0;
-
-	drm_fb_helper_remove_conflicting_framebuffers(ap, "sun4i-drm-fb", false);
-	kfree(ap);
-}
-
 static int sun4i_drv_bind(struct device *dev)
 {
 	struct drm_device *drm;
@@ -118,7 +102,7 @@ static int sun4i_drv_bind(struct device *dev)
 	drm->irq_enabled = true;
 
 	/* Remove early framebuffers (ie. simplefb) */
-	sun4i_remove_framebuffers();
+	drm_fb_helper_remove_conflicting_framebuffers(NULL, "sun4i-drm-fb", false);
 
 	/* Create our framebuffer */
 	ret = sun4i_framebuffer_init(drm);
Signature · 6 lines
2.18.0

_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
#80 lore raw

PATCH v2 12/12 drm/tegra: kick out simplefb

In reply to Michał Mirosław

Kick out firmware fb when loading Tegra driver.

---
 drivers/gpu/drm/tegra/drm.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/gpu/drm/tegra/drm.c +4 -0
index 7afe2f635f74..b51ec138fed2 100644
@@ -1203,6 +1203,10 @@ static int host1x_drm_probe(struct host1x_device *dev)
 
 	dev_set_drvdata(&dev->dev, drm);
 
+	err = drm_fb_helper_remove_conflicting_framebuffers(NULL, "tegradrmfb", false);
+	if (err < 0)
+		goto unref;
+
 	err = drm_dev_register(drm, 0);
 	if (err < 0)
 		goto unref;
Signature · 7 lines
2.18.0


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#81 lore raw

PATCH v2 12/12 drm/tegra: kick out simplefb

In reply to Michał Mirosław

Kick out firmware fb when loading Tegra driver.

---
 drivers/gpu/drm/tegra/drm.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/gpu/drm/tegra/drm.c +4 -0
index 7afe2f635f74..b51ec138fed2 100644
@@ -1203,6 +1203,10 @@ static int host1x_drm_probe(struct host1x_device *dev)
 
 	dev_set_drvdata(&dev->dev, drm);
 
+	err = drm_fb_helper_remove_conflicting_framebuffers(NULL, "tegradrmfb", false);
+	if (err < 0)
+		goto unref;
+
 	err = drm_dev_register(drm, 0);
 	if (err < 0)
 		goto unref;
Signature · 6 lines
2.18.0

_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
#82 lore raw
In reply to Michał Mirosław
Quoted 11 lines · Michał Mirosław

This series cleans up duplicated code for replacing firmware FB driver with proper DRI driver and adds handover support to Tegra driver.

This is a sligtly updated version of a series sent on 24 Nov 2017.

v2:
- rebased on current drm-next
- dropped staging/sm750fb changes
- added kernel docs for DRM helpers

Quoted 13 lines

Michał Mirosław (12):
fbdev: show fbdev number for debugging
fbdev: allow apertures == NULL in remove_conflicting_framebuffers()
fbdev: add remove_conflicting_pci_framebuffers() drm/amdgpu: use simpler remove_conflicting_pci_framebuffers() drm/bochs: use simpler remove_conflicting_pci_framebuffers() drm/cirrus: use simpler remove_conflicting_pci_framebuffers() drm/mgag200: use simpler remove_conflicting_pci_framebuffers() drm/radeon: use simpler remove_conflicting_pci_framebuffers() drm/virtio: use simpler remove_conflicting_pci_framebuffers() drm/vc4: use simpler remove_conflicting_framebuffers(NULL) drm/sun4i: use simpler remove_conflicting_framebuffers(NULL) drm/tegra: kick out simplefb

Looks very neat. A bit confused about the drm changes in the fbdev-titled patches 1&3, but I guess we can merge as-is. Up to you whether you want to split or not I'd say.

Bartlomiej, ack for pullin in this entire pile through drm-misc?

Thanks, Daniel

Quoted 23 lines
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c  | 24 +-------------
 drivers/gpu/drm/bochs/bochs_drv.c        | 18 +----------
 drivers/gpu/drm/cirrus/cirrus_drv.c      | 23 +-------------
 drivers/gpu/drm/mgag200/mgag200_drv.c    | 21 +------------
 drivers/gpu/drm/mgag200/mgag200_main.c   |  9 ------
 drivers/gpu/drm/radeon/radeon_drv.c      | 23 +-------------
 drivers/gpu/drm/sun4i/sun4i_drv.c        | 18 +----------
 drivers/gpu/drm/tegra/drm.c              |  4 +++
 drivers/gpu/drm/vc4/vc4_drv.c            | 20 +-----------
 drivers/gpu/drm/virtio/virtgpu_drm_bus.c | 24 ++------------
 drivers/video/fbdev/core/fbmem.c         | 40 ++++++++++++++++++++++--
 include/drm/drm_fb_helper.h              | 34 ++++++++++++++++++++
 include/linux/fb.h                       |  2 ++
 13 files changed, 88 insertions(+), 172 deletions(-)
Signature · 6 lines
2.18.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

A message that is not in the archive (sent off-list or not yet received): 20180831090439.GT21634-dv86pmgwkMBes7Z6vYuT8azUEOm+Xw19@public.gmane.org

#84 lore raw

Quoting Daniel Vetter (2018-08-31 10:04:39)

Quoted 26 lines · Michał Mirosław
Quoted 11 lines

This series cleans up duplicated code for replacing firmware FB driver with proper DRI driver and adds handover support to Tegra driver.

This is a sligtly updated version of a series sent on 24 Nov 2017.

v2:
- rebased on current drm-next
- dropped staging/sm750fb changes
- added kernel docs for DRM helpers

Quoted 13 lines

Michał Mirosław (12):
fbdev: show fbdev number for debugging
fbdev: allow apertures == NULL in remove_conflicting_framebuffers()
fbdev: add remove_conflicting_pci_framebuffers() drm/amdgpu: use simpler remove_conflicting_pci_framebuffers() drm/bochs: use simpler remove_conflicting_pci_framebuffers() drm/cirrus: use simpler remove_conflicting_pci_framebuffers() drm/mgag200: use simpler remove_conflicting_pci_framebuffers() drm/radeon: use simpler remove_conflicting_pci_framebuffers() drm/virtio: use simpler remove_conflicting_pci_framebuffers() drm/vc4: use simpler remove_conflicting_framebuffers(NULL) drm/sun4i: use simpler remove_conflicting_framebuffers(NULL) drm/tegra: kick out simplefb

Quoted 3 lines

Looks very neat. A bit confused about the drm changes in the fbdev-titled patches 1&3, but I guess we can merge as-is. Up to you whether you want to split or not I'd say.

Ahah, someone is looking at remove_conflicting_framebuffers(). May I interest you in a use-after-free?

[  378.423513] stack segment: 0000 [#1] PREEMPT SMP PTI
[  378.423530] CPU: 1 PID: 4338 Comm: pm_rpm Tainted: G     U            4.19.0-rc1-CI-CI_DRM_4746+ #1
[  378.423548] Hardware name: To Be Filled By O.E.M. To Be Filled By O.E.M./J4205-ITX, BIOS P1.10 09/29/2016
[  378.423570] RIP: 0010:do_remove_conflicting_framebuffers+0x56/0x170
[  378.423587] Code: 49 8b 45 00 48 85 c0 74 50 f6 40 0a 08 74 4a 4d 85 e4 48 8b a8 78 04 00 00 74 1f 48 85 ed 74 1a 41 8b 0c 24 31 db 85 c9 74 10 <8b> 55 00 85 d2 75 42 83 c3 01 41 39 1c 24 77 f0 48 85 ed 74 1a 45
[  378.423620] RSP: 0018:ffffc900001dfa88 EFLAGS: 00010202
[  378.423632] RAX: ffff880274470008 RBX: 0000000000000000 RCX: 0000000000000001
[  378.423646] RDX: 0000000000000001 RSI: ffffffffa025c634 RDI: ffff88025cc3b428
[  378.423660] RBP: 6b6b6b6b6b6b6b6b R08: 000000001edaddfa R09: ffffffffa025c634
[  378.423673] R10: ffffc900001dfae8 R11: ffffffff820de938 R12: ffff88025cc3b428
[  378.423687] R13: ffffffff8234ca20 R14: ffffffff8234cb20 R15: 0000000000000001
[  378.423701] FS:  00007fcf03d0a980(0000) GS:ffff880277e80000(0000) knlGS:0000000000000000
[  378.423717] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[  378.423729] CR2: 00007fffece1fdb8 CR3: 00000001fe32e000 CR4: 00000000003406e0
[  378.423742] Call Trace:
[  378.423756]  remove_conflicting_framebuffers+0x28/0x40
[  378.423856]  i915_driver_load+0x7f5/0x10c0 [i915]
[  378.423873]  ? _raw_spin_unlock_irqrestore+0x4c/0x60
[  378.423887]  ? lockdep_hardirqs_on+0xe0/0x1b0
[  378.423962]  i915_pci_probe+0x29/0xa0 [i915]
[  378.423977]  pci_device_probe+0xa1/0x130
[  378.423990]  really_probe+0x25d/0x3c0
[  378.424002]  driver_probe_device+0x10a/0x120
[  378.424013]  __driver_attach+0xdb/0x100
[  378.424025]  ? driver_probe_device+0x120/0x120
[  378.424037]  bus_for_each_dev+0x74/0xc0
[  378.424048]  bus_add_driver+0x15f/0x250
[  378.424060]  ? 0xffffffffa069d000
[  378.424070]  driver_register+0x56/0xe0
[  378.424080]  ? 0xffffffffa069d000
[  378.424090]  do_one_initcall+0x58/0x2e0
[  378.424101]  ? rcu_lockdep_current_cpu_online+0x8f/0xd0
[  378.424116]  ? do_init_module+0x1d/0x1ea
[  378.424127]  ? rcu_read_lock_sched_held+0x6f/0x80
[  378.424141]  ? kmem_cache_alloc_trace+0x264/0x290
[  378.424154]  do_init_module+0x56/0x1ea
[  378.424167]  load_module+0x26ba/0x29a0
[  378.424182]  ? vfs_read+0x122/0x140
[  378.424199]  ? __se_sys_finit_module+0xd3/0xf0
[  378.424210]  __se_sys_finit_module+0xd3/0xf0
[  378.424226]  do_syscall_64+0x55/0x190
[  378.424237]  entry_SYSCALL_64_after_hwframe+0x49/0xbe
[  378.424249] RIP: 0033:0x7fcf02f9b839
[  378.424258] Code: 00 f3 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 1f f6 2c 00 f7 d8 64 89 01 48
[  378.424290] RSP: 002b:00007fffece21f58 EFLAGS: 00000246 ORIG_RAX: 0000000000000139
[  378.424307] RAX: ffffffffffffffda RBX: 000056344e1a4d80 RCX: 00007fcf02f9b839
[  378.424321] RDX: 0000000000000000 RSI: 00007fcf026470e5 RDI: 0000000000000003
[  378.424336] RBP: 00007fcf026470e5 R08: 0000000000000000 R09: 0000000000000000
[  378.424349] R10: 0000000000000003 R11: 0000000000000246 R12: 0000000000000000
[  378.424363] R13: 000056344e1a0000 R14: 0000000000000000 R15: 000056344e1a4d80

https://intel-gfx-ci.01.org/tree/drm-tip/IGT_4613/fi-bxt-j4205/dmesg0.log
-Chris
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#85 lore raw

On Fri, Aug 31, 2018 at 10:07:42AM +0100, Chris Wilson wrote:
[...]

Quoted 12 lines

Ahah, someone is looking at remove_conflicting_framebuffers(). May I interest you in a use-after-free?

[  378.423513] stack segment: 0000 [#1] PREEMPT SMP PTI
[  378.423530] CPU: 1 PID: 4338 Comm: pm_rpm Tainted: G     U            4.19.0-rc1-CI-CI_DRM_4746+ #1
[  378.423548] Hardware name: To Be Filled By O.E.M. To Be Filled By O.E.M./J4205-ITX, BIOS P1.10 09/29/2016
[  378.423570] RIP: 0010:do_remove_conflicting_framebuffers+0x56/0x170
[  378.423587] Code: 49 8b 45 00 48 85 c0 74 50 f6 40 0a 08 74 4a 4d 85 e4 48 8b a8 78 04 00 00 74 1f 48 85 ed 74 1a 41 8b 0c 24 31 db 85 c9 74 10 <8b> 55 00 85 d2 75 42 83 c3 01 41 39 1c 24 77 f0 48 85 ed 74 1a 45
[  378.423620] RSP: 0018:ffffc900001dfa88 EFLAGS: 00010202
[  378.423632] RAX: ffff880274470008 RBX: 0000000000000000 RCX: 0000000000000001
[  378.423646] RDX: 0000000000000001 RSI: ffffffffa025c634 RDI: ffff88025cc3b428
[  378.423660] RBP: 6b6b6b6b6b6b6b6b R08: 000000001edaddfa R09: ffffffffa025c634
Quoted 8 lines
[  378.423673] R10: ffffc900001dfae8 R11: ffffffff820de938 R12: ffff88025cc3b428
[  378.423687] R13: ffffffff8234ca20 R14: ffffffff8234cb20 R15: 0000000000000001
[  378.423701] FS:  00007fcf03d0a980(0000) GS:ffff880277e80000(0000) knlGS:0000000000000000
[  378.423717] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[  378.423729] CR2: 00007fffece1fdb8 CR3: 00000001fe32e000 CR4: 00000000003406e0
[  378.423742] Call Trace:
[  378.423756]  remove_conflicting_framebuffers+0x28/0x40
[  378.423856]  i915_driver_load+0x7f5/0x10c0 [i915]

[...]

Looks like registered_fb[] entry is pointing to (partially?) freed or corrupted fb_info, but I can't see how this could be an effect of remove_conflicting_framebuffers().

Best Regards,
Michał Mirosław

#86 lore raw
In reply to Daniel Vetter

Quoting Daniel Vetter (2018-08-31 10:04:39)

Quoted 26 lines · Michał Mirosław
Quoted 11 lines

This series cleans up duplicated code for replacing firmware FB driver with proper DRI driver and adds handover support to Tegra driver.

This is a sligtly updated version of a series sent on 24 Nov 2017.

v2:
- rebased on current drm-next
- dropped staging/sm750fb changes
- added kernel docs for DRM helpers

Quoted 13 lines

Michał Mirosław (12):
fbdev: show fbdev number for debugging
fbdev: allow apertures == NULL in remove_conflicting_framebuffers()
fbdev: add remove_conflicting_pci_framebuffers() drm/amdgpu: use simpler remove_conflicting_pci_framebuffers() drm/bochs: use simpler remove_conflicting_pci_framebuffers() drm/cirrus: use simpler remove_conflicting_pci_framebuffers() drm/mgag200: use simpler remove_conflicting_pci_framebuffers() drm/radeon: use simpler remove_conflicting_pci_framebuffers() drm/virtio: use simpler remove_conflicting_pci_framebuffers() drm/vc4: use simpler remove_conflicting_framebuffers(NULL) drm/sun4i: use simpler remove_conflicting_framebuffers(NULL) drm/tegra: kick out simplefb

Quoted 3 lines

Looks very neat. A bit confused about the drm changes in the fbdev-titled patches 1&3, but I guess we can merge as-is. Up to you whether you want to split or not I'd say.

Ahah, someone is looking at remove_conflicting_framebuffers(). May I interest you in a use-after-free?

[  378.423513] stack segment: 0000 [#1] PREEMPT SMP PTI
[  378.423530] CPU: 1 PID: 4338 Comm: pm_rpm Tainted: G     U            4.19.0-rc1-CI-CI_DRM_4746+ #1
[  378.423548] Hardware name: To Be Filled By O.E.M. To Be Filled By O.E.M./J4205-ITX, BIOS P1.10 09/29/2016
[  378.423570] RIP: 0010:do_remove_conflicting_framebuffers+0x56/0x170
[  378.423587] Code: 49 8b 45 00 48 85 c0 74 50 f6 40 0a 08 74 4a 4d 85 e4 48 8b a8 78 04 00 00 74 1f 48 85 ed 74 1a 41 8b 0c 24 31 db 85 c9 74 10 <8b> 55 00 85 d2 75 42 83 c3 01 41 39 1c 24 77 f0 48 85 ed 74 1a 45
[  378.423620] RSP: 0018:ffffc900001dfa88 EFLAGS: 00010202
[  378.423632] RAX: ffff880274470008 RBX: 0000000000000000 RCX: 0000000000000001
[  378.423646] RDX: 0000000000000001 RSI: ffffffffa025c634 RDI: ffff88025cc3b428
[  378.423660] RBP: 6b6b6b6b6b6b6b6b R08: 000000001edaddfa R09: ffffffffa025c634
[  378.423673] R10: ffffc900001dfae8 R11: ffffffff820de938 R12: ffff88025cc3b428
[  378.423687] R13: ffffffff8234ca20 R14: ffffffff8234cb20 R15: 0000000000000001
[  378.423701] FS:  00007fcf03d0a980(0000) GS:ffff880277e80000(0000) knlGS:0000000000000000
[  378.423717] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[  378.423729] CR2: 00007fffece1fdb8 CR3: 00000001fe32e000 CR4: 00000000003406e0
[  378.423742] Call Trace:
[  378.423756]  remove_conflicting_framebuffers+0x28/0x40
[  378.423856]  i915_driver_load+0x7f5/0x10c0 [i915]
[  378.423873]  ? _raw_spin_unlock_irqrestore+0x4c/0x60
[  378.423887]  ? lockdep_hardirqs_on+0xe0/0x1b0
[  378.423962]  i915_pci_probe+0x29/0xa0 [i915]
[  378.423977]  pci_device_probe+0xa1/0x130
[  378.423990]  really_probe+0x25d/0x3c0
[  378.424002]  driver_probe_device+0x10a/0x120
[  378.424013]  __driver_attach+0xdb/0x100
[  378.424025]  ? driver_probe_device+0x120/0x120
[  378.424037]  bus_for_each_dev+0x74/0xc0
[  378.424048]  bus_add_driver+0x15f/0x250
[  378.424060]  ? 0xffffffffa069d000
[  378.424070]  driver_register+0x56/0xe0
[  378.424080]  ? 0xffffffffa069d000
[  378.424090]  do_one_initcall+0x58/0x2e0
[  378.424101]  ? rcu_lockdep_current_cpu_online+0x8f/0xd0
[  378.424116]  ? do_init_module+0x1d/0x1ea
[  378.424127]  ? rcu_read_lock_sched_held+0x6f/0x80
[  378.424141]  ? kmem_cache_alloc_trace+0x264/0x290
[  378.424154]  do_init_module+0x56/0x1ea
[  378.424167]  load_module+0x26ba/0x29a0
[  378.424182]  ? vfs_read+0x122/0x140
[  378.424199]  ? __se_sys_finit_module+0xd3/0xf0
[  378.424210]  __se_sys_finit_module+0xd3/0xf0
[  378.424226]  do_syscall_64+0x55/0x190
[  378.424237]  entry_SYSCALL_64_after_hwframe+0x49/0xbe
[  378.424249] RIP: 0033:0x7fcf02f9b839
[  378.424258] Code: 00 f3 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 1f f6 2c 00 f7 d8 64 89 01 48
[  378.424290] RSP: 002b:00007fffece21f58 EFLAGS: 00000246 ORIG_RAX: 0000000000000139
[  378.424307] RAX: ffffffffffffffda RBX: 000056344e1a4d80 RCX: 00007fcf02f9b839
[  378.424321] RDX: 0000000000000000 RSI: 00007fcf026470e5 RDI: 0000000000000003
[  378.424336] RBP: 00007fcf026470e5 R08: 0000000000000000 R09: 0000000000000000
[  378.424349] R10: 0000000000000003 R11: 0000000000000246 R12: 0000000000000000
[  378.424363] R13: 000056344e1a0000 R14: 0000000000000000 R15: 000056344e1a4d80

https://intel-gfx-ci.01.org/tree/drm-tip/IGT_4613/fi-bxt-j4205/dmesg0.log
-Chris
_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

#87 lore raw

v3 cover remove_conflicting_framebuffers() cleanup

In reply to Michał Mirosław

This series cleans up duplicated code for replacing firmware FB driver with proper DRI driver and adds handover support to Tegra driver.

This is a sligtly updated version of a series sent on 24 Nov 2017.

---
v2:
- rebased on current drm-next
- dropped staging/sm750fb changes
- added kernel docs for DRM helpers
v3:
- move kerneldoc to fbdev, where functions are implemented
- split kerneldoc for remove_conflicting_framebuffers()
- propagate return value in remove_conflicting_pci_framebuffers()

---
Michał Mirosław (13):
fbdev: show fbdev number for debugging
fbdev: allow apertures == NULL in remove_conflicting_framebuffers()
fbdev: add kerneldoc do remove_conflicting_framebuffers()
fbdev: add remove_conflicting_pci_framebuffers() drm/amdgpu: use simpler remove_conflicting_pci_framebuffers() drm/bochs: use simpler remove_conflicting_pci_framebuffers() drm/cirrus: use simpler remove_conflicting_pci_framebuffers() drm/mgag200: use simpler remove_conflicting_pci_framebuffers() drm/radeon: use simpler remove_conflicting_pci_framebuffers() drm/virtio: use simpler remove_conflicting_pci_framebuffers() drm/vc4: use simpler remove_conflicting_framebuffers(NULL) drm/sun4i: use simpler remove_conflicting_framebuffers(NULL) drm/tegra: kick out simplefb

 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c  | 24 +--------
 drivers/gpu/drm/bochs/bochs_drv.c        | 18 +------
 drivers/gpu/drm/cirrus/cirrus_drv.c      | 23 +--------
 drivers/gpu/drm/mgag200/mgag200_drv.c    | 21 +-------
 drivers/gpu/drm/mgag200/mgag200_main.c   |  9 ----
 drivers/gpu/drm/radeon/radeon_drv.c      | 23 +--------
 drivers/gpu/drm/sun4i/sun4i_drv.c        | 18 +------
 drivers/gpu/drm/tegra/drm.c              |  4 ++
 drivers/gpu/drm/vc4/vc4_drv.c            | 20 +-------
 drivers/gpu/drm/virtio/virtgpu_drm_bus.c | 24 ++-------
 drivers/video/fbdev/core/fbmem.c         | 63 +++++++++++++++++++++++-
 include/drm/drm_fb_helper.h              | 12 +++++
 include/linux/fb.h                       |  2 +
 13 files changed, 89 insertions(+), 172 deletions(-)
Signature · 6 lines
2.18.0

_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
#88 lore raw

PATCH v3 1/13 fbdev: show fbdev number for debugging

---
 drivers/video/fbdev/core/fbmem.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/video/fbdev/core/fbmem.c +2 -2
index f741ba8df01b..30a18d4c9de4 100644
@@ -1618,8 +1618,8 @@ static int do_remove_conflicting_framebuffers(struct apertures_struct *a,
 			(primary && gen_aper && gen_aper->count &&
 			 gen_aper->ranges[0].base == VGA_FB_PHYS)) {
 
-			printk(KERN_INFO "fb: switching to %s from %s\n",
-			       name, registered_fb[i]->fix.id);
+			printk(KERN_INFO "fb%d: switching to %s from %s\n",
+			       i, name, registered_fb[i]->fix.id);
 			ret = do_unregister_framebuffer(registered_fb[i]);
 			if (ret)
 				return ret;
Signature · 7 lines
2.18.0


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#89 lore raw

PATCH v3 1/13 fbdev: show fbdev number for debugging

In reply to Michał Mirosław
---
 drivers/video/fbdev/core/fbmem.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/video/fbdev/core/fbmem.c +2 -2
index f741ba8df01b..30a18d4c9de4 100644
@@ -1618,8 +1618,8 @@ static int do_remove_conflicting_framebuffers(struct apertures_struct *a,
 			(primary && gen_aper && gen_aper->count &&
 			 gen_aper->ranges[0].base == VGA_FB_PHYS)) {
 
-			printk(KERN_INFO "fb: switching to %s from %s\n",
-			       name, registered_fb[i]->fix.id);
+			printk(KERN_INFO "fb%d: switching to %s from %s\n",
+			       i, name, registered_fb[i]->fix.id);
 			ret = do_unregister_framebuffer(registered_fb[i]);
 			if (ret)
 				return ret;
Signature · 6 lines
2.18.0

_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
#90 lore raw

PATCH v3 2/13 fbdev: allow apertures == NULL in remove_conflicting_framebuffers()

In reply to Michał Mirosław

Interpret (otherwise-invalid) NULL apertures argument to mean all-memory range. This will allow to remove several duplicates of this code from drivers in following patches.

---
v2: added kerneldoc to corresponding DRM helper
v3: split kerneldoc to another patch

---
 drivers/video/fbdev/core/fbmem.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
drivers/video/fbdev/core/fbmem.c +14 -0
index 30a18d4c9de4..0df148eb4699 100644
@@ -1779,11 +1779,25 @@ int remove_conflicting_framebuffers(struct apertures_struct *a,
 				    const char *name, bool primary)
 {
 	int ret;
+	bool do_free = false;
+
+	if (!a) {
+		a = alloc_apertures(1);
+		if (!a)
+			return -ENOMEM;
+
+		a->ranges[0].base = 0;
+		a->ranges[0].size = ~0;
+		do_free = true;
+	}
 
 	mutex_lock(&registration_lock);
 	ret = do_remove_conflicting_framebuffers(a, name, primary);
 	mutex_unlock(&registration_lock);
 
+	if (do_free)
+		kfree(a);
+
 	return ret;
 }
 EXPORT_SYMBOL(remove_conflicting_framebuffers);
Signature · 6 lines
2.18.0

_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
#91 lore raw

PATCH v3 3/13 fbdev: add kerneldoc do remove_conflicting_framebuffers()

In reply to Michał Mirosław

Document remove_conflicting_framebuffers() behaviour.

---
 drivers/video/fbdev/core/fbmem.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
drivers/video/fbdev/core/fbmem.c +10 -0
index 0df148eb4699..2de93b5014e3 100644
@@ -1775,6 +1775,16 @@ int unlink_framebuffer(struct fb_info *fb_info)
 }
 EXPORT_SYMBOL(unlink_framebuffer);
 
+/**
+ * remove_conflicting_framebuffers - remove firmware-configured framebuffers
+ * @a: memory range, users of which are to be removed
+ * @name: requesting driver name
+ * @primary: also kick vga16fb if present
+ *
+ * This function removes framebuffer devices (initialized by firmware/bootloader)
+ * which use memory range described by @a. If @a is NULL all such devices are
+ * removed.
+ */
 int remove_conflicting_framebuffers(struct apertures_struct *a,
 				    const char *name, bool primary)
 {
Signature · 7 lines
2.18.0


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

A message that is not in the archive (sent off-list or not yet received): 283fef19815b991700b56119d8d5874a2a8da44e.1535810304.git.mirq-linux-CoA6ZxLDdyEEUmgCuDUIdw@public.gmane.org

Acked-by
#93 lore raw

Re: [PATCH v3 03/13] fbdev: add kerneldoc do remove_conflicting_framebuffers()

Dear Michał,

Thank you for documenting the function. Do you mean *to* instead of *do* in the commit message summary?

Quoted 18 lines · Michał Mirosław

Document remove_conflicting_framebuffers() behaviour.

---
 drivers/video/fbdev/core/fbmem.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
drivers/video/fbdev/core/fbmem.c +3 -0
index 0df148eb4699..2de93b5014e3 100644
@@ -1775,6 +1775,16 @@ int unlink_framebuffer(struct fb_info *fb_info)
 }
 EXPORT_SYMBOL(unlink_framebuffer);
 
+/**
+ * remove_conflicting_framebuffers - remove firmware-configured framebuffers
+ * @a: memory range, users of which are to be removed

drivers/video/fbdev/core/fbmem.c int unlink_framebuffer(struct fb_info *fb_info) · line 1790

Quoted 10 lines
drivers/video/fbdev/core/fbmem.c +7 -0
+ * @name: requesting driver name
+ * @primary: also kick vga16fb if present
+ *
+ * This function removes framebuffer devices (initialized by firmware/bootloader)
+ * which use memory range described by @a. If @a is NULL all such devices are
+ * removed.
+ */
 int remove_conflicting_framebuffers(struct apertures_struct *a,
 				    const char *name, bool primary)
 {

Kind regards,

Paul

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

#94 lore raw

PATCH v3 3/13 fbdev: add kerneldoc do remove_conflicting_framebuffers()

In reply to Michał Mirosław

Document remove_conflicting_framebuffers() behaviour.

---
 drivers/video/fbdev/core/fbmem.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
drivers/video/fbdev/core/fbmem.c +10 -0
index 0df148eb4699..2de93b5014e3 100644
@@ -1775,6 +1775,16 @@ int unlink_framebuffer(struct fb_info *fb_info)
 }
 EXPORT_SYMBOL(unlink_framebuffer);
 
+/**
+ * remove_conflicting_framebuffers - remove firmware-configured framebuffers
+ * @a: memory range, users of which are to be removed
+ * @name: requesting driver name
+ * @primary: also kick vga16fb if present
+ *
+ * This function removes framebuffer devices (initialized by firmware/bootloader)
+ * which use memory range described by @a. If @a is NULL all such devices are
+ * removed.
+ */
 int remove_conflicting_framebuffers(struct apertures_struct *a,
 				    const char *name, bool primary)
 {
Signature · 6 lines
2.18.0

_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
#95 lore raw

PATCH v3 4/13 fbdev: add remove_conflicting_pci_framebuffers()

In reply to Michał Mirosław

Almost all PCI drivers using remove_conflicting_framebuffers() wrap it with the same code.

---
v2: add kerneldoc for DRM helper
v3: propagate remove_conflicting_framebuffers() return value
+ move kerneldoc to where function is implemented

---
 drivers/video/fbdev/core/fbmem.c | 35 ++++++++++++++++++++++++++++++++
 include/drm/drm_fb_helper.h      | 12 +++++++++++
 include/linux/fb.h               |  2 ++
 3 files changed, 49 insertions(+)
drivers/video/fbdev/core/fbmem.c +35 -0
index 2de93b5014e3..cd96b1c62bbe 100644
@@ -34,6 +34,7 @@
 #include <linux/fb.h>
 #include <linux/fbcon.h>
 #include <linux/mem_encrypt.h>
+#include <linux/pci.h>
 
 #include <asm/fb.h>
 
@@ -1812,6 +1813,40 @@ int remove_conflicting_framebuffers(struct apertures_struct *a,
 }
 EXPORT_SYMBOL(remove_conflicting_framebuffers);
 
+/**
+ * remove_conflicting_pci_framebuffers - remove firmware-configured framebuffers for PCI devices
+ * @pdev: PCI device
+ * @resource_id: index of PCI BAR configuring framebuffer memory
+ * @name: requesting driver name
+ *
+ * This function removes framebuffer devices (eg. initialized by firmware)
+ * using memory range configured for @pdev's BAR @resource_id.
+ *
+ * The function assumes that PCI device with shadowed ROM drives a primary
+ * display and so kicks out vga16fb.
+ */
+int remove_conflicting_pci_framebuffers(struct pci_dev *pdev, int res_id, const char *name)
+{
+	struct apertures_struct *ap;
+	bool primary = false;
+	int err;
+
+	ap = alloc_apertures(1);
+	if (!ap)
+		return -ENOMEM;
+
+	ap->ranges[0].base = pci_resource_start(pdev, res_id);
+	ap->ranges[0].size = pci_resource_len(pdev, res_id);
+#ifdef CONFIG_X86
+	primary = pdev->resource[PCI_ROM_RESOURCE].flags &
+					IORESOURCE_ROM_SHADOW;
+#endif
+	err = remove_conflicting_framebuffers(ap, name, primary);
+	kfree(ap);
+	return err;
+}
+EXPORT_SYMBOL(remove_conflicting_pci_framebuffers);
+
 /**
  *	register_framebuffer - registers a frame buffer device
  *	@fb_info: frame buffer info structure
include/drm/drm_fb_helper.h +12 -0
index b069433e7fc1..20ea856db900 100644
@@ -577,4 +577,16 @@ drm_fb_helper_remove_conflicting_framebuffers(struct apertures_struct *a,
 #endif
 }
 
+static inline int
+drm_fb_helper_remove_conflicting_pci_framebuffers(struct pci_dev *pdev,
+						  int resource_id,
+						  const char *name)
+{
+#if IS_REACHABLE(CONFIG_FB)
+	return remove_conflicting_pci_framebuffers(pdev, resource_id, name);
+#else
+	return 0;
+#endif
+}
+
 #endif
include/linux/fb.h +2 -0
index aa74a228bb92..abeffd55b66a 100644
@@ -632,6 +632,8 @@ extern ssize_t fb_sys_write(struct fb_info *info, const char __user *buf,
 extern int register_framebuffer(struct fb_info *fb_info);
 extern int unregister_framebuffer(struct fb_info *fb_info);
 extern int unlink_framebuffer(struct fb_info *fb_info);
+extern int remove_conflicting_pci_framebuffers(struct pci_dev *pdev, int res_id,
+					       const char *name);
 extern int remove_conflicting_framebuffers(struct apertures_struct *a,
 					   const char *name, bool primary);
 extern int fb_prepare_logo(struct fb_info *fb_info, int rotate);
Signature · 7 lines
2.18.0


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#96 lore raw

Re: [PATCH v3 04/13] fbdev: add remove_conflicting_pci_framebuffers()

Quoted 4 lines · Michał Mirosław

Almost all PCI drivers using remove_conflicting_framebuffers() wrap it with the same code.

---

This cuts away the sob. Just fyi.
-Daniel

Quoted 105 lines

v2: add kerneldoc for DRM helper
v3: propagate remove_conflicting_framebuffers() return value
+ move kerneldoc to where function is implemented

---
 drivers/video/fbdev/core/fbmem.c | 35 ++++++++++++++++++++++++++++++++
 include/drm/drm_fb_helper.h      | 12 +++++++++++
 include/linux/fb.h               |  2 ++
 3 files changed, 49 insertions(+)
drivers/video/fbdev/core/fbmem.c +35 -0
index 2de93b5014e3..cd96b1c62bbe 100644
@@ -34,6 +34,7 @@
 #include <linux/fb.h>
 #include <linux/fbcon.h>
 #include <linux/mem_encrypt.h>
+#include <linux/pci.h>
 
 #include <asm/fb.h>
 
@@ -1812,6 +1813,40 @@ int remove_conflicting_framebuffers(struct apertures_struct *a,
 }
 EXPORT_SYMBOL(remove_conflicting_framebuffers);
 
+/**
+ * remove_conflicting_pci_framebuffers - remove firmware-configured framebuffers for PCI devices
+ * @pdev: PCI device
+ * @resource_id: index of PCI BAR configuring framebuffer memory
+ * @name: requesting driver name
+ *
+ * This function removes framebuffer devices (eg. initialized by firmware)
+ * using memory range configured for @pdev's BAR @resource_id.
+ *
+ * The function assumes that PCI device with shadowed ROM drives a primary
+ * display and so kicks out vga16fb.
+ */
+int remove_conflicting_pci_framebuffers(struct pci_dev *pdev, int res_id, const char *name)
+{
+	struct apertures_struct *ap;
+	bool primary = false;
+	int err;
+
+	ap = alloc_apertures(1);
+	if (!ap)
+		return -ENOMEM;
+
+	ap->ranges[0].base = pci_resource_start(pdev, res_id);
+	ap->ranges[0].size = pci_resource_len(pdev, res_id);
+#ifdef CONFIG_X86
+	primary = pdev->resource[PCI_ROM_RESOURCE].flags &
+					IORESOURCE_ROM_SHADOW;
+#endif
+	err = remove_conflicting_framebuffers(ap, name, primary);
+	kfree(ap);
+	return err;
+}
+EXPORT_SYMBOL(remove_conflicting_pci_framebuffers);
+
 /**
  *	register_framebuffer - registers a frame buffer device
  *	@fb_info: frame buffer info structure
include/drm/drm_fb_helper.h +12 -0
index b069433e7fc1..20ea856db900 100644
@@ -577,4 +577,16 @@ drm_fb_helper_remove_conflicting_framebuffers(struct apertures_struct *a,
 #endif
 }
 
+static inline int
+drm_fb_helper_remove_conflicting_pci_framebuffers(struct pci_dev *pdev,
+						  int resource_id,
+						  const char *name)
+{
+#if IS_REACHABLE(CONFIG_FB)
+	return remove_conflicting_pci_framebuffers(pdev, resource_id, name);
+#else
+	return 0;
+#endif
+}
+
 #endif
include/linux/fb.h +2 -0
index aa74a228bb92..abeffd55b66a 100644
@@ -632,6 +632,8 @@ extern ssize_t fb_sys_write(struct fb_info *info, const char __user *buf,
 extern int register_framebuffer(struct fb_info *fb_info);
 extern int unregister_framebuffer(struct fb_info *fb_info);
 extern int unlink_framebuffer(struct fb_info *fb_info);
+extern int remove_conflicting_pci_framebuffers(struct pci_dev *pdev, int res_id,
+					       const char *name);
 extern int remove_conflicting_framebuffers(struct apertures_struct *a,
 					   const char *name, bool primary);
 extern int fb_prepare_logo(struct fb_info *fb_info, int rotate);
Signature · 6 lines
2.18.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
#97 lore raw

Re: [PATCH v3 04/13] fbdev: add remove_conflicting_pci_framebuffers()

In reply to Michał Mirosław
I love your patch! Perhaps something to improve:

Hi Michał,

I love your patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[also build test WARNING on v4.19-rc2 next-20180831]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url: https://github.com/0day-ci/linux/commits/Micha-Miros-aw/remove_conflicting_framebuffers-cleanup/20180903-094322
reproduce: make htmldocs
:::::: branch date: 5 hours ago
:::::: commit date: 5 hours ago

All warnings (new ones prefixed by >>):

WARNING: convert(1) not found, for SVG to PDF conversion install ImageMagick (https://www.imagemagick.org)
include/linux/srcu.h:175: warning: Function parameter or member 'p' not described in 'srcu_dereference_notrace' include/linux/srcu.h:175: warning: Function parameter or member 'sp' not described in 'srcu_dereference_notrace' include/linux/gfp.h:1: warning: no structured comments found
include/net/cfg80211.h:4381: warning: Function parameter or member 'wext.ibss' not described in 'wireless_dev' include/net/cfg80211.h:4381: warning: Function parameter or member 'wext.connect' not described in 'wireless_dev' include/net/cfg80211.h:4381: warning: Function parameter or member 'wext.keys' not described in 'wireless_dev' include/net/cfg80211.h:4381: warning: Function parameter or member 'wext.ie' not described in 'wireless_dev' include/net/cfg80211.h:4381: warning: Function parameter or member 'wext.ie_len' not described in 'wireless_dev' include/net/cfg80211.h:4381: warning: Function parameter or member 'wext.bssid' not described in 'wireless_dev' include/net/cfg80211.h:4381: warning: Function parameter or member 'wext.ssid' not described in 'wireless_dev' include/net/cfg80211.h:4381: warning: Function parameter or member 'wext.default_key' not described in 'wireless_dev' include/net/cfg80211.h:4381: warning: Function parameter or member 'wext.default_mgmt_key' not described in 'wireless_dev' include/net/cfg80211.h:4381: warning: Function parameter or member 'wext.prev_bssid_valid' not described in 'wireless_dev' include/net/mac80211.h:2328: warning: Function parameter or member 'radiotap_timestamp.units_pos' not described in 'ieee80211_hw' include/net/mac80211.h:2328: warning: Function parameter or member 'radiotap_timestamp.accuracy' not described in 'ieee80211_hw' include/net/mac80211.h:977: warning: Function parameter or member 'control.rates' not described in 'ieee80211_tx_info' include/net/mac80211.h:977: warning: Function parameter or member 'control.rts_cts_rate_idx' not described in 'ieee80211_tx_info' include/net/mac80211.h:977: warning: Function parameter or member 'control.use_rts' not described in 'ieee80211_tx_info' include/net/mac80211.h:977: warning: Function parameter or member 'control.use_cts_prot' not described in 'ieee80211_tx_info' include/net/mac80211.h:977: warning: Function parameter or member 'control.short_preamble' not described in 'ieee80211_tx_info' include/net/mac80211.h:977: warning: Function parameter or member 'control.skip_table' not described in 'ieee80211_tx_info' include/net/mac80211.h:977: warning: Function parameter or member 'control.jiffies' not described in 'ieee80211_tx_info' include/net/mac80211.h:977: warning: Function parameter or member 'control.vif' not described in 'ieee80211_tx_info' include/net/mac80211.h:977: warning: Function parameter or member 'control.hw_key' not described in 'ieee80211_tx_info' include/net/mac80211.h:977: warning: Function parameter or member 'control.flags' not described in 'ieee80211_tx_info' include/net/mac80211.h:977: warning: Function parameter or member 'control.enqueue_time' not described in 'ieee80211_tx_info' include/net/mac80211.h:977: warning: Function parameter or member 'ack' not described in 'ieee80211_tx_info' include/net/mac80211.h:977: warning: Function parameter or member 'ack.cookie' not described in 'ieee80211_tx_info' include/net/mac80211.h:977: warning: Function parameter or member 'status.rates' not described in 'ieee80211_tx_info' include/net/mac80211.h:977: warning: Function parameter or member 'status.ack_signal' not described in 'ieee80211_tx_info' include/net/mac80211.h:977: warning: Function parameter or member 'status.ampdu_ack_len' not described in 'ieee80211_tx_info' include/net/mac80211.h:977: warning: Function parameter or member 'status.ampdu_len' not described in 'ieee80211_tx_info' include/net/mac80211.h:977: warning: Function parameter or member 'status.antenna' not described in 'ieee80211_tx_info' include/net/mac80211.h:977: warning: Function parameter or member 'status.tx_time' not described in 'ieee80211_tx_info' include/net/mac80211.h:977: warning: Function parameter or member 'status.is_valid_ack_signal' not described in 'ieee80211_tx_info' include/net/mac80211.h:977: warning: Function parameter or member 'status.status_driver_data' not described in 'ieee80211_tx_info' include/net/mac80211.h:977: warning: Function parameter or member 'driver_rates' not described in 'ieee80211_tx_info' include/net/mac80211.h:977: warning: Function parameter or member 'pad' not described in 'ieee80211_tx_info' include/net/mac80211.h:977: warning: Function parameter or member 'rate_driver_data' not described in 'ieee80211_tx_info' net/mac80211/sta_info.h:588: warning: Function parameter or member 'rx_stats_avg' not described in 'sta_info' net/mac80211/sta_info.h:588: warning: Function parameter or member 'rx_stats_avg.signal' not described in 'sta_info' net/mac80211/sta_info.h:588: warning: Function parameter or member 'rx_stats_avg.chain_signal' not described in 'sta_info' net/mac80211/sta_info.h:588: warning: Function parameter or member 'status_stats.filtered' not described in 'sta_info' net/mac80211/sta_info.h:588: warning: Function parameter or member 'status_stats.retry_failed' not described in 'sta_info' net/mac80211/sta_info.h:588: warning: Function parameter or member 'status_stats.retry_count' not described in 'sta_info' net/mac80211/sta_info.h:588: warning: Function parameter or member 'status_stats.lost_packets' not described in 'sta_info' net/mac80211/sta_info.h:588: warning: Function parameter or member 'status_stats.last_tdls_pkt_time' not described in 'sta_info' net/mac80211/sta_info.h:588: warning: Function parameter or member 'status_stats.msdu_retries' not described in 'sta_info' net/mac80211/sta_info.h:588: warning: Function parameter or member 'status_stats.msdu_failed' not described in 'sta_info' net/mac80211/sta_info.h:588: warning: Function parameter or member 'status_stats.last_ack' not described in 'sta_info' net/mac80211/sta_info.h:588: warning: Function parameter or member 'status_stats.last_ack_signal' not described in 'sta_info' net/mac80211/sta_info.h:588: warning: Function parameter or member 'status_stats.ack_signal_filled' not described in 'sta_info' net/mac80211/sta_info.h:588: warning: Function parameter or member 'status_stats.avg_ack_signal' not described in 'sta_info' net/mac80211/sta_info.h:588: warning: Function parameter or member 'tx_stats.packets' not described in 'sta_info' net/mac80211/sta_info.h:588: warning: Function parameter or member 'tx_stats.bytes' not described in 'sta_info' net/mac80211/sta_info.h:588: warning: Function parameter or member 'tx_stats.last_rate' not described in 'sta_info' net/mac80211/sta_info.h:588: warning: Function parameter or member 'tx_stats.msdu' not described in 'sta_info' include/linux/mod_devicetable.h:763: warning: Function parameter or member 'driver_data' not described in 'typec_device_id' kernel/sched/fair.c:3371: warning: Function parameter or member 'flags' not described in 'attach_entity_load_avg' arch/x86/include/asm/atomic.h:84: warning: Excess function parameter 'i' description in 'arch_atomic_sub_and_test' arch/x86/include/asm/atomic.h:84: warning: Excess function parameter 'v' description in 'arch_atomic_sub_and_test' arch/x86/include/asm/atomic.h:96: warning: Excess function parameter 'v' description in 'arch_atomic_inc' arch/x86/include/asm/atomic.h:109: warning: Excess function parameter 'v' description in 'arch_atomic_dec' arch/x86/include/asm/atomic.h:124: warning: Excess function parameter 'v' description in 'arch_atomic_dec_and_test' arch/x86/include/asm/atomic.h:138: warning: Excess function parameter 'v' description in 'arch_atomic_inc_and_test' arch/x86/include/asm/atomic.h:153: warning: Excess function parameter 'i' description in 'arch_atomic_add_negative' arch/x86/include/asm/atomic.h:153: warning: Excess function parameter 'v' description in 'arch_atomic_add_negative' include/linux/dma-buf.h:304: warning: Function parameter or member 'cb_excl.cb' not described in 'dma_buf' include/linux/dma-buf.h:304: warning: Function parameter or member 'cb_excl.poll' not described in 'dma_buf' include/linux/dma-buf.h:304: warning: Function parameter or member 'cb_excl.active' not described in 'dma_buf' include/linux/dma-buf.h:304: warning: Function parameter or member 'cb_shared.cb' not described in 'dma_buf' include/linux/dma-buf.h:304: warning: Function parameter or member 'cb_shared.poll' not described in 'dma_buf' include/linux/dma-buf.h:304: warning: Function parameter or member 'cb_shared.active' not described in 'dma_buf' include/linux/dma-fence-array.h:54: warning: Function parameter or member 'work' not described in 'dma_fence_array'

>> drivers/video/fbdev/core/fbmem.c:1848: warning: Function parameter or member 'res_id' not described in 'remove_conflicting_pci_framebuffers'

drivers/video/fbdev/core/fbmem.c:1848: warning: Excess function parameter 'resource_id' description in 'remove_conflicting_pci_framebuffers' include/linux/gpio/driver.h:142: warning: Function parameter or member 'request_key' not described in 'gpio_irq_chip' include/linux/iio/hw-consumer.h:1: warning: no structured comments found
include/linux/input/sparse-keymap.h:46: warning: Function parameter or member 'sw' not described in 'key_entry' drivers/pci/pci.c:218: warning: Excess function parameter 'p' description in 'pci_dev_str_match_path' include/linux/regulator/driver.h:227: warning: Function parameter or member 'resume' not described in 'regulator_ops' drivers/regulator/core.c:4479: warning: Excess function parameter 'state' description in 'regulator_suspend' arch/s390/include/asm/cio.h:245: warning: Function parameter or member 'esw.esw0' not described in 'irb' arch/s390/include/asm/cio.h:245: warning: Function parameter or member 'esw.esw1' not described in 'irb' arch/s390/include/asm/cio.h:245: warning: Function parameter or member 'esw.esw2' not described in 'irb' arch/s390/include/asm/cio.h:245: warning: Function parameter or member 'esw.esw3' not described in 'irb' arch/s390/include/asm/cio.h:245: warning: Function parameter or member 'esw.eadm' not described in 'irb' drivers/slimbus/stream.c:1: warning: no structured comments found
drivers/target/target_core_device.c:1: warning: no structured comments found
drivers/usb/dwc3/gadget.c:510: warning: Excess function parameter 'dwc' description in 'dwc3_gadget_start_config' drivers/usb/typec/class.c:1497: warning: Excess function parameter 'drvdata' description in 'typec_port_register_altmode' drivers/usb/typec/class.c:1497: warning: Excess function parameter 'drvdata' description in 'typec_port_register_altmode' drivers/usb/typec/class.c:1497: warning: Excess function parameter 'drvdata' description in 'typec_port_register_altmode' drivers/usb/typec/class.c:1497: warning: Excess function parameter 'drvdata' description in 'typec_port_register_altmode' drivers/usb/typec/class.c:1497: warning: Excess function parameter 'drvdata' description in 'typec_port_register_altmode' drivers/usb/typec/class.c:1497: warning: Excess function parameter 'drvdata' description in 'typec_port_register_altmode' drivers/usb/typec/class.c:1497: warning: Excess function parameter 'drvdata' description in 'typec_port_register_altmode' drivers/usb/typec/class.c:1497: warning: Excess function parameter 'drvdata' description in 'typec_port_register_altmode' drivers/usb/typec/class.c:1497: warning: Excess function parameter 'drvdata' description in 'typec_port_register_altmode' drivers/usb/typec/class.c:1497: warning: Excess function parameter 'drvdata' description in 'typec_port_register_altmode' drivers/usb/typec/class.c:1497: warning: Excess function parameter 'drvdata' description in 'typec_port_register_altmode' drivers/usb/typec/class.c:1497: warning: Excess function parameter 'drvdata' description in 'typec_port_register_altmode' drivers/usb/typec/bus.c:1: warning: no structured comments found
drivers/usb/typec/bus.c:268: warning: Function parameter or member 'mode' not described in 'typec_match_altmode' drivers/usb/typec/class.c:1497: warning: Excess function parameter 'drvdata' description in 'typec_port_register_altmode' drivers/usb/typec/class.c:1: warning: no structured comments found
include/linux/w1.h:281: warning: Function parameter or member 'of_match_table' not described in 'w1_family' fs/direct-io.c:257: warning: Excess function parameter 'offset' description in 'dio_complete'
fs/file_table.c:1: warning: no structured comments found
fs/libfs.c:477: warning: Excess function parameter 'available' description in 'simple_write_end'
fs/posix_acl.c:646: warning: Function parameter or member 'inode' not described in 'posix_acl_update_mode' fs/posix_acl.c:646: warning: Function parameter or member 'mode_p' not described in 'posix_acl_update_mode' fs/posix_acl.c:646: warning: Function parameter or member 'acl' not described in 'posix_acl_update_mode' drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c:183: warning: Function parameter or member 'blockable' not described in 'amdgpu_mn_read_lock' drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c:254: warning: Function parameter or member 'blockable' not described in 'amdgpu_mn_invalidate_range_start_gfx' drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c:302: warning: Function parameter or member 'blockable' not described in 'amdgpu_mn_invalidate_range_start_hsa' drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:3011: warning: Excess function parameter 'dev' description in 'amdgpu_vm_get_task_info' drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:3012: warning: Function parameter or member 'adev' not described in 'amdgpu_vm_get_task_info' drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:3012: warning: Excess function parameter 'dev' description in 'amdgpu_vm_get_task_info' include/drm/drm_drv.h:610: warning: Function parameter or member 'gem_prime_pin' not described in 'drm_driver' include/drm/drm_drv.h:610: warning: Function parameter or member 'gem_prime_unpin' not described in 'drm_driver' include/drm/drm_drv.h:610: warning: Function parameter or member 'gem_prime_res_obj' not described in 'drm_driver' include/drm/drm_drv.h:610: warning: Function parameter or member 'gem_prime_get_sg_table' not described in 'drm_driver' include/drm/drm_drv.h:610: warning: Function parameter or member 'gem_prime_import_sg_table' not described in 'drm_driver' include/drm/drm_drv.h:610: warning: Function parameter or member 'gem_prime_vmap' not described in 'drm_driver' include/drm/drm_drv.h:610: warning: Function parameter or member 'gem_prime_vunmap' not described in 'drm_driver' include/drm/drm_drv.h:610: warning: Function parameter or member 'gem_prime_mmap' not described in 'drm_driver' include/drm/drm_panel.h:98: warning: Function parameter or member 'link' not described in 'drm_panel' drivers/gpu/drm/i915/i915_vma.h:49: warning: cannot understand function prototype: 'struct i915_vma ' drivers/gpu/drm/i915/i915_vma.h:1: warning: no structured comments found
drivers/gpu/drm/i915/intel_guc_fwif.h:553: warning: cannot understand function prototype: 'struct guc_log_buffer_state ' drivers/gpu/drm/i915/i915_trace.h:1: warning: no structured comments found
include/linux/skbuff.h:860: warning: Function parameter or member 'dev_scratch' not described in 'sk_buff' include/linux/skbuff.h:860: warning: Function parameter or member 'list' not described in 'sk_buff' include/linux/skbuff.h:860: warning: Function parameter or member 'ip_defrag_offset' not described in 'sk_buff' include/linux/skbuff.h:860: warning: Function parameter or member 'skb_mstamp' not described in 'sk_buff' include/linux/skbuff.h:860: warning: Function parameter or member '__cloned_offset' not described in 'sk_buff' include/linux/skbuff.h:860: warning: Function parameter or member 'head_frag' not described in 'sk_buff' include/linux/skbuff.h:860: warning: Function parameter or member '__pkt_type_offset' not described in 'sk_buff' include/linux/skbuff.h:860: warning: Function parameter or member 'encapsulation' not described in 'sk_buff' include/linux/skbuff.h:860: warning: Function parameter or member 'encap_hdr_csum' not described in 'sk_buff' include/linux/skbuff.h:860: warning: Function parameter or member 'csum_valid' not described in 'sk_buff' include/linux/skbuff.h:860: warning: Function parameter or member 'csum_complete_sw' not described in 'sk_buff' include/linux/skbuff.h:860: warning: Function parameter or member 'csum_level' not described in 'sk_buff' include/linux/skbuff.h:860: warning: Function parameter or member 'inner_protocol_type' not described in 'sk_buff' include/linux/skbuff.h:860: warning: Function parameter or member 'remcsum_offload' not described in 'sk_buff' include/linux/skbuff.h:860: warning: Function parameter or member 'offload_fwd_mark' not described in 'sk_buff' include/linux/skbuff.h:860: warning: Function parameter or member 'offload_mr_fwd_mark' not described in 'sk_buff' include/linux/skbuff.h:860: warning: Function parameter or member 'sender_cpu' not described in 'sk_buff' include/linux/skbuff.h:860: warning: Function parameter or member 'reserved_tailroom' not described in 'sk_buff' include/linux/skbuff.h:860: warning: Function parameter or member 'inner_ipproto' not described in 'sk_buff' include/net/sock.h:238: warning: Function parameter or member 'skc_addrpair' not described in 'sock_common' include/net/sock.h:238: warning: Function parameter or member 'skc_portpair' not described in 'sock_common' include/net/sock.h:238: warning: Function parameter or member 'skc_ipv6only' not described in 'sock_common' include/net/sock.h:238: warning: Function parameter or member 'skc_net_refcnt' not described in 'sock_common' include/net/sock.h:238: warning: Function parameter or member 'skc_v6_daddr' not described in 'sock_common' include/net/sock.h:238: warning: Function parameter or member 'skc_v6_rcv_saddr' not described in 'sock_common' include/net/sock.h:238: warning: Function parameter or member 'skc_cookie' not described in 'sock_common' include/net/sock.h:238: warning: Function parameter or member 'skc_listener' not described in 'sock_common' include/net/sock.h:238: warning: Function parameter or member 'skc_tw_dr' not described in 'sock_common' include/net/sock.h:238: warning: Function parameter or member 'skc_rcv_wnd' not described in 'sock_common' include/net/sock.h:238: warning: Function parameter or member 'skc_tw_rcv_nxt' not described in 'sock_common' include/net/sock.h:509: warning: Function parameter or member 'sk_backlog.rmem_alloc' not described in 'sock' include/net/sock.h:509: warning: Function parameter or member 'sk_backlog.len' not described in 'sock' include/net/sock.h:509: warning: Function parameter or member 'sk_backlog.head' not described in 'sock' include/net/sock.h:509: warning: Function parameter or member 'sk_backlog.tail' not described in 'sock' include/net/sock.h:509: warning: Function parameter or member 'sk_wq_raw' not described in 'sock'
include/net/sock.h:509: warning: Function parameter or member 'tcp_rtx_queue' not described in 'sock' include/net/sock.h:509: warning: Function parameter or member 'sk_route_forced_caps' not described in 'sock' include/net/sock.h:509: warning: Function parameter or member 'sk_txtime_report_errors' not described in 'sock' include/net/sock.h:509: warning: Function parameter or member 'sk_validate_xmit_skb' not described in 'sock' include/linux/netdevice.h:2018: warning: Function parameter or member 'adj_list.upper' not described in 'net_device' include/linux/netdevice.h:2018: warning: Function parameter or member 'adj_list.lower' not described in 'net_device' include/linux/netdevice.h:2018: warning: Function parameter or member 'gso_partial_features' not described in 'net_device' include/linux/netdevice.h:2018: warning: Function parameter or member 'switchdev_ops' not described in 'net_device'

# https://github.com/0day-ci/linux/commit/eed1edfa16cb1ed0b7530c47d080859c9a2036ec
git remote add linux-review https://github.com/0day-ci/linux
git remote update linux-review
git checkout eed1edfa16cb1ed0b7530c47d080859c9a2036ec
vim +1848 drivers/video/fbdev/core/fbmem.c

712f3147 drivers/video/fbmem.c            Linus Torvalds  2011-05-13  1833  
712f3147 drivers/video/fbmem.c            Linus Torvalds  2011-05-13  1834  /**
eed1edfa drivers/video/fbdev/core/fbmem.c Michał Mirosław 2018-09-01  1835   * remove_conflicting_pci_framebuffers - remove firmware-configured framebuffers for PCI devices
eed1edfa drivers/video/fbdev/core/fbmem.c Michał Mirosław 2018-09-01  1836   * @pdev: PCI device
eed1edfa drivers/video/fbdev/core/fbmem.c Michał Mirosław 2018-09-01  1837   * @resource_id: index of PCI BAR configuring framebuffer memory
eed1edfa drivers/video/fbdev/core/fbmem.c Michał Mirosław 2018-09-01  1838   * @name: requesting driver name
eed1edfa drivers/video/fbdev/core/fbmem.c Michał Mirosław 2018-09-01  1839   *
eed1edfa drivers/video/fbdev/core/fbmem.c Michał Mirosław 2018-09-01  1840   * This function removes framebuffer devices (eg. initialized by firmware)
eed1edfa drivers/video/fbdev/core/fbmem.c Michał Mirosław 2018-09-01  1841   * using memory range configured for @pdev's BAR @resource_id.
eed1edfa drivers/video/fbdev/core/fbmem.c Michał Mirosław 2018-09-01  1842   *
eed1edfa drivers/video/fbdev/core/fbmem.c Michał Mirosław 2018-09-01  1843   * The function assumes that PCI device with shadowed ROM drives a primary
eed1edfa drivers/video/fbdev/core/fbmem.c Michał Mirosław 2018-09-01  1844   * display and so kicks out vga16fb.
eed1edfa drivers/video/fbdev/core/fbmem.c Michał Mirosław 2018-09-01  1845   */
eed1edfa drivers/video/fbdev/core/fbmem.c Michał Mirosław 2018-09-01  1846  int remove_conflicting_pci_framebuffers(struct pci_dev *pdev, int res_id, const char *name)
eed1edfa drivers/video/fbdev/core/fbmem.c Michał Mirosław 2018-09-01  1847  {
eed1edfa drivers/video/fbdev/core/fbmem.c Michał Mirosław 2018-09-01 @1848  	struct apertures_struct *ap;
eed1edfa drivers/video/fbdev/core/fbmem.c Michał Mirosław 2018-09-01  1849  	bool primary = false;
eed1edfa drivers/video/fbdev/core/fbmem.c Michał Mirosław 2018-09-01  1850  	int err;
eed1edfa drivers/video/fbdev/core/fbmem.c Michał Mirosław 2018-09-01  1851  
eed1edfa drivers/video/fbdev/core/fbmem.c Michał Mirosław 2018-09-01  1852  	ap = alloc_apertures(1);
eed1edfa drivers/video/fbdev/core/fbmem.c Michał Mirosław 2018-09-01  1853  	if (!ap)
eed1edfa drivers/video/fbdev/core/fbmem.c Michał Mirosław 2018-09-01  1854  		return -ENOMEM;
eed1edfa drivers/video/fbdev/core/fbmem.c Michał Mirosław 2018-09-01  1855  
eed1edfa drivers/video/fbdev/core/fbmem.c Michał Mirosław 2018-09-01  1856  	ap->ranges[0].base = pci_resource_start(pdev, res_id);
eed1edfa drivers/video/fbdev/core/fbmem.c Michał Mirosław 2018-09-01  1857  	ap->ranges[0].size = pci_resource_len(pdev, res_id);
eed1edfa drivers/video/fbdev/core/fbmem.c Michał Mirosław 2018-09-01  1858  #ifdef CONFIG_X86
eed1edfa drivers/video/fbdev/core/fbmem.c Michał Mirosław 2018-09-01  1859  	primary = pdev->resource[PCI_ROM_RESOURCE].flags &
eed1edfa drivers/video/fbdev/core/fbmem.c Michał Mirosław 2018-09-01  1860  					IORESOURCE_ROM_SHADOW;
eed1edfa drivers/video/fbdev/core/fbmem.c Michał Mirosław 2018-09-01  1861  #endif
eed1edfa drivers/video/fbdev/core/fbmem.c Michał Mirosław 2018-09-01  1862  	err = remove_conflicting_framebuffers(ap, name, primary);
eed1edfa drivers/video/fbdev/core/fbmem.c Michał Mirosław 2018-09-01  1863  	kfree(ap);
eed1edfa drivers/video/fbdev/core/fbmem.c Michał Mirosław 2018-09-01  1864  	return err;
eed1edfa drivers/video/fbdev/core/fbmem.c Michał Mirosław 2018-09-01  1865  }
eed1edfa drivers/video/fbdev/core/fbmem.c Michał Mirosław 2018-09-01  1866  EXPORT_SYMBOL(remove_conflicting_pci_framebuffers);
eed1edfa drivers/video/fbdev/core/fbmem.c Michał Mirosław 2018-09-01  1867  

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

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

#98 lore raw

Re: [PATCH v3 04/13] fbdev: add remove_conflicting_pci_framebuffers()

In reply to Michał Mirosław
I love your patch! Perhaps something to improve:

Hi Michał,

I love your patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[also build test WARNING on v4.19-rc2 next-20180831]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url: https://github.com/0day-ci/linux/commits/Micha-Miros-aw/remove_conflicting_framebuffers-cleanup/20180903-094322
reproduce: make htmldocs
:::::: branch date: 5 hours ago
:::::: commit date: 5 hours ago

All warnings (new ones prefixed by >>):

WARNING: convert(1) not found, for SVG to PDF conversion install ImageMagick (https://www.imagemagick.org)
include/linux/srcu.h:175: warning: Function parameter or member 'p' not described in 'srcu_dereference_notrace' include/linux/srcu.h:175: warning: Function parameter or member 'sp' not described in 'srcu_dereference_notrace' include/linux/gfp.h:1: warning: no structured comments found
include/net/cfg80211.h:4381: warning: Function parameter or member 'wext.ibss' not described in 'wireless_dev' include/net/cfg80211.h:4381: warning: Function parameter or member 'wext.connect' not described in 'wireless_dev' include/net/cfg80211.h:4381: warning: Function parameter or member 'wext.keys' not described in 'wireless_dev' include/net/cfg80211.h:4381: warning: Function parameter or member 'wext.ie' not described in 'wireless_dev' include/net/cfg80211.h:4381: warning: Function parameter or member 'wext.ie_len' not described in 'wireless_dev' include/net/cfg80211.h:4381: warning: Function parameter or member 'wext.bssid' not described in 'wireless_dev' include/net/cfg80211.h:4381: warning: Function parameter or member 'wext.ssid' not described in 'wireless_dev' include/net/cfg80211.h:4381: warning: Function parameter or member 'wext.default_key' not described in 'wireless_dev' include/net/cfg80211.h:4381: warning: Function parameter or member 'wext.default_mgmt_key' not described in 'wireless_dev' include/net/cfg80211.h:4381: warning: Function parameter or member 'wext.prev_bssid_valid' not described in 'wireless_dev' include/net/mac80211.h:2328: warning: Function parameter or member 'radiotap_timestamp.units_pos' not described in 'ieee80211_hw' include/net/mac80211.h:2328: warning: Function parameter or member 'radiotap_timestamp.accuracy' not described in 'ieee80211_hw' include/net/mac80211.h:977: warning: Function parameter or member 'control.rates' not described in 'ieee80211_tx_info' include/net/mac80211.h:977: warning: Function parameter or member 'control.rts_cts_rate_idx' not described in 'ieee80211_tx_info' include/net/mac80211.h:977: warning: Function parameter or member 'control.use_rts' not described in 'ieee80211_tx_info' include/net/mac80211.h:977: warning: Function parameter or member 'control.use_cts_prot' not described in 'ieee80211_tx_info' include/net/mac80211.h:977: warning: Function parameter or member 'control.short_preamble' not described in 'ieee80211_tx_info' include/net/mac80211.h:977: warning: Function parameter or member 'control.skip_table' not described in 'ieee80211_tx_info' include/net/mac80211.h:977: warning: Function parameter or member 'control.jiffies' not described in 'ieee80211_tx_info' include/net/mac80211.h:977: warning: Function parameter or member 'control.vif' not described in 'ieee80211_tx_info' include/net/mac80211.h:977: warning: Function parameter or member 'control.hw_key' not described in 'ieee80211_tx_info' include/net/mac80211.h:977: warning: Function parameter or member 'control.flags' not described in 'ieee80211_tx_info' include/net/mac80211.h:977: warning: Function parameter or member 'control.enqueue_time' not described in 'ieee80211_tx_info' include/net/mac80211.h:977: warning: Function parameter or member 'ack' not described in 'ieee80211_tx_info' include/net/mac80211.h:977: warning: Function parameter or member 'ack.cookie' not described in 'ieee80211_tx_info' include/net/mac80211.h:977: warning: Function parameter or member 'status.rates' not described in 'ieee80211_tx_info' include/net/mac80211.h:977: warning: Function parameter or member 'status.ack_signal' not described in 'ieee80211_tx_info' include/net/mac80211.h:977: warning: Function parameter or member 'status.ampdu_ack_len' not described in 'ieee80211_tx_info' include/net/mac80211.h:977: warning: Function parameter or member 'status.ampdu_len' not described in 'ieee80211_tx_info' include/net/mac80211.h:977: warning: Function parameter or member 'status.antenna' not described in 'ieee80211_tx_info' include/net/mac80211.h:977: warning: Function parameter or member 'status.tx_time' not described in 'ieee80211_tx_info' include/net/mac80211.h:977: warning: Function parameter or member 'status.is_valid_ack_signal' not described in 'ieee80211_tx_info' include/net/mac80211.h:977: warning: Function parameter or member 'status.status_driver_data' not described in 'ieee80211_tx_info' include/net/mac80211.h:977: warning: Function parameter or member 'driver_rates' not described in 'ieee80211_tx_info' include/net/mac80211.h:977: warning: Function parameter or member 'pad' not described in 'ieee80211_tx_info' include/net/mac80211.h:977: warning: Function parameter or member 'rate_driver_data' not described in 'ieee80211_tx_info' net/mac80211/sta_info.h:588: warning: Function parameter or member 'rx_stats_avg' not described in 'sta_info' net/mac80211/sta_info.h:588: warning: Function parameter or member 'rx_stats_avg.signal' not described in 'sta_info' net/mac80211/sta_info.h:588: warning: Function parameter or member 'rx_stats_avg.chain_signal' not described in 'sta_info' net/mac80211/sta_info.h:588: warning: Function parameter or member 'status_stats.filtered' not described in 'sta_info' net/mac80211/sta_info.h:588: warning: Function parameter or member 'status_stats.retry_failed' not described in 'sta_info' net/mac80211/sta_info.h:588: warning: Function parameter or member 'status_stats.retry_count' not described in 'sta_info' net/mac80211/sta_info.h:588: warning: Function parameter or member 'status_stats.lost_packets' not described in 'sta_info' net/mac80211/sta_info.h:588: warning: Function parameter or member 'status_stats.last_tdls_pkt_time' not described in 'sta_info' net/mac80211/sta_info.h:588: warning: Function parameter or member 'status_stats.msdu_retries' not described in 'sta_info' net/mac80211/sta_info.h:588: warning: Function parameter or member 'status_stats.msdu_failed' not described in 'sta_info' net/mac80211/sta_info.h:588: warning: Function parameter or member 'status_stats.last_ack' not described in 'sta_info' net/mac80211/sta_info.h:588: warning: Function parameter or member 'status_stats.last_ack_signal' not described in 'sta_info' net/mac80211/sta_info.h:588: warning: Function parameter or member 'status_stats.ack_signal_filled' not described in 'sta_info' net/mac80211/sta_info.h:588: warning: Function parameter or member 'status_stats.avg_ack_signal' not described in 'sta_info' net/mac80211/sta_info.h:588: warning: Function parameter or member 'tx_stats.packets' not described in 'sta_info' net/mac80211/sta_info.h:588: warning: Function parameter or member 'tx_stats.bytes' not described in 'sta_info' net/mac80211/sta_info.h:588: warning: Function parameter or member 'tx_stats.last_rate' not described in 'sta_info' net/mac80211/sta_info.h:588: warning: Function parameter or member 'tx_stats.msdu' not described in 'sta_info' include/linux/mod_devicetable.h:763: warning: Function parameter or member 'driver_data' not described in 'typec_device_id' kernel/sched/fair.c:3371: warning: Function parameter or member 'flags' not described in 'attach_entity_load_avg' arch/x86/include/asm/atomic.h:84: warning: Excess function parameter 'i' description in 'arch_atomic_sub_and_test' arch/x86/include/asm/atomic.h:84: warning: Excess function parameter 'v' description in 'arch_atomic_sub_and_test' arch/x86/include/asm/atomic.h:96: warning: Excess function parameter 'v' description in 'arch_atomic_inc' arch/x86/include/asm/atomic.h:109: warning: Excess function parameter 'v' description in 'arch_atomic_dec' arch/x86/include/asm/atomic.h:124: warning: Excess function parameter 'v' description in 'arch_atomic_dec_and_test' arch/x86/include/asm/atomic.h:138: warning: Excess function parameter 'v' description in 'arch_atomic_inc_and_test' arch/x86/include/asm/atomic.h:153: warning: Excess function parameter 'i' description in 'arch_atomic_add_negative' arch/x86/include/asm/atomic.h:153: warning: Excess function parameter 'v' description in 'arch_atomic_add_negative' include/linux/dma-buf.h:304: warning: Function parameter or member 'cb_excl.cb' not described in 'dma_buf' include/linux/dma-buf.h:304: warning: Function parameter or member 'cb_excl.poll' not described in 'dma_buf' include/linux/dma-buf.h:304: warning: Function parameter or member 'cb_excl.active' not described in 'dma_buf' include/linux/dma-buf.h:304: warning: Function parameter or member 'cb_shared.cb' not described in 'dma_buf' include/linux/dma-buf.h:304: warning: Function parameter or member 'cb_shared.poll' not described in 'dma_buf' include/linux/dma-buf.h:304: warning: Function parameter or member 'cb_shared.active' not described in 'dma_buf' include/linux/dma-fence-array.h:54: warning: Function parameter or member 'work' not described in 'dma_fence_array'

>> drivers/video/fbdev/core/fbmem.c:1848: warning: Function parameter or member 'res_id' not described in 'remove_conflicting_pci_framebuffers'

drivers/video/fbdev/core/fbmem.c:1848: warning: Excess function parameter 'resource_id' description in 'remove_conflicting_pci_framebuffers' include/linux/gpio/driver.h:142: warning: Function parameter or member 'request_key' not described in 'gpio_irq_chip' include/linux/iio/hw-consumer.h:1: warning: no structured comments found
include/linux/input/sparse-keymap.h:46: warning: Function parameter or member 'sw' not described in 'key_entry' drivers/pci/pci.c:218: warning: Excess function parameter 'p' description in 'pci_dev_str_match_path' include/linux/regulator/driver.h:227: warning: Function parameter or member 'resume' not described in 'regulator_ops' drivers/regulator/core.c:4479: warning: Excess function parameter 'state' description in 'regulator_suspend' arch/s390/include/asm/cio.h:245: warning: Function parameter or member 'esw.esw0' not described in 'irb' arch/s390/include/asm/cio.h:245: warning: Function parameter or member 'esw.esw1' not described in 'irb' arch/s390/include/asm/cio.h:245: warning: Function parameter or member 'esw.esw2' not described in 'irb' arch/s390/include/asm/cio.h:245: warning: Function parameter or member 'esw.esw3' not described in 'irb' arch/s390/include/asm/cio.h:245: warning: Function parameter or member 'esw.eadm' not described in 'irb' drivers/slimbus/stream.c:1: warning: no structured comments found
drivers/target/target_core_device.c:1: warning: no structured comments found
drivers/usb/dwc3/gadget.c:510: warning: Excess function parameter 'dwc' description in 'dwc3_gadget_start_config' drivers/usb/typec/class.c:1497: warning: Excess function parameter 'drvdata' description in 'typec_port_register_altmode' drivers/usb/typec/class.c:1497: warning: Excess function parameter 'drvdata' description in 'typec_port_register_altmode' drivers/usb/typec/class.c:1497: warning: Excess function parameter 'drvdata' description in 'typec_port_register_altmode' drivers/usb/typec/class.c:1497: warning: Excess function parameter 'drvdata' description in 'typec_port_register_altmode' drivers/usb/typec/class.c:1497: warning: Excess function parameter 'drvdata' description in 'typec_port_register_altmode' drivers/usb/typec/class.c:1497: warning: Excess function parameter 'drvdata' description in 'typec_port_register_altmode' drivers/usb/typec/class.c:1497: warning: Excess function parameter 'drvdata' description in 'typec_port_register_altmode' drivers/usb/typec/class.c:1497: warning: Excess function parameter 'drvdata' description in 'typec_port_register_altmode' drivers/usb/typec/class.c:1497: warning: Excess function parameter 'drvdata' description in 'typec_port_register_altmode' drivers/usb/typec/class.c:1497: warning: Excess function parameter 'drvdata' description in 'typec_port_register_altmode' drivers/usb/typec/class.c:1497: warning: Excess function parameter 'drvdata' description in 'typec_port_register_altmode' drivers/usb/typec/class.c:1497: warning: Excess function parameter 'drvdata' description in 'typec_port_register_altmode' drivers/usb/typec/bus.c:1: warning: no structured comments found
drivers/usb/typec/bus.c:268: warning: Function parameter or member 'mode' not described in 'typec_match_altmode' drivers/usb/typec/class.c:1497: warning: Excess function parameter 'drvdata' description in 'typec_port_register_altmode' drivers/usb/typec/class.c:1: warning: no structured comments found
include/linux/w1.h:281: warning: Function parameter or member 'of_match_table' not described in 'w1_family' fs/direct-io.c:257: warning: Excess function parameter 'offset' description in 'dio_complete'
fs/file_table.c:1: warning: no structured comments found
fs/libfs.c:477: warning: Excess function parameter 'available' description in 'simple_write_end'
fs/posix_acl.c:646: warning: Function parameter or member 'inode' not described in 'posix_acl_update_mode' fs/posix_acl.c:646: warning: Function parameter or member 'mode_p' not described in 'posix_acl_update_mode' fs/posix_acl.c:646: warning: Function parameter or member 'acl' not described in 'posix_acl_update_mode' drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c:183: warning: Function parameter or member 'blockable' not described in 'amdgpu_mn_read_lock' drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c:254: warning: Function parameter or member 'blockable' not described in 'amdgpu_mn_invalidate_range_start_gfx' drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c:302: warning: Function parameter or member 'blockable' not described in 'amdgpu_mn_invalidate_range_start_hsa' drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:3011: warning: Excess function parameter 'dev' description in 'amdgpu_vm_get_task_info' drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:3012: warning: Function parameter or member 'adev' not described in 'amdgpu_vm_get_task_info' drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:3012: warning: Excess function parameter 'dev' description in 'amdgpu_vm_get_task_info' include/drm/drm_drv.h:610: warning: Function parameter or member 'gem_prime_pin' not described in 'drm_driver' include/drm/drm_drv.h:610: warning: Function parameter or member 'gem_prime_unpin' not described in 'drm_driver' include/drm/drm_drv.h:610: warning: Function parameter or member 'gem_prime_res_obj' not described in 'drm_driver' include/drm/drm_drv.h:610: warning: Function parameter or member 'gem_prime_get_sg_table' not described in 'drm_driver' include/drm/drm_drv.h:610: warning: Function parameter or member 'gem_prime_import_sg_table' not described in 'drm_driver' include/drm/drm_drv.h:610: warning: Function parameter or member 'gem_prime_vmap' not described in 'drm_driver' include/drm/drm_drv.h:610: warning: Function parameter or member 'gem_prime_vunmap' not described in 'drm_driver' include/drm/drm_drv.h:610: warning: Function parameter or member 'gem_prime_mmap' not described in 'drm_driver' include/drm/drm_panel.h:98: warning: Function parameter or member 'link' not described in 'drm_panel' drivers/gpu/drm/i915/i915_vma.h:49: warning: cannot understand function prototype: 'struct i915_vma ' drivers/gpu/drm/i915/i915_vma.h:1: warning: no structured comments found
drivers/gpu/drm/i915/intel_guc_fwif.h:553: warning: cannot understand function prototype: 'struct guc_log_buffer_state ' drivers/gpu/drm/i915/i915_trace.h:1: warning: no structured comments found
include/linux/skbuff.h:860: warning: Function parameter or member 'dev_scratch' not described in 'sk_buff' include/linux/skbuff.h:860: warning: Function parameter or member 'list' not described in 'sk_buff' include/linux/skbuff.h:860: warning: Function parameter or member 'ip_defrag_offset' not described in 'sk_buff' include/linux/skbuff.h:860: warning: Function parameter or member 'skb_mstamp' not described in 'sk_buff' include/linux/skbuff.h:860: warning: Function parameter or member '__cloned_offset' not described in 'sk_buff' include/linux/skbuff.h:860: warning: Function parameter or member 'head_frag' not described in 'sk_buff' include/linux/skbuff.h:860: warning: Function parameter or member '__pkt_type_offset' not described in 'sk_buff' include/linux/skbuff.h:860: warning: Function parameter or member 'encapsulation' not described in 'sk_buff' include/linux/skbuff.h:860: warning: Function parameter or member 'encap_hdr_csum' not described in 'sk_buff' include/linux/skbuff.h:860: warning: Function parameter or member 'csum_valid' not described in 'sk_buff' include/linux/skbuff.h:860: warning: Function parameter or member 'csum_complete_sw' not described in 'sk_buff' include/linux/skbuff.h:860: warning: Function parameter or member 'csum_level' not described in 'sk_buff' include/linux/skbuff.h:860: warning: Function parameter or member 'inner_protocol_type' not described in 'sk_buff' include/linux/skbuff.h:860: warning: Function parameter or member 'remcsum_offload' not described in 'sk_buff' include/linux/skbuff.h:860: warning: Function parameter or member 'offload_fwd_mark' not described in 'sk_buff' include/linux/skbuff.h:860: warning: Function parameter or member 'offload_mr_fwd_mark' not described in 'sk_buff' include/linux/skbuff.h:860: warning: Function parameter or member 'sender_cpu' not described in 'sk_buff' include/linux/skbuff.h:860: warning: Function parameter or member 'reserved_tailroom' not described in 'sk_buff' include/linux/skbuff.h:860: warning: Function parameter or member 'inner_ipproto' not described in 'sk_buff' include/net/sock.h:238: warning: Function parameter or member 'skc_addrpair' not described in 'sock_common' include/net/sock.h:238: warning: Function parameter or member 'skc_portpair' not described in 'sock_common' include/net/sock.h:238: warning: Function parameter or member 'skc_ipv6only' not described in 'sock_common' include/net/sock.h:238: warning: Function parameter or member 'skc_net_refcnt' not described in 'sock_common' include/net/sock.h:238: warning: Function parameter or member 'skc_v6_daddr' not described in 'sock_common' include/net/sock.h:238: warning: Function parameter or member 'skc_v6_rcv_saddr' not described in 'sock_common' include/net/sock.h:238: warning: Function parameter or member 'skc_cookie' not described in 'sock_common' include/net/sock.h:238: warning: Function parameter or member 'skc_listener' not described in 'sock_common' include/net/sock.h:238: warning: Function parameter or member 'skc_tw_dr' not described in 'sock_common' include/net/sock.h:238: warning: Function parameter or member 'skc_rcv_wnd' not described in 'sock_common' include/net/sock.h:238: warning: Function parameter or member 'skc_tw_rcv_nxt' not described in 'sock_common' include/net/sock.h:509: warning: Function parameter or member 'sk_backlog.rmem_alloc' not described in 'sock' include/net/sock.h:509: warning: Function parameter or member 'sk_backlog.len' not described in 'sock' include/net/sock.h:509: warning: Function parameter or member 'sk_backlog.head' not described in 'sock' include/net/sock.h:509: warning: Function parameter or member 'sk_backlog.tail' not described in 'sock' include/net/sock.h:509: warning: Function parameter or member 'sk_wq_raw' not described in 'sock'
include/net/sock.h:509: warning: Function parameter or member 'tcp_rtx_queue' not described in 'sock' include/net/sock.h:509: warning: Function parameter or member 'sk_route_forced_caps' not described in 'sock' include/net/sock.h:509: warning: Function parameter or member 'sk_txtime_report_errors' not described in 'sock' include/net/sock.h:509: warning: Function parameter or member 'sk_validate_xmit_skb' not described in 'sock' include/linux/netdevice.h:2018: warning: Function parameter or member 'adj_list.upper' not described in 'net_device' include/linux/netdevice.h:2018: warning: Function parameter or member 'adj_list.lower' not described in 'net_device' include/linux/netdevice.h:2018: warning: Function parameter or member 'gso_partial_features' not described in 'net_device' include/linux/netdevice.h:2018: warning: Function parameter or member 'switchdev_ops' not described in 'net_device'

# https://github.com/0day-ci/linux/commit/eed1edfa16cb1ed0b7530c47d080859c9a2036ec
git remote add linux-review https://github.com/0day-ci/linux
git remote update linux-review
git checkout eed1edfa16cb1ed0b7530c47d080859c9a2036ec
vim +1848 drivers/video/fbdev/core/fbmem.c

712f3147 drivers/video/fbmem.c            Linus Torvalds  2011-05-13  1833  
712f3147 drivers/video/fbmem.c            Linus Torvalds  2011-05-13  1834  /**
eed1edfa drivers/video/fbdev/core/fbmem.c Michał Mirosław 2018-09-01  1835   * remove_conflicting_pci_framebuffers - remove firmware-configured framebuffers for PCI devices
eed1edfa drivers/video/fbdev/core/fbmem.c Michał Mirosław 2018-09-01  1836   * @pdev: PCI device
eed1edfa drivers/video/fbdev/core/fbmem.c Michał Mirosław 2018-09-01  1837   * @resource_id: index of PCI BAR configuring framebuffer memory
eed1edfa drivers/video/fbdev/core/fbmem.c Michał Mirosław 2018-09-01  1838   * @name: requesting driver name
eed1edfa drivers/video/fbdev/core/fbmem.c Michał Mirosław 2018-09-01  1839   *
eed1edfa drivers/video/fbdev/core/fbmem.c Michał Mirosław 2018-09-01  1840   * This function removes framebuffer devices (eg. initialized by firmware)
eed1edfa drivers/video/fbdev/core/fbmem.c Michał Mirosław 2018-09-01  1841   * using memory range configured for @pdev's BAR @resource_id.
eed1edfa drivers/video/fbdev/core/fbmem.c Michał Mirosław 2018-09-01  1842   *
eed1edfa drivers/video/fbdev/core/fbmem.c Michał Mirosław 2018-09-01  1843   * The function assumes that PCI device with shadowed ROM drives a primary
eed1edfa drivers/video/fbdev/core/fbmem.c Michał Mirosław 2018-09-01  1844   * display and so kicks out vga16fb.
eed1edfa drivers/video/fbdev/core/fbmem.c Michał Mirosław 2018-09-01  1845   */
eed1edfa drivers/video/fbdev/core/fbmem.c Michał Mirosław 2018-09-01  1846  int remove_conflicting_pci_framebuffers(struct pci_dev *pdev, int res_id, const char *name)
eed1edfa drivers/video/fbdev/core/fbmem.c Michał Mirosław 2018-09-01  1847  {
eed1edfa drivers/video/fbdev/core/fbmem.c Michał Mirosław 2018-09-01 @1848  	struct apertures_struct *ap;
eed1edfa drivers/video/fbdev/core/fbmem.c Michał Mirosław 2018-09-01  1849  	bool primary = false;
eed1edfa drivers/video/fbdev/core/fbmem.c Michał Mirosław 2018-09-01  1850  	int err;
eed1edfa drivers/video/fbdev/core/fbmem.c Michał Mirosław 2018-09-01  1851  
eed1edfa drivers/video/fbdev/core/fbmem.c Michał Mirosław 2018-09-01  1852  	ap = alloc_apertures(1);
eed1edfa drivers/video/fbdev/core/fbmem.c Michał Mirosław 2018-09-01  1853  	if (!ap)
eed1edfa drivers/video/fbdev/core/fbmem.c Michał Mirosław 2018-09-01  1854  		return -ENOMEM;
eed1edfa drivers/video/fbdev/core/fbmem.c Michał Mirosław 2018-09-01  1855  
eed1edfa drivers/video/fbdev/core/fbmem.c Michał Mirosław 2018-09-01  1856  	ap->ranges[0].base = pci_resource_start(pdev, res_id);
eed1edfa drivers/video/fbdev/core/fbmem.c Michał Mirosław 2018-09-01  1857  	ap->ranges[0].size = pci_resource_len(pdev, res_id);
eed1edfa drivers/video/fbdev/core/fbmem.c Michał Mirosław 2018-09-01  1858  #ifdef CONFIG_X86
eed1edfa drivers/video/fbdev/core/fbmem.c Michał Mirosław 2018-09-01  1859  	primary = pdev->resource[PCI_ROM_RESOURCE].flags &
eed1edfa drivers/video/fbdev/core/fbmem.c Michał Mirosław 2018-09-01  1860  					IORESOURCE_ROM_SHADOW;
eed1edfa drivers/video/fbdev/core/fbmem.c Michał Mirosław 2018-09-01  1861  #endif
eed1edfa drivers/video/fbdev/core/fbmem.c Michał Mirosław 2018-09-01  1862  	err = remove_conflicting_framebuffers(ap, name, primary);
eed1edfa drivers/video/fbdev/core/fbmem.c Michał Mirosław 2018-09-01  1863  	kfree(ap);
eed1edfa drivers/video/fbdev/core/fbmem.c Michał Mirosław 2018-09-01  1864  	return err;
eed1edfa drivers/video/fbdev/core/fbmem.c Michał Mirosław 2018-09-01  1865  }
eed1edfa drivers/video/fbdev/core/fbmem.c Michał Mirosław 2018-09-01  1866  EXPORT_SYMBOL(remove_conflicting_pci_framebuffers);
eed1edfa drivers/video/fbdev/core/fbmem.c Michał Mirosław 2018-09-01  1867  

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

#99 lore raw

PATCH v3 4/13 fbdev: add remove_conflicting_pci_framebuffers()

In reply to Michał Mirosław

Almost all PCI drivers using remove_conflicting_framebuffers() wrap it with the same code.

---
v2: add kerneldoc for DRM helper
v3: propagate remove_conflicting_framebuffers() return value
+ move kerneldoc to where function is implemented

---
 drivers/video/fbdev/core/fbmem.c | 35 ++++++++++++++++++++++++++++++++
 include/drm/drm_fb_helper.h      | 12 +++++++++++
 include/linux/fb.h               |  2 ++
 3 files changed, 49 insertions(+)
drivers/video/fbdev/core/fbmem.c +35 -0
index 2de93b5014e3..cd96b1c62bbe 100644
@@ -34,6 +34,7 @@
 #include <linux/fb.h>
 #include <linux/fbcon.h>
 #include <linux/mem_encrypt.h>
+#include <linux/pci.h>
 
 #include <asm/fb.h>
 
@@ -1812,6 +1813,40 @@ int remove_conflicting_framebuffers(struct apertures_struct *a,
 }
 EXPORT_SYMBOL(remove_conflicting_framebuffers);
 
+/**
+ * remove_conflicting_pci_framebuffers - remove firmware-configured framebuffers for PCI devices
+ * @pdev: PCI device
+ * @resource_id: index of PCI BAR configuring framebuffer memory
+ * @name: requesting driver name
+ *
+ * This function removes framebuffer devices (eg. initialized by firmware)
+ * using memory range configured for @pdev's BAR @resource_id.
+ *
+ * The function assumes that PCI device with shadowed ROM drives a primary
+ * display and so kicks out vga16fb.
+ */
+int remove_conflicting_pci_framebuffers(struct pci_dev *pdev, int res_id, const char *name)
+{
+	struct apertures_struct *ap;
+	bool primary = false;
+	int err;
+
+	ap = alloc_apertures(1);
+	if (!ap)
+		return -ENOMEM;
+
+	ap->ranges[0].base = pci_resource_start(pdev, res_id);
+	ap->ranges[0].size = pci_resource_len(pdev, res_id);
+#ifdef CONFIG_X86
+	primary = pdev->resource[PCI_ROM_RESOURCE].flags &
+					IORESOURCE_ROM_SHADOW;
+#endif
+	err = remove_conflicting_framebuffers(ap, name, primary);
+	kfree(ap);
+	return err;
+}
+EXPORT_SYMBOL(remove_conflicting_pci_framebuffers);
+
 /**
  *	register_framebuffer - registers a frame buffer device
  *	@fb_info: frame buffer info structure
include/drm/drm_fb_helper.h +12 -0
index b069433e7fc1..20ea856db900 100644
@@ -577,4 +577,16 @@ drm_fb_helper_remove_conflicting_framebuffers(struct apertures_struct *a,
 #endif
 }
 
+static inline int
+drm_fb_helper_remove_conflicting_pci_framebuffers(struct pci_dev *pdev,
+						  int resource_id,
+						  const char *name)
+{
+#if IS_REACHABLE(CONFIG_FB)
+	return remove_conflicting_pci_framebuffers(pdev, resource_id, name);
+#else
+	return 0;
+#endif
+}
+
 #endif
include/linux/fb.h +2 -0
index aa74a228bb92..abeffd55b66a 100644
@@ -632,6 +632,8 @@ extern ssize_t fb_sys_write(struct fb_info *info, const char __user *buf,
 extern int register_framebuffer(struct fb_info *fb_info);
 extern int unregister_framebuffer(struct fb_info *fb_info);
 extern int unlink_framebuffer(struct fb_info *fb_info);
+extern int remove_conflicting_pci_framebuffers(struct pci_dev *pdev, int res_id,
+					       const char *name);
 extern int remove_conflicting_framebuffers(struct apertures_struct *a,
 					   const char *name, bool primary);
 extern int fb_prepare_logo(struct fb_info *fb_info, int rotate);
Signature · 6 lines
2.18.0

_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
#100 lore raw

PATCH v3 5/13 drm/amdgpu: use simpler remove_conflicting_pci_framebuffers()

In reply to Michał Mirosław
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 24 +-----------------------
 1 file changed, 1 insertion(+), 23 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +1 -23
index 0b19482b36b8..9b6e037719db 100644
@@ -560,28 +560,6 @@ MODULE_DEVICE_TABLE(pci, pciidlist);
 
 static struct drm_driver kms_driver;
 
-static int amdgpu_kick_out_firmware_fb(struct pci_dev *pdev)
-{
-	struct apertures_struct *ap;
-	bool primary = false;
-
-	ap = alloc_apertures(1);
-	if (!ap)
-		return -ENOMEM;
-
-	ap->ranges[0].base = pci_resource_start(pdev, 0);
-	ap->ranges[0].size = pci_resource_len(pdev, 0);
-
-#ifdef CONFIG_X86
-	primary = pdev->resource[PCI_ROM_RESOURCE].flags & IORESOURCE_ROM_SHADOW;
-#endif
-	drm_fb_helper_remove_conflicting_framebuffers(ap, "amdgpudrmfb", primary);
-	kfree(ap);
-
-	return 0;
-}
-
-
 static int amdgpu_pci_probe(struct pci_dev *pdev,
 			    const struct pci_device_id *ent)
 {
@@ -609,7 +587,7 @@ static int amdgpu_pci_probe(struct pci_dev *pdev,
 		return ret;
 
 	/* Get rid of things like offb */
-	ret = amdgpu_kick_out_firmware_fb(pdev);
+	ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, 0, "amdgpudrmfb");
 	if (ret)
 		return ret;
 
Signature · 7 lines
2.18.0


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#101 lore raw

PATCH v3 5/13 drm/amdgpu: use simpler remove_conflicting_pci_framebuffers()

In reply to Michał Mirosław
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 24 +-----------------------
 1 file changed, 1 insertion(+), 23 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +1 -23
index 0b19482b36b8..9b6e037719db 100644
@@ -560,28 +560,6 @@ MODULE_DEVICE_TABLE(pci, pciidlist);
 
 static struct drm_driver kms_driver;
 
-static int amdgpu_kick_out_firmware_fb(struct pci_dev *pdev)
-{
-	struct apertures_struct *ap;
-	bool primary = false;
-
-	ap = alloc_apertures(1);
-	if (!ap)
-		return -ENOMEM;
-
-	ap->ranges[0].base = pci_resource_start(pdev, 0);
-	ap->ranges[0].size = pci_resource_len(pdev, 0);
-
-#ifdef CONFIG_X86
-	primary = pdev->resource[PCI_ROM_RESOURCE].flags & IORESOURCE_ROM_SHADOW;
-#endif
-	drm_fb_helper_remove_conflicting_framebuffers(ap, "amdgpudrmfb", primary);
-	kfree(ap);
-
-	return 0;
-}
-
-
 static int amdgpu_pci_probe(struct pci_dev *pdev,
 			    const struct pci_device_id *ent)
 {
@@ -609,7 +587,7 @@ static int amdgpu_pci_probe(struct pci_dev *pdev,
 		return ret;
 
 	/* Get rid of things like offb */
-	ret = amdgpu_kick_out_firmware_fb(pdev);
+	ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, 0, "amdgpudrmfb");
 	if (ret)
 		return ret;
 
Signature · 6 lines
2.18.0

_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
#102 lore raw

PATCH v3 6/13 drm/bochs: use simpler remove_conflicting_pci_framebuffers()

In reply to Michał Mirosław
---
 drivers/gpu/drm/bochs/bochs_drv.c | 18 +-----------------
 1 file changed, 1 insertion(+), 17 deletions(-)
drivers/gpu/drm/bochs/bochs_drv.c +1 -17
index 7b20318483e4..c61b40c72b62 100644
@@ -143,22 +143,6 @@ static const struct dev_pm_ops bochs_pm_ops = {
 /* ---------------------------------------------------------------------- */
 /* pci interface                                                          */
 
-static int bochs_kick_out_firmware_fb(struct pci_dev *pdev)
-{
-	struct apertures_struct *ap;
-
-	ap = alloc_apertures(1);
-	if (!ap)
-		return -ENOMEM;
-
-	ap->ranges[0].base = pci_resource_start(pdev, 0);
-	ap->ranges[0].size = pci_resource_len(pdev, 0);
-	drm_fb_helper_remove_conflicting_framebuffers(ap, "bochsdrmfb", false);
-	kfree(ap);
-
-	return 0;
-}
-
 static int bochs_pci_probe(struct pci_dev *pdev,
 			   const struct pci_device_id *ent)
 {
@@ -171,7 +155,7 @@ static int bochs_pci_probe(struct pci_dev *pdev,
 		return -ENOMEM;
 	}
 
-	ret = bochs_kick_out_firmware_fb(pdev);
+	ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, 0, "bochsdrmfb");
 	if (ret)
 		return ret;
 
Signature · 6 lines
2.18.0

_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
#103 lore raw

PATCH v3 7/13 drm/cirrus: use simpler remove_conflicting_pci_framebuffers()

In reply to Michał Mirosław
---
 drivers/gpu/drm/cirrus/cirrus_drv.c | 23 +----------------------
 1 file changed, 1 insertion(+), 22 deletions(-)
drivers/gpu/drm/cirrus/cirrus_drv.c +1 -22
index 69c4e352dd78..85ed8657c862 100644
@@ -42,33 +42,12 @@ static const struct pci_device_id pciidlist[] = {
 };
 
 
-static int cirrus_kick_out_firmware_fb(struct pci_dev *pdev)
-{
-	struct apertures_struct *ap;
-	bool primary = false;
-
-	ap = alloc_apertures(1);
-	if (!ap)
-		return -ENOMEM;
-
-	ap->ranges[0].base = pci_resource_start(pdev, 0);
-	ap->ranges[0].size = pci_resource_len(pdev, 0);
-
-#ifdef CONFIG_X86
-	primary = pdev->resource[PCI_ROM_RESOURCE].flags & IORESOURCE_ROM_SHADOW;
-#endif
-	drm_fb_helper_remove_conflicting_framebuffers(ap, "cirrusdrmfb", primary);
-	kfree(ap);
-
-	return 0;
-}
-
 static int cirrus_pci_probe(struct pci_dev *pdev,
 			    const struct pci_device_id *ent)
 {
 	int ret;
 
-	ret = cirrus_kick_out_firmware_fb(pdev);
+	ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, 0, "cirrusdrmfb");
 	if (ret)
 		return ret;
 
Signature · 6 lines
2.18.0

_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
#104 lore raw

PATCH v3 8/13 drm/mgag200: use simpler remove_conflicting_pci_framebuffers()

In reply to Michał Mirosław

Remove duplicated call, while at it.

---
 drivers/gpu/drm/mgag200/mgag200_drv.c  | 21 +--------------------
 drivers/gpu/drm/mgag200/mgag200_main.c |  9 ---------
 2 files changed, 1 insertion(+), 29 deletions(-)
drivers/gpu/drm/mgag200/mgag200_drv.c +1 -20
index 74cdde2ee474..ac6af4bd9df6 100644
@@ -42,29 +42,10 @@ static const struct pci_device_id pciidlist[] = {
 
 MODULE_DEVICE_TABLE(pci, pciidlist);
 
-static void mgag200_kick_out_firmware_fb(struct pci_dev *pdev)
-{
-	struct apertures_struct *ap;
-	bool primary = false;
-
-	ap = alloc_apertures(1);
-	if (!ap)
-		return;
-
-	ap->ranges[0].base = pci_resource_start(pdev, 0);
-	ap->ranges[0].size = pci_resource_len(pdev, 0);
-
-#ifdef CONFIG_X86
-	primary = pdev->resource[PCI_ROM_RESOURCE].flags & IORESOURCE_ROM_SHADOW;
-#endif
-	drm_fb_helper_remove_conflicting_framebuffers(ap, "mgag200drmfb", primary);
-	kfree(ap);
-}
-
 
 static int mga_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 {
-	mgag200_kick_out_firmware_fb(pdev);
+	drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, 0, "mgag200drmfb");
 
 	return drm_get_pci_dev(pdev, ent, &driver);
 }
drivers/gpu/drm/mgag200/mgag200_main.c +0 -9
index 780f983b0294..79d54103d470 100644
@@ -124,20 +124,11 @@ static int mga_probe_vram(struct mga_device *mdev, void __iomem *mem)
 static int mga_vram_init(struct mga_device *mdev)
 {
 	void __iomem *mem;
-	struct apertures_struct *aper = alloc_apertures(1);
-	if (!aper)
-		return -ENOMEM;
 
 	/* BAR 0 is VRAM */
 	mdev->mc.vram_base = pci_resource_start(mdev->dev->pdev, 0);
 	mdev->mc.vram_window = pci_resource_len(mdev->dev->pdev, 0);
 
-	aper->ranges[0].base = mdev->mc.vram_base;
-	aper->ranges[0].size = mdev->mc.vram_window;
-
-	drm_fb_helper_remove_conflicting_framebuffers(aper, "mgafb", true);
-	kfree(aper);
-
 	if (!devm_request_mem_region(mdev->dev->dev, mdev->mc.vram_base, mdev->mc.vram_window,
 				"mgadrmfb_vram")) {
 		DRM_ERROR("can't reserve VRAM\n");
Signature · 7 lines
2.18.0


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#105 lore raw

PATCH v3 8/13 drm/mgag200: use simpler remove_conflicting_pci_framebuffers()

In reply to Michał Mirosław

Remove duplicated call, while at it.

---
 drivers/gpu/drm/mgag200/mgag200_drv.c  | 21 +--------------------
 drivers/gpu/drm/mgag200/mgag200_main.c |  9 ---------
 2 files changed, 1 insertion(+), 29 deletions(-)
drivers/gpu/drm/mgag200/mgag200_drv.c +1 -20
index 74cdde2ee474..ac6af4bd9df6 100644
@@ -42,29 +42,10 @@ static const struct pci_device_id pciidlist[] = {
 
 MODULE_DEVICE_TABLE(pci, pciidlist);
 
-static void mgag200_kick_out_firmware_fb(struct pci_dev *pdev)
-{
-	struct apertures_struct *ap;
-	bool primary = false;
-
-	ap = alloc_apertures(1);
-	if (!ap)
-		return;
-
-	ap->ranges[0].base = pci_resource_start(pdev, 0);
-	ap->ranges[0].size = pci_resource_len(pdev, 0);
-
-#ifdef CONFIG_X86
-	primary = pdev->resource[PCI_ROM_RESOURCE].flags & IORESOURCE_ROM_SHADOW;
-#endif
-	drm_fb_helper_remove_conflicting_framebuffers(ap, "mgag200drmfb", primary);
-	kfree(ap);
-}
-
 
 static int mga_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 {
-	mgag200_kick_out_firmware_fb(pdev);
+	drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, 0, "mgag200drmfb");
 
 	return drm_get_pci_dev(pdev, ent, &driver);
 }
drivers/gpu/drm/mgag200/mgag200_main.c +0 -9
index 780f983b0294..79d54103d470 100644
@@ -124,20 +124,11 @@ static int mga_probe_vram(struct mga_device *mdev, void __iomem *mem)
 static int mga_vram_init(struct mga_device *mdev)
 {
 	void __iomem *mem;
-	struct apertures_struct *aper = alloc_apertures(1);
-	if (!aper)
-		return -ENOMEM;
 
 	/* BAR 0 is VRAM */
 	mdev->mc.vram_base = pci_resource_start(mdev->dev->pdev, 0);
 	mdev->mc.vram_window = pci_resource_len(mdev->dev->pdev, 0);
 
-	aper->ranges[0].base = mdev->mc.vram_base;
-	aper->ranges[0].size = mdev->mc.vram_window;
-
-	drm_fb_helper_remove_conflicting_framebuffers(aper, "mgafb", true);
-	kfree(aper);
-
 	if (!devm_request_mem_region(mdev->dev->dev, mdev->mc.vram_base, mdev->mc.vram_window,
 				"mgadrmfb_vram")) {
 		DRM_ERROR("can't reserve VRAM\n");
Signature · 6 lines
2.18.0

_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
#106 lore raw

PATCH v3 9/13 drm/radeon: use simpler remove_conflicting_pci_framebuffers()

In reply to Michał Mirosław
---
 drivers/gpu/drm/radeon/radeon_drv.c | 23 +----------------------
 1 file changed, 1 insertion(+), 22 deletions(-)
drivers/gpu/drm/radeon/radeon_drv.c +1 -22
index b28288a781ef..36c98a0ec991 100644
@@ -311,27 +311,6 @@ static struct drm_driver kms_driver;
 
 bool radeon_device_is_virtual(void);
 
-static int radeon_kick_out_firmware_fb(struct pci_dev *pdev)
-{
-	struct apertures_struct *ap;
-	bool primary = false;
-
-	ap = alloc_apertures(1);
-	if (!ap)
-		return -ENOMEM;
-
-	ap->ranges[0].base = pci_resource_start(pdev, 0);
-	ap->ranges[0].size = pci_resource_len(pdev, 0);
-
-#ifdef CONFIG_X86
-	primary = pdev->resource[PCI_ROM_RESOURCE].flags & IORESOURCE_ROM_SHADOW;
-#endif
-	drm_fb_helper_remove_conflicting_framebuffers(ap, "radeondrmfb", primary);
-	kfree(ap);
-
-	return 0;
-}
-
 static int radeon_pci_probe(struct pci_dev *pdev,
 			    const struct pci_device_id *ent)
 {
@@ -341,7 +320,7 @@ static int radeon_pci_probe(struct pci_dev *pdev,
 		return -EPROBE_DEFER;
 
 	/* Get rid of things like offb */
-	ret = radeon_kick_out_firmware_fb(pdev);
+	ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, 0, "radeondrmfb");
 	if (ret)
 		return ret;
 
Signature · 7 lines
2.18.0


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#107 lore raw

PATCH v3 9/13 drm/radeon: use simpler remove_conflicting_pci_framebuffers()

In reply to Michał Mirosław
---
 drivers/gpu/drm/radeon/radeon_drv.c | 23 +----------------------
 1 file changed, 1 insertion(+), 22 deletions(-)
drivers/gpu/drm/radeon/radeon_drv.c +1 -22
index b28288a781ef..36c98a0ec991 100644
@@ -311,27 +311,6 @@ static struct drm_driver kms_driver;
 
 bool radeon_device_is_virtual(void);
 
-static int radeon_kick_out_firmware_fb(struct pci_dev *pdev)
-{
-	struct apertures_struct *ap;
-	bool primary = false;
-
-	ap = alloc_apertures(1);
-	if (!ap)
-		return -ENOMEM;
-
-	ap->ranges[0].base = pci_resource_start(pdev, 0);
-	ap->ranges[0].size = pci_resource_len(pdev, 0);
-
-#ifdef CONFIG_X86
-	primary = pdev->resource[PCI_ROM_RESOURCE].flags & IORESOURCE_ROM_SHADOW;
-#endif
-	drm_fb_helper_remove_conflicting_framebuffers(ap, "radeondrmfb", primary);
-	kfree(ap);
-
-	return 0;
-}
-
 static int radeon_pci_probe(struct pci_dev *pdev,
 			    const struct pci_device_id *ent)
 {
@@ -341,7 +320,7 @@ static int radeon_pci_probe(struct pci_dev *pdev,
 		return -EPROBE_DEFER;
 
 	/* Get rid of things like offb */
-	ret = radeon_kick_out_firmware_fb(pdev);
+	ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, 0, "radeondrmfb");
 	if (ret)
 		return ret;
 
Signature · 6 lines
2.18.0

_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
#108 lore raw

PATCH v3 10/13 drm/virtio: use simpler remove_conflicting_pci_framebuffers()

In reply to Michał Mirosław
---
 drivers/gpu/drm/virtio/virtgpu_drm_bus.c | 24 +++---------------------
 1 file changed, 3 insertions(+), 21 deletions(-)
drivers/gpu/drm/virtio/virtgpu_drm_bus.c +3 -21
index 7df8d0c9026a..115ed546ca4e 100644
@@ -28,26 +28,6 @@
 
 #include "virtgpu_drv.h"
 
-static void virtio_pci_kick_out_firmware_fb(struct pci_dev *pci_dev)
-{
-	struct apertures_struct *ap;
-	bool primary;
-
-	ap = alloc_apertures(1);
-	if (!ap)
-		return;
-
-	ap->ranges[0].base = pci_resource_start(pci_dev, 0);
-	ap->ranges[0].size = pci_resource_len(pci_dev, 0);
-
-	primary = pci_dev->resource[PCI_ROM_RESOURCE].flags
-		& IORESOURCE_ROM_SHADOW;
-
-	drm_fb_helper_remove_conflicting_framebuffers(ap, "virtiodrmfb", primary);
-
-	kfree(ap);
-}
-
 int drm_virtio_init(struct drm_driver *driver, struct virtio_device *vdev)
 {
 	struct drm_device *dev;
@@ -69,7 +49,9 @@ int drm_virtio_init(struct drm_driver *driver, struct virtio_device *vdev)
 			 pname);
 		dev->pdev = pdev;
 		if (vga)
-			virtio_pci_kick_out_firmware_fb(pdev);
+			drm_fb_helper_remove_conflicting_pci_framebuffers(pdev,
+									  0,
+									  "virtiodrmfb");
 
 		snprintf(unique, sizeof(unique), "pci:%s", pname);
 		ret = drm_dev_set_unique(dev, unique);
Signature · 7 lines
2.18.0


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#109 lore raw

PATCH v3 10/13 drm/virtio: use simpler remove_conflicting_pci_framebuffers()

In reply to Michał Mirosław
---
 drivers/gpu/drm/virtio/virtgpu_drm_bus.c | 24 +++---------------------
 1 file changed, 3 insertions(+), 21 deletions(-)
drivers/gpu/drm/virtio/virtgpu_drm_bus.c +3 -21
index 7df8d0c9026a..115ed546ca4e 100644
@@ -28,26 +28,6 @@
 
 #include "virtgpu_drv.h"
 
-static void virtio_pci_kick_out_firmware_fb(struct pci_dev *pci_dev)
-{
-	struct apertures_struct *ap;
-	bool primary;
-
-	ap = alloc_apertures(1);
-	if (!ap)
-		return;
-
-	ap->ranges[0].base = pci_resource_start(pci_dev, 0);
-	ap->ranges[0].size = pci_resource_len(pci_dev, 0);
-
-	primary = pci_dev->resource[PCI_ROM_RESOURCE].flags
-		& IORESOURCE_ROM_SHADOW;
-
-	drm_fb_helper_remove_conflicting_framebuffers(ap, "virtiodrmfb", primary);
-
-	kfree(ap);
-}
-
 int drm_virtio_init(struct drm_driver *driver, struct virtio_device *vdev)
 {
 	struct drm_device *dev;
@@ -69,7 +49,9 @@ int drm_virtio_init(struct drm_driver *driver, struct virtio_device *vdev)
 			 pname);
 		dev->pdev = pdev;
 		if (vga)
-			virtio_pci_kick_out_firmware_fb(pdev);
+			drm_fb_helper_remove_conflicting_pci_framebuffers(pdev,
+									  0,
+									  "virtiodrmfb");
 
 		snprintf(unique, sizeof(unique), "pci:%s", pname);
 		ret = drm_dev_set_unique(dev, unique);
Signature · 6 lines
2.18.0

_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
#110 lore raw

PATCH v3 11/13 drm/vc4: use simpler remove_conflicting_framebuffers(NULL)

In reply to Michał Mirosław

Use remove_conflicting_framebuffers(NULL) instead of open-coding it.

---
 drivers/gpu/drm/vc4/vc4_drv.c | 20 +-------------------
 1 file changed, 1 insertion(+), 19 deletions(-)
drivers/gpu/drm/vc4/vc4_drv.c +1 -19
index 94b99c90425a..96bb90325995 100644
@@ -246,24 +246,6 @@ static void vc4_match_add_drivers(struct device *dev,
 	}
 }
 
-static void vc4_kick_out_firmware_fb(void)
-{
-	struct apertures_struct *ap;
-
-	ap = alloc_apertures(1);
-	if (!ap)
-		return;
-
-	/* Since VC4 is a UMA device, the simplefb node may have been
-	 * located anywhere in memory.
-	 */
-	ap->ranges[0].base = 0;
-	ap->ranges[0].size = ~0;
-
-	drm_fb_helper_remove_conflicting_framebuffers(ap, "vc4drmfb", false);
-	kfree(ap);
-}
-
 static int vc4_drm_bind(struct device *dev)
 {
 	struct platform_device *pdev = to_platform_device(dev);
@@ -296,7 +278,7 @@ static int vc4_drm_bind(struct device *dev)
 	if (ret)
 		goto gem_destroy;
 
-	vc4_kick_out_firmware_fb();
+	drm_fb_helper_remove_conflicting_framebuffers(NULL, "vc4drmfb", false);
 
 	ret = drm_dev_register(drm, 0);
 	if (ret < 0)
Signature · 7 lines
2.18.0


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#111 lore raw

PATCH v3 11/13 drm/vc4: use simpler remove_conflicting_framebuffers(NULL)

In reply to Michał Mirosław

Use remove_conflicting_framebuffers(NULL) instead of open-coding it.

---
 drivers/gpu/drm/vc4/vc4_drv.c | 20 +-------------------
 1 file changed, 1 insertion(+), 19 deletions(-)
drivers/gpu/drm/vc4/vc4_drv.c +1 -19
index 94b99c90425a..96bb90325995 100644
@@ -246,24 +246,6 @@ static void vc4_match_add_drivers(struct device *dev,
 	}
 }
 
-static void vc4_kick_out_firmware_fb(void)
-{
-	struct apertures_struct *ap;
-
-	ap = alloc_apertures(1);
-	if (!ap)
-		return;
-
-	/* Since VC4 is a UMA device, the simplefb node may have been
-	 * located anywhere in memory.
-	 */
-	ap->ranges[0].base = 0;
-	ap->ranges[0].size = ~0;
-
-	drm_fb_helper_remove_conflicting_framebuffers(ap, "vc4drmfb", false);
-	kfree(ap);
-}
-
 static int vc4_drm_bind(struct device *dev)
 {
 	struct platform_device *pdev = to_platform_device(dev);
@@ -296,7 +278,7 @@ static int vc4_drm_bind(struct device *dev)
 	if (ret)
 		goto gem_destroy;
 
-	vc4_kick_out_firmware_fb();
+	drm_fb_helper_remove_conflicting_framebuffers(NULL, "vc4drmfb", false);
 
 	ret = drm_dev_register(drm, 0);
 	if (ret < 0)
Signature · 6 lines
2.18.0

_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
#112 lore raw

PATCH v3 12/13 drm/sun4i: use simpler remove_conflicting_framebuffers(NULL)

In reply to Michał Mirosław

Use remove_conflicting_framebuffers(NULL) instead of duplicating it.

---
 drivers/gpu/drm/sun4i/sun4i_drv.c | 18 +-----------------
 1 file changed, 1 insertion(+), 17 deletions(-)
drivers/gpu/drm/sun4i/sun4i_drv.c +1 -17
index 50d19605c38f..555b5db8036f 100644
@@ -60,22 +60,6 @@ static struct drm_driver sun4i_drv_driver = {
 	/* Frame Buffer Operations */
 };
 
-static void sun4i_remove_framebuffers(void)
-{
-	struct apertures_struct *ap;
-
-	ap = alloc_apertures(1);
-	if (!ap)
-		return;
-
-	/* The framebuffer can be located anywhere in RAM */
-	ap->ranges[0].base = 0;
-	ap->ranges[0].size = ~0;
-
-	drm_fb_helper_remove_conflicting_framebuffers(ap, "sun4i-drm-fb", false);
-	kfree(ap);
-}
-
 static int sun4i_drv_bind(struct device *dev)
 {
 	struct drm_device *drm;
@@ -118,7 +102,7 @@ static int sun4i_drv_bind(struct device *dev)
 	drm->irq_enabled = true;
 
 	/* Remove early framebuffers (ie. simplefb) */
-	sun4i_remove_framebuffers();
+	drm_fb_helper_remove_conflicting_framebuffers(NULL, "sun4i-drm-fb", false);
 
 	/* Create our framebuffer */
 	ret = sun4i_framebuffer_init(drm);
Signature · 7 lines
2.18.0


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#113 lore raw

PATCH v3 12/13 drm/sun4i: use simpler remove_conflicting_framebuffers(NULL)

In reply to Michał Mirosław

Use remove_conflicting_framebuffers(NULL) instead of duplicating it.

---
 drivers/gpu/drm/sun4i/sun4i_drv.c | 18 +-----------------
 1 file changed, 1 insertion(+), 17 deletions(-)
drivers/gpu/drm/sun4i/sun4i_drv.c +1 -17
index 50d19605c38f..555b5db8036f 100644
@@ -60,22 +60,6 @@ static struct drm_driver sun4i_drv_driver = {
 	/* Frame Buffer Operations */
 };
 
-static void sun4i_remove_framebuffers(void)
-{
-	struct apertures_struct *ap;
-
-	ap = alloc_apertures(1);
-	if (!ap)
-		return;
-
-	/* The framebuffer can be located anywhere in RAM */
-	ap->ranges[0].base = 0;
-	ap->ranges[0].size = ~0;
-
-	drm_fb_helper_remove_conflicting_framebuffers(ap, "sun4i-drm-fb", false);
-	kfree(ap);
-}
-
 static int sun4i_drv_bind(struct device *dev)
 {
 	struct drm_device *drm;
@@ -118,7 +102,7 @@ static int sun4i_drv_bind(struct device *dev)
 	drm->irq_enabled = true;
 
 	/* Remove early framebuffers (ie. simplefb) */
-	sun4i_remove_framebuffers();
+	drm_fb_helper_remove_conflicting_framebuffers(NULL, "sun4i-drm-fb", false);
 
 	/* Create our framebuffer */
 	ret = sun4i_framebuffer_init(drm);
Signature · 6 lines
2.18.0

_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
#114 lore raw

PATCH v3 13/13 drm/tegra: kick out simplefb

In reply to Michał Mirosław

Kick out firmware fb when loading Tegra driver.

---
 drivers/gpu/drm/tegra/drm.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/gpu/drm/tegra/drm.c +4 -0
index 7afe2f635f74..b51ec138fed2 100644
@@ -1203,6 +1203,10 @@ static int host1x_drm_probe(struct host1x_device *dev)
 
 	dev_set_drvdata(&dev->dev, drm);
 
+	err = drm_fb_helper_remove_conflicting_framebuffers(NULL, "tegradrmfb", false);
+	if (err < 0)
+		goto unref;
+
 	err = drm_dev_register(drm, 0);
 	if (err < 0)
 		goto unref;
Signature · 7 lines
2.18.0


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#115 lore raw

PATCH v3 13/13 drm/tegra: kick out simplefb

In reply to Michał Mirosław

Kick out firmware fb when loading Tegra driver.

---
 drivers/gpu/drm/tegra/drm.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/gpu/drm/tegra/drm.c +4 -0
index 7afe2f635f74..b51ec138fed2 100644
@@ -1203,6 +1203,10 @@ static int host1x_drm_probe(struct host1x_device *dev)
 
 	dev_set_drvdata(&dev->dev, drm);
 
+	err = drm_fb_helper_remove_conflicting_framebuffers(NULL, "tegradrmfb", false);
+	if (err < 0)
+		goto unref;
+
 	err = drm_dev_register(drm, 0);
 	if (err < 0)
 		goto unref;
Signature · 6 lines
2.18.0

_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

A message that is not in the archive (sent off-list or not yet received): cover.1535810304.git.mirq-linux-CoA6ZxLDdyEEUmgCuDUIdw@public.gmane.org

#117 lore raw
Quoted 6 lines · Michał Mirosław

This series cleans up duplicated code for replacing firmware FB driver with proper DRI driver and adds handover support to Tegra driver.

This is a sligtly updated version of a series sent on 24 Nov 2017.

Quoted 8 lines

---
v2:
- rebased on current drm-next
- dropped staging/sm750fb changes
- added kernel docs for DRM helpers
v3:
- move kerneldoc to fbdev, where functions are implemented
- split kerneldoc for remove_conflicting_framebuffers()

Ah, that's not quite what I had in mind. I think having the docs (also) in the drm helpers would be good, since that's where drm people will look, and that's the function they'll call. I just wanted you to split the fbdev and drm parts into 2 patches (since those are two different maintainers).

Anyway, this is ok too, so imo ready for merging. If you can resurrect the drm docs (with a patch title of "drm/fb-helper: document fbdev remove functions" or similar) that would be great.

Only thing we need for merging now is the ack from Bartlomiej. -Daniel

Quoted 40 lines

- propagate return value in remove_conflicting_pci_framebuffers()

---
Michał Mirosław (13):
fbdev: show fbdev number for debugging
fbdev: allow apertures == NULL in remove_conflicting_framebuffers()
fbdev: add kerneldoc do remove_conflicting_framebuffers()
fbdev: add remove_conflicting_pci_framebuffers() drm/amdgpu: use simpler remove_conflicting_pci_framebuffers() drm/bochs: use simpler remove_conflicting_pci_framebuffers() drm/cirrus: use simpler remove_conflicting_pci_framebuffers() drm/mgag200: use simpler remove_conflicting_pci_framebuffers() drm/radeon: use simpler remove_conflicting_pci_framebuffers() drm/virtio: use simpler remove_conflicting_pci_framebuffers() drm/vc4: use simpler remove_conflicting_framebuffers(NULL) drm/sun4i: use simpler remove_conflicting_framebuffers(NULL) drm/tegra: kick out simplefb

 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c  | 24 +--------
 drivers/gpu/drm/bochs/bochs_drv.c        | 18 +------
 drivers/gpu/drm/cirrus/cirrus_drv.c      | 23 +--------
 drivers/gpu/drm/mgag200/mgag200_drv.c    | 21 +-------
 drivers/gpu/drm/mgag200/mgag200_main.c   |  9 ----
 drivers/gpu/drm/radeon/radeon_drv.c      | 23 +--------
 drivers/gpu/drm/sun4i/sun4i_drv.c        | 18 +------
 drivers/gpu/drm/tegra/drm.c              |  4 ++
 drivers/gpu/drm/vc4/vc4_drv.c            | 20 +-------
 drivers/gpu/drm/virtio/virtgpu_drm_bus.c | 24 ++-------
 drivers/video/fbdev/core/fbmem.c         | 63 +++++++++++++++++++++++-
 include/drm/drm_fb_helper.h              | 12 +++++
 include/linux/fb.h                       |  2 +
 13 files changed, 89 insertions(+), 172 deletions(-)
Signature · 6 lines
2.18.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 20180903074315.GB21634-dv86pmgwkMBes7Z6vYuT8azUEOm+Xw19@public.gmane.org

#119 lore raw
Quoted 21 lines · Daniel Vetter
Quoted 6 lines · Michał Mirosław

This series cleans up duplicated code for replacing firmware FB driver with proper DRI driver and adds handover support to Tegra driver.

This is a sligtly updated version of a series sent on 24 Nov 2017.

Quoted 8 lines

---
v2:
- rebased on current drm-next
- dropped staging/sm750fb changes
- added kernel docs for DRM helpers
v3:
- move kerneldoc to fbdev, where functions are implemented
- split kerneldoc for remove_conflicting_framebuffers()

Ah, that's not quite what I had in mind. I think having the docs (also) in the drm helpers would be good, since that's where drm people will look, and that's the function they'll call. I just wanted you to split the fbdev and drm parts into 2 patches (since those are two different maintainers).

Quoted 5 lines

Anyway, this is ok too, so imo ready for merging. If you can resurrect the drm docs (with a patch title of "drm/fb-helper: document fbdev remove functions" or similar) that would be great.

Only thing we need for merging now is the ack from Bartlomiej.

For the whole patchset:

Quoted 34 lines

-Daniel

Quoted 32 lines

- propagate return value in remove_conflicting_pci_framebuffers()

---
Michał Mirosław (13):
fbdev: show fbdev number for debugging
fbdev: allow apertures == NULL in remove_conflicting_framebuffers()
fbdev: add kerneldoc do remove_conflicting_framebuffers()
fbdev: add remove_conflicting_pci_framebuffers() drm/amdgpu: use simpler remove_conflicting_pci_framebuffers() drm/bochs: use simpler remove_conflicting_pci_framebuffers() drm/cirrus: use simpler remove_conflicting_pci_framebuffers() drm/mgag200: use simpler remove_conflicting_pci_framebuffers() drm/radeon: use simpler remove_conflicting_pci_framebuffers() drm/virtio: use simpler remove_conflicting_pci_framebuffers() drm/vc4: use simpler remove_conflicting_framebuffers(NULL) drm/sun4i: use simpler remove_conflicting_framebuffers(NULL) drm/tegra: kick out simplefb

 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c  | 24 +--------
 drivers/gpu/drm/bochs/bochs_drv.c        | 18 +------
 drivers/gpu/drm/cirrus/cirrus_drv.c      | 23 +--------
 drivers/gpu/drm/mgag200/mgag200_drv.c    | 21 +-------
 drivers/gpu/drm/mgag200/mgag200_main.c   |  9 ----
 drivers/gpu/drm/radeon/radeon_drv.c      | 23 +--------
 drivers/gpu/drm/sun4i/sun4i_drv.c        | 18 +------
 drivers/gpu/drm/tegra/drm.c              |  4 ++
 drivers/gpu/drm/vc4/vc4_drv.c            | 20 +-------
 drivers/gpu/drm/virtio/virtgpu_drm_bus.c | 24 ++-------
 drivers/video/fbdev/core/fbmem.c         | 63 +++++++++++++++++++++++-
 include/drm/drm_fb_helper.h              | 12 +++++
 include/linux/fb.h                       |  2 +
 13 files changed, 89 insertions(+), 172 deletions(-)

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics

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

#120 lore raw
Quoted 26 lines · Bartlomiej Zolnierkiewicz
Quoted 25 lines · Daniel Vetter
Quoted 6 lines · Michał Mirosław

This series cleans up duplicated code for replacing firmware FB driver with proper DRI driver and adds handover support to Tegra driver.

This is a sligtly updated version of a series sent on 24 Nov 2017.

Quoted 8 lines

---
v2:
- rebased on current drm-next
- dropped staging/sm750fb changes
- added kernel docs for DRM helpers
v3:
- move kerneldoc to fbdev, where functions are implemented
- split kerneldoc for remove_conflicting_framebuffers()

Ah, that's not quite what I had in mind. I think having the docs (also) in the drm helpers would be good, since that's where drm people will look, and that's the function they'll call. I just wanted you to split the fbdev and drm parts into 2 patches (since those are two different maintainers).

Anyway, this is ok too, so imo ready for merging. If you can resurrect the drm docs (with a patch title of "drm/fb-helper: document fbdev remove functions" or similar) that would be great.

Quoted 5 lines
Quoted 1 line

Only thing we need for merging now is the ack from Bartlomiej.

For the whole patchset:

Thanks, entire patch set applied to drm-misc-next for 4.20. -Daniel

Quoted 42 lines
Quoted 35 lines

-Daniel

Quoted 32 lines

- propagate return value in remove_conflicting_pci_framebuffers()

---
Michał Mirosław (13):
fbdev: show fbdev number for debugging
fbdev: allow apertures == NULL in remove_conflicting_framebuffers()
fbdev: add kerneldoc do remove_conflicting_framebuffers()
fbdev: add remove_conflicting_pci_framebuffers() drm/amdgpu: use simpler remove_conflicting_pci_framebuffers() drm/bochs: use simpler remove_conflicting_pci_framebuffers() drm/cirrus: use simpler remove_conflicting_pci_framebuffers() drm/mgag200: use simpler remove_conflicting_pci_framebuffers() drm/radeon: use simpler remove_conflicting_pci_framebuffers() drm/virtio: use simpler remove_conflicting_pci_framebuffers() drm/vc4: use simpler remove_conflicting_framebuffers(NULL) drm/sun4i: use simpler remove_conflicting_framebuffers(NULL) drm/tegra: kick out simplefb

 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c  | 24 +--------
 drivers/gpu/drm/bochs/bochs_drv.c        | 18 +------
 drivers/gpu/drm/cirrus/cirrus_drv.c      | 23 +--------
 drivers/gpu/drm/mgag200/mgag200_drv.c    | 21 +-------
 drivers/gpu/drm/mgag200/mgag200_main.c   |  9 ----
 drivers/gpu/drm/radeon/radeon_drv.c      | 23 +--------
 drivers/gpu/drm/sun4i/sun4i_drv.c        | 18 +------
 drivers/gpu/drm/tegra/drm.c              |  4 ++
 drivers/gpu/drm/vc4/vc4_drv.c            | 20 +-------
 drivers/gpu/drm/virtio/virtgpu_drm_bus.c | 24 ++-------
 drivers/video/fbdev/core/fbmem.c         | 63 +++++++++++++++++++++++-
 include/drm/drm_fb_helper.h              | 12 +++++
 include/linux/fb.h                       |  2 +
 13 files changed, 89 insertions(+), 172 deletions(-)

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#121 lore raw
In reply to Bartlomiej Zolnierkiewicz
Quoted 26 lines · Bartlomiej Zolnierkiewicz
Quoted 25 lines · Daniel Vetter
Quoted 6 lines · Michał Mirosław

This series cleans up duplicated code for replacing firmware FB driver with proper DRI driver and adds handover support to Tegra driver.

This is a sligtly updated version of a series sent on 24 Nov 2017.

Quoted 8 lines

---
v2:
- rebased on current drm-next
- dropped staging/sm750fb changes
- added kernel docs for DRM helpers
v3:
- move kerneldoc to fbdev, where functions are implemented
- split kerneldoc for remove_conflicting_framebuffers()

Ah, that's not quite what I had in mind. I think having the docs (also) in the drm helpers would be good, since that's where drm people will look, and that's the function they'll call. I just wanted you to split the fbdev and drm parts into 2 patches (since those are two different maintainers).

Anyway, this is ok too, so imo ready for merging. If you can resurrect the drm docs (with a patch title of "drm/fb-helper: document fbdev remove functions" or similar) that would be great.

Quoted 5 lines
Quoted 1 line

Only thing we need for merging now is the ack from Bartlomiej.

For the whole patchset:

Thanks, entire patch set applied to drm-misc-next for 4.20. -Daniel

Quoted 42 lines
Quoted 35 lines

-Daniel

Quoted 32 lines

- propagate return value in remove_conflicting_pci_framebuffers()

---
Michał Mirosław (13):
fbdev: show fbdev number for debugging
fbdev: allow apertures == NULL in remove_conflicting_framebuffers()
fbdev: add kerneldoc do remove_conflicting_framebuffers()
fbdev: add remove_conflicting_pci_framebuffers() drm/amdgpu: use simpler remove_conflicting_pci_framebuffers() drm/bochs: use simpler remove_conflicting_pci_framebuffers() drm/cirrus: use simpler remove_conflicting_pci_framebuffers() drm/mgag200: use simpler remove_conflicting_pci_framebuffers() drm/radeon: use simpler remove_conflicting_pci_framebuffers() drm/virtio: use simpler remove_conflicting_pci_framebuffers() drm/vc4: use simpler remove_conflicting_framebuffers(NULL) drm/sun4i: use simpler remove_conflicting_framebuffers(NULL) drm/tegra: kick out simplefb

 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c  | 24 +--------
 drivers/gpu/drm/bochs/bochs_drv.c        | 18 +------
 drivers/gpu/drm/cirrus/cirrus_drv.c      | 23 +--------
 drivers/gpu/drm/mgag200/mgag200_drv.c    | 21 +-------
 drivers/gpu/drm/mgag200/mgag200_main.c   |  9 ----
 drivers/gpu/drm/radeon/radeon_drv.c      | 23 +--------
 drivers/gpu/drm/sun4i/sun4i_drv.c        | 18 +------
 drivers/gpu/drm/tegra/drm.c              |  4 ++
 drivers/gpu/drm/vc4/vc4_drv.c            | 20 +-------
 drivers/gpu/drm/virtio/virtgpu_drm_bus.c | 24 ++-------
 drivers/video/fbdev/core/fbmem.c         | 63 +++++++++++++++++++++++-
 include/drm/drm_fb_helper.h              | 12 +++++
 include/linux/fb.h                       |  2 +
 13 files changed, 89 insertions(+), 172 deletions(-)

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
#122 lore raw
In reply to Daniel Vetter
Quoted 21 lines · Daniel Vetter
Quoted 6 lines · Michał Mirosław

This series cleans up duplicated code for replacing firmware FB driver with proper DRI driver and adds handover support to Tegra driver.

This is a sligtly updated version of a series sent on 24 Nov 2017.

Quoted 8 lines

---
v2:
- rebased on current drm-next
- dropped staging/sm750fb changes
- added kernel docs for DRM helpers
v3:
- move kerneldoc to fbdev, where functions are implemented
- split kerneldoc for remove_conflicting_framebuffers()

Ah, that's not quite what I had in mind. I think having the docs (also) in the drm helpers would be good, since that's where drm people will look, and that's the function they'll call. I just wanted you to split the fbdev and drm parts into 2 patches (since those are two different maintainers).

Quoted 5 lines

Anyway, this is ok too, so imo ready for merging. If you can resurrect the drm docs (with a patch title of "drm/fb-helper: document fbdev remove functions" or similar) that would be great.

Only thing we need for merging now is the ack from Bartlomiej.

For the whole patchset:

Quoted 34 lines

-Daniel

Quoted 32 lines

- propagate return value in remove_conflicting_pci_framebuffers()

---
Michał Mirosław (13):
fbdev: show fbdev number for debugging
fbdev: allow apertures == NULL in remove_conflicting_framebuffers()
fbdev: add kerneldoc do remove_conflicting_framebuffers()
fbdev: add remove_conflicting_pci_framebuffers() drm/amdgpu: use simpler remove_conflicting_pci_framebuffers() drm/bochs: use simpler remove_conflicting_pci_framebuffers() drm/cirrus: use simpler remove_conflicting_pci_framebuffers() drm/mgag200: use simpler remove_conflicting_pci_framebuffers() drm/radeon: use simpler remove_conflicting_pci_framebuffers() drm/virtio: use simpler remove_conflicting_pci_framebuffers() drm/vc4: use simpler remove_conflicting_framebuffers(NULL) drm/sun4i: use simpler remove_conflicting_framebuffers(NULL) drm/tegra: kick out simplefb

 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c  | 24 +--------
 drivers/gpu/drm/bochs/bochs_drv.c        | 18 +------
 drivers/gpu/drm/cirrus/cirrus_drv.c      | 23 +--------
 drivers/gpu/drm/mgag200/mgag200_drv.c    | 21 +-------
 drivers/gpu/drm/mgag200/mgag200_main.c   |  9 ----
 drivers/gpu/drm/radeon/radeon_drv.c      | 23 +--------
 drivers/gpu/drm/sun4i/sun4i_drv.c        | 18 +------
 drivers/gpu/drm/tegra/drm.c              |  4 ++
 drivers/gpu/drm/vc4/vc4_drv.c            | 20 +-------
 drivers/gpu/drm/virtio/virtgpu_drm_bus.c | 24 ++-------
 drivers/video/fbdev/core/fbmem.c         | 63 +++++++++++++++++++++++-
 include/drm/drm_fb_helper.h              | 12 +++++
 include/linux/fb.h                       |  2 +
 13 files changed, 89 insertions(+), 172 deletions(-)

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics

_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

#123 lore raw
In reply to Michał Mirosław
Quoted 6 lines · Michał Mirosław

This series cleans up duplicated code for replacing firmware FB driver with proper DRI driver and adds handover support to Tegra driver.

This is a sligtly updated version of a series sent on 24 Nov 2017.

Quoted 8 lines

---
v2:
- rebased on current drm-next
- dropped staging/sm750fb changes
- added kernel docs for DRM helpers
v3:
- move kerneldoc to fbdev, where functions are implemented
- split kerneldoc for remove_conflicting_framebuffers()

Ah, that's not quite what I had in mind. I think having the docs (also) in the drm helpers would be good, since that's where drm people will look, and that's the function they'll call. I just wanted you to split the fbdev and drm parts into 2 patches (since those are two different maintainers).

Anyway, this is ok too, so imo ready for merging. If you can resurrect the drm docs (with a patch title of "drm/fb-helper: document fbdev remove functions" or similar) that would be great.

Only thing we need for merging now is the ack from Bartlomiej. -Daniel

Quoted 40 lines

- propagate return value in remove_conflicting_pci_framebuffers()

---
Michał Mirosław (13):
fbdev: show fbdev number for debugging
fbdev: allow apertures == NULL in remove_conflicting_framebuffers()
fbdev: add kerneldoc do remove_conflicting_framebuffers()
fbdev: add remove_conflicting_pci_framebuffers() drm/amdgpu: use simpler remove_conflicting_pci_framebuffers() drm/bochs: use simpler remove_conflicting_pci_framebuffers() drm/cirrus: use simpler remove_conflicting_pci_framebuffers() drm/mgag200: use simpler remove_conflicting_pci_framebuffers() drm/radeon: use simpler remove_conflicting_pci_framebuffers() drm/virtio: use simpler remove_conflicting_pci_framebuffers() drm/vc4: use simpler remove_conflicting_framebuffers(NULL) drm/sun4i: use simpler remove_conflicting_framebuffers(NULL) drm/tegra: kick out simplefb

 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c  | 24 +--------
 drivers/gpu/drm/bochs/bochs_drv.c        | 18 +------
 drivers/gpu/drm/cirrus/cirrus_drv.c      | 23 +--------
 drivers/gpu/drm/mgag200/mgag200_drv.c    | 21 +-------
 drivers/gpu/drm/mgag200/mgag200_main.c   |  9 ----
 drivers/gpu/drm/radeon/radeon_drv.c      | 23 +--------
 drivers/gpu/drm/sun4i/sun4i_drv.c        | 18 +------
 drivers/gpu/drm/tegra/drm.c              |  4 ++
 drivers/gpu/drm/vc4/vc4_drv.c            | 20 +-------
 drivers/gpu/drm/virtio/virtgpu_drm_bus.c | 24 ++-------
 drivers/video/fbdev/core/fbmem.c         | 63 +++++++++++++++++++++++-
 include/drm/drm_fb_helper.h              | 12 +++++
 include/linux/fb.h                       |  2 +
 13 files changed, 89 insertions(+), 172 deletions(-)
Signature · 6 lines
2.18.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
#124 lore raw

v2 cover remove_conflicting_framebuffers() cleanup

In reply to Michał Mirosław

This series cleans up duplicated code for replacing firmware FB driver with proper DRI driver and adds handover support to Tegra driver.

This is a sligtly updated version of a series sent on 24 Nov 2017.

v2:
- rebased on current drm-next
- dropped staging/sm750fb changes
- added kernel docs for DRM helpers

Michał Mirosław (12):
fbdev: show fbdev number for debugging
fbdev: allow apertures == NULL in remove_conflicting_framebuffers()
fbdev: add remove_conflicting_pci_framebuffers() drm/amdgpu: use simpler remove_conflicting_pci_framebuffers() drm/bochs: use simpler remove_conflicting_pci_framebuffers() drm/cirrus: use simpler remove_conflicting_pci_framebuffers() drm/mgag200: use simpler remove_conflicting_pci_framebuffers() drm/radeon: use simpler remove_conflicting_pci_framebuffers() drm/virtio: use simpler remove_conflicting_pci_framebuffers() drm/vc4: use simpler remove_conflicting_framebuffers(NULL) drm/sun4i: use simpler remove_conflicting_framebuffers(NULL) drm/tegra: kick out simplefb

 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c  | 24 +-------------
 drivers/gpu/drm/bochs/bochs_drv.c        | 18 +----------
 drivers/gpu/drm/cirrus/cirrus_drv.c      | 23 +-------------
 drivers/gpu/drm/mgag200/mgag200_drv.c    | 21 +------------
 drivers/gpu/drm/mgag200/mgag200_main.c   |  9 ------
 drivers/gpu/drm/radeon/radeon_drv.c      | 23 +-------------
 drivers/gpu/drm/sun4i/sun4i_drv.c        | 18 +----------
 drivers/gpu/drm/tegra/drm.c              |  4 +++
 drivers/gpu/drm/vc4/vc4_drv.c            | 20 +-----------
 drivers/gpu/drm/virtio/virtgpu_drm_bus.c | 24 ++------------
 drivers/video/fbdev/core/fbmem.c         | 40 ++++++++++++++++++++++--
 include/drm/drm_fb_helper.h              | 34 ++++++++++++++++++++
 include/linux/fb.h                       |  2 ++
 13 files changed, 88 insertions(+), 172 deletions(-)
Signature · 6 lines
2.18.0

_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization