drm/aperture: Remove primary argument
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 6 Apr 2023 13:21:03 +0000 (15:21 +0200)
committerThomas Zimmermann <tzimmermann@suse.de>
Sun, 16 Apr 2023 12:17:41 +0000 (14:17 +0200)
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 preceding 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.

v4:
- fix Daniel's S-o-b address

v5:
- add back an S-o-b tag with Daniel's Intel address

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Javier Martinez Canillas <javierm@redhat.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Maxime Ripard <mripard@kernel.org>
Cc: Deepak Rawat <drawat.floss@gmail.com>
Cc: Neil Armstrong <neil.armstrong@linaro.org>
Cc: Kevin Hilman <khilman@baylibre.com>
Cc: Jerome Brunet <jbrunet@baylibre.com>
Cc: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Jonathan Hunter <jonathanh@nvidia.com>
Cc: Emma Anholt <emma@anholt.net>
Cc: Helge Deller <deller@gmx.de>
Cc: David Airlie <airlied@gmail.com>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: linux-hyperv@vger.kernel.org
Cc: linux-amlogic@lists.infradead.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-tegra@vger.kernel.org
Cc: linux-fbdev@vger.kernel.org
Acked-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Acked-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230406132109.32050-4-tzimmermann@suse.de
13 files changed:
drivers/gpu/drm/arm/hdlcd_drv.c
drivers/gpu/drm/armada/armada_drv.c
drivers/gpu/drm/drm_aperture.c
drivers/gpu/drm/gma500/psb_drv.c
drivers/gpu/drm/hyperv/hyperv_drm_drv.c
drivers/gpu/drm/meson/meson_drv.c
drivers/gpu/drm/msm/msm_fbdev.c
drivers/gpu/drm/rockchip/rockchip_drm_drv.c
drivers/gpu/drm/stm/drv.c
drivers/gpu/drm/sun4i/sun4i_drv.c
drivers/gpu/drm/tegra/drm.c
drivers/gpu/drm/vc4/vc4_drv.c
include/drm/drm_aperture.h

index 9020bf820bc8dc6c9005ae9c3be041a51fb4ed29..12f5a2c7f03d50921e7784efcc94e00eb839e6a3 100644 (file)
@@ -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);
         */
        if (hdlcd_read(hdlcd, HDLCD_REG_COMMAND)) {
                hdlcd_write(hdlcd, HDLCD_REG_COMMAND, 0);
-               drm_aperture_remove_framebuffers(false, &hdlcd_driver);
+               drm_aperture_remove_framebuffers(&hdlcd_driver);
        }
 
        drm_mode_config_reset(drm);
        }
 
        drm_mode_config_reset(drm);
index 0643887800b4d33cea277876b604e44a18f76c5c..c99ec70783013b31fcf1ffdb59fa5c662b9768ff 100644 (file)
@@ -95,7 +95,7 @@ static int armada_drm_bind(struct device *dev)
        }
 
        /* Remove early framebuffers */
        }
 
        /* Remove early framebuffers */
-       ret = drm_aperture_remove_framebuffers(false, &armada_drm_driver);
+       ret = drm_aperture_remove_framebuffers(&armada_drm_driver);
        if (ret) {
                dev_err(dev, "[" DRM_NAME ":%s] can't kick out simple-fb: %d\n",
                        __func__, ret);
        if (ret) {
                dev_err(dev, "[" DRM_NAME ":%s] can't kick out simple-fb: %d\n",
                        __func__, ret);
index 3b8fdeeafd53a7696796f6737d84231cc413603a..697cffbfd6037d3004935600ea4ffdd253a42181 100644 (file)
  *
  *     static int remove_conflicting_framebuffers(struct pci_dev *pdev)
  *     {
  *
  *     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);
  *             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,
  *                                                                 &example_driver);
  *     }
  *
  *                                                                 &example_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
  * 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
  * @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,
  * 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);
 
 }
 EXPORT_SYMBOL(drm_aperture_remove_conflicting_framebuffers);
 
index f1e0eed8fea4765511e715b25222004b9fd04ad5..4bb06a89e48da39a7f1e1421b7d588bf41c0c735 100644 (file)
@@ -428,7 +428,7 @@ static int psb_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
         * TODO: Refactor psb_driver_load() to map vdc_reg earlier. Then we
         *       might be able to read the framebuffer range from the device.
         */
         * TODO: Refactor psb_driver_load() to map vdc_reg earlier. Then we
         *       might be able to read the framebuffer range from the device.
         */
-       ret = drm_aperture_remove_framebuffers(false, &driver);
+       ret = drm_aperture_remove_framebuffers(&driver);
        if (ret)
                return ret;
 
        if (ret)
                return ret;
 
index f830d62a5ce6047a3b88570ba6ad76162fe9a1ad..a7d2c92d6c6a033b36a8c97b431538df62544d14 100644 (file)
@@ -74,7 +74,6 @@ static int hyperv_setup_vram(struct hyperv_drm_device *hv,
 
        drm_aperture_remove_conflicting_framebuffers(screen_info.lfb_base,
                                                     screen_info.lfb_size,
 
        drm_aperture_remove_conflicting_framebuffers(screen_info.lfb_base,
                                                     screen_info.lfb_size,
-                                                    false,
                                                     &hyperv_driver);
 
        hv->fb_size = (unsigned long)hv->mmio_megabytes * 1024 * 1024;
                                                     &hyperv_driver);
 
        hv->fb_size = (unsigned long)hv->mmio_megabytes * 1024 * 1024;
index bb72fda9106dde93b971cbcb8b8833571e07e26d..ca6d1e59e5d9fc370ad84623c358f78fb89664be 100644 (file)
@@ -285,7 +285,7 @@ static int meson_drv_bind_master(struct device *dev, bool has_components)
         * Remove early framebuffers (ie. simplefb). The framebuffer can be
         * located anywhere in RAM
         */
         * Remove early framebuffers (ie. simplefb). The framebuffer can be
         * located anywhere in RAM
         */
-       ret = drm_aperture_remove_framebuffers(false, &meson_driver);
+       ret = drm_aperture_remove_framebuffers(&meson_driver);
        if (ret)
                goto free_drm;
 
        if (ret)
                goto free_drm;
 
index d26aa52217ce198f1b99f4e86b6269c1053c9977..16652a5a7018d4297f14977ccc7d61869dd1431d 100644 (file)
@@ -155,7 +155,7 @@ struct drm_fb_helper *msm_fbdev_init(struct drm_device *dev)
        }
 
        /* the fw fb could be anywhere in memory */
        }
 
        /* the fw fb could be anywhere in memory */
-       ret = drm_aperture_remove_framebuffers(false, dev->driver);
+       ret = drm_aperture_remove_framebuffers(dev->driver);
        if (ret)
                goto fini;
 
        if (ret)
                goto fini;
 
index 6e0788d14c10fbdc2d52ac96737b438d39098f36..d97f2edc646b77bf0f3d6beea10335ce6ea0c62b 100644 (file)
@@ -140,7 +140,7 @@ static int rockchip_drm_bind(struct device *dev)
        int ret;
 
        /* Remove existing drivers that may own the framebuffer memory. */
        int ret;
 
        /* Remove existing drivers that may own the framebuffer memory. */
-       ret = drm_aperture_remove_framebuffers(false, &rockchip_drm_driver);
+       ret = drm_aperture_remove_framebuffers(&rockchip_drm_driver);
        if (ret) {
                DRM_DEV_ERROR(dev,
                              "Failed to remove existing framebuffers - %d.\n",
        if (ret) {
                DRM_DEV_ERROR(dev,
                              "Failed to remove existing framebuffers - %d.\n",
index 422220df7d8cd36398794a429a97c1f3227c5f9c..cb4404b3ce62ceacd407a3d31c2fc22e23a67882 100644 (file)
@@ -185,7 +185,7 @@ static int stm_drm_platform_probe(struct platform_device *pdev)
 
        DRM_DEBUG("%s\n", __func__);
 
 
        DRM_DEBUG("%s\n", __func__);
 
-       ret = drm_aperture_remove_framebuffers(false, &drv_driver);
+       ret = drm_aperture_remove_framebuffers(&drv_driver);
        if (ret)
                return ret;
 
        if (ret)
                return ret;
 
index e49f78a6a8cf5a445357a6accaec49f02a01c293..daa7faf72a4b785876d11928f1e54b44d2f7580d 100644 (file)
@@ -98,7 +98,7 @@ static int sun4i_drv_bind(struct device *dev)
                goto unbind_all;
 
        /* Remove early framebuffers (ie. simplefb) */
                goto unbind_all;
 
        /* Remove early framebuffers (ie. simplefb) */
-       ret = drm_aperture_remove_framebuffers(false, &sun4i_drv_driver);
+       ret = drm_aperture_remove_framebuffers(&sun4i_drv_driver);
        if (ret)
                goto unbind_all;
 
        if (ret)
                goto unbind_all;
 
index 6ca9f396e55be455e8d3981cb6a90084c3f5c108..d11d259f9399ffb1914274bc39eb7d7e1972aba3 100644 (file)
@@ -1252,7 +1252,7 @@ static int host1x_drm_probe(struct host1x_device *dev)
 
        drm_mode_config_reset(drm);
 
 
        drm_mode_config_reset(drm);
 
-       err = drm_aperture_remove_framebuffers(false, &tegra_drm_driver);
+       err = drm_aperture_remove_framebuffers(&tegra_drm_driver);
        if (err < 0)
                goto hub;
 
        if (err < 0)
                goto hub;
 
index c8bf954042e0a6ad2268d752c1b3f59d4912a58b..823395c23cc308fac53ce61147a452e39bc03c4c 100644 (file)
@@ -350,7 +350,7 @@ static int vc4_drm_bind(struct device *dev)
                        return -EPROBE_DEFER;
        }
 
                        return -EPROBE_DEFER;
        }
 
-       ret = drm_aperture_remove_framebuffers(false, driver);
+       ret = drm_aperture_remove_framebuffers(driver);
        if (ret)
                return ret;
 
        if (ret)
                return ret;
 
index 7096703c3949348710f8b4c3afbc13541c4f65c2..cbe33b49fd5dcc7203e99306e9e5ce83320130c0 100644 (file)
@@ -13,14 +13,13 @@ int devm_aperture_acquire_from_firmware(struct drm_device *dev, resource_size_t
                                        resource_size_t size);
 
 int drm_aperture_remove_conflicting_framebuffers(resource_size_t base, resource_size_t size,
                                        resource_size_t size);
 
 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);
 
 int drm_aperture_remove_conflicting_pci_framebuffers(struct pci_dev *pdev,
                                                     const struct drm_driver *req_driver);
 
 /**
  * drm_aperture_remove_framebuffers - remove all existing framebuffers
 
 int drm_aperture_remove_conflicting_pci_framebuffers(struct pci_dev *pdev,
                                                     const struct drm_driver *req_driver);
 
 /**
  * drm_aperture_remove_framebuffers - remove all existing framebuffers
- * @primary: also kick vga16fb if present
  * @req_driver: requesting DRM driver
  *
  * This function removes all graphics device drivers. Use this function on systems
  * @req_driver: requesting DRM driver
  *
  * This function removes all graphics device drivers. Use this function on systems
@@ -30,9 +29,9 @@ int drm_aperture_remove_conflicting_pci_framebuffers(struct pci_dev *pdev,
  * 0 on success, or a negative errno code otherwise
  */
 static inline int
  * 0 on success, or a negative errno code otherwise
  */
 static inline int
-drm_aperture_remove_framebuffers(bool primary, const struct drm_driver *req_driver)
+drm_aperture_remove_framebuffers(const struct drm_driver *req_driver)
 {
 {
-       return drm_aperture_remove_conflicting_framebuffers(0, (resource_size_t)-1, primary,
+       return drm_aperture_remove_conflicting_framebuffers(0, (resource_size_t)-1,
                                                            req_driver);
 }
 
                                                            req_driver);
 }