All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] drm, fbdev: complete remove_conflicting_pci_framebuffers cleanup.
@ 2019-08-22  9:06 Gerd Hoffmann
  2019-08-22  9:06   ` Gerd Hoffmann
                   ` (3 more replies)
  0 siblings, 4 replies; 17+ messages in thread
From: Gerd Hoffmann @ 2019-08-22  9:06 UTC (permalink / raw)
  To: dri-devel; +Cc: Gerd Hoffmann



Gerd Hoffmann (3):
  fbdev: drop res_id parameter from remove_conflicting_pci_framebuffers
  drm: drop resource_id parameter from
    drm_fb_helper_remove_conflicting_pci_framebuffers
  drm/i915: switch to drm_fb_helper_remove_conflicting_pci_framebuffers

 include/drm/drm_fb_helper.h             |  6 ++--
 include/linux/fb.h                      |  2 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c |  2 +-
 drivers/gpu/drm/bochs/bochs_drv.c       |  2 +-
 drivers/gpu/drm/cirrus/cirrus.c         |  2 +-
 drivers/gpu/drm/i915/i915_drv.c         | 41 ++-----------------------
 drivers/gpu/drm/mgag200/mgag200_drv.c   |  2 +-
 drivers/gpu/drm/qxl/qxl_drv.c           |  2 +-
 drivers/gpu/drm/radeon/radeon_drv.c     |  2 +-
 drivers/gpu/drm/virtio/virtgpu_drv.c    |  1 -
 drivers/video/fbdev/core/fbmem.c        | 17 +++-------
 11 files changed, 16 insertions(+), 63 deletions(-)

-- 
2.18.1

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

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH 1/3] fbdev: drop res_id parameter from remove_conflicting_pci_framebuffers
  2019-08-22  9:06 [PATCH 0/3] drm, fbdev: complete remove_conflicting_pci_framebuffers cleanup Gerd Hoffmann
  2019-08-22  9:06   ` Gerd Hoffmann
@ 2019-08-22  9:06   ` Gerd Hoffmann
  2019-08-22  9:06   ` Gerd Hoffmann
  2019-08-22  9:06 ` [PATCH 3/3] drm/i915: switch to drm_fb_helper_remove_conflicting_pci_framebuffers Gerd Hoffmann
  3 siblings, 0 replies; 17+ messages in thread
From: Gerd Hoffmann @ 2019-08-22  9:06 UTC (permalink / raw)
  To: dri-devel
  Cc: Gerd Hoffmann, Bartlomiej Zolnierkiewicz, Maarten Lankhorst,
	Maxime Ripard, Sean Paul, David Airlie, Daniel Vetter,
	open list:FRAMEBUFFER LAYER, open list

Since commit b0e999c95581 ("fbdev: list all pci memory bars as
conflicting apertures") the parameter was used for some sanity checks
only, to make sure we detect any issues with the new approach to just
list all memory bars as apertures.

No issues turned up so far, so continue to cleanup:  Drop the res_id
parameter, drop the sanity checks.  Also downgrade the logging from
"info" level to "debug" level and update documentation.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 include/drm/drm_fb_helper.h      |  2 +-
 include/linux/fb.h               |  2 +-
 drivers/video/fbdev/core/fbmem.c | 17 +++++------------
 3 files changed, 7 insertions(+), 14 deletions(-)

diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h
index c8a8ae2a678a..5a5f4b1d8241 100644
--- a/include/drm/drm_fb_helper.h
+++ b/include/drm/drm_fb_helper.h
@@ -560,7 +560,7 @@ drm_fb_helper_remove_conflicting_pci_framebuffers(struct pci_dev *pdev,
 	 * otherwise the vga fbdev driver falls over.
 	 */
 #if IS_REACHABLE(CONFIG_FB)
-	ret = remove_conflicting_pci_framebuffers(pdev, resource_id, name);
+	ret = remove_conflicting_pci_framebuffers(pdev, name);
 #endif
 	if (ret == 0)
 		ret = vga_remove_vgacon(pdev);
diff --git a/include/linux/fb.h b/include/linux/fb.h
index 756706b666a1..41e0069eca0a 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -607,7 +607,7 @@ extern ssize_t fb_sys_write(struct fb_info *info, const char __user *buf,
 extern int register_framebuffer(struct fb_info *fb_info);
 extern void unregister_framebuffer(struct fb_info *fb_info);
 extern void unlink_framebuffer(struct fb_info *fb_info);
-extern int remove_conflicting_pci_framebuffers(struct pci_dev *pdev, int res_id,
+extern int remove_conflicting_pci_framebuffers(struct pci_dev *pdev,
 					       const char *name);
 extern int remove_conflicting_framebuffers(struct apertures_struct *a,
 					   const char *name, bool primary);
diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c
index e6a1c805064f..95c32952fa8a 100644
--- a/drivers/video/fbdev/core/fbmem.c
+++ b/drivers/video/fbdev/core/fbmem.c
@@ -1758,21 +1758,19 @@ EXPORT_SYMBOL(remove_conflicting_framebuffers);
 /**
  * remove_conflicting_pci_framebuffers - remove firmware-configured framebuffers for PCI devices
  * @pdev: PCI device
- * @res_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 @res_id.
+ * using memory range configured for any of @pdev's memory bars.
  *
  * 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)
+int remove_conflicting_pci_framebuffers(struct pci_dev *pdev, const char *name)
 {
 	struct apertures_struct *ap;
 	bool primary = false;
 	int err, idx, bar;
-	bool res_id_found = false;
 
 	for (idx = 0, bar = 0; bar < PCI_ROM_RESOURCE; bar++) {
 		if (!(pci_resource_flags(pdev, bar) & IORESOURCE_MEM))
@@ -1789,16 +1787,11 @@ int remove_conflicting_pci_framebuffers(struct pci_dev *pdev, int res_id, const
 			continue;
 		ap->ranges[idx].base = pci_resource_start(pdev, bar);
 		ap->ranges[idx].size = pci_resource_len(pdev, bar);
-		pci_info(pdev, "%s: bar %d: 0x%lx -> 0x%lx\n", __func__, bar,
-			 (unsigned long)pci_resource_start(pdev, bar),
-			 (unsigned long)pci_resource_end(pdev, bar));
+		pci_dbg(pdev, "%s: bar %d: 0x%lx -> 0x%lx\n", __func__, bar,
+			(unsigned long)pci_resource_start(pdev, bar),
+			(unsigned long)pci_resource_end(pdev, bar));
 		idx++;
-		if (res_id == bar)
-			res_id_found = true;
 	}
-	if (!res_id_found)
-		pci_warn(pdev, "%s: passed res_id (%d) is not a memory bar\n",
-			 __func__, res_id);
 
 #ifdef CONFIG_X86
 	primary = pdev->resource[PCI_ROM_RESOURCE].flags &
-- 
2.18.1


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 1/3] fbdev: drop res_id parameter from remove_conflicting_pci_framebuffers
@ 2019-08-22  9:06   ` Gerd Hoffmann
  0 siblings, 0 replies; 17+ messages in thread
From: Gerd Hoffmann @ 2019-08-22  9:06 UTC (permalink / raw)
  To: dri-devel
  Cc: open list:FRAMEBUFFER LAYER, Bartlomiej Zolnierkiewicz,
	Maxime Ripard, open list, David Airlie, Gerd Hoffmann, Sean Paul

Since commit b0e999c95581 ("fbdev: list all pci memory bars as
conflicting apertures") the parameter was used for some sanity checks
only, to make sure we detect any issues with the new approach to just
list all memory bars as apertures.

No issues turned up so far, so continue to cleanup:  Drop the res_id
parameter, drop the sanity checks.  Also downgrade the logging from
"info" level to "debug" level and update documentation.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 include/drm/drm_fb_helper.h      |  2 +-
 include/linux/fb.h               |  2 +-
 drivers/video/fbdev/core/fbmem.c | 17 +++++------------
 3 files changed, 7 insertions(+), 14 deletions(-)

diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h
index c8a8ae2a678a..5a5f4b1d8241 100644
--- a/include/drm/drm_fb_helper.h
+++ b/include/drm/drm_fb_helper.h
@@ -560,7 +560,7 @@ drm_fb_helper_remove_conflicting_pci_framebuffers(struct pci_dev *pdev,
 	 * otherwise the vga fbdev driver falls over.
 	 */
 #if IS_REACHABLE(CONFIG_FB)
-	ret = remove_conflicting_pci_framebuffers(pdev, resource_id, name);
+	ret = remove_conflicting_pci_framebuffers(pdev, name);
 #endif
 	if (ret = 0)
 		ret = vga_remove_vgacon(pdev);
diff --git a/include/linux/fb.h b/include/linux/fb.h
index 756706b666a1..41e0069eca0a 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -607,7 +607,7 @@ extern ssize_t fb_sys_write(struct fb_info *info, const char __user *buf,
 extern int register_framebuffer(struct fb_info *fb_info);
 extern void unregister_framebuffer(struct fb_info *fb_info);
 extern void unlink_framebuffer(struct fb_info *fb_info);
-extern int remove_conflicting_pci_framebuffers(struct pci_dev *pdev, int res_id,
+extern int remove_conflicting_pci_framebuffers(struct pci_dev *pdev,
 					       const char *name);
 extern int remove_conflicting_framebuffers(struct apertures_struct *a,
 					   const char *name, bool primary);
diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c
index e6a1c805064f..95c32952fa8a 100644
--- a/drivers/video/fbdev/core/fbmem.c
+++ b/drivers/video/fbdev/core/fbmem.c
@@ -1758,21 +1758,19 @@ EXPORT_SYMBOL(remove_conflicting_framebuffers);
 /**
  * remove_conflicting_pci_framebuffers - remove firmware-configured framebuffers for PCI devices
  * @pdev: PCI device
- * @res_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 @res_id.
+ * using memory range configured for any of @pdev's memory bars.
  *
  * 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)
+int remove_conflicting_pci_framebuffers(struct pci_dev *pdev, const char *name)
 {
 	struct apertures_struct *ap;
 	bool primary = false;
 	int err, idx, bar;
-	bool res_id_found = false;
 
 	for (idx = 0, bar = 0; bar < PCI_ROM_RESOURCE; bar++) {
 		if (!(pci_resource_flags(pdev, bar) & IORESOURCE_MEM))
@@ -1789,16 +1787,11 @@ int remove_conflicting_pci_framebuffers(struct pci_dev *pdev, int res_id, const
 			continue;
 		ap->ranges[idx].base = pci_resource_start(pdev, bar);
 		ap->ranges[idx].size = pci_resource_len(pdev, bar);
-		pci_info(pdev, "%s: bar %d: 0x%lx -> 0x%lx\n", __func__, bar,
-			 (unsigned long)pci_resource_start(pdev, bar),
-			 (unsigned long)pci_resource_end(pdev, bar));
+		pci_dbg(pdev, "%s: bar %d: 0x%lx -> 0x%lx\n", __func__, bar,
+			(unsigned long)pci_resource_start(pdev, bar),
+			(unsigned long)pci_resource_end(pdev, bar));
 		idx++;
-		if (res_id = bar)
-			res_id_found = true;
 	}
-	if (!res_id_found)
-		pci_warn(pdev, "%s: passed res_id (%d) is not a memory bar\n",
-			 __func__, res_id);
 
 #ifdef CONFIG_X86
 	primary = pdev->resource[PCI_ROM_RESOURCE].flags &
-- 
2.18.1

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 1/3] fbdev: drop res_id parameter from remove_conflicting_pci_framebuffers
@ 2019-08-22  9:06   ` Gerd Hoffmann
  0 siblings, 0 replies; 17+ messages in thread
From: Gerd Hoffmann @ 2019-08-22  9:06 UTC (permalink / raw)
  To: dri-devel
  Cc: open list:FRAMEBUFFER LAYER, Bartlomiej Zolnierkiewicz,
	Maxime Ripard, open list, David Airlie, Gerd Hoffmann, Sean Paul

Since commit b0e999c95581 ("fbdev: list all pci memory bars as
conflicting apertures") the parameter was used for some sanity checks
only, to make sure we detect any issues with the new approach to just
list all memory bars as apertures.

No issues turned up so far, so continue to cleanup:  Drop the res_id
parameter, drop the sanity checks.  Also downgrade the logging from
"info" level to "debug" level and update documentation.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 include/drm/drm_fb_helper.h      |  2 +-
 include/linux/fb.h               |  2 +-
 drivers/video/fbdev/core/fbmem.c | 17 +++++------------
 3 files changed, 7 insertions(+), 14 deletions(-)

diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h
index c8a8ae2a678a..5a5f4b1d8241 100644
--- a/include/drm/drm_fb_helper.h
+++ b/include/drm/drm_fb_helper.h
@@ -560,7 +560,7 @@ drm_fb_helper_remove_conflicting_pci_framebuffers(struct pci_dev *pdev,
 	 * otherwise the vga fbdev driver falls over.
 	 */
 #if IS_REACHABLE(CONFIG_FB)
-	ret = remove_conflicting_pci_framebuffers(pdev, resource_id, name);
+	ret = remove_conflicting_pci_framebuffers(pdev, name);
 #endif
 	if (ret == 0)
 		ret = vga_remove_vgacon(pdev);
diff --git a/include/linux/fb.h b/include/linux/fb.h
index 756706b666a1..41e0069eca0a 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -607,7 +607,7 @@ extern ssize_t fb_sys_write(struct fb_info *info, const char __user *buf,
 extern int register_framebuffer(struct fb_info *fb_info);
 extern void unregister_framebuffer(struct fb_info *fb_info);
 extern void unlink_framebuffer(struct fb_info *fb_info);
-extern int remove_conflicting_pci_framebuffers(struct pci_dev *pdev, int res_id,
+extern int remove_conflicting_pci_framebuffers(struct pci_dev *pdev,
 					       const char *name);
 extern int remove_conflicting_framebuffers(struct apertures_struct *a,
 					   const char *name, bool primary);
diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c
index e6a1c805064f..95c32952fa8a 100644
--- a/drivers/video/fbdev/core/fbmem.c
+++ b/drivers/video/fbdev/core/fbmem.c
@@ -1758,21 +1758,19 @@ EXPORT_SYMBOL(remove_conflicting_framebuffers);
 /**
  * remove_conflicting_pci_framebuffers - remove firmware-configured framebuffers for PCI devices
  * @pdev: PCI device
- * @res_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 @res_id.
+ * using memory range configured for any of @pdev's memory bars.
  *
  * 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)
+int remove_conflicting_pci_framebuffers(struct pci_dev *pdev, const char *name)
 {
 	struct apertures_struct *ap;
 	bool primary = false;
 	int err, idx, bar;
-	bool res_id_found = false;
 
 	for (idx = 0, bar = 0; bar < PCI_ROM_RESOURCE; bar++) {
 		if (!(pci_resource_flags(pdev, bar) & IORESOURCE_MEM))
@@ -1789,16 +1787,11 @@ int remove_conflicting_pci_framebuffers(struct pci_dev *pdev, int res_id, const
 			continue;
 		ap->ranges[idx].base = pci_resource_start(pdev, bar);
 		ap->ranges[idx].size = pci_resource_len(pdev, bar);
-		pci_info(pdev, "%s: bar %d: 0x%lx -> 0x%lx\n", __func__, bar,
-			 (unsigned long)pci_resource_start(pdev, bar),
-			 (unsigned long)pci_resource_end(pdev, bar));
+		pci_dbg(pdev, "%s: bar %d: 0x%lx -> 0x%lx\n", __func__, bar,
+			(unsigned long)pci_resource_start(pdev, bar),
+			(unsigned long)pci_resource_end(pdev, bar));
 		idx++;
-		if (res_id == bar)
-			res_id_found = true;
 	}
-	if (!res_id_found)
-		pci_warn(pdev, "%s: passed res_id (%d) is not a memory bar\n",
-			 __func__, res_id);
 
 #ifdef CONFIG_X86
 	primary = pdev->resource[PCI_ROM_RESOURCE].flags &
-- 
2.18.1

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

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 2/3] drm: drop resource_id parameter from drm_fb_helper_remove_conflicting_pci_framebuffers
  2019-08-22  9:06 [PATCH 0/3] drm, fbdev: complete remove_conflicting_pci_framebuffers cleanup Gerd Hoffmann
@ 2019-08-22  9:06   ` Gerd Hoffmann
  2019-08-22  9:06 ` [PATCH 2/3] drm: drop resource_id parameter from drm_fb_helper_remove_conflicting_pci_framebuffers Gerd Hoffmann
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 17+ messages in thread
From: Gerd Hoffmann @ 2019-08-22  9:06 UTC (permalink / raw)
  To: dri-devel
  Cc: Gerd Hoffmann, Alex Deucher, Christian König,
	David (ChunMing) Zhou, David Airlie, Daniel Vetter, Dave Airlie,
	Maarten Lankhorst, Maxime Ripard, Sean Paul,
	open list:RADEON and AMDGPU DRM DRIVERS, open list,
	open list:DRM DRIVER FOR BOCHS VIRTUAL GPU,
	open list:DRM DRIVER FOR QXL VIRTUAL GPU

Not needed any more for remove_conflicting_pci_framebuffers calls.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 include/drm/drm_fb_helper.h             | 4 +---
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 2 +-
 drivers/gpu/drm/bochs/bochs_drv.c       | 2 +-
 drivers/gpu/drm/cirrus/cirrus.c         | 2 +-
 drivers/gpu/drm/mgag200/mgag200_drv.c   | 2 +-
 drivers/gpu/drm/qxl/qxl_drv.c           | 2 +-
 drivers/gpu/drm/radeon/radeon_drv.c     | 2 +-
 drivers/gpu/drm/virtio/virtgpu_drv.c    | 1 -
 8 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h
index 5a5f4b1d8241..8dcc012ccbc8 100644
--- a/include/drm/drm_fb_helper.h
+++ b/include/drm/drm_fb_helper.h
@@ -539,18 +539,16 @@ drm_fb_helper_remove_conflicting_framebuffers(struct apertures_struct *a,
 /**
  * drm_fb_helper_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.
+ * using memory range configured for any of @pdev's memory bars.
  *
  * The function assumes that PCI device with shadowed ROM 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)
 {
 	int ret = 0;
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
index 98df55534a6d..6b96a5738e57 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
@@ -1031,7 +1031,7 @@ static int amdgpu_pci_probe(struct pci_dev *pdev,
 	}
 
 	/* Get rid of things like offb */
-	ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, 0, "amdgpudrmfb");
+	ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, "amdgpudrmfb");
 	if (ret)
 		return ret;
 
diff --git a/drivers/gpu/drm/bochs/bochs_drv.c b/drivers/gpu/drm/bochs/bochs_drv.c
index 770e1625d05e..3b9b0d9bbc14 100644
--- a/drivers/gpu/drm/bochs/bochs_drv.c
+++ b/drivers/gpu/drm/bochs/bochs_drv.c
@@ -114,7 +114,7 @@ static int bochs_pci_probe(struct pci_dev *pdev,
 		return -ENOMEM;
 	}
 
-	ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, 0, "bochsdrmfb");
+	ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, "bochsdrmfb");
 	if (ret)
 		return ret;
 
diff --git a/drivers/gpu/drm/cirrus/cirrus.c b/drivers/gpu/drm/cirrus/cirrus.c
index 36a69aec8a4b..89d9e6fdeb8c 100644
--- a/drivers/gpu/drm/cirrus/cirrus.c
+++ b/drivers/gpu/drm/cirrus/cirrus.c
@@ -532,7 +532,7 @@ static int cirrus_pci_probe(struct pci_dev *pdev,
 	struct cirrus_device *cirrus;
 	int ret;
 
-	ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, 0, "cirrusdrmfb");
+	ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, "cirrusdrmfb");
 	if (ret)
 		return ret;
 
diff --git a/drivers/gpu/drm/mgag200/mgag200_drv.c b/drivers/gpu/drm/mgag200/mgag200_drv.c
index afd9119b6cf1..4f9df3b93598 100644
--- a/drivers/gpu/drm/mgag200/mgag200_drv.c
+++ b/drivers/gpu/drm/mgag200/mgag200_drv.c
@@ -46,7 +46,7 @@ MODULE_DEVICE_TABLE(pci, pciidlist);
 
 static int mga_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 {
-	drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, 0, "mgag200drmfb");
+	drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, "mgag200drmfb");
 
 	return drm_get_pci_dev(pdev, ent, &driver);
 }
diff --git a/drivers/gpu/drm/qxl/qxl_drv.c b/drivers/gpu/drm/qxl/qxl_drv.c
index c1802e01d9f6..2b726a51a302 100644
--- a/drivers/gpu/drm/qxl/qxl_drv.c
+++ b/drivers/gpu/drm/qxl/qxl_drv.c
@@ -83,7 +83,7 @@ qxl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	if (ret)
 		goto free_dev;
 
-	ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, 0, "qxl");
+	ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, "qxl");
 	if (ret)
 		goto disable_pci;
 
diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c
index a4a78dfdef37..624aa580d418 100644
--- a/drivers/gpu/drm/radeon/radeon_drv.c
+++ b/drivers/gpu/drm/radeon/radeon_drv.c
@@ -329,7 +329,7 @@ static int radeon_pci_probe(struct pci_dev *pdev,
 		return -EPROBE_DEFER;
 
 	/* Get rid of things like offb */
-	ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, 0, "radeondrmfb");
+	ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, "radeondrmfb");
 	if (ret)
 		return ret;
 
diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.c b/drivers/gpu/drm/virtio/virtgpu_drv.c
index 0fc32fa0b3c0..3d24181636e1 100644
--- a/drivers/gpu/drm/virtio/virtgpu_drv.c
+++ b/drivers/gpu/drm/virtio/virtgpu_drv.c
@@ -56,7 +56,6 @@ static int virtio_gpu_pci_quirk(struct drm_device *dev, struct virtio_device *vd
 	dev->pdev = pdev;
 	if (vga)
 		drm_fb_helper_remove_conflicting_pci_framebuffers(pdev,
-								  0,
 								  "virtiodrmfb");
 
 	/*
-- 
2.18.1


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 2/3] drm: drop resource_id parameter from drm_fb_helper_remove_conflicting_pci_framebuffers
  2019-08-22  9:06 [PATCH 0/3] drm, fbdev: complete remove_conflicting_pci_framebuffers cleanup Gerd Hoffmann
  2019-08-22  9:06   ` Gerd Hoffmann
@ 2019-08-22  9:06 ` Gerd Hoffmann
  2019-08-22  9:06   ` Gerd Hoffmann
  2019-08-22  9:06 ` [PATCH 3/3] drm/i915: switch to drm_fb_helper_remove_conflicting_pci_framebuffers Gerd Hoffmann
  3 siblings, 0 replies; 17+ messages in thread
From: Gerd Hoffmann @ 2019-08-22  9:06 UTC (permalink / raw)
  To: dri-devel
  Cc: David (ChunMing) Zhou, David Airlie, Maarten Lankhorst,
	open list, open list:RADEON and AMDGPU DRM DRIVERS,
	open list:DRM DRIVER FOR BOCHS VIRTUAL GPU, Maxime Ripard,
	Daniel Vetter, open list:DRM DRIVER FOR QXL VIRTUAL GPU,
	Alex Deucher, Dave Airlie, Sean Paul, Christian König

Not needed any more for remove_conflicting_pci_framebuffers calls.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 include/drm/drm_fb_helper.h             | 4 +---
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 2 +-
 drivers/gpu/drm/bochs/bochs_drv.c       | 2 +-
 drivers/gpu/drm/cirrus/cirrus.c         | 2 +-
 drivers/gpu/drm/mgag200/mgag200_drv.c   | 2 +-
 drivers/gpu/drm/qxl/qxl_drv.c           | 2 +-
 drivers/gpu/drm/radeon/radeon_drv.c     | 2 +-
 drivers/gpu/drm/virtio/virtgpu_drv.c    | 1 -
 8 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h
index 5a5f4b1d8241..8dcc012ccbc8 100644
--- a/include/drm/drm_fb_helper.h
+++ b/include/drm/drm_fb_helper.h
@@ -539,18 +539,16 @@ drm_fb_helper_remove_conflicting_framebuffers(struct apertures_struct *a,
 /**
  * drm_fb_helper_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.
+ * using memory range configured for any of @pdev's memory bars.
  *
  * The function assumes that PCI device with shadowed ROM 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)
 {
 	int ret = 0;
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
index 98df55534a6d..6b96a5738e57 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
@@ -1031,7 +1031,7 @@ static int amdgpu_pci_probe(struct pci_dev *pdev,
 	}
 
 	/* Get rid of things like offb */
-	ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, 0, "amdgpudrmfb");
+	ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, "amdgpudrmfb");
 	if (ret)
 		return ret;
 
diff --git a/drivers/gpu/drm/bochs/bochs_drv.c b/drivers/gpu/drm/bochs/bochs_drv.c
index 770e1625d05e..3b9b0d9bbc14 100644
--- a/drivers/gpu/drm/bochs/bochs_drv.c
+++ b/drivers/gpu/drm/bochs/bochs_drv.c
@@ -114,7 +114,7 @@ static int bochs_pci_probe(struct pci_dev *pdev,
 		return -ENOMEM;
 	}
 
-	ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, 0, "bochsdrmfb");
+	ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, "bochsdrmfb");
 	if (ret)
 		return ret;
 
diff --git a/drivers/gpu/drm/cirrus/cirrus.c b/drivers/gpu/drm/cirrus/cirrus.c
index 36a69aec8a4b..89d9e6fdeb8c 100644
--- a/drivers/gpu/drm/cirrus/cirrus.c
+++ b/drivers/gpu/drm/cirrus/cirrus.c
@@ -532,7 +532,7 @@ static int cirrus_pci_probe(struct pci_dev *pdev,
 	struct cirrus_device *cirrus;
 	int ret;
 
-	ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, 0, "cirrusdrmfb");
+	ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, "cirrusdrmfb");
 	if (ret)
 		return ret;
 
diff --git a/drivers/gpu/drm/mgag200/mgag200_drv.c b/drivers/gpu/drm/mgag200/mgag200_drv.c
index afd9119b6cf1..4f9df3b93598 100644
--- a/drivers/gpu/drm/mgag200/mgag200_drv.c
+++ b/drivers/gpu/drm/mgag200/mgag200_drv.c
@@ -46,7 +46,7 @@ MODULE_DEVICE_TABLE(pci, pciidlist);
 
 static int mga_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 {
-	drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, 0, "mgag200drmfb");
+	drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, "mgag200drmfb");
 
 	return drm_get_pci_dev(pdev, ent, &driver);
 }
diff --git a/drivers/gpu/drm/qxl/qxl_drv.c b/drivers/gpu/drm/qxl/qxl_drv.c
index c1802e01d9f6..2b726a51a302 100644
--- a/drivers/gpu/drm/qxl/qxl_drv.c
+++ b/drivers/gpu/drm/qxl/qxl_drv.c
@@ -83,7 +83,7 @@ qxl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	if (ret)
 		goto free_dev;
 
-	ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, 0, "qxl");
+	ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, "qxl");
 	if (ret)
 		goto disable_pci;
 
diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c
index a4a78dfdef37..624aa580d418 100644
--- a/drivers/gpu/drm/radeon/radeon_drv.c
+++ b/drivers/gpu/drm/radeon/radeon_drv.c
@@ -329,7 +329,7 @@ static int radeon_pci_probe(struct pci_dev *pdev,
 		return -EPROBE_DEFER;
 
 	/* Get rid of things like offb */
-	ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, 0, "radeondrmfb");
+	ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, "radeondrmfb");
 	if (ret)
 		return ret;
 
diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.c b/drivers/gpu/drm/virtio/virtgpu_drv.c
index 0fc32fa0b3c0..3d24181636e1 100644
--- a/drivers/gpu/drm/virtio/virtgpu_drv.c
+++ b/drivers/gpu/drm/virtio/virtgpu_drv.c
@@ -56,7 +56,6 @@ static int virtio_gpu_pci_quirk(struct drm_device *dev, struct virtio_device *vd
 	dev->pdev = pdev;
 	if (vga)
 		drm_fb_helper_remove_conflicting_pci_framebuffers(pdev,
-								  0,
 								  "virtiodrmfb");
 
 	/*
-- 
2.18.1

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 2/3] drm: drop resource_id parameter from drm_fb_helper_remove_conflicting_pci_framebuffers
@ 2019-08-22  9:06   ` Gerd Hoffmann
  0 siblings, 0 replies; 17+ messages in thread
From: Gerd Hoffmann @ 2019-08-22  9:06 UTC (permalink / raw)
  To: dri-devel
  Cc: Gerd Hoffmann, Alex Deucher, Christian König,
	David (ChunMing) Zhou, David Airlie, Daniel Vetter, Dave Airlie,
	Maarten Lankhorst, Maxime Ripard, Sean Paul,
	open list:RADEON and AMDGPU DRM DRIVERS, open list,
	open list:DRM DRIVER FOR BOCHS VIRTUAL GPU,
	open list:DRM DRIVER FOR QXL VIRTUAL GPU

Not needed any more for remove_conflicting_pci_framebuffers calls.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 include/drm/drm_fb_helper.h             | 4 +---
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 2 +-
 drivers/gpu/drm/bochs/bochs_drv.c       | 2 +-
 drivers/gpu/drm/cirrus/cirrus.c         | 2 +-
 drivers/gpu/drm/mgag200/mgag200_drv.c   | 2 +-
 drivers/gpu/drm/qxl/qxl_drv.c           | 2 +-
 drivers/gpu/drm/radeon/radeon_drv.c     | 2 +-
 drivers/gpu/drm/virtio/virtgpu_drv.c    | 1 -
 8 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h
index 5a5f4b1d8241..8dcc012ccbc8 100644
--- a/include/drm/drm_fb_helper.h
+++ b/include/drm/drm_fb_helper.h
@@ -539,18 +539,16 @@ drm_fb_helper_remove_conflicting_framebuffers(struct apertures_struct *a,
 /**
  * drm_fb_helper_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.
+ * using memory range configured for any of @pdev's memory bars.
  *
  * The function assumes that PCI device with shadowed ROM 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)
 {
 	int ret = 0;
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
index 98df55534a6d..6b96a5738e57 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
@@ -1031,7 +1031,7 @@ static int amdgpu_pci_probe(struct pci_dev *pdev,
 	}
 
 	/* Get rid of things like offb */
-	ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, 0, "amdgpudrmfb");
+	ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, "amdgpudrmfb");
 	if (ret)
 		return ret;
 
diff --git a/drivers/gpu/drm/bochs/bochs_drv.c b/drivers/gpu/drm/bochs/bochs_drv.c
index 770e1625d05e..3b9b0d9bbc14 100644
--- a/drivers/gpu/drm/bochs/bochs_drv.c
+++ b/drivers/gpu/drm/bochs/bochs_drv.c
@@ -114,7 +114,7 @@ static int bochs_pci_probe(struct pci_dev *pdev,
 		return -ENOMEM;
 	}
 
-	ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, 0, "bochsdrmfb");
+	ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, "bochsdrmfb");
 	if (ret)
 		return ret;
 
diff --git a/drivers/gpu/drm/cirrus/cirrus.c b/drivers/gpu/drm/cirrus/cirrus.c
index 36a69aec8a4b..89d9e6fdeb8c 100644
--- a/drivers/gpu/drm/cirrus/cirrus.c
+++ b/drivers/gpu/drm/cirrus/cirrus.c
@@ -532,7 +532,7 @@ static int cirrus_pci_probe(struct pci_dev *pdev,
 	struct cirrus_device *cirrus;
 	int ret;
 
-	ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, 0, "cirrusdrmfb");
+	ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, "cirrusdrmfb");
 	if (ret)
 		return ret;
 
diff --git a/drivers/gpu/drm/mgag200/mgag200_drv.c b/drivers/gpu/drm/mgag200/mgag200_drv.c
index afd9119b6cf1..4f9df3b93598 100644
--- a/drivers/gpu/drm/mgag200/mgag200_drv.c
+++ b/drivers/gpu/drm/mgag200/mgag200_drv.c
@@ -46,7 +46,7 @@ MODULE_DEVICE_TABLE(pci, pciidlist);
 
 static int mga_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 {
-	drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, 0, "mgag200drmfb");
+	drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, "mgag200drmfb");
 
 	return drm_get_pci_dev(pdev, ent, &driver);
 }
diff --git a/drivers/gpu/drm/qxl/qxl_drv.c b/drivers/gpu/drm/qxl/qxl_drv.c
index c1802e01d9f6..2b726a51a302 100644
--- a/drivers/gpu/drm/qxl/qxl_drv.c
+++ b/drivers/gpu/drm/qxl/qxl_drv.c
@@ -83,7 +83,7 @@ qxl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	if (ret)
 		goto free_dev;
 
-	ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, 0, "qxl");
+	ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, "qxl");
 	if (ret)
 		goto disable_pci;
 
diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c
index a4a78dfdef37..624aa580d418 100644
--- a/drivers/gpu/drm/radeon/radeon_drv.c
+++ b/drivers/gpu/drm/radeon/radeon_drv.c
@@ -329,7 +329,7 @@ static int radeon_pci_probe(struct pci_dev *pdev,
 		return -EPROBE_DEFER;
 
 	/* Get rid of things like offb */
-	ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, 0, "radeondrmfb");
+	ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, "radeondrmfb");
 	if (ret)
 		return ret;
 
diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.c b/drivers/gpu/drm/virtio/virtgpu_drv.c
index 0fc32fa0b3c0..3d24181636e1 100644
--- a/drivers/gpu/drm/virtio/virtgpu_drv.c
+++ b/drivers/gpu/drm/virtio/virtgpu_drv.c
@@ -56,7 +56,6 @@ static int virtio_gpu_pci_quirk(struct drm_device *dev, struct virtio_device *vd
 	dev->pdev = pdev;
 	if (vga)
 		drm_fb_helper_remove_conflicting_pci_framebuffers(pdev,
-								  0,
 								  "virtiodrmfb");
 
 	/*
-- 
2.18.1

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 3/3] drm/i915: switch to drm_fb_helper_remove_conflicting_pci_framebuffers
  2019-08-22  9:06 [PATCH 0/3] drm, fbdev: complete remove_conflicting_pci_framebuffers cleanup Gerd Hoffmann
                   ` (2 preceding siblings ...)
  2019-08-22  9:06   ` Gerd Hoffmann
@ 2019-08-22  9:06 ` Gerd Hoffmann
  2019-08-22 13:13   ` Daniel Vetter
  3 siblings, 1 reply; 17+ messages in thread
From: Gerd Hoffmann @ 2019-08-22  9:06 UTC (permalink / raw)
  To: dri-devel
  Cc: David Airlie, open list:INTEL DRM DRIVERS excluding Poulsbo,
	Moorestow...,
	linux-kernel@vger.kernel.org open list, Gerd Hoffmann

No need for a home-grown version, the generic helper should work just
fine.  It also handles vgacon removal these days, see commit
1c74ca7a1a9a ("drm/fb-helper: call vga_remove_vgacon automatically."),
so that can be removed too.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 drivers/gpu/drm/i915/i915_drv.c | 41 ++-------------------------------
 1 file changed, 2 insertions(+), 39 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index b99d73c1c4db..ddc317ceb8de 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -766,31 +766,6 @@ static int i915_load_modeset_init(struct drm_device *dev)
 	return ret;
 }
 
-static int i915_kick_out_firmware_fb(struct drm_i915_private *dev_priv)
-{
-	struct apertures_struct *ap;
-	struct pci_dev *pdev = dev_priv->drm.pdev;
-	struct i915_ggtt *ggtt = &dev_priv->ggtt;
-	bool primary;
-	int ret;
-
-	ap = alloc_apertures(1);
-	if (!ap)
-		return -ENOMEM;
-
-	ap->ranges[0].base = ggtt->gmadr.start;
-	ap->ranges[0].size = ggtt->mappable_end;
-
-	primary =
-		pdev->resource[PCI_ROM_RESOURCE].flags & IORESOURCE_ROM_SHADOW;
-
-	ret = drm_fb_helper_remove_conflicting_framebuffers(ap, "inteldrmfb", primary);
-
-	kfree(ap);
-
-	return ret;
-}
-
 static void intel_init_dpio(struct drm_i915_private *dev_priv)
 {
 	/*
@@ -1570,21 +1545,9 @@ static int i915_driver_init_hw(struct drm_i915_private *dev_priv)
 	if (ret)
 		goto err_perf;
 
-	/*
-	 * WARNING: Apparently we must kick fbdev drivers before vgacon,
-	 * otherwise the vga fbdev driver falls over.
-	 */
-	ret = i915_kick_out_firmware_fb(dev_priv);
-	if (ret) {
-		DRM_ERROR("failed to remove conflicting framebuffer drivers\n");
+	ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, "inteldrmfb");
+	if (ret)
 		goto err_ggtt;
-	}
-
-	ret = vga_remove_vgacon(pdev);
-	if (ret) {
-		DRM_ERROR("failed to remove conflicting VGA console\n");
-		goto err_ggtt;
-	}
 
 	ret = i915_ggtt_init_hw(dev_priv);
 	if (ret)
-- 
2.18.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* Re: [PATCH 1/3] fbdev: drop res_id parameter from remove_conflicting_pci_framebuffers
  2019-08-22  9:06   ` Gerd Hoffmann
@ 2019-08-22 13:08     ` Daniel Vetter
  -1 siblings, 0 replies; 17+ messages in thread
From: Daniel Vetter @ 2019-08-22 13:08 UTC (permalink / raw)
  To: Gerd Hoffmann
  Cc: dri-devel, Bartlomiej Zolnierkiewicz, Maarten Lankhorst,
	Maxime Ripard, Sean Paul, David Airlie, Daniel Vetter,
	open list:FRAMEBUFFER LAYER, open list

On Thu, Aug 22, 2019 at 11:06:43AM +0200, Gerd Hoffmann wrote:
> Since commit b0e999c95581 ("fbdev: list all pci memory bars as
> conflicting apertures") the parameter was used for some sanity checks
> only, to make sure we detect any issues with the new approach to just
> list all memory bars as apertures.
> 
> No issues turned up so far, so continue to cleanup:  Drop the res_id
> parameter, drop the sanity checks.  Also downgrade the logging from
> "info" level to "debug" level and update documentation.
> 
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

> ---
>  include/drm/drm_fb_helper.h      |  2 +-
>  include/linux/fb.h               |  2 +-
>  drivers/video/fbdev/core/fbmem.c | 17 +++++------------
>  3 files changed, 7 insertions(+), 14 deletions(-)
> 
> diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h
> index c8a8ae2a678a..5a5f4b1d8241 100644
> --- a/include/drm/drm_fb_helper.h
> +++ b/include/drm/drm_fb_helper.h
> @@ -560,7 +560,7 @@ drm_fb_helper_remove_conflicting_pci_framebuffers(struct pci_dev *pdev,
>  	 * otherwise the vga fbdev driver falls over.
>  	 */
>  #if IS_REACHABLE(CONFIG_FB)
> -	ret = remove_conflicting_pci_framebuffers(pdev, resource_id, name);
> +	ret = remove_conflicting_pci_framebuffers(pdev, name);
>  #endif
>  	if (ret == 0)
>  		ret = vga_remove_vgacon(pdev);
> diff --git a/include/linux/fb.h b/include/linux/fb.h
> index 756706b666a1..41e0069eca0a 100644
> --- a/include/linux/fb.h
> +++ b/include/linux/fb.h
> @@ -607,7 +607,7 @@ extern ssize_t fb_sys_write(struct fb_info *info, const char __user *buf,
>  extern int register_framebuffer(struct fb_info *fb_info);
>  extern void unregister_framebuffer(struct fb_info *fb_info);
>  extern void unlink_framebuffer(struct fb_info *fb_info);
> -extern int remove_conflicting_pci_framebuffers(struct pci_dev *pdev, int res_id,
> +extern int remove_conflicting_pci_framebuffers(struct pci_dev *pdev,
>  					       const char *name);
>  extern int remove_conflicting_framebuffers(struct apertures_struct *a,
>  					   const char *name, bool primary);
> diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c
> index e6a1c805064f..95c32952fa8a 100644
> --- a/drivers/video/fbdev/core/fbmem.c
> +++ b/drivers/video/fbdev/core/fbmem.c
> @@ -1758,21 +1758,19 @@ EXPORT_SYMBOL(remove_conflicting_framebuffers);
>  /**
>   * remove_conflicting_pci_framebuffers - remove firmware-configured framebuffers for PCI devices
>   * @pdev: PCI device
> - * @res_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 @res_id.
> + * using memory range configured for any of @pdev's memory bars.
>   *
>   * 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)
> +int remove_conflicting_pci_framebuffers(struct pci_dev *pdev, const char *name)
>  {
>  	struct apertures_struct *ap;
>  	bool primary = false;
>  	int err, idx, bar;
> -	bool res_id_found = false;
>  
>  	for (idx = 0, bar = 0; bar < PCI_ROM_RESOURCE; bar++) {
>  		if (!(pci_resource_flags(pdev, bar) & IORESOURCE_MEM))
> @@ -1789,16 +1787,11 @@ int remove_conflicting_pci_framebuffers(struct pci_dev *pdev, int res_id, const
>  			continue;
>  		ap->ranges[idx].base = pci_resource_start(pdev, bar);
>  		ap->ranges[idx].size = pci_resource_len(pdev, bar);
> -		pci_info(pdev, "%s: bar %d: 0x%lx -> 0x%lx\n", __func__, bar,
> -			 (unsigned long)pci_resource_start(pdev, bar),
> -			 (unsigned long)pci_resource_end(pdev, bar));
> +		pci_dbg(pdev, "%s: bar %d: 0x%lx -> 0x%lx\n", __func__, bar,
> +			(unsigned long)pci_resource_start(pdev, bar),
> +			(unsigned long)pci_resource_end(pdev, bar));
>  		idx++;
> -		if (res_id == bar)
> -			res_id_found = true;
>  	}
> -	if (!res_id_found)
> -		pci_warn(pdev, "%s: passed res_id (%d) is not a memory bar\n",
> -			 __func__, res_id);
>  
>  #ifdef CONFIG_X86
>  	primary = pdev->resource[PCI_ROM_RESOURCE].flags &
> -- 
> 2.18.1
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 1/3] fbdev: drop res_id parameter from remove_conflicting_pci_framebuffers
@ 2019-08-22 13:08     ` Daniel Vetter
  0 siblings, 0 replies; 17+ messages in thread
From: Daniel Vetter @ 2019-08-22 13:08 UTC (permalink / raw)
  To: Gerd Hoffmann
  Cc: dri-devel, Bartlomiej Zolnierkiewicz, Maarten Lankhorst,
	Maxime Ripard, Sean Paul, David Airlie, Daniel Vetter,
	open list:FRAMEBUFFER LAYER, open list

On Thu, Aug 22, 2019 at 11:06:43AM +0200, Gerd Hoffmann wrote:
> Since commit b0e999c95581 ("fbdev: list all pci memory bars as
> conflicting apertures") the parameter was used for some sanity checks
> only, to make sure we detect any issues with the new approach to just
> list all memory bars as apertures.
> 
> No issues turned up so far, so continue to cleanup:  Drop the res_id
> parameter, drop the sanity checks.  Also downgrade the logging from
> "info" level to "debug" level and update documentation.
> 
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

> ---
>  include/drm/drm_fb_helper.h      |  2 +-
>  include/linux/fb.h               |  2 +-
>  drivers/video/fbdev/core/fbmem.c | 17 +++++------------
>  3 files changed, 7 insertions(+), 14 deletions(-)
> 
> diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h
> index c8a8ae2a678a..5a5f4b1d8241 100644
> --- a/include/drm/drm_fb_helper.h
> +++ b/include/drm/drm_fb_helper.h
> @@ -560,7 +560,7 @@ drm_fb_helper_remove_conflicting_pci_framebuffers(struct pci_dev *pdev,
>  	 * otherwise the vga fbdev driver falls over.
>  	 */
>  #if IS_REACHABLE(CONFIG_FB)
> -	ret = remove_conflicting_pci_framebuffers(pdev, resource_id, name);
> +	ret = remove_conflicting_pci_framebuffers(pdev, name);
>  #endif
>  	if (ret = 0)
>  		ret = vga_remove_vgacon(pdev);
> diff --git a/include/linux/fb.h b/include/linux/fb.h
> index 756706b666a1..41e0069eca0a 100644
> --- a/include/linux/fb.h
> +++ b/include/linux/fb.h
> @@ -607,7 +607,7 @@ extern ssize_t fb_sys_write(struct fb_info *info, const char __user *buf,
>  extern int register_framebuffer(struct fb_info *fb_info);
>  extern void unregister_framebuffer(struct fb_info *fb_info);
>  extern void unlink_framebuffer(struct fb_info *fb_info);
> -extern int remove_conflicting_pci_framebuffers(struct pci_dev *pdev, int res_id,
> +extern int remove_conflicting_pci_framebuffers(struct pci_dev *pdev,
>  					       const char *name);
>  extern int remove_conflicting_framebuffers(struct apertures_struct *a,
>  					   const char *name, bool primary);
> diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c
> index e6a1c805064f..95c32952fa8a 100644
> --- a/drivers/video/fbdev/core/fbmem.c
> +++ b/drivers/video/fbdev/core/fbmem.c
> @@ -1758,21 +1758,19 @@ EXPORT_SYMBOL(remove_conflicting_framebuffers);
>  /**
>   * remove_conflicting_pci_framebuffers - remove firmware-configured framebuffers for PCI devices
>   * @pdev: PCI device
> - * @res_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 @res_id.
> + * using memory range configured for any of @pdev's memory bars.
>   *
>   * 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)
> +int remove_conflicting_pci_framebuffers(struct pci_dev *pdev, const char *name)
>  {
>  	struct apertures_struct *ap;
>  	bool primary = false;
>  	int err, idx, bar;
> -	bool res_id_found = false;
>  
>  	for (idx = 0, bar = 0; bar < PCI_ROM_RESOURCE; bar++) {
>  		if (!(pci_resource_flags(pdev, bar) & IORESOURCE_MEM))
> @@ -1789,16 +1787,11 @@ int remove_conflicting_pci_framebuffers(struct pci_dev *pdev, int res_id, const
>  			continue;
>  		ap->ranges[idx].base = pci_resource_start(pdev, bar);
>  		ap->ranges[idx].size = pci_resource_len(pdev, bar);
> -		pci_info(pdev, "%s: bar %d: 0x%lx -> 0x%lx\n", __func__, bar,
> -			 (unsigned long)pci_resource_start(pdev, bar),
> -			 (unsigned long)pci_resource_end(pdev, bar));
> +		pci_dbg(pdev, "%s: bar %d: 0x%lx -> 0x%lx\n", __func__, bar,
> +			(unsigned long)pci_resource_start(pdev, bar),
> +			(unsigned long)pci_resource_end(pdev, bar));
>  		idx++;
> -		if (res_id = bar)
> -			res_id_found = true;
>  	}
> -	if (!res_id_found)
> -		pci_warn(pdev, "%s: passed res_id (%d) is not a memory bar\n",
> -			 __func__, res_id);
>  
>  #ifdef CONFIG_X86
>  	primary = pdev->resource[PCI_ROM_RESOURCE].flags &
> -- 
> 2.18.1
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 2/3] drm: drop resource_id parameter from drm_fb_helper_remove_conflicting_pci_framebuffers
  2019-08-22  9:06   ` Gerd Hoffmann
@ 2019-08-22 13:08     ` Daniel Vetter
  -1 siblings, 0 replies; 17+ messages in thread
From: Daniel Vetter @ 2019-08-22 13:08 UTC (permalink / raw)
  To: Gerd Hoffmann
  Cc: dri-devel, Alex Deucher, Christian König,
	David (ChunMing) Zhou, David Airlie, Daniel Vetter, Dave Airlie,
	Maarten Lankhorst, Maxime Ripard, Sean Paul,
	open list:RADEON and AMDGPU DRM DRIVERS, open list,
	open list:DRM DRIVER FOR BOCHS VIRTUAL GPU,
	open list:DRM DRIVER FOR QXL VIRTUAL GPU

On Thu, Aug 22, 2019 at 11:06:44AM +0200, Gerd Hoffmann wrote:
> Not needed any more for remove_conflicting_pci_framebuffers calls.
> 
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

> ---
>  include/drm/drm_fb_helper.h             | 4 +---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 2 +-
>  drivers/gpu/drm/bochs/bochs_drv.c       | 2 +-
>  drivers/gpu/drm/cirrus/cirrus.c         | 2 +-
>  drivers/gpu/drm/mgag200/mgag200_drv.c   | 2 +-
>  drivers/gpu/drm/qxl/qxl_drv.c           | 2 +-
>  drivers/gpu/drm/radeon/radeon_drv.c     | 2 +-
>  drivers/gpu/drm/virtio/virtgpu_drv.c    | 1 -
>  8 files changed, 7 insertions(+), 10 deletions(-)
> 
> diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h
> index 5a5f4b1d8241..8dcc012ccbc8 100644
> --- a/include/drm/drm_fb_helper.h
> +++ b/include/drm/drm_fb_helper.h
> @@ -539,18 +539,16 @@ drm_fb_helper_remove_conflicting_framebuffers(struct apertures_struct *a,
>  /**
>   * drm_fb_helper_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.
> + * using memory range configured for any of @pdev's memory bars.
>   *
>   * The function assumes that PCI device with shadowed ROM 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)
>  {
>  	int ret = 0;
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> index 98df55534a6d..6b96a5738e57 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> @@ -1031,7 +1031,7 @@ static int amdgpu_pci_probe(struct pci_dev *pdev,
>  	}
>  
>  	/* Get rid of things like offb */
> -	ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, 0, "amdgpudrmfb");
> +	ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, "amdgpudrmfb");
>  	if (ret)
>  		return ret;
>  
> diff --git a/drivers/gpu/drm/bochs/bochs_drv.c b/drivers/gpu/drm/bochs/bochs_drv.c
> index 770e1625d05e..3b9b0d9bbc14 100644
> --- a/drivers/gpu/drm/bochs/bochs_drv.c
> +++ b/drivers/gpu/drm/bochs/bochs_drv.c
> @@ -114,7 +114,7 @@ static int bochs_pci_probe(struct pci_dev *pdev,
>  		return -ENOMEM;
>  	}
>  
> -	ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, 0, "bochsdrmfb");
> +	ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, "bochsdrmfb");
>  	if (ret)
>  		return ret;
>  
> diff --git a/drivers/gpu/drm/cirrus/cirrus.c b/drivers/gpu/drm/cirrus/cirrus.c
> index 36a69aec8a4b..89d9e6fdeb8c 100644
> --- a/drivers/gpu/drm/cirrus/cirrus.c
> +++ b/drivers/gpu/drm/cirrus/cirrus.c
> @@ -532,7 +532,7 @@ static int cirrus_pci_probe(struct pci_dev *pdev,
>  	struct cirrus_device *cirrus;
>  	int ret;
>  
> -	ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, 0, "cirrusdrmfb");
> +	ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, "cirrusdrmfb");
>  	if (ret)
>  		return ret;
>  
> diff --git a/drivers/gpu/drm/mgag200/mgag200_drv.c b/drivers/gpu/drm/mgag200/mgag200_drv.c
> index afd9119b6cf1..4f9df3b93598 100644
> --- a/drivers/gpu/drm/mgag200/mgag200_drv.c
> +++ b/drivers/gpu/drm/mgag200/mgag200_drv.c
> @@ -46,7 +46,7 @@ MODULE_DEVICE_TABLE(pci, pciidlist);
>  
>  static int mga_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
>  {
> -	drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, 0, "mgag200drmfb");
> +	drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, "mgag200drmfb");
>  
>  	return drm_get_pci_dev(pdev, ent, &driver);
>  }
> diff --git a/drivers/gpu/drm/qxl/qxl_drv.c b/drivers/gpu/drm/qxl/qxl_drv.c
> index c1802e01d9f6..2b726a51a302 100644
> --- a/drivers/gpu/drm/qxl/qxl_drv.c
> +++ b/drivers/gpu/drm/qxl/qxl_drv.c
> @@ -83,7 +83,7 @@ qxl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
>  	if (ret)
>  		goto free_dev;
>  
> -	ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, 0, "qxl");
> +	ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, "qxl");
>  	if (ret)
>  		goto disable_pci;
>  
> diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c
> index a4a78dfdef37..624aa580d418 100644
> --- a/drivers/gpu/drm/radeon/radeon_drv.c
> +++ b/drivers/gpu/drm/radeon/radeon_drv.c
> @@ -329,7 +329,7 @@ static int radeon_pci_probe(struct pci_dev *pdev,
>  		return -EPROBE_DEFER;
>  
>  	/* Get rid of things like offb */
> -	ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, 0, "radeondrmfb");
> +	ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, "radeondrmfb");
>  	if (ret)
>  		return ret;
>  
> diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.c b/drivers/gpu/drm/virtio/virtgpu_drv.c
> index 0fc32fa0b3c0..3d24181636e1 100644
> --- a/drivers/gpu/drm/virtio/virtgpu_drv.c
> +++ b/drivers/gpu/drm/virtio/virtgpu_drv.c
> @@ -56,7 +56,6 @@ static int virtio_gpu_pci_quirk(struct drm_device *dev, struct virtio_device *vd
>  	dev->pdev = pdev;
>  	if (vga)
>  		drm_fb_helper_remove_conflicting_pci_framebuffers(pdev,
> -								  0,
>  								  "virtiodrmfb");
>  
>  	/*
> -- 
> 2.18.1
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 2/3] drm: drop resource_id parameter from drm_fb_helper_remove_conflicting_pci_framebuffers
@ 2019-08-22 13:08     ` Daniel Vetter
  0 siblings, 0 replies; 17+ messages in thread
From: Daniel Vetter @ 2019-08-22 13:08 UTC (permalink / raw)
  To: Gerd Hoffmann
  Cc: David (ChunMing) Zhou, David Airlie, Maarten Lankhorst,
	open list, dri-devel, open list:DRM DRIVER FOR BOCHS VIRTUAL GPU,
	Maxime Ripard, open list:RADEON and AMDGPU DRM DRIVERS,
	Daniel Vetter, open list:DRM DRIVER FOR QXL VIRTUAL GPU,
	Alex Deucher, Dave Airlie, Sean Paul, Christian König

On Thu, Aug 22, 2019 at 11:06:44AM +0200, Gerd Hoffmann wrote:
> Not needed any more for remove_conflicting_pci_framebuffers calls.
> 
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

> ---
>  include/drm/drm_fb_helper.h             | 4 +---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 2 +-
>  drivers/gpu/drm/bochs/bochs_drv.c       | 2 +-
>  drivers/gpu/drm/cirrus/cirrus.c         | 2 +-
>  drivers/gpu/drm/mgag200/mgag200_drv.c   | 2 +-
>  drivers/gpu/drm/qxl/qxl_drv.c           | 2 +-
>  drivers/gpu/drm/radeon/radeon_drv.c     | 2 +-
>  drivers/gpu/drm/virtio/virtgpu_drv.c    | 1 -
>  8 files changed, 7 insertions(+), 10 deletions(-)
> 
> diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h
> index 5a5f4b1d8241..8dcc012ccbc8 100644
> --- a/include/drm/drm_fb_helper.h
> +++ b/include/drm/drm_fb_helper.h
> @@ -539,18 +539,16 @@ drm_fb_helper_remove_conflicting_framebuffers(struct apertures_struct *a,
>  /**
>   * drm_fb_helper_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.
> + * using memory range configured for any of @pdev's memory bars.
>   *
>   * The function assumes that PCI device with shadowed ROM 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)
>  {
>  	int ret = 0;
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> index 98df55534a6d..6b96a5738e57 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> @@ -1031,7 +1031,7 @@ static int amdgpu_pci_probe(struct pci_dev *pdev,
>  	}
>  
>  	/* Get rid of things like offb */
> -	ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, 0, "amdgpudrmfb");
> +	ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, "amdgpudrmfb");
>  	if (ret)
>  		return ret;
>  
> diff --git a/drivers/gpu/drm/bochs/bochs_drv.c b/drivers/gpu/drm/bochs/bochs_drv.c
> index 770e1625d05e..3b9b0d9bbc14 100644
> --- a/drivers/gpu/drm/bochs/bochs_drv.c
> +++ b/drivers/gpu/drm/bochs/bochs_drv.c
> @@ -114,7 +114,7 @@ static int bochs_pci_probe(struct pci_dev *pdev,
>  		return -ENOMEM;
>  	}
>  
> -	ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, 0, "bochsdrmfb");
> +	ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, "bochsdrmfb");
>  	if (ret)
>  		return ret;
>  
> diff --git a/drivers/gpu/drm/cirrus/cirrus.c b/drivers/gpu/drm/cirrus/cirrus.c
> index 36a69aec8a4b..89d9e6fdeb8c 100644
> --- a/drivers/gpu/drm/cirrus/cirrus.c
> +++ b/drivers/gpu/drm/cirrus/cirrus.c
> @@ -532,7 +532,7 @@ static int cirrus_pci_probe(struct pci_dev *pdev,
>  	struct cirrus_device *cirrus;
>  	int ret;
>  
> -	ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, 0, "cirrusdrmfb");
> +	ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, "cirrusdrmfb");
>  	if (ret)
>  		return ret;
>  
> diff --git a/drivers/gpu/drm/mgag200/mgag200_drv.c b/drivers/gpu/drm/mgag200/mgag200_drv.c
> index afd9119b6cf1..4f9df3b93598 100644
> --- a/drivers/gpu/drm/mgag200/mgag200_drv.c
> +++ b/drivers/gpu/drm/mgag200/mgag200_drv.c
> @@ -46,7 +46,7 @@ MODULE_DEVICE_TABLE(pci, pciidlist);
>  
>  static int mga_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
>  {
> -	drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, 0, "mgag200drmfb");
> +	drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, "mgag200drmfb");
>  
>  	return drm_get_pci_dev(pdev, ent, &driver);
>  }
> diff --git a/drivers/gpu/drm/qxl/qxl_drv.c b/drivers/gpu/drm/qxl/qxl_drv.c
> index c1802e01d9f6..2b726a51a302 100644
> --- a/drivers/gpu/drm/qxl/qxl_drv.c
> +++ b/drivers/gpu/drm/qxl/qxl_drv.c
> @@ -83,7 +83,7 @@ qxl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
>  	if (ret)
>  		goto free_dev;
>  
> -	ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, 0, "qxl");
> +	ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, "qxl");
>  	if (ret)
>  		goto disable_pci;
>  
> diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c
> index a4a78dfdef37..624aa580d418 100644
> --- a/drivers/gpu/drm/radeon/radeon_drv.c
> +++ b/drivers/gpu/drm/radeon/radeon_drv.c
> @@ -329,7 +329,7 @@ static int radeon_pci_probe(struct pci_dev *pdev,
>  		return -EPROBE_DEFER;
>  
>  	/* Get rid of things like offb */
> -	ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, 0, "radeondrmfb");
> +	ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, "radeondrmfb");
>  	if (ret)
>  		return ret;
>  
> diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.c b/drivers/gpu/drm/virtio/virtgpu_drv.c
> index 0fc32fa0b3c0..3d24181636e1 100644
> --- a/drivers/gpu/drm/virtio/virtgpu_drv.c
> +++ b/drivers/gpu/drm/virtio/virtgpu_drv.c
> @@ -56,7 +56,6 @@ static int virtio_gpu_pci_quirk(struct drm_device *dev, struct virtio_device *vd
>  	dev->pdev = pdev;
>  	if (vga)
>  		drm_fb_helper_remove_conflicting_pci_framebuffers(pdev,
> -								  0,
>  								  "virtiodrmfb");
>  
>  	/*
> -- 
> 2.18.1
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 3/3] drm/i915: switch to drm_fb_helper_remove_conflicting_pci_framebuffers
  2019-08-22  9:06 ` [PATCH 3/3] drm/i915: switch to drm_fb_helper_remove_conflicting_pci_framebuffers Gerd Hoffmann
@ 2019-08-22 13:13   ` Daniel Vetter
  2019-08-23  8:14     ` Gerd Hoffmann
  0 siblings, 1 reply; 17+ messages in thread
From: Daniel Vetter @ 2019-08-22 13:13 UTC (permalink / raw)
  To: Gerd Hoffmann; +Cc: dri-devel

On Thu, Aug 22, 2019 at 11:06:45AM +0200, Gerd Hoffmann wrote:
> No need for a home-grown version, the generic helper should work just
> fine.  It also handles vgacon removal these days, see commit
> 1c74ca7a1a9a ("drm/fb-helper: call vga_remove_vgacon automatically."),
> so that can be removed too.
> 
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

I think I'd still wait until 5.4-rc1 with merging this one, just to give
another full release and people to test it before we pull the trigger.
Overabundance of caution and all that.

Thanks a lot for doing this!
-Daniel

> ---
>  drivers/gpu/drm/i915/i915_drv.c | 41 ++-------------------------------
>  1 file changed, 2 insertions(+), 39 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> index b99d73c1c4db..ddc317ceb8de 100644
> --- a/drivers/gpu/drm/i915/i915_drv.c
> +++ b/drivers/gpu/drm/i915/i915_drv.c
> @@ -766,31 +766,6 @@ static int i915_load_modeset_init(struct drm_device *dev)
>  	return ret;
>  }
>  
> -static int i915_kick_out_firmware_fb(struct drm_i915_private *dev_priv)
> -{
> -	struct apertures_struct *ap;
> -	struct pci_dev *pdev = dev_priv->drm.pdev;
> -	struct i915_ggtt *ggtt = &dev_priv->ggtt;
> -	bool primary;
> -	int ret;
> -
> -	ap = alloc_apertures(1);
> -	if (!ap)
> -		return -ENOMEM;
> -
> -	ap->ranges[0].base = ggtt->gmadr.start;
> -	ap->ranges[0].size = ggtt->mappable_end;
> -
> -	primary =
> -		pdev->resource[PCI_ROM_RESOURCE].flags & IORESOURCE_ROM_SHADOW;
> -
> -	ret = drm_fb_helper_remove_conflicting_framebuffers(ap, "inteldrmfb", primary);
> -
> -	kfree(ap);
> -
> -	return ret;
> -}
> -
>  static void intel_init_dpio(struct drm_i915_private *dev_priv)
>  {
>  	/*
> @@ -1570,21 +1545,9 @@ static int i915_driver_init_hw(struct drm_i915_private *dev_priv)
>  	if (ret)
>  		goto err_perf;
>  
> -	/*
> -	 * WARNING: Apparently we must kick fbdev drivers before vgacon,
> -	 * otherwise the vga fbdev driver falls over.
> -	 */
> -	ret = i915_kick_out_firmware_fb(dev_priv);
> -	if (ret) {
> -		DRM_ERROR("failed to remove conflicting framebuffer drivers\n");
> +	ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, "inteldrmfb");
> +	if (ret)
>  		goto err_ggtt;
> -	}
> -
> -	ret = vga_remove_vgacon(pdev);
> -	if (ret) {
> -		DRM_ERROR("failed to remove conflicting VGA console\n");
> -		goto err_ggtt;
> -	}
>  
>  	ret = i915_ggtt_init_hw(dev_priv);
>  	if (ret)
> -- 
> 2.18.1
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 3/3] drm/i915: switch to drm_fb_helper_remove_conflicting_pci_framebuffers
  2019-08-22 13:13   ` Daniel Vetter
@ 2019-08-23  8:14     ` Gerd Hoffmann
  2019-08-23  8:30       ` Daniel Vetter
  0 siblings, 1 reply; 17+ messages in thread
From: Gerd Hoffmann @ 2019-08-23  8:14 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: dri-devel

On Thu, Aug 22, 2019 at 03:13:14PM +0200, Daniel Vetter wrote:
> On Thu, Aug 22, 2019 at 11:06:45AM +0200, Gerd Hoffmann wrote:
> > No need for a home-grown version, the generic helper should work just
> > fine.  It also handles vgacon removal these days, see commit
> > 1c74ca7a1a9a ("drm/fb-helper: call vga_remove_vgacon automatically."),
> > so that can be removed too.
> > 
> > Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> 
> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> 
> I think I'd still wait until 5.4-rc1 with merging this one, just to give
> another full release and people to test it before we pull the trigger.
> Overabundance of caution and all that.

Whole series or just the i915 patch?

cheers,
  Gerd

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

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 3/3] drm/i915: switch to drm_fb_helper_remove_conflicting_pci_framebuffers
  2019-08-23  8:14     ` Gerd Hoffmann
@ 2019-08-23  8:30       ` Daniel Vetter
  2019-08-23  9:02         ` Gerd Hoffmann
  0 siblings, 1 reply; 17+ messages in thread
From: Daniel Vetter @ 2019-08-23  8:30 UTC (permalink / raw)
  To: Gerd Hoffmann; +Cc: dri-devel

On Fri, Aug 23, 2019 at 10:14 AM Gerd Hoffmann <kraxel@redhat.com> wrote:
> On Thu, Aug 22, 2019 at 03:13:14PM +0200, Daniel Vetter wrote:
> > On Thu, Aug 22, 2019 at 11:06:45AM +0200, Gerd Hoffmann wrote:
> > > No need for a home-grown version, the generic helper should work just
> > > fine.  It also handles vgacon removal these days, see commit
> > > 1c74ca7a1a9a ("drm/fb-helper: call vga_remove_vgacon automatically."),
> > > so that can be removed too.
> > >
> > > Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> >
> > Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> >
> > I think I'd still wait until 5.4-rc1 with merging this one, just to give
> > another full release and people to test it before we pull the trigger.
> > Overabundance of caution and all that.
>
> Whole series or just the i915 patch?

Ok I just checked and this all landed in 5.1 already, I thought it was
more recent. I think that's good enough, push it all without more
waiting.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 3/3] drm/i915: switch to drm_fb_helper_remove_conflicting_pci_framebuffers
  2019-08-23  8:30       ` Daniel Vetter
@ 2019-08-23  9:02         ` Gerd Hoffmann
  2019-09-23  8:18           ` Jani Nikula
  0 siblings, 1 reply; 17+ messages in thread
From: Gerd Hoffmann @ 2019-08-23  9:02 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: dri-devel

On Fri, Aug 23, 2019 at 10:30:35AM +0200, Daniel Vetter wrote:
> On Fri, Aug 23, 2019 at 10:14 AM Gerd Hoffmann <kraxel@redhat.com> wrote:
> >
> > Whole series or just the i915 patch?
> 
> Ok I just checked and this all landed in 5.1 already, I thought it was
> more recent. I think that's good enough, push it all without more
> waiting.

Pushed to drm-misc-next.

cheers,
  Gerd

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

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 3/3] drm/i915: switch to drm_fb_helper_remove_conflicting_pci_framebuffers
  2019-08-23  9:02         ` Gerd Hoffmann
@ 2019-09-23  8:18           ` Jani Nikula
  0 siblings, 0 replies; 17+ messages in thread
From: Jani Nikula @ 2019-09-23  8:18 UTC (permalink / raw)
  To: Gerd Hoffmann, Daniel Vetter; +Cc: dri-devel, Rodrigo Vivi

On Fri, 23 Aug 2019, Gerd Hoffmann <kraxel@redhat.com> wrote:
> On Fri, Aug 23, 2019 at 10:30:35AM +0200, Daniel Vetter wrote:
>> On Fri, Aug 23, 2019 at 10:14 AM Gerd Hoffmann <kraxel@redhat.com> wrote:
>> >
>> > Whole series or just the i915 patch?
>> 
>> Ok I just checked and this all landed in 5.1 already, I thought it was
>> more recent. I think that's good enough, push it all without more
>> waiting.
>
> Pushed to drm-misc-next.

After-the-fact nitpick: i915 maintainers were Cc'd on the original
patch, but not on the subsequent discussion on merging, or where to
merge. intel-gfx@ mailing list wasn't Cc'd at all, which means this
didn't get any pre-merge CI coverage we expect on every patch. I found
about this having been merged through a merge conflict.

If you don't see the ack from the maintainers, please ask.


BR,
Jani.

-- 
Jani Nikula, Intel Open Source Graphics Center
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2019-09-23  8:18 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-22  9:06 [PATCH 0/3] drm, fbdev: complete remove_conflicting_pci_framebuffers cleanup Gerd Hoffmann
2019-08-22  9:06 ` [PATCH 1/3] fbdev: drop res_id parameter from remove_conflicting_pci_framebuffers Gerd Hoffmann
2019-08-22  9:06   ` Gerd Hoffmann
2019-08-22  9:06   ` Gerd Hoffmann
2019-08-22 13:08   ` Daniel Vetter
2019-08-22 13:08     ` Daniel Vetter
2019-08-22  9:06 ` [PATCH 2/3] drm: drop resource_id parameter from drm_fb_helper_remove_conflicting_pci_framebuffers Gerd Hoffmann
2019-08-22  9:06 ` Gerd Hoffmann
2019-08-22  9:06   ` Gerd Hoffmann
2019-08-22 13:08   ` Daniel Vetter
2019-08-22 13:08     ` Daniel Vetter
2019-08-22  9:06 ` [PATCH 3/3] drm/i915: switch to drm_fb_helper_remove_conflicting_pci_framebuffers Gerd Hoffmann
2019-08-22 13:13   ` Daniel Vetter
2019-08-23  8:14     ` Gerd Hoffmann
2019-08-23  8:30       ` Daniel Vetter
2019-08-23  9:02         ` Gerd Hoffmann
2019-09-23  8:18           ` Jani Nikula

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.