Re: [PATCH 3/8] drm/aperture: Remove primary argument

2023-04-05 Thread Javier Martinez Canillas
Daniel Vetter  writes:

> Only really pci devices have a business setting this - it's for
> figuring out whether the legacy vga stuff should be nuked too. And
> with the preceeding two patches those are all using the pci version of
> this.
>
> Which means for all other callers primary == false and we can remove
> it now.
>
> v2:
> - Reorder to avoid compile fail (Thomas)
> - Include gma500, which retained it's called to the non-pci version.
>
> Signed-off-by: Daniel Vetter 

Reviewed-by: Javier Martinez Canillas 

-- 
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat



Re: [PATCH 3/8] drm/aperture: Remove primary argument

2023-04-05 Thread Thierry Reding
On Tue, Apr 04, 2023 at 10:18:37PM +0200, Daniel Vetter wrote:
> Only really pci devices have a business setting this - it's for
> figuring out whether the legacy vga stuff should be nuked too. And
> with the preceeding two patches those are all using the pci version of
> this.
> 
> Which means for all other callers primary == false and we can remove
> it now.
> 
> v2:
> - Reorder to avoid compile fail (Thomas)
> - Include gma500, which retained it's called to the non-pci version.
> 
> Signed-off-by: Daniel Vetter 
> Cc: Thomas Zimmermann 
> Cc: Javier Martinez Canillas 
> Cc: Maarten Lankhorst 
> Cc: Maxime Ripard 
> Cc: Deepak Rawat 
> Cc: Neil Armstrong 
> Cc: Kevin Hilman 
> Cc: Jerome Brunet 
> Cc: Martin Blumenstingl 
> Cc: Thierry Reding 
> Cc: Jonathan Hunter 
> Cc: Emma Anholt 
> Cc: Helge Deller 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: linux-hyp...@vger.kernel.org
> Cc: linux-amlo...@lists.infradead.org
> Cc: linux-arm-ker...@lists.infradead.org
> Cc: linux-te...@vger.kernel.org
> Cc: linux-fb...@vger.kernel.org
> ---
>  drivers/gpu/drm/arm/hdlcd_drv.c |  2 +-
>  drivers/gpu/drm/armada/armada_drv.c |  2 +-
>  drivers/gpu/drm/drm_aperture.c  | 11 +++
>  drivers/gpu/drm/gma500/psb_drv.c|  2 +-
>  drivers/gpu/drm/hyperv/hyperv_drm_drv.c |  1 -
>  drivers/gpu/drm/meson/meson_drv.c   |  2 +-
>  drivers/gpu/drm/msm/msm_fbdev.c |  2 +-
>  drivers/gpu/drm/rockchip/rockchip_drm_drv.c |  2 +-
>  drivers/gpu/drm/stm/drv.c   |  2 +-
>  drivers/gpu/drm/sun4i/sun4i_drv.c   |  2 +-
>  drivers/gpu/drm/tegra/drm.c |  2 +-
>  drivers/gpu/drm/vc4/vc4_drv.c   |  2 +-
>  include/drm/drm_aperture.h  |  7 +++
>  13 files changed, 16 insertions(+), 23 deletions(-)

Acked-by: Thierry Reding 


signature.asc
Description: PGP signature


Re: [PATCH 3/8] drm/aperture: Remove primary argument

2023-04-04 Thread Martin Blumenstingl
On Tue, Apr 4, 2023 at 10:18 PM Daniel Vetter  wrote:
>
> Only really pci devices have a business setting this - it's for
> figuring out whether the legacy vga stuff should be nuked too. And
> with the preceeding two patches those are all using the pci version of
I think it's spelled "preceding"

[...]
>  drivers/gpu/drm/meson/meson_drv.c   |  2 +-
for the meson driver:
Acked-by: Martin Blumenstingl 


Thank you and best regards,
Martin


[PATCH 3/8] drm/aperture: Remove primary argument

2023-04-04 Thread Daniel Vetter
Only really pci devices have a business setting this - it's for
figuring out whether the legacy vga stuff should be nuked too. And
with the preceeding two patches those are all using the pci version of
this.

Which means for all other callers primary == false and we can remove
it now.

v2:
- Reorder to avoid compile fail (Thomas)
- Include gma500, which retained it's called to the non-pci version.

Signed-off-by: Daniel Vetter 
Cc: Thomas Zimmermann 
Cc: Javier Martinez Canillas 
Cc: Maarten Lankhorst 
Cc: Maxime Ripard 
Cc: Deepak Rawat 
Cc: Neil Armstrong 
Cc: Kevin Hilman 
Cc: Jerome Brunet 
Cc: Martin Blumenstingl 
Cc: Thierry Reding 
Cc: Jonathan Hunter 
Cc: Emma Anholt 
Cc: Helge Deller 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: linux-hyp...@vger.kernel.org
Cc: linux-amlo...@lists.infradead.org
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-te...@vger.kernel.org
Cc: linux-fb...@vger.kernel.org
---
 drivers/gpu/drm/arm/hdlcd_drv.c |  2 +-
 drivers/gpu/drm/armada/armada_drv.c |  2 +-
 drivers/gpu/drm/drm_aperture.c  | 11 +++
 drivers/gpu/drm/gma500/psb_drv.c|  2 +-
 drivers/gpu/drm/hyperv/hyperv_drm_drv.c |  1 -
 drivers/gpu/drm/meson/meson_drv.c   |  2 +-
 drivers/gpu/drm/msm/msm_fbdev.c |  2 +-
 drivers/gpu/drm/rockchip/rockchip_drm_drv.c |  2 +-
 drivers/gpu/drm/stm/drv.c   |  2 +-
 drivers/gpu/drm/sun4i/sun4i_drv.c   |  2 +-
 drivers/gpu/drm/tegra/drm.c |  2 +-
 drivers/gpu/drm/vc4/vc4_drv.c   |  2 +-
 include/drm/drm_aperture.h  |  7 +++
 13 files changed, 16 insertions(+), 23 deletions(-)

diff --git a/drivers/gpu/drm/arm/hdlcd_drv.c b/drivers/gpu/drm/arm/hdlcd_drv.c
index 9020bf820bc8..12f5a2c7f03d 100644
--- a/drivers/gpu/drm/arm/hdlcd_drv.c
+++ b/drivers/gpu/drm/arm/hdlcd_drv.c
@@ -285,7 +285,7 @@ static int hdlcd_drm_bind(struct device *dev)
 */
if (hdlcd_read(hdlcd, HDLCD_REG_COMMAND)) {
hdlcd_write(hdlcd, HDLCD_REG_COMMAND, 0);
-   drm_aperture_remove_framebuffers(false, _driver);
+   drm_aperture_remove_framebuffers(_driver);
}
 
drm_mode_config_reset(drm);
diff --git a/drivers/gpu/drm/armada/armada_drv.c 
b/drivers/gpu/drm/armada/armada_drv.c
index 0643887800b4..c99ec7078301 100644
--- a/drivers/gpu/drm/armada/armada_drv.c
+++ b/drivers/gpu/drm/armada/armada_drv.c
@@ -95,7 +95,7 @@ static int armada_drm_bind(struct device *dev)
}
 
/* Remove early framebuffers */
-   ret = drm_aperture_remove_framebuffers(false, _drm_driver);
+   ret = drm_aperture_remove_framebuffers(_drm_driver);
if (ret) {
dev_err(dev, "[" DRM_NAME ":%s] can't kick out simple-fb: %d\n",
__func__, ret);
diff --git a/drivers/gpu/drm/drm_aperture.c b/drivers/gpu/drm/drm_aperture.c
index 3b8fdeeafd53..697cffbfd603 100644
--- a/drivers/gpu/drm/drm_aperture.c
+++ b/drivers/gpu/drm/drm_aperture.c
@@ -32,17 +32,13 @@
  *
  * static int remove_conflicting_framebuffers(struct pci_dev *pdev)
  * {
- * bool primary = false;
  * resource_size_t base, size;
  * int ret;
  *
  * base = pci_resource_start(pdev, 0);
  * size = pci_resource_len(pdev, 0);
- * #ifdef CONFIG_X86
- * primary = pdev->resource[PCI_ROM_RESOURCE].flags & 
IORESOURCE_ROM_SHADOW;
- * #endif
  *
- * return drm_aperture_remove_conflicting_framebuffers(base, size, 
primary,
+ * return drm_aperture_remove_conflicting_framebuffers(base, size,
  * 
_driver);
  * }
  *
@@ -161,7 +157,6 @@ EXPORT_SYMBOL(devm_aperture_acquire_from_firmware);
  * drm_aperture_remove_conflicting_framebuffers - remove existing framebuffers 
in the given range
  * @base: the aperture's base address in physical memory
  * @size: aperture size in bytes
- * @primary: also kick vga16fb if present
  * @req_driver: requesting DRM driver
  *
  * This function removes graphics device drivers which use the memory range 
described by
@@ -171,9 +166,9 @@ EXPORT_SYMBOL(devm_aperture_acquire_from_firmware);
  * 0 on success, or a negative errno code otherwise
  */
 int drm_aperture_remove_conflicting_framebuffers(resource_size_t base, 
resource_size_t size,
-bool primary, const struct 
drm_driver *req_driver)
+const struct drm_driver 
*req_driver)
 {
-   return aperture_remove_conflicting_devices(base, size, primary, 
req_driver->name);
+   return aperture_remove_conflicting_devices(base, size, false, 
req_driver->name);
 }
 EXPORT_SYMBOL(drm_aperture_remove_conflicting_framebuffers);
 
diff --git a/drivers/gpu/drm/gma500/psb_drv.c b/drivers/gpu/drm/gma500/psb_drv.c
index f1e0eed8fea4..4bb06a89e48d 100644
---