* [PATCH 01/28] drm/amdgpu: Use video aperture helpers
2024-09-30 13:02 [PATCH 00/28] drm: Remove DRM aperture helpers Thomas Zimmermann
@ 2024-09-30 13:02 ` Thomas Zimmermann
2024-09-30 13:03 ` [PATCH 02/28] drm/arm/hdlcd: " Thomas Zimmermann
` (28 subsequent siblings)
29 siblings, 0 replies; 38+ messages in thread
From: Thomas Zimmermann @ 2024-09-30 13:02 UTC (permalink / raw)
To: javierm, airlied, simona, maarten.lankhorst, mripard
Cc: dri-devel, amd-gfx, intel-gfx, intel-xe, Thomas Zimmermann,
Alex Deucher, Christian König, Xinhui Pan
DRM's aperture functions have long been implemented as helpers
under drivers/video/ for use with fbdev. Avoid the DRM wrappers by
calling the video functions directly.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: "Christian König" <christian.koenig@amd.com>
Cc: Xinhui Pan <Xinhui.Pan@amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index fd853dc843e9..128e086b4251 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -25,6 +25,8 @@
* Alex Deucher
* Jerome Glisse
*/
+
+#include <linux/aperture.h>
#include <linux/power_supply.h>
#include <linux/kthread.h>
#include <linux/module.h>
@@ -35,7 +37,6 @@
#include <linux/pci-p2pdma.h>
#include <linux/apple-gmux.h>
-#include <drm/drm_aperture.h>
#include <drm/drm_atomic_helper.h>
#include <drm/drm_crtc_helper.h>
#include <drm/drm_fb_helper.h>
@@ -4199,7 +4200,7 @@ int amdgpu_device_init(struct amdgpu_device *adev,
return r;
/* Get rid of things like offb */
- r = drm_aperture_remove_conflicting_pci_framebuffers(adev->pdev, &amdgpu_kms_driver);
+ r = aperture_remove_conflicting_pci_devices(adev->pdev, amdgpu_kms_driver.name);
if (r)
return r;
--
2.46.0
^ permalink raw reply related [flat|nested] 38+ messages in thread* [PATCH 02/28] drm/arm/hdlcd: Use video aperture helpers
2024-09-30 13:02 [PATCH 00/28] drm: Remove DRM aperture helpers Thomas Zimmermann
2024-09-30 13:02 ` [PATCH 01/28] drm/amdgpu: Use video " Thomas Zimmermann
@ 2024-09-30 13:03 ` Thomas Zimmermann
2024-10-02 13:48 ` Liviu Dudau
2024-09-30 13:03 ` [PATCH 03/28] drm/armada: " Thomas Zimmermann
` (27 subsequent siblings)
29 siblings, 1 reply; 38+ messages in thread
From: Thomas Zimmermann @ 2024-09-30 13:03 UTC (permalink / raw)
To: javierm, airlied, simona, maarten.lankhorst, mripard
Cc: dri-devel, amd-gfx, intel-gfx, intel-xe, Thomas Zimmermann,
Liviu Dudau
DRM's aperture functions have long been implemented as helpers
under drivers/video/ for use with fbdev. Avoid the DRM wrappers by
calling the video functions directly.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Liviu Dudau <liviu.dudau@arm.com>
---
drivers/gpu/drm/arm/hdlcd_drv.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/arm/hdlcd_drv.c b/drivers/gpu/drm/arm/hdlcd_drv.c
index f5d358f3893b..cd4389809d42 100644
--- a/drivers/gpu/drm/arm/hdlcd_drv.c
+++ b/drivers/gpu/drm/arm/hdlcd_drv.c
@@ -9,6 +9,7 @@
* ARM HDLCD Driver
*/
+#include <linux/aperture.h>
#include <linux/module.h>
#include <linux/spinlock.h>
#include <linux/clk.h>
@@ -21,7 +22,6 @@
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
-#include <drm/drm_aperture.h>
#include <drm/drm_atomic_helper.h>
#include <drm/drm_client_setup.h>
#include <drm/drm_crtc.h>
@@ -287,7 +287,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(&hdlcd_driver);
+ aperture_remove_all_conflicting_devices(hdlcd_driver.name);
}
drm_mode_config_reset(drm);
--
2.46.0
^ permalink raw reply related [flat|nested] 38+ messages in thread* Re: [PATCH 02/28] drm/arm/hdlcd: Use video aperture helpers
2024-09-30 13:03 ` [PATCH 02/28] drm/arm/hdlcd: " Thomas Zimmermann
@ 2024-10-02 13:48 ` Liviu Dudau
0 siblings, 0 replies; 38+ messages in thread
From: Liviu Dudau @ 2024-10-02 13:48 UTC (permalink / raw)
To: Thomas Zimmermann
Cc: javierm, airlied, simona, maarten.lankhorst, mripard, dri-devel,
amd-gfx, intel-gfx, intel-xe
On Mon, Sep 30, 2024 at 03:03:00PM +0200, Thomas Zimmermann wrote:
> DRM's aperture functions have long been implemented as helpers
> under drivers/video/ for use with fbdev. Avoid the DRM wrappers by
> calling the video functions directly.
>
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
> Cc: Liviu Dudau <liviu.dudau@arm.com>
Acked-by: Liviu Dudau <liviu.dudau@arm.com>
Best regards,
Liviu
> ---
> drivers/gpu/drm/arm/hdlcd_drv.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/arm/hdlcd_drv.c b/drivers/gpu/drm/arm/hdlcd_drv.c
> index f5d358f3893b..cd4389809d42 100644
> --- a/drivers/gpu/drm/arm/hdlcd_drv.c
> +++ b/drivers/gpu/drm/arm/hdlcd_drv.c
> @@ -9,6 +9,7 @@
> * ARM HDLCD Driver
> */
>
> +#include <linux/aperture.h>
> #include <linux/module.h>
> #include <linux/spinlock.h>
> #include <linux/clk.h>
> @@ -21,7 +22,6 @@
> #include <linux/platform_device.h>
> #include <linux/pm_runtime.h>
>
> -#include <drm/drm_aperture.h>
> #include <drm/drm_atomic_helper.h>
> #include <drm/drm_client_setup.h>
> #include <drm/drm_crtc.h>
> @@ -287,7 +287,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(&hdlcd_driver);
> + aperture_remove_all_conflicting_devices(hdlcd_driver.name);
> }
>
> drm_mode_config_reset(drm);
> --
> 2.46.0
>
--
====================
| I would like to |
| fix the world, |
| but they're not |
| giving me the |
\ source code! /
---------------
¯\_(ツ)_/¯
^ permalink raw reply [flat|nested] 38+ messages in thread
* [PATCH 03/28] drm/armada: Use video aperture helpers
2024-09-30 13:02 [PATCH 00/28] drm: Remove DRM aperture helpers Thomas Zimmermann
2024-09-30 13:02 ` [PATCH 01/28] drm/amdgpu: Use video " Thomas Zimmermann
2024-09-30 13:03 ` [PATCH 02/28] drm/arm/hdlcd: " Thomas Zimmermann
@ 2024-09-30 13:03 ` Thomas Zimmermann
2024-09-30 13:03 ` [PATCH 04/28] drm/ast: " Thomas Zimmermann
` (26 subsequent siblings)
29 siblings, 0 replies; 38+ messages in thread
From: Thomas Zimmermann @ 2024-09-30 13:03 UTC (permalink / raw)
To: javierm, airlied, simona, maarten.lankhorst, mripard
Cc: dri-devel, amd-gfx, intel-gfx, intel-xe, Thomas Zimmermann,
Russell King
DRM's aperture functions have long been implemented as helpers
under drivers/video/ for use with fbdev. Avoid the DRM wrappers by
calling the video functions directly.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Russell King <linux@armlinux.org.uk>
---
drivers/gpu/drm/armada/armada_drv.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/armada/armada_drv.c b/drivers/gpu/drm/armada/armada_drv.c
index 3dc5f0499e4c..5c26f0409478 100644
--- a/drivers/gpu/drm/armada/armada_drv.c
+++ b/drivers/gpu/drm/armada/armada_drv.c
@@ -3,6 +3,7 @@
* Copyright (C) 2012 Russell King
*/
+#include <linux/aperture.h>
#include <linux/clk.h>
#include <linux/component.h>
#include <linux/module.h>
@@ -10,7 +11,6 @@
#include <linux/of_graph.h>
#include <linux/platform_device.h>
-#include <drm/drm_aperture.h>
#include <drm/drm_atomic_helper.h>
#include <drm/drm_client_setup.h>
#include <drm/drm_drv.h>
@@ -93,7 +93,7 @@ static int armada_drm_bind(struct device *dev)
}
/* Remove early framebuffers */
- ret = drm_aperture_remove_framebuffers(&armada_drm_driver);
+ ret = aperture_remove_all_conflicting_devices(armada_drm_driver.name);
if (ret) {
dev_err(dev, "[" DRM_NAME ":%s] can't kick out simple-fb: %d\n",
__func__, ret);
--
2.46.0
^ permalink raw reply related [flat|nested] 38+ messages in thread* [PATCH 04/28] drm/ast: Use video aperture helpers
2024-09-30 13:02 [PATCH 00/28] drm: Remove DRM aperture helpers Thomas Zimmermann
` (2 preceding siblings ...)
2024-09-30 13:03 ` [PATCH 03/28] drm/armada: " Thomas Zimmermann
@ 2024-09-30 13:03 ` Thomas Zimmermann
2024-09-30 13:03 ` [PATCH 05/28] drm/hisilicon/hibmc: " Thomas Zimmermann
` (25 subsequent siblings)
29 siblings, 0 replies; 38+ messages in thread
From: Thomas Zimmermann @ 2024-09-30 13:03 UTC (permalink / raw)
To: javierm, airlied, simona, maarten.lankhorst, mripard
Cc: dri-devel, amd-gfx, intel-gfx, intel-xe, Thomas Zimmermann,
Dave Airlie, Jocelyn Falempe
DRM's aperture functions have long been implemented as helpers
under drivers/video/ for use with fbdev. Avoid the DRM wrappers by
calling the video functions directly.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Dave Airlie <airlied@redhat.com>
Cc: Jocelyn Falempe <jfalempe@redhat.com>
---
drivers/gpu/drm/ast/ast_drv.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/ast/ast_drv.c b/drivers/gpu/drm/ast/ast_drv.c
index 898c8b93c0b1..4afe4be072ef 100644
--- a/drivers/gpu/drm/ast/ast_drv.c
+++ b/drivers/gpu/drm/ast/ast_drv.c
@@ -26,11 +26,11 @@
* Authors: Dave Airlie <airlied@redhat.com>
*/
+#include <linux/aperture.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/pci.h>
-#include <drm/drm_aperture.h>
#include <drm/drm_atomic_helper.h>
#include <drm/drm_client_setup.h>
#include <drm/drm_drv.h>
@@ -281,7 +281,7 @@ static int ast_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
struct drm_device *drm;
bool need_post = false;
- ret = drm_aperture_remove_conflicting_pci_framebuffers(pdev, &ast_driver);
+ ret = aperture_remove_conflicting_pci_devices(pdev, ast_driver.name);
if (ret)
return ret;
--
2.46.0
^ permalink raw reply related [flat|nested] 38+ messages in thread* [PATCH 05/28] drm/hisilicon/hibmc: Use video aperture helpers
2024-09-30 13:02 [PATCH 00/28] drm: Remove DRM aperture helpers Thomas Zimmermann
` (3 preceding siblings ...)
2024-09-30 13:03 ` [PATCH 04/28] drm/ast: " Thomas Zimmermann
@ 2024-09-30 13:03 ` Thomas Zimmermann
2024-09-30 13:03 ` [PATCH 06/28] drm/hyperv-drm: " Thomas Zimmermann
` (24 subsequent siblings)
29 siblings, 0 replies; 38+ messages in thread
From: Thomas Zimmermann @ 2024-09-30 13:03 UTC (permalink / raw)
To: javierm, airlied, simona, maarten.lankhorst, mripard
Cc: dri-devel, amd-gfx, intel-gfx, intel-xe, Thomas Zimmermann,
Xinliang Liu, Tian Tao, Xinwei Kong, Sumit Semwal, Yongqin Liu,
John Stultz
DRM's aperture functions have long been implemented as helpers
under drivers/video/ for use with fbdev. Avoid the DRM wrappers by
calling the video functions directly.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Xinliang Liu <xinliang.liu@linaro.org>
Cc: Tian Tao <tiantao6@hisilicon.com>
Cc: Xinwei Kong <kong.kongxinwei@hisilicon.com>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: Yongqin Liu <yongqin.liu@linaro.org>
Cc: John Stultz <jstultz@google.com>
---
drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
index 866a9ecaf8b9..8c488c98ac97 100644
--- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
+++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
@@ -11,10 +11,10 @@
* Jianhua Li <lijianhua@huawei.com>
*/
+#include <linux/aperture.h>
#include <linux/module.h>
#include <linux/pci.h>
-#include <drm/drm_aperture.h>
#include <drm/drm_atomic_helper.h>
#include <drm/drm_client_setup.h>
#include <drm/drm_drv.h>
@@ -308,7 +308,7 @@ static int hibmc_pci_probe(struct pci_dev *pdev,
struct drm_device *dev;
int ret;
- ret = drm_aperture_remove_conflicting_pci_framebuffers(pdev, &hibmc_driver);
+ ret = aperture_remove_conflicting_pci_devices(pdev, hibmc_driver.name);
if (ret)
return ret;
--
2.46.0
^ permalink raw reply related [flat|nested] 38+ messages in thread* [PATCH 06/28] drm/hyperv-drm: Use video aperture helpers
2024-09-30 13:02 [PATCH 00/28] drm: Remove DRM aperture helpers Thomas Zimmermann
` (4 preceding siblings ...)
2024-09-30 13:03 ` [PATCH 05/28] drm/hisilicon/hibmc: " Thomas Zimmermann
@ 2024-09-30 13:03 ` Thomas Zimmermann
2024-09-30 16:22 ` Deepak Rawat
2024-09-30 13:03 ` [PATCH 07/28] drm/i915: " Thomas Zimmermann
` (23 subsequent siblings)
29 siblings, 1 reply; 38+ messages in thread
From: Thomas Zimmermann @ 2024-09-30 13:03 UTC (permalink / raw)
To: javierm, airlied, simona, maarten.lankhorst, mripard
Cc: dri-devel, amd-gfx, intel-gfx, intel-xe, Thomas Zimmermann,
Deepak Rawat
DRM's aperture functions have long been implemented as helpers
under drivers/video/ for use with fbdev. Avoid the DRM wrappers by
calling the video functions directly.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Deepak Rawat <drawat.floss@gmail.com>
---
drivers/gpu/drm/hyperv/hyperv_drm_drv.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/hyperv/hyperv_drm_drv.c b/drivers/gpu/drm/hyperv/hyperv_drm_drv.c
index 3077ce5470f6..e0953777a206 100644
--- a/drivers/gpu/drm/hyperv/hyperv_drm_drv.c
+++ b/drivers/gpu/drm/hyperv/hyperv_drm_drv.c
@@ -3,12 +3,12 @@
* Copyright 2021 Microsoft
*/
+#include <linux/aperture.h>
#include <linux/efi.h>
#include <linux/hyperv.h>
#include <linux/module.h>
#include <linux/pci.h>
-#include <drm/drm_aperture.h>
#include <drm/drm_atomic_helper.h>
#include <drm/drm_client_setup.h>
#include <drm/drm_drv.h>
@@ -126,7 +126,7 @@ static int hyperv_vmbus_probe(struct hv_device *hdev,
goto err_hv_set_drv_data;
}
- drm_aperture_remove_framebuffers(&hyperv_driver);
+ aperture_remove_all_conflicting_devices(hyperv_driver.name);
ret = hyperv_setup_vram(hv, hdev);
if (ret)
--
2.46.0
^ permalink raw reply related [flat|nested] 38+ messages in thread* Re: [PATCH 06/28] drm/hyperv-drm: Use video aperture helpers
2024-09-30 13:03 ` [PATCH 06/28] drm/hyperv-drm: " Thomas Zimmermann
@ 2024-09-30 16:22 ` Deepak Rawat
0 siblings, 0 replies; 38+ messages in thread
From: Deepak Rawat @ 2024-09-30 16:22 UTC (permalink / raw)
To: Thomas Zimmermann
Cc: javierm, airlied, simona, maarten.lankhorst, mripard, dri-devel,
amd-gfx, intel-gfx, intel-xe
On Mon, Sep 30, 2024 at 6:09 AM Thomas Zimmermann <tzimmermann@suse.de> wrote:
>
> DRM's aperture functions have long been implemented as helpers
> under drivers/video/ for use with fbdev. Avoid the DRM wrappers by
> calling the video functions directly.
>
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
> Cc: Deepak Rawat <drawat.floss@gmail.com>
> ---
> drivers/gpu/drm/hyperv/hyperv_drm_drv.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/hyperv/hyperv_drm_drv.c b/drivers/gpu/drm/hyperv/hyperv_drm_drv.c
> index 3077ce5470f6..e0953777a206 100644
> --- a/drivers/gpu/drm/hyperv/hyperv_drm_drv.c
> +++ b/drivers/gpu/drm/hyperv/hyperv_drm_drv.c
> @@ -3,12 +3,12 @@
> * Copyright 2021 Microsoft
> */
>
> +#include <linux/aperture.h>
> #include <linux/efi.h>
> #include <linux/hyperv.h>
> #include <linux/module.h>
> #include <linux/pci.h>
>
> -#include <drm/drm_aperture.h>
> #include <drm/drm_atomic_helper.h>
> #include <drm/drm_client_setup.h>
> #include <drm/drm_drv.h>
> @@ -126,7 +126,7 @@ static int hyperv_vmbus_probe(struct hv_device *hdev,
> goto err_hv_set_drv_data;
> }
>
> - drm_aperture_remove_framebuffers(&hyperv_driver);
> + aperture_remove_all_conflicting_devices(hyperv_driver.name);
>
> ret = hyperv_setup_vram(hv, hdev);
> if (ret)
> --
> 2.46.0
>
Reviewed-by: Deepak Rawat <drawat.floss@gmail.com>
^ permalink raw reply [flat|nested] 38+ messages in thread
* [PATCH 07/28] drm/i915: Use video aperture helpers
2024-09-30 13:02 [PATCH 00/28] drm: Remove DRM aperture helpers Thomas Zimmermann
` (5 preceding siblings ...)
2024-09-30 13:03 ` [PATCH 06/28] drm/hyperv-drm: " Thomas Zimmermann
@ 2024-09-30 13:03 ` Thomas Zimmermann
2024-10-02 11:54 ` Jani Nikula
2024-09-30 13:03 ` [PATCH 08/28] drm/loongson: " Thomas Zimmermann
` (22 subsequent siblings)
29 siblings, 1 reply; 38+ messages in thread
From: Thomas Zimmermann @ 2024-09-30 13:03 UTC (permalink / raw)
To: javierm, airlied, simona, maarten.lankhorst, mripard
Cc: dri-devel, amd-gfx, intel-gfx, intel-xe, Thomas Zimmermann,
Jani Nikula, Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin
DRM's aperture functions have long been implemented as helpers
under drivers/video/ for use with fbdev. Avoid the DRM wrappers by
calling the video functions directly.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Tvrtko Ursulin <tursulin@ursulin.net>
---
drivers/gpu/drm/i915/i915_driver.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_driver.c b/drivers/gpu/drm/i915/i915_driver.c
index b3eb35fa5ff8..365329ff8a07 100644
--- a/drivers/gpu/drm/i915/i915_driver.c
+++ b/drivers/gpu/drm/i915/i915_driver.c
@@ -27,6 +27,7 @@
*
*/
+#include <linux/aperture.h>
#include <linux/acpi.h>
#include <linux/device.h>
#include <linux/module.h>
@@ -39,7 +40,6 @@
#include <linux/vga_switcheroo.h>
#include <linux/vt.h>
-#include <drm/drm_aperture.h>
#include <drm/drm_atomic_helper.h>
#include <drm/drm_ioctl.h>
#include <drm/drm_managed.h>
@@ -485,7 +485,7 @@ static int i915_driver_hw_probe(struct drm_i915_private *dev_priv)
if (ret)
goto err_perf;
- ret = drm_aperture_remove_conflicting_pci_framebuffers(pdev, dev_priv->drm.driver);
+ ret = aperture_remove_conflicting_pci_devices(pdev, dev_priv->drm.driver->name);
if (ret)
goto err_ggtt;
--
2.46.0
^ permalink raw reply related [flat|nested] 38+ messages in thread* Re: [PATCH 07/28] drm/i915: Use video aperture helpers
2024-09-30 13:03 ` [PATCH 07/28] drm/i915: " Thomas Zimmermann
@ 2024-10-02 11:54 ` Jani Nikula
0 siblings, 0 replies; 38+ messages in thread
From: Jani Nikula @ 2024-10-02 11:54 UTC (permalink / raw)
To: Thomas Zimmermann, javierm, airlied, simona, maarten.lankhorst,
mripard
Cc: dri-devel, amd-gfx, intel-gfx, intel-xe, Thomas Zimmermann,
Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin
On Mon, 30 Sep 2024, Thomas Zimmermann <tzimmermann@suse.de> wrote:
> DRM's aperture functions have long been implemented as helpers
> under drivers/video/ for use with fbdev. Avoid the DRM wrappers by
> calling the video functions directly.
>
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
> Cc: Jani Nikula <jani.nikula@linux.intel.com>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Cc: Tvrtko Ursulin <tursulin@ursulin.net>
Acked-by: Jani Nikula <jani.nikula@intel.com>
> ---
> drivers/gpu/drm/i915/i915_driver.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_driver.c b/drivers/gpu/drm/i915/i915_driver.c
> index b3eb35fa5ff8..365329ff8a07 100644
> --- a/drivers/gpu/drm/i915/i915_driver.c
> +++ b/drivers/gpu/drm/i915/i915_driver.c
> @@ -27,6 +27,7 @@
> *
> */
>
> +#include <linux/aperture.h>
> #include <linux/acpi.h>
> #include <linux/device.h>
> #include <linux/module.h>
> @@ -39,7 +40,6 @@
> #include <linux/vga_switcheroo.h>
> #include <linux/vt.h>
>
> -#include <drm/drm_aperture.h>
> #include <drm/drm_atomic_helper.h>
> #include <drm/drm_ioctl.h>
> #include <drm/drm_managed.h>
> @@ -485,7 +485,7 @@ static int i915_driver_hw_probe(struct drm_i915_private *dev_priv)
> if (ret)
> goto err_perf;
>
> - ret = drm_aperture_remove_conflicting_pci_framebuffers(pdev, dev_priv->drm.driver);
> + ret = aperture_remove_conflicting_pci_devices(pdev, dev_priv->drm.driver->name);
> if (ret)
> goto err_ggtt;
--
Jani Nikula, Intel
^ permalink raw reply [flat|nested] 38+ messages in thread
* [PATCH 08/28] drm/loongson: Use video aperture helpers
2024-09-30 13:02 [PATCH 00/28] drm: Remove DRM aperture helpers Thomas Zimmermann
` (6 preceding siblings ...)
2024-09-30 13:03 ` [PATCH 07/28] drm/i915: " Thomas Zimmermann
@ 2024-09-30 13:03 ` Thomas Zimmermann
2024-10-04 9:01 ` Sui Jingfeng
2024-09-30 13:03 ` [PATCH 09/28] drm/meson: " Thomas Zimmermann
` (21 subsequent siblings)
29 siblings, 1 reply; 38+ messages in thread
From: Thomas Zimmermann @ 2024-09-30 13:03 UTC (permalink / raw)
To: javierm, airlied, simona, maarten.lankhorst, mripard
Cc: dri-devel, amd-gfx, intel-gfx, intel-xe, Thomas Zimmermann,
Sui Jingfeng
DRM's aperture functions have long been implemented as helpers
under drivers/video/ for use with fbdev. Avoid the DRM wrappers by
calling the video functions directly.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Sui Jingfeng <suijingfeng@loongson.cn>
---
drivers/gpu/drm/loongson/lsdc_drv.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/loongson/lsdc_drv.c b/drivers/gpu/drm/loongson/lsdc_drv.c
index a19dce35c839..b350bdcf1645 100644
--- a/drivers/gpu/drm/loongson/lsdc_drv.c
+++ b/drivers/gpu/drm/loongson/lsdc_drv.c
@@ -3,10 +3,10 @@
* Copyright (C) 2023 Loongson Technology Corporation Limited
*/
+#include <linux/aperture.h>
#include <linux/pci.h>
#include <linux/vgaarb.h>
-#include <drm/drm_aperture.h>
#include <drm/drm_atomic.h>
#include <drm/drm_atomic_helper.h>
#include <drm/drm_client_setup.h>
@@ -215,9 +215,9 @@ lsdc_create_device(struct pci_dev *pdev,
return ERR_PTR(ret);
}
- ret = drm_aperture_remove_conflicting_framebuffers(ldev->vram_base,
- ldev->vram_size,
- driver);
+ ret = aperture_remove_conflicting_devices(ldev->vram_base,
+ ldev->vram_size,
+ driver->name);
if (ret) {
drm_err(ddev, "Remove firmware framebuffers failed: %d\n", ret);
return ERR_PTR(ret);
--
2.46.0
^ permalink raw reply related [flat|nested] 38+ messages in thread* Re: [PATCH 08/28] drm/loongson: Use video aperture helpers
2024-09-30 13:03 ` [PATCH 08/28] drm/loongson: " Thomas Zimmermann
@ 2024-10-04 9:01 ` Sui Jingfeng
0 siblings, 0 replies; 38+ messages in thread
From: Sui Jingfeng @ 2024-10-04 9:01 UTC (permalink / raw)
To: Thomas Zimmermann, javierm, airlied, simona, maarten.lankhorst,
mripard
Cc: dri-devel, amd-gfx, intel-gfx, intel-xe
Hi,
On 2024/9/30 21:03, Thomas Zimmermann wrote:
> DRM's aperture functions have long been implemented as helpers
> under drivers/video/ for use with fbdev. Avoid the DRM wrappers by
> calling the video functions directly.
Okay!
Sometimes the aperture_remove_conflicting_devices() is more easier
to use, as it doesn't need direct reference to the struct drm_driver.
The third argument of aperture_remove_conflicting_devices() does not
get used, so we can actually pass a casual string.
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
> Cc: Sui Jingfeng <suijingfeng@loongson.cn>
Acked-by: Sui Jingfeng <sui.jingfeng@linux.dev>
> ---
> drivers/gpu/drm/loongson/lsdc_drv.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/loongson/lsdc_drv.c b/drivers/gpu/drm/loongson/lsdc_drv.c
> index a19dce35c839..b350bdcf1645 100644
> --- a/drivers/gpu/drm/loongson/lsdc_drv.c
> +++ b/drivers/gpu/drm/loongson/lsdc_drv.c
> @@ -3,10 +3,10 @@
> * Copyright (C) 2023 Loongson Technology Corporation Limited
> */
>
> +#include <linux/aperture.h>
> #include <linux/pci.h>
> #include <linux/vgaarb.h>
>
> -#include <drm/drm_aperture.h>
> #include <drm/drm_atomic.h>
> #include <drm/drm_atomic_helper.h>
> #include <drm/drm_client_setup.h>
> @@ -215,9 +215,9 @@ lsdc_create_device(struct pci_dev *pdev,
> return ERR_PTR(ret);
> }
>
> - ret = drm_aperture_remove_conflicting_framebuffers(ldev->vram_base,
> - ldev->vram_size,
> - driver);
> + ret = aperture_remove_conflicting_devices(ldev->vram_base,
> + ldev->vram_size,
> + driver->name);
> if (ret) {
> drm_err(ddev, "Remove firmware framebuffers failed: %d\n", ret);
> return ERR_PTR(ret);
--
Best regards,
Sui
^ permalink raw reply [flat|nested] 38+ messages in thread
* [PATCH 09/28] drm/meson: Use video aperture helpers
2024-09-30 13:02 [PATCH 00/28] drm: Remove DRM aperture helpers Thomas Zimmermann
` (7 preceding siblings ...)
2024-09-30 13:03 ` [PATCH 08/28] drm/loongson: " Thomas Zimmermann
@ 2024-09-30 13:03 ` Thomas Zimmermann
2024-09-30 13:16 ` Neil Armstrong
2024-09-30 13:03 ` [PATCH 10/28] drm/mgag200: " Thomas Zimmermann
` (20 subsequent siblings)
29 siblings, 1 reply; 38+ messages in thread
From: Thomas Zimmermann @ 2024-09-30 13:03 UTC (permalink / raw)
To: javierm, airlied, simona, maarten.lankhorst, mripard
Cc: dri-devel, amd-gfx, intel-gfx, intel-xe, Thomas Zimmermann,
Neil Armstrong, Kevin Hilman, Jerome Brunet, Martin Blumenstingl
DRM's aperture functions have long been implemented as helpers
under drivers/video/ for use with fbdev. Avoid the DRM wrappers by
calling the video functions directly.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
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>
---
drivers/gpu/drm/meson/meson_drv.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/meson/meson_drv.c b/drivers/gpu/drm/meson/meson_drv.c
index 2f76f48da38d..bbb662d2f184 100644
--- a/drivers/gpu/drm/meson/meson_drv.c
+++ b/drivers/gpu/drm/meson/meson_drv.c
@@ -8,6 +8,7 @@
* Jasper St. Pierre <jstpierre@mecheye.net>
*/
+#include <linux/aperture.h>
#include <linux/component.h>
#include <linux/module.h>
#include <linux/of_graph.h>
@@ -15,7 +16,6 @@
#include <linux/platform_device.h>
#include <linux/soc/amlogic/meson-canvas.h>
-#include <drm/drm_aperture.h>
#include <drm/drm_atomic_helper.h>
#include <drm/drm_client_setup.h>
#include <drm/drm_drv.h>
@@ -279,7 +279,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
*/
- ret = drm_aperture_remove_framebuffers(&meson_driver);
+ ret = aperture_remove_all_conflicting_devices(meson_driver.name);
if (ret)
goto free_canvas_vd1_2;
--
2.46.0
^ permalink raw reply related [flat|nested] 38+ messages in thread* Re: [PATCH 09/28] drm/meson: Use video aperture helpers
2024-09-30 13:03 ` [PATCH 09/28] drm/meson: " Thomas Zimmermann
@ 2024-09-30 13:16 ` Neil Armstrong
0 siblings, 0 replies; 38+ messages in thread
From: Neil Armstrong @ 2024-09-30 13:16 UTC (permalink / raw)
To: Thomas Zimmermann, javierm, airlied, simona, maarten.lankhorst,
mripard
Cc: dri-devel, amd-gfx, intel-gfx, intel-xe, Kevin Hilman,
Jerome Brunet, Martin Blumenstingl
On 30/09/2024 15:03, Thomas Zimmermann wrote:
> DRM's aperture functions have long been implemented as helpers
> under drivers/video/ for use with fbdev. Avoid the DRM wrappers by
> calling the video functions directly.
>
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
> 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>
> ---
> drivers/gpu/drm/meson/meson_drv.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/meson/meson_drv.c b/drivers/gpu/drm/meson/meson_drv.c
> index 2f76f48da38d..bbb662d2f184 100644
> --- a/drivers/gpu/drm/meson/meson_drv.c
> +++ b/drivers/gpu/drm/meson/meson_drv.c
> @@ -8,6 +8,7 @@
> * Jasper St. Pierre <jstpierre@mecheye.net>
> */
>
> +#include <linux/aperture.h>
> #include <linux/component.h>
> #include <linux/module.h>
> #include <linux/of_graph.h>
> @@ -15,7 +16,6 @@
> #include <linux/platform_device.h>
> #include <linux/soc/amlogic/meson-canvas.h>
>
> -#include <drm/drm_aperture.h>
> #include <drm/drm_atomic_helper.h>
> #include <drm/drm_client_setup.h>
> #include <drm/drm_drv.h>
> @@ -279,7 +279,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
> */
> - ret = drm_aperture_remove_framebuffers(&meson_driver);
> + ret = aperture_remove_all_conflicting_devices(meson_driver.name);
> if (ret)
> goto free_canvas_vd1_2;
>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
^ permalink raw reply [flat|nested] 38+ messages in thread
* [PATCH 10/28] drm/mgag200: Use video aperture helpers
2024-09-30 13:02 [PATCH 00/28] drm: Remove DRM aperture helpers Thomas Zimmermann
` (8 preceding siblings ...)
2024-09-30 13:03 ` [PATCH 09/28] drm/meson: " Thomas Zimmermann
@ 2024-09-30 13:03 ` Thomas Zimmermann
2024-09-30 13:03 ` [PATCH 11/28] drm/msm: " Thomas Zimmermann
` (19 subsequent siblings)
29 siblings, 0 replies; 38+ messages in thread
From: Thomas Zimmermann @ 2024-09-30 13:03 UTC (permalink / raw)
To: javierm, airlied, simona, maarten.lankhorst, mripard
Cc: dri-devel, amd-gfx, intel-gfx, intel-xe, Thomas Zimmermann,
Dave Airlie, Jocelyn Falempe
DRM's aperture functions have long been implemented as helpers
under drivers/video/ for use with fbdev. Avoid the DRM wrappers by
calling the video functions directly.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Dave Airlie <airlied@redhat.com>
Cc: Jocelyn Falempe <jfalempe@redhat.com>
---
drivers/gpu/drm/mgag200/mgag200_drv.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/mgag200/mgag200_drv.c b/drivers/gpu/drm/mgag200/mgag200_drv.c
index 29087e2398df..42fabe817e21 100644
--- a/drivers/gpu/drm/mgag200/mgag200_drv.c
+++ b/drivers/gpu/drm/mgag200/mgag200_drv.c
@@ -6,10 +6,10 @@
* Dave Airlie
*/
+#include <linux/aperture.h>
#include <linux/module.h>
#include <linux/pci.h>
-#include <drm/drm_aperture.h>
#include <drm/drm_atomic_helper.h>
#include <drm/drm_client_setup.h>
#include <drm/drm_drv.h>
@@ -266,7 +266,7 @@ mgag200_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
struct drm_device *dev;
int ret;
- ret = drm_aperture_remove_conflicting_pci_framebuffers(pdev, &mgag200_driver);
+ ret = aperture_remove_conflicting_pci_devices(pdev, mgag200_driver.name);
if (ret)
return ret;
--
2.46.0
^ permalink raw reply related [flat|nested] 38+ messages in thread* [PATCH 11/28] drm/msm: Use video aperture helpers
2024-09-30 13:02 [PATCH 00/28] drm: Remove DRM aperture helpers Thomas Zimmermann
` (9 preceding siblings ...)
2024-09-30 13:03 ` [PATCH 10/28] drm/mgag200: " Thomas Zimmermann
@ 2024-09-30 13:03 ` Thomas Zimmermann
2024-10-19 13:52 ` Dmitry Baryshkov
2024-09-30 13:03 ` [PATCH 12/28] drm/nouveau: " Thomas Zimmermann
` (18 subsequent siblings)
29 siblings, 1 reply; 38+ messages in thread
From: Thomas Zimmermann @ 2024-09-30 13:03 UTC (permalink / raw)
To: javierm, airlied, simona, maarten.lankhorst, mripard
Cc: dri-devel, amd-gfx, intel-gfx, intel-xe, Thomas Zimmermann,
Rob Clark, Abhinav Kumar, Dmitry Baryshkov, Sean Paul,
Marijn Suijten
DRM's aperture functions have long been implemented as helpers
under drivers/video/ for use with fbdev. Avoid the DRM wrappers by
calling the video functions directly.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Rob Clark <robdclark@gmail.com>
Cc: Abhinav Kumar <quic_abhinavk@quicinc.com>
Cc: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Cc: Sean Paul <sean@poorly.run>
Cc: Marijn Suijten <marijn.suijten@somainline.org>
---
drivers/gpu/drm/msm/msm_kms.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/msm/msm_kms.c b/drivers/gpu/drm/msm/msm_kms.c
index af6a6fcb1173..f3326d09bdbc 100644
--- a/drivers/gpu/drm/msm/msm_kms.c
+++ b/drivers/gpu/drm/msm/msm_kms.c
@@ -5,11 +5,11 @@
* Author: Rob Clark <robdclark@gmail.com>
*/
+#include <linux/aperture.h>
#include <linux/kthread.h>
#include <linux/sched/mm.h>
#include <uapi/linux/sched/types.h>
-#include <drm/drm_aperture.h>
#include <drm/drm_drv.h>
#include <drm/drm_mode_config.h>
#include <drm/drm_vblank.h>
@@ -237,7 +237,7 @@ int msm_drm_kms_init(struct device *dev, const struct drm_driver *drv)
int ret;
/* the fw fb could be anywhere in memory */
- ret = drm_aperture_remove_framebuffers(drv);
+ ret = aperture_remove_all_conflicting_devices(drv->name);
if (ret)
return ret;
--
2.46.0
^ permalink raw reply related [flat|nested] 38+ messages in thread* Re: [PATCH 11/28] drm/msm: Use video aperture helpers
2024-09-30 13:03 ` [PATCH 11/28] drm/msm: " Thomas Zimmermann
@ 2024-10-19 13:52 ` Dmitry Baryshkov
0 siblings, 0 replies; 38+ messages in thread
From: Dmitry Baryshkov @ 2024-10-19 13:52 UTC (permalink / raw)
To: Thomas Zimmermann
Cc: javierm, airlied, simona, maarten.lankhorst, mripard, dri-devel,
amd-gfx, intel-gfx, intel-xe, Rob Clark, Abhinav Kumar, Sean Paul,
Marijn Suijten
On Mon, Sep 30, 2024 at 03:03:09PM +0200, Thomas Zimmermann wrote:
> DRM's aperture functions have long been implemented as helpers
> under drivers/video/ for use with fbdev. Avoid the DRM wrappers by
> calling the video functions directly.
>
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
> Cc: Rob Clark <robdclark@gmail.com>
> Cc: Abhinav Kumar <quic_abhinavk@quicinc.com>
> Cc: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> Cc: Sean Paul <sean@poorly.run>
> Cc: Marijn Suijten <marijn.suijten@somainline.org>
> ---
> drivers/gpu/drm/msm/msm_kms.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 38+ messages in thread
* [PATCH 12/28] drm/nouveau: Use video aperture helpers
2024-09-30 13:02 [PATCH 00/28] drm: Remove DRM aperture helpers Thomas Zimmermann
` (10 preceding siblings ...)
2024-09-30 13:03 ` [PATCH 11/28] drm/msm: " Thomas Zimmermann
@ 2024-09-30 13:03 ` Thomas Zimmermann
2024-09-30 13:03 ` [PATCH 13/28] drm/ofdrm: " Thomas Zimmermann
` (17 subsequent siblings)
29 siblings, 0 replies; 38+ messages in thread
From: Thomas Zimmermann @ 2024-09-30 13:03 UTC (permalink / raw)
To: javierm, airlied, simona, maarten.lankhorst, mripard
Cc: dri-devel, amd-gfx, intel-gfx, intel-xe, Thomas Zimmermann,
Karol Herbst, Lyude Paul, Danilo Krummrich
DRM's aperture functions have long been implemented as helpers
under drivers/video/ for use with fbdev. Avoid the DRM wrappers by
calling the video functions directly.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Karol Herbst <kherbst@redhat.com>
Cc: Lyude Paul <lyude@redhat.com>
Cc: Danilo Krummrich <dakr@redhat.com>
---
drivers/gpu/drm/nouveau/nouveau_drm.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c
index 84d692d68817..02dd179a2f31 100644
--- a/drivers/gpu/drm/nouveau/nouveau_drm.c
+++ b/drivers/gpu/drm/nouveau/nouveau_drm.c
@@ -22,6 +22,7 @@
* Authors: Ben Skeggs
*/
+#include <linux/aperture.h>
#include <linux/delay.h>
#include <linux/module.h>
#include <linux/pci.h>
@@ -30,7 +31,6 @@
#include <linux/mmu_notifier.h>
#include <linux/dynamic_debug.h>
-#include <drm/drm_aperture.h>
#include <drm/drm_client_setup.h>
#include <drm/drm_drv.h>
#include <drm/drm_fbdev_ttm.h>
@@ -851,7 +851,7 @@ static int nouveau_drm_probe(struct pci_dev *pdev,
return ret;
/* Remove conflicting drivers (vesafb, efifb etc). */
- ret = drm_aperture_remove_conflicting_pci_framebuffers(pdev, &driver_pci);
+ ret = aperture_remove_conflicting_pci_devices(pdev, driver_pci.name);
if (ret)
return ret;
--
2.46.0
^ permalink raw reply related [flat|nested] 38+ messages in thread* [PATCH 13/28] drm/ofdrm: Use video aperture helpers
2024-09-30 13:02 [PATCH 00/28] drm: Remove DRM aperture helpers Thomas Zimmermann
` (11 preceding siblings ...)
2024-09-30 13:03 ` [PATCH 12/28] drm/nouveau: " Thomas Zimmermann
@ 2024-09-30 13:03 ` Thomas Zimmermann
2024-09-30 13:03 ` [PATCH 14/28] drm/qxl: " Thomas Zimmermann
` (16 subsequent siblings)
29 siblings, 0 replies; 38+ messages in thread
From: Thomas Zimmermann @ 2024-09-30 13:03 UTC (permalink / raw)
To: javierm, airlied, simona, maarten.lankhorst, mripard
Cc: dri-devel, amd-gfx, intel-gfx, intel-xe, Thomas Zimmermann
DRM's aperture functions have long been implemented as helpers
under drivers/video/ for use with fbdev. Avoid the DRM wrappers by
calling the video functions directly.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Javier Martinez Canillas <javierm@redhat.com>
---
drivers/gpu/drm/tiny/ofdrm.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/tiny/ofdrm.c b/drivers/gpu/drm/tiny/ofdrm.c
index 04ffa93de44a..220c1244b3c0 100644
--- a/drivers/gpu/drm/tiny/ofdrm.c
+++ b/drivers/gpu/drm/tiny/ofdrm.c
@@ -1,10 +1,10 @@
// SPDX-License-Identifier: GPL-2.0-only
+#include <linux/aperture.h>
#include <linux/of_address.h>
#include <linux/pci.h>
#include <linux/platform_device.h>
-#include <drm/drm_aperture.h>
#include <drm/drm_atomic.h>
#include <drm/drm_atomic_state_helper.h>
#include <drm/drm_client_setup.h>
@@ -1220,7 +1220,7 @@ static struct ofdrm_device *ofdrm_device_create(struct drm_driver *drv,
fb_pgbase = round_down(fb_base, PAGE_SIZE);
fb_pgsize = fb_base - fb_pgbase + round_up(fb_size, PAGE_SIZE);
- ret = devm_aperture_acquire_from_firmware(dev, fb_pgbase, fb_pgsize);
+ ret = devm_aperture_acquire_for_platform_device(pdev, fb_pgbase, fb_pgsize);
if (ret) {
drm_err(dev, "could not acquire memory range %pr: error %d\n", &res, ret);
return ERR_PTR(ret);
--
2.46.0
^ permalink raw reply related [flat|nested] 38+ messages in thread* [PATCH 14/28] drm/qxl: Use video aperture helpers
2024-09-30 13:02 [PATCH 00/28] drm: Remove DRM aperture helpers Thomas Zimmermann
` (12 preceding siblings ...)
2024-09-30 13:03 ` [PATCH 13/28] drm/ofdrm: " Thomas Zimmermann
@ 2024-09-30 13:03 ` Thomas Zimmermann
2024-09-30 13:03 ` [PATCH 15/28] drm/radeon: " Thomas Zimmermann
` (15 subsequent siblings)
29 siblings, 0 replies; 38+ messages in thread
From: Thomas Zimmermann @ 2024-09-30 13:03 UTC (permalink / raw)
To: javierm, airlied, simona, maarten.lankhorst, mripard
Cc: dri-devel, amd-gfx, intel-gfx, intel-xe, Thomas Zimmermann,
Dave Airlie, Gerd Hoffmann
DRM's aperture functions have long been implemented as helpers
under drivers/video/ for use with fbdev. Avoid the DRM wrappers by
calling the video functions directly.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Dave Airlie <airlied@redhat.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
---
drivers/gpu/drm/qxl/qxl_drv.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/qxl/qxl_drv.c b/drivers/gpu/drm/qxl/qxl_drv.c
index 4ef1c134d6dd..21f752644242 100644
--- a/drivers/gpu/drm/qxl/qxl_drv.c
+++ b/drivers/gpu/drm/qxl/qxl_drv.c
@@ -29,12 +29,12 @@
#include "qxl_drv.h"
+#include <linux/aperture.h>
#include <linux/module.h>
#include <linux/pci.h>
#include <linux/vgaarb.h>
#include <drm/drm.h>
-#include <drm/drm_aperture.h>
#include <drm/drm_atomic_helper.h>
#include <drm/drm_client_setup.h>
#include <drm/drm_drv.h>
@@ -92,7 +92,7 @@ qxl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
if (ret)
return ret;
- ret = drm_aperture_remove_conflicting_pci_framebuffers(pdev, &qxl_driver);
+ ret = aperture_remove_conflicting_pci_devices(pdev, qxl_driver.name);
if (ret)
goto disable_pci;
--
2.46.0
^ permalink raw reply related [flat|nested] 38+ messages in thread* [PATCH 15/28] drm/radeon: Use video aperture helpers
2024-09-30 13:02 [PATCH 00/28] drm: Remove DRM aperture helpers Thomas Zimmermann
` (13 preceding siblings ...)
2024-09-30 13:03 ` [PATCH 14/28] drm/qxl: " Thomas Zimmermann
@ 2024-09-30 13:03 ` Thomas Zimmermann
2024-09-30 13:03 ` [PATCH 16/28] drm/rockchip: " Thomas Zimmermann
` (14 subsequent siblings)
29 siblings, 0 replies; 38+ messages in thread
From: Thomas Zimmermann @ 2024-09-30 13:03 UTC (permalink / raw)
To: javierm, airlied, simona, maarten.lankhorst, mripard
Cc: dri-devel, amd-gfx, intel-gfx, intel-xe, Thomas Zimmermann,
Alex Deucher, Christian König, Xinhui Pan
DRM's aperture functions have long been implemented as helpers
under drivers/video/ for use with fbdev. Avoid the DRM wrappers by
calling the video functions directly.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: "Christian König" <christian.koenig@amd.com>
Cc: Xinhui Pan <Xinhui.Pan@amd.com>
---
drivers/gpu/drm/radeon/radeon_drv.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c
index 900b05d8aa5c..23d6d1a2586d 100644
--- a/drivers/gpu/drm/radeon/radeon_drv.c
+++ b/drivers/gpu/drm/radeon/radeon_drv.c
@@ -29,7 +29,7 @@
* OTHER DEALINGS IN THE SOFTWARE.
*/
-
+#include <linux/aperture.h>
#include <linux/compat.h>
#include <linux/module.h>
#include <linux/pm_runtime.h>
@@ -37,7 +37,6 @@
#include <linux/mmu_notifier.h>
#include <linux/pci.h>
-#include <drm/drm_aperture.h>
#include <drm/drm_client_setup.h>
#include <drm/drm_drv.h>
#include <drm/drm_file.h>
@@ -300,7 +299,7 @@ static int radeon_pci_probe(struct pci_dev *pdev,
return -EPROBE_DEFER;
/* Get rid of things like offb */
- ret = drm_aperture_remove_conflicting_pci_framebuffers(pdev, &kms_driver);
+ ret = aperture_remove_conflicting_pci_devices(pdev, kms_driver.name);
if (ret)
return ret;
--
2.46.0
^ permalink raw reply related [flat|nested] 38+ messages in thread* [PATCH 16/28] drm/rockchip: Use video aperture helpers
2024-09-30 13:02 [PATCH 00/28] drm: Remove DRM aperture helpers Thomas Zimmermann
` (14 preceding siblings ...)
2024-09-30 13:03 ` [PATCH 15/28] drm/radeon: " Thomas Zimmermann
@ 2024-09-30 13:03 ` Thomas Zimmermann
2024-09-30 13:03 ` [PATCH 17/28] drm/simpledrm: " Thomas Zimmermann
` (13 subsequent siblings)
29 siblings, 0 replies; 38+ messages in thread
From: Thomas Zimmermann @ 2024-09-30 13:03 UTC (permalink / raw)
To: javierm, airlied, simona, maarten.lankhorst, mripard
Cc: dri-devel, amd-gfx, intel-gfx, intel-xe, Thomas Zimmermann,
Sandy Huang, Heiko Stübner, Andy Yan
DRM's aperture functions have long been implemented as helpers
under drivers/video/ for use with fbdev. Avoid the DRM wrappers by
calling the video functions directly.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Sandy Huang <hjc@rock-chips.com>
Cc: "Heiko Stübner" <heiko@sntech.de>
Cc: Andy Yan <andy.yan@rock-chips.com>
---
drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
index 4e080040ba01..2560b0eec9db 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
@@ -6,6 +6,7 @@
* based on exynos_drm_drv.c
*/
+#include <linux/aperture.h>
#include <linux/dma-mapping.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
@@ -16,7 +17,6 @@
#include <linux/console.h>
#include <linux/iommu.h>
-#include <drm/drm_aperture.h>
#include <drm/drm_client_setup.h>
#include <drm/drm_drv.h>
#include <drm/drm_fbdev_dma.h>
@@ -146,7 +146,7 @@ static int rockchip_drm_bind(struct device *dev)
int ret;
/* Remove existing drivers that may own the framebuffer memory. */
- ret = drm_aperture_remove_framebuffers(&rockchip_drm_driver);
+ ret = aperture_remove_all_conflicting_devices(rockchip_drm_driver.name);
if (ret) {
DRM_DEV_ERROR(dev,
"Failed to remove existing framebuffers - %d.\n",
--
2.46.0
^ permalink raw reply related [flat|nested] 38+ messages in thread* [PATCH 17/28] drm/simpledrm: Use video aperture helpers
2024-09-30 13:02 [PATCH 00/28] drm: Remove DRM aperture helpers Thomas Zimmermann
` (15 preceding siblings ...)
2024-09-30 13:03 ` [PATCH 16/28] drm/rockchip: " Thomas Zimmermann
@ 2024-09-30 13:03 ` Thomas Zimmermann
2024-09-30 13:03 ` [PATCH 18/28] drm/stm: " Thomas Zimmermann
` (12 subsequent siblings)
29 siblings, 0 replies; 38+ messages in thread
From: Thomas Zimmermann @ 2024-09-30 13:03 UTC (permalink / raw)
To: javierm, airlied, simona, maarten.lankhorst, mripard
Cc: dri-devel, amd-gfx, intel-gfx, intel-xe, Thomas Zimmermann
DRM's aperture functions have long been implemented as helpers
under drivers/video/ for use with fbdev. Avoid the DRM wrappers by
calling the video functions directly.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Javier Martinez Canillas <javierm@redhat.com>
---
drivers/gpu/drm/tiny/simpledrm.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/tiny/simpledrm.c b/drivers/gpu/drm/tiny/simpledrm.c
index 484901e5e2f4..3182d32f1b8f 100644
--- a/drivers/gpu/drm/tiny/simpledrm.c
+++ b/drivers/gpu/drm/tiny/simpledrm.c
@@ -1,5 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-only
+#include <linux/aperture.h>
#include <linux/clk.h>
#include <linux/of_clk.h>
#include <linux/minmax.h>
@@ -9,7 +10,6 @@
#include <linux/pm_domain.h>
#include <linux/regulator/consumer.h>
-#include <drm/drm_aperture.h>
#include <drm/drm_atomic.h>
#include <drm/drm_atomic_state_helper.h>
#include <drm/drm_client_setup.h>
@@ -883,7 +883,8 @@ static struct simpledrm_device *simpledrm_device_create(struct drm_driver *drv,
if (mem) {
void *screen_base;
- ret = devm_aperture_acquire_from_firmware(dev, mem->start, resource_size(mem));
+ ret = devm_aperture_acquire_for_platform_device(pdev, mem->start,
+ resource_size(mem));
if (ret) {
drm_err(dev, "could not acquire memory range %pr: %d\n", mem, ret);
return ERR_PTR(ret);
@@ -903,7 +904,8 @@ static struct simpledrm_device *simpledrm_device_create(struct drm_driver *drv,
if (!res)
return ERR_PTR(-EINVAL);
- ret = devm_aperture_acquire_from_firmware(dev, res->start, resource_size(res));
+ ret = devm_aperture_acquire_for_platform_device(pdev, res->start,
+ resource_size(res));
if (ret) {
drm_err(dev, "could not acquire memory range %pr: %d\n", res, ret);
return ERR_PTR(ret);
--
2.46.0
^ permalink raw reply related [flat|nested] 38+ messages in thread* [PATCH 18/28] drm/stm: Use video aperture helpers
2024-09-30 13:02 [PATCH 00/28] drm: Remove DRM aperture helpers Thomas Zimmermann
` (16 preceding siblings ...)
2024-09-30 13:03 ` [PATCH 17/28] drm/simpledrm: " Thomas Zimmermann
@ 2024-09-30 13:03 ` Thomas Zimmermann
2024-09-30 13:03 ` [PATCH 19/28] drm/sun4i: " Thomas Zimmermann
` (11 subsequent siblings)
29 siblings, 0 replies; 38+ messages in thread
From: Thomas Zimmermann @ 2024-09-30 13:03 UTC (permalink / raw)
To: javierm, airlied, simona, maarten.lankhorst, mripard
Cc: dri-devel, amd-gfx, intel-gfx, intel-xe, Thomas Zimmermann,
Yannick Fertre, Raphael Gallais-Pou, Philippe Cornu,
Maxime Coquelin, Alexandre Torgue
DRM's aperture functions have long been implemented as helpers
under drivers/video/ for use with fbdev. Avoid the DRM wrappers by
calling the video functions directly.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Yannick Fertre <yannick.fertre@foss.st.com>
Cc: Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>
Cc: Philippe Cornu <philippe.cornu@foss.st.com>
Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>
Cc: Alexandre Torgue <alexandre.torgue@foss.st.com>
---
drivers/gpu/drm/stm/drv.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/stm/drv.c b/drivers/gpu/drm/stm/drv.c
index fee274a60623..478dc129d5c2 100644
--- a/drivers/gpu/drm/stm/drv.c
+++ b/drivers/gpu/drm/stm/drv.c
@@ -8,6 +8,7 @@
* Mickael Reulier <mickael.reulier@st.com>
*/
+#include <linux/aperture.h>
#include <linux/component.h>
#include <linux/dma-mapping.h>
#include <linux/mod_devicetable.h>
@@ -15,7 +16,6 @@
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
-#include <drm/drm_aperture.h>
#include <drm/drm_atomic.h>
#include <drm/drm_atomic_helper.h>
#include <drm/drm_client_setup.h>
@@ -191,7 +191,7 @@ static int stm_drm_platform_probe(struct platform_device *pdev)
DRM_DEBUG("%s\n", __func__);
- ret = drm_aperture_remove_framebuffers(&drv_driver);
+ ret = aperture_remove_all_conflicting_devices(drv_driver.name);
if (ret)
return ret;
--
2.46.0
^ permalink raw reply related [flat|nested] 38+ messages in thread* [PATCH 19/28] drm/sun4i: Use video aperture helpers
2024-09-30 13:02 [PATCH 00/28] drm: Remove DRM aperture helpers Thomas Zimmermann
` (17 preceding siblings ...)
2024-09-30 13:03 ` [PATCH 18/28] drm/stm: " Thomas Zimmermann
@ 2024-09-30 13:03 ` Thomas Zimmermann
2024-09-30 13:03 ` [PATCH 20/28] drm/tegra: " Thomas Zimmermann
` (10 subsequent siblings)
29 siblings, 0 replies; 38+ messages in thread
From: Thomas Zimmermann @ 2024-09-30 13:03 UTC (permalink / raw)
To: javierm, airlied, simona, maarten.lankhorst, mripard
Cc: dri-devel, amd-gfx, intel-gfx, intel-xe, Thomas Zimmermann,
Chen-Yu Tsai, Jernej Skrabec, Samuel Holland
DRM's aperture functions have long been implemented as helpers
under drivers/video/ for use with fbdev. Avoid the DRM wrappers by
calling the video functions directly.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Maxime Ripard <mripard@kernel.org>
Cc: Chen-Yu Tsai <wens@csie.org>
Cc: Jernej Skrabec <jernej.skrabec@gmail.com>
Cc: Samuel Holland <samuel@sholland.org>
---
drivers/gpu/drm/sun4i/sun4i_drv.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/sun4i/sun4i_drv.c b/drivers/gpu/drm/sun4i/sun4i_drv.c
index c3342789e3b0..3f880d8a5666 100644
--- a/drivers/gpu/drm/sun4i/sun4i_drv.c
+++ b/drivers/gpu/drm/sun4i/sun4i_drv.c
@@ -6,6 +6,7 @@
* Maxime Ripard <maxime.ripard@free-electrons.com>
*/
+#include <linux/aperture.h>
#include <linux/component.h>
#include <linux/dma-mapping.h>
#include <linux/kfifo.h>
@@ -14,7 +15,6 @@
#include <linux/of_reserved_mem.h>
#include <linux/platform_device.h>
-#include <drm/drm_aperture.h>
#include <drm/drm_atomic_helper.h>
#include <drm/drm_client_setup.h>
#include <drm/drm_drv.h>
@@ -100,7 +100,7 @@ static int sun4i_drv_bind(struct device *dev)
goto unbind_all;
/* Remove early framebuffers (ie. simplefb) */
- ret = drm_aperture_remove_framebuffers(&sun4i_drv_driver);
+ ret = aperture_remove_all_conflicting_devices(sun4i_drv_driver.name);
if (ret)
goto unbind_all;
--
2.46.0
^ permalink raw reply related [flat|nested] 38+ messages in thread* [PATCH 20/28] drm/tegra: Use video aperture helpers
2024-09-30 13:02 [PATCH 00/28] drm: Remove DRM aperture helpers Thomas Zimmermann
` (18 preceding siblings ...)
2024-09-30 13:03 ` [PATCH 19/28] drm/sun4i: " Thomas Zimmermann
@ 2024-09-30 13:03 ` Thomas Zimmermann
2024-09-30 13:03 ` [PATCH 21/28] drm/bochs: " Thomas Zimmermann
` (9 subsequent siblings)
29 siblings, 0 replies; 38+ messages in thread
From: Thomas Zimmermann @ 2024-09-30 13:03 UTC (permalink / raw)
To: javierm, airlied, simona, maarten.lankhorst, mripard
Cc: dri-devel, amd-gfx, intel-gfx, intel-xe, Thomas Zimmermann,
Thierry Reding, Mikko Perttunen, Jonathan Hunter
DRM's aperture functions have long been implemented as helpers
under drivers/video/ for use with fbdev. Avoid the DRM wrappers by
calling the video functions directly.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Mikko Perttunen <mperttunen@nvidia.com>
Cc: Jonathan Hunter <jonathanh@nvidia.com>
---
drivers/gpu/drm/tegra/drm.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/tegra/drm.c b/drivers/gpu/drm/tegra/drm.c
index dd82ab71d4a9..babcb3958f86 100644
--- a/drivers/gpu/drm/tegra/drm.c
+++ b/drivers/gpu/drm/tegra/drm.c
@@ -4,6 +4,7 @@
* Copyright (C) 2012-2016 NVIDIA CORPORATION. All rights reserved.
*/
+#include <linux/aperture.h>
#include <linux/bitops.h>
#include <linux/host1x.h>
#include <linux/idr.h>
@@ -12,7 +13,6 @@
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
-#include <drm/drm_aperture.h>
#include <drm/drm_atomic.h>
#include <drm/drm_atomic_helper.h>
#include <drm/drm_client_setup.h>
@@ -1258,7 +1258,7 @@ static int host1x_drm_probe(struct host1x_device *dev)
* will not expose any modesetting features.
*/
if (drm->mode_config.num_crtc > 0) {
- err = drm_aperture_remove_framebuffers(&tegra_drm_driver);
+ err = aperture_remove_all_conflicting_devices(tegra_drm_driver.name);
if (err < 0)
goto hub;
} else {
--
2.46.0
^ permalink raw reply related [flat|nested] 38+ messages in thread* [PATCH 21/28] drm/bochs: Use video aperture helpers
2024-09-30 13:02 [PATCH 00/28] drm: Remove DRM aperture helpers Thomas Zimmermann
` (19 preceding siblings ...)
2024-09-30 13:03 ` [PATCH 20/28] drm/tegra: " Thomas Zimmermann
@ 2024-09-30 13:03 ` Thomas Zimmermann
2024-09-30 13:03 ` [PATCH 22/28] drm/cirrus: " Thomas Zimmermann
` (8 subsequent siblings)
29 siblings, 0 replies; 38+ messages in thread
From: Thomas Zimmermann @ 2024-09-30 13:03 UTC (permalink / raw)
To: javierm, airlied, simona, maarten.lankhorst, mripard
Cc: dri-devel, amd-gfx, intel-gfx, intel-xe, Thomas Zimmermann,
Gerd Hoffmann
DRM's aperture functions have long been implemented as helpers
under drivers/video/ for use with fbdev. Avoid the DRM wrappers by
calling the video functions directly.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Gerd Hoffmann <kraxel@redhat.com>
---
drivers/gpu/drm/tiny/bochs.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/tiny/bochs.c b/drivers/gpu/drm/tiny/bochs.c
index 5d2d34976d4b..dd90003b8fd9 100644
--- a/drivers/gpu/drm/tiny/bochs.c
+++ b/drivers/gpu/drm/tiny/bochs.c
@@ -1,9 +1,9 @@
// SPDX-License-Identifier: GPL-2.0-or-later
+#include <linux/aperture.h>
#include <linux/module.h>
#include <linux/pci.h>
-#include <drm/drm_aperture.h>
#include <drm/drm_atomic.h>
#include <drm/drm_atomic_helper.h>
#include <drm/drm_client_setup.h>
@@ -711,7 +711,7 @@ static int bochs_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent
struct drm_device *dev;
int ret;
- ret = drm_aperture_remove_conflicting_pci_framebuffers(pdev, &bochs_driver);
+ ret = aperture_remove_conflicting_pci_devices(pdev, bochs_driver.name);
if (ret)
return ret;
--
2.46.0
^ permalink raw reply related [flat|nested] 38+ messages in thread* [PATCH 22/28] drm/cirrus: Use video aperture helpers
2024-09-30 13:02 [PATCH 00/28] drm: Remove DRM aperture helpers Thomas Zimmermann
` (20 preceding siblings ...)
2024-09-30 13:03 ` [PATCH 21/28] drm/bochs: " Thomas Zimmermann
@ 2024-09-30 13:03 ` Thomas Zimmermann
2024-09-30 13:03 ` [PATCH 23/28] drm/vboxvideo: " Thomas Zimmermann
` (7 subsequent siblings)
29 siblings, 0 replies; 38+ messages in thread
From: Thomas Zimmermann @ 2024-09-30 13:03 UTC (permalink / raw)
To: javierm, airlied, simona, maarten.lankhorst, mripard
Cc: dri-devel, amd-gfx, intel-gfx, intel-xe, Thomas Zimmermann,
Dave Airlie, Gerd Hoffmann
DRM's aperture functions have long been implemented as helpers
under drivers/video/ for use with fbdev. Avoid the DRM wrappers by
calling the video functions directly.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Dave Airlie <airlied@redhat.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
---
drivers/gpu/drm/tiny/cirrus.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/tiny/cirrus.c b/drivers/gpu/drm/tiny/cirrus.c
index 20c4479ed4c3..f06a2be71f60 100644
--- a/drivers/gpu/drm/tiny/cirrus.c
+++ b/drivers/gpu/drm/tiny/cirrus.c
@@ -16,6 +16,7 @@
* Copyright 1999-2001 Jeff Garzik <jgarzik@pobox.com>
*/
+#include <linux/aperture.h>
#include <linux/iosys-map.h>
#include <linux/module.h>
#include <linux/pci.h>
@@ -23,7 +24,6 @@
#include <video/cirrus.h>
#include <video/vga.h>
-#include <drm/drm_aperture.h>
#include <drm/drm_atomic.h>
#include <drm/drm_atomic_helper.h>
#include <drm/drm_atomic_state_helper.h>
@@ -673,7 +673,7 @@ static int cirrus_pci_probe(struct pci_dev *pdev,
struct cirrus_device *cirrus;
int ret;
- ret = drm_aperture_remove_conflicting_pci_framebuffers(pdev, &cirrus_driver);
+ ret = aperture_remove_conflicting_pci_devices(pdev, cirrus_driver.name);
if (ret)
return ret;
--
2.46.0
^ permalink raw reply related [flat|nested] 38+ messages in thread* [PATCH 23/28] drm/vboxvideo: Use video aperture helpers
2024-09-30 13:02 [PATCH 00/28] drm: Remove DRM aperture helpers Thomas Zimmermann
` (21 preceding siblings ...)
2024-09-30 13:03 ` [PATCH 22/28] drm/cirrus: " Thomas Zimmermann
@ 2024-09-30 13:03 ` Thomas Zimmermann
2024-09-30 13:03 ` [PATCH 24/28] drm/vc4: " Thomas Zimmermann
` (6 subsequent siblings)
29 siblings, 0 replies; 38+ messages in thread
From: Thomas Zimmermann @ 2024-09-30 13:03 UTC (permalink / raw)
To: javierm, airlied, simona, maarten.lankhorst, mripard
Cc: dri-devel, amd-gfx, intel-gfx, intel-xe, Thomas Zimmermann,
Hans de Goede
DRM's aperture functions have long been implemented as helpers
under drivers/video/ for use with fbdev. Avoid the DRM wrappers by
calling the video functions directly.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Hans de Goede <hdegoede@redhat.com>
---
drivers/gpu/drm/vboxvideo/vbox_drv.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/vboxvideo/vbox_drv.c b/drivers/gpu/drm/vboxvideo/vbox_drv.c
index 49dc337b3e01..a536c467e2b2 100644
--- a/drivers/gpu/drm/vboxvideo/vbox_drv.c
+++ b/drivers/gpu/drm/vboxvideo/vbox_drv.c
@@ -7,11 +7,12 @@
* Michael Thayer <michael.thayer@oracle.com,
* Hans de Goede <hdegoede@redhat.com>
*/
+
+#include <linux/aperture.h>
#include <linux/module.h>
#include <linux/pci.h>
#include <linux/vt_kern.h>
-#include <drm/drm_aperture.h>
#include <drm/drm_atomic_helper.h>
#include <drm/drm_client_setup.h>
#include <drm/drm_drv.h>
@@ -45,7 +46,7 @@ static int vbox_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
if (!vbox_check_supported(VBE_DISPI_ID_HGSMI))
return -ENODEV;
- ret = drm_aperture_remove_conflicting_pci_framebuffers(pdev, &driver);
+ ret = aperture_remove_conflicting_pci_devices(pdev, driver.name);
if (ret)
return ret;
--
2.46.0
^ permalink raw reply related [flat|nested] 38+ messages in thread* [PATCH 24/28] drm/vc4: Use video aperture helpers
2024-09-30 13:02 [PATCH 00/28] drm: Remove DRM aperture helpers Thomas Zimmermann
` (22 preceding siblings ...)
2024-09-30 13:03 ` [PATCH 23/28] drm/vboxvideo: " Thomas Zimmermann
@ 2024-09-30 13:03 ` Thomas Zimmermann
2024-09-30 13:03 ` [PATCH 25/28] drm/virtgpu: " Thomas Zimmermann
` (5 subsequent siblings)
29 siblings, 0 replies; 38+ messages in thread
From: Thomas Zimmermann @ 2024-09-30 13:03 UTC (permalink / raw)
To: javierm, airlied, simona, maarten.lankhorst, mripard
Cc: dri-devel, amd-gfx, intel-gfx, intel-xe, Thomas Zimmermann,
Dave Stevenson, Raspberry Pi Kernel Maintenance
DRM's aperture functions have long been implemented as helpers
under drivers/video/ for use with fbdev. Avoid the DRM wrappers by
calling the video functions directly.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Maxime Ripard <mripard@kernel.org>
Cc: Dave Stevenson <dave.stevenson@raspberrypi.com>
Cc: Raspberry Pi Kernel Maintenance <kernel-list@raspberrypi.com>
---
drivers/gpu/drm/vc4/vc4_drv.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c
index 13a1ecddbca3..9fe7cc7b9ccd 100644
--- a/drivers/gpu/drm/vc4/vc4_drv.c
+++ b/drivers/gpu/drm/vc4/vc4_drv.c
@@ -20,6 +20,7 @@
* driver.
*/
+#include <linux/aperture.h>
#include <linux/clk.h>
#include <linux/component.h>
#include <linux/device.h>
@@ -30,7 +31,6 @@
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
-#include <drm/drm_aperture.h>
#include <drm/drm_atomic_helper.h>
#include <drm/drm_client_setup.h>
#include <drm/drm_drv.h>
@@ -359,7 +359,7 @@ static int vc4_drm_bind(struct device *dev)
}
}
- ret = drm_aperture_remove_framebuffers(driver);
+ ret = aperture_remove_all_conflicting_devices(driver->name);
if (ret)
goto err;
--
2.46.0
^ permalink raw reply related [flat|nested] 38+ messages in thread* [PATCH 25/28] drm/virtgpu: Use video aperture helpers
2024-09-30 13:02 [PATCH 00/28] drm: Remove DRM aperture helpers Thomas Zimmermann
` (23 preceding siblings ...)
2024-09-30 13:03 ` [PATCH 24/28] drm/vc4: " Thomas Zimmermann
@ 2024-09-30 13:03 ` Thomas Zimmermann
2024-09-30 13:03 ` [PATCH 26/28] drm/vmwgfx: " Thomas Zimmermann
` (4 subsequent siblings)
29 siblings, 0 replies; 38+ messages in thread
From: Thomas Zimmermann @ 2024-09-30 13:03 UTC (permalink / raw)
To: javierm, airlied, simona, maarten.lankhorst, mripard
Cc: dri-devel, amd-gfx, intel-gfx, intel-xe, Thomas Zimmermann,
David Airlie, Gerd Hoffmann, Gurchetan Singh, Chia-I Wu
DRM's aperture functions have long been implemented as helpers
under drivers/video/ for use with fbdev. Avoid the DRM wrappers by
calling the video functions directly.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Cc: David Airlie <airlied@redhat.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Gurchetan Singh <gurchetansingh@chromium.org>
Cc: Chia-I Wu <olvaffe@gmail.com>
---
drivers/gpu/drm/virtio/virtgpu_drv.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.c b/drivers/gpu/drm/virtio/virtgpu_drv.c
index 1e08d91a4d17..ffca6e2e1c9a 100644
--- a/drivers/gpu/drm/virtio/virtgpu_drv.c
+++ b/drivers/gpu/drm/virtio/virtgpu_drv.c
@@ -26,13 +26,13 @@
* OTHER DEALINGS IN THE SOFTWARE.
*/
+#include <linux/aperture.h>
#include <linux/module.h>
#include <linux/pci.h>
#include <linux/poll.h>
#include <linux/wait.h>
#include <drm/drm.h>
-#include <drm/drm_aperture.h>
#include <drm/drm_atomic_helper.h>
#include <drm/drm_client_setup.h>
#include <drm/drm_drv.h>
@@ -59,7 +59,7 @@ static int virtio_gpu_pci_quirk(struct drm_device *dev)
vga ? "virtio-vga" : "virtio-gpu-pci",
pname);
if (vga) {
- ret = drm_aperture_remove_conflicting_pci_framebuffers(pdev, &driver);
+ ret = aperture_remove_conflicting_pci_devices(pdev, driver.name);
if (ret)
return ret;
}
--
2.46.0
^ permalink raw reply related [flat|nested] 38+ messages in thread* [PATCH 26/28] drm/vmwgfx: Use video aperture helpers
2024-09-30 13:02 [PATCH 00/28] drm: Remove DRM aperture helpers Thomas Zimmermann
` (24 preceding siblings ...)
2024-09-30 13:03 ` [PATCH 25/28] drm/virtgpu: " Thomas Zimmermann
@ 2024-09-30 13:03 ` Thomas Zimmermann
2024-09-30 13:03 ` [PATCH 27/28] drm/xe: " Thomas Zimmermann
` (3 subsequent siblings)
29 siblings, 0 replies; 38+ messages in thread
From: Thomas Zimmermann @ 2024-09-30 13:03 UTC (permalink / raw)
To: javierm, airlied, simona, maarten.lankhorst, mripard
Cc: dri-devel, amd-gfx, intel-gfx, intel-xe, Thomas Zimmermann,
Zack Rusin, Broadcom internal kernel review list
DRM's aperture functions have long been implemented as helpers
under drivers/video/ for use with fbdev. Avoid the DRM wrappers by
calling the video functions directly.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Zack Rusin <zack.rusin@broadcom.com>
Cc: Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>
---
drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
index cf7a89d002e4..36f6ce022a73 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
@@ -35,7 +35,6 @@
#include "vmwgfx_vkms.h"
#include "ttm_object.h"
-#include <drm/drm_aperture.h>
#include <drm/drm_client_setup.h>
#include <drm/drm_drv.h>
#include <drm/drm_fbdev_ttm.h>
@@ -50,6 +49,8 @@
#ifdef CONFIG_X86
#include <asm/hypervisor.h>
#endif
+
+#include <linux/aperture.h>
#include <linux/cc_platform.h>
#include <linux/dma-mapping.h>
#include <linux/module.h>
@@ -1656,7 +1657,7 @@ static int vmw_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
struct vmw_private *vmw;
int ret;
- ret = drm_aperture_remove_conflicting_pci_framebuffers(pdev, &driver);
+ ret = aperture_remove_conflicting_pci_devices(pdev, driver.name);
if (ret)
goto out_error;
--
2.46.0
^ permalink raw reply related [flat|nested] 38+ messages in thread* [PATCH 27/28] drm/xe: Use video aperture helpers
2024-09-30 13:02 [PATCH 00/28] drm: Remove DRM aperture helpers Thomas Zimmermann
` (25 preceding siblings ...)
2024-09-30 13:03 ` [PATCH 26/28] drm/vmwgfx: " Thomas Zimmermann
@ 2024-09-30 13:03 ` Thomas Zimmermann
2024-09-30 13:03 ` [PATCH 28/28] drm: Remove DRM " Thomas Zimmermann
` (2 subsequent siblings)
29 siblings, 0 replies; 38+ messages in thread
From: Thomas Zimmermann @ 2024-09-30 13:03 UTC (permalink / raw)
To: javierm, airlied, simona, maarten.lankhorst, mripard
Cc: dri-devel, amd-gfx, intel-gfx, intel-xe, Thomas Zimmermann,
Lucas De Marchi, Thomas Hellström, Rodrigo Vivi
DRM's aperture functions have long been implemented as helpers
under drivers/video/ for use with fbdev. Avoid the DRM wrappers by
calling the video functions directly.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: "Thomas Hellström" <thomas.hellstrom@linux.intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
---
drivers/gpu/drm/xe/xe_device.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/xe/xe_device.c b/drivers/gpu/drm/xe/xe_device.c
index 09a7ad830e69..bedd909ab9f6 100644
--- a/drivers/gpu/drm/xe/xe_device.c
+++ b/drivers/gpu/drm/xe/xe_device.c
@@ -5,10 +5,10 @@
#include "xe_device.h"
+#include <linux/aperture.h>
#include <linux/delay.h>
#include <linux/units.h>
-#include <drm/drm_aperture.h>
#include <drm/drm_atomic_helper.h>
#include <drm/drm_client.h>
#include <drm/drm_gem_ttm_helper.h>
@@ -310,7 +310,7 @@ struct xe_device *xe_device_create(struct pci_dev *pdev,
xe_display_driver_set_hooks(&driver);
- err = drm_aperture_remove_conflicting_pci_framebuffers(pdev, &driver);
+ err = aperture_remove_conflicting_pci_devices(pdev, driver.name);
if (err)
return ERR_PTR(err);
--
2.46.0
^ permalink raw reply related [flat|nested] 38+ messages in thread* [PATCH 28/28] drm: Remove DRM aperture helpers
2024-09-30 13:02 [PATCH 00/28] drm: Remove DRM aperture helpers Thomas Zimmermann
` (26 preceding siblings ...)
2024-09-30 13:03 ` [PATCH 27/28] drm/xe: " Thomas Zimmermann
@ 2024-09-30 13:03 ` Thomas Zimmermann
2024-09-30 14:06 ` Deucher, Alexander
2024-09-30 13:26 ` [PATCH 00/28] " Javier Martinez Canillas
2024-10-21 12:17 ` (subset) " Dmitry Baryshkov
29 siblings, 1 reply; 38+ messages in thread
From: Thomas Zimmermann @ 2024-09-30 13:03 UTC (permalink / raw)
To: javierm, airlied, simona, maarten.lankhorst, mripard
Cc: dri-devel, amd-gfx, intel-gfx, intel-xe, Thomas Zimmermann,
Jonathan Corbet
The DRM aperture helpers are wrappers around video helpers from
<linux/aperture.h>. There are no callers of these functions. Remove
them entirely.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Jonathan Corbet <corbet@lwn.net>
---
Documentation/gpu/drm-internals.rst | 12 --
MAINTAINERS | 2 -
drivers/gpu/drm/Makefile | 1 -
drivers/gpu/drm/drm_aperture.c | 192 ----------------------------
include/drm/drm_aperture.h | 38 ------
5 files changed, 245 deletions(-)
delete mode 100644 drivers/gpu/drm/drm_aperture.c
delete mode 100644 include/drm/drm_aperture.h
diff --git a/Documentation/gpu/drm-internals.rst b/Documentation/gpu/drm-internals.rst
index 11d9a5730fb2..cb9ae282771c 100644
--- a/Documentation/gpu/drm-internals.rst
+++ b/Documentation/gpu/drm-internals.rst
@@ -75,18 +75,6 @@ Module Initialization
.. kernel-doc:: include/drm/drm_module.h
:doc: overview
-Managing Ownership of the Framebuffer Aperture
-----------------------------------------------
-
-.. kernel-doc:: drivers/gpu/drm/drm_aperture.c
- :doc: overview
-
-.. kernel-doc:: include/drm/drm_aperture.h
- :internal:
-
-.. kernel-doc:: drivers/gpu/drm/drm_aperture.c
- :export:
-
Device Instance and Driver Handling
-----------------------------------
diff --git a/MAINTAINERS b/MAINTAINERS
index 5a0b7bfb6315..e71e12085a9f 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -7097,12 +7097,10 @@ M: Javier Martinez Canillas <javierm@redhat.com>
L: dri-devel@lists.freedesktop.org
S: Maintained
T: git https://gitlab.freedesktop.org/drm/misc/kernel.git
-F: drivers/gpu/drm/drm_aperture.c
F: drivers/gpu/drm/tiny/ofdrm.c
F: drivers/gpu/drm/tiny/simpledrm.c
F: drivers/video/aperture.c
F: drivers/video/nomodeset.c
-F: include/drm/drm_aperture.h
F: include/linux/aperture.h
F: include/video/nomodeset.h
diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile
index 3894f43f6d47..31d8bf60a2fd 100644
--- a/drivers/gpu/drm/Makefile
+++ b/drivers/gpu/drm/Makefile
@@ -34,7 +34,6 @@ endif
subdir-ccflags-$(CONFIG_DRM_WERROR) += -Werror
drm-y := \
- drm_aperture.o \
drm_atomic.o \
drm_atomic_uapi.o \
drm_auth.o \
diff --git a/drivers/gpu/drm/drm_aperture.c b/drivers/gpu/drm/drm_aperture.c
deleted file mode 100644
index 5729f3bb4398..000000000000
--- a/drivers/gpu/drm/drm_aperture.c
+++ /dev/null
@@ -1,192 +0,0 @@
-// SPDX-License-Identifier: MIT
-
-#include <linux/aperture.h>
-#include <linux/platform_device.h>
-
-#include <drm/drm_aperture.h>
-#include <drm/drm_drv.h>
-#include <drm/drm_print.h>
-
-/**
- * DOC: overview
- *
- * A graphics device might be supported by different drivers, but only one
- * driver can be active at any given time. Many systems load a generic
- * graphics drivers, such as EFI-GOP or VESA, early during the boot process.
- * During later boot stages, they replace the generic driver with a dedicated,
- * hardware-specific driver. To take over the device the dedicated driver
- * first has to remove the generic driver. DRM aperture functions manage
- * ownership of DRM framebuffer memory and hand-over between drivers.
- *
- * DRM drivers should call drm_aperture_remove_conflicting_framebuffers()
- * at the top of their probe function. The function removes any generic
- * driver that is currently associated with the given framebuffer memory.
- * If the framebuffer is located at PCI BAR 0, the rsp code looks as in the
- * example given below.
- *
- * .. code-block:: c
- *
- * static const struct drm_driver example_driver = {
- * ...
- * };
- *
- * static int remove_conflicting_framebuffers(struct pci_dev *pdev)
- * {
- * resource_size_t base, size;
- * int ret;
- *
- * base = pci_resource_start(pdev, 0);
- * size = pci_resource_len(pdev, 0);
- *
- * return drm_aperture_remove_conflicting_framebuffers(base, size,
- * &example_driver);
- * }
- *
- * static int probe(struct pci_dev *pdev)
- * {
- * int ret;
- *
- * // Remove any generic drivers...
- * ret = remove_conflicting_framebuffers(pdev);
- * if (ret)
- * return ret;
- *
- * // ... and initialize the hardware.
- * ...
- *
- * drm_dev_register();
- *
- * return 0;
- * }
- *
- * PCI device drivers should call
- * drm_aperture_remove_conflicting_pci_framebuffers() and let it detect the
- * framebuffer apertures automatically. Device drivers without knowledge of
- * the framebuffer's location shall call drm_aperture_remove_framebuffers(),
- * which removes all drivers for known framebuffer.
- *
- * Drivers that are susceptible to being removed by other drivers, such as
- * generic EFI or VESA drivers, have to register themselves as owners of their
- * given framebuffer memory. Ownership of the framebuffer memory is achieved
- * by calling devm_aperture_acquire_from_firmware(). On success, the driver
- * is the owner of the framebuffer range. The function fails if the
- * framebuffer is already owned by another driver. See below for an example.
- *
- * .. code-block:: c
- *
- * static int acquire_framebuffers(struct drm_device *dev, struct platform_device *pdev)
- * {
- * resource_size_t base, size;
- *
- * mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- * if (!mem)
- * return -EINVAL;
- * base = mem->start;
- * size = resource_size(mem);
- *
- * return devm_acquire_aperture_from_firmware(dev, base, size);
- * }
- *
- * static int probe(struct platform_device *pdev)
- * {
- * struct drm_device *dev;
- * int ret;
- *
- * // ... Initialize the device...
- * dev = devm_drm_dev_alloc();
- * ...
- *
- * // ... and acquire ownership of the framebuffer.
- * ret = acquire_framebuffers(dev, pdev);
- * if (ret)
- * return ret;
- *
- * drm_dev_register(dev, 0);
- *
- * return 0;
- * }
- *
- * The generic driver is now subject to forced removal by other drivers. This
- * only works for platform drivers that support hot unplug.
- * When a driver calls drm_aperture_remove_conflicting_framebuffers() et al.
- * for the registered framebuffer range, the aperture helpers call
- * platform_device_unregister() and the generic driver unloads itself. It
- * may not access the device's registers, framebuffer memory, ROM, etc
- * afterwards.
- */
-
-/**
- * devm_aperture_acquire_from_firmware - Acquires ownership of a firmware framebuffer
- * on behalf of a DRM driver.
- * @dev: the DRM device to own the framebuffer memory
- * @base: the framebuffer's byte offset in physical memory
- * @size: the framebuffer size in bytes
- *
- * Installs the given device as the new owner of the framebuffer. The function
- * expects the framebuffer to be provided by a platform device that has been
- * set up by firmware. Firmware can be any generic interface, such as EFI,
- * VESA, VGA, etc. If the native hardware driver takes over ownership of the
- * framebuffer range, the firmware state gets lost. Aperture helpers will then
- * unregister the platform device automatically. Acquired apertures are
- * released automatically if the underlying device goes away.
- *
- * The function fails if the framebuffer range, or parts of it, is currently
- * owned by another driver. To evict current owners, callers should use
- * drm_aperture_remove_conflicting_framebuffers() et al. before calling this
- * function. The function also fails if the given device is not a platform
- * device.
- *
- * Returns:
- * 0 on success, or a negative errno value otherwise.
- */
-int devm_aperture_acquire_from_firmware(struct drm_device *dev, resource_size_t base,
- resource_size_t size)
-{
- struct platform_device *pdev;
-
- if (drm_WARN_ON(dev, !dev_is_platform(dev->dev)))
- return -EINVAL;
-
- pdev = to_platform_device(dev->dev);
-
- return devm_aperture_acquire_for_platform_device(pdev, base, size);
-}
-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
- * @req_driver: requesting DRM driver
- *
- * This function removes graphics device drivers which use the memory range described by
- * @base and @size.
- *
- * Returns:
- * 0 on success, or a negative errno code otherwise
- */
-int drm_aperture_remove_conflicting_framebuffers(resource_size_t base, resource_size_t size,
- const struct drm_driver *req_driver)
-{
- return aperture_remove_conflicting_devices(base, size, req_driver->name);
-}
-EXPORT_SYMBOL(drm_aperture_remove_conflicting_framebuffers);
-
-/**
- * drm_aperture_remove_conflicting_pci_framebuffers - remove existing framebuffers for PCI devices
- * @pdev: PCI device
- * @req_driver: requesting DRM driver
- *
- * This function removes graphics device drivers using the memory range configured
- * for any of @pdev's memory bars. The function assumes that a PCI device with
- * shadowed ROM drives a primary display and so kicks out vga16fb.
- *
- * Returns:
- * 0 on success, or a negative errno code otherwise
- */
-int drm_aperture_remove_conflicting_pci_framebuffers(struct pci_dev *pdev,
- const struct drm_driver *req_driver)
-{
- return aperture_remove_conflicting_pci_devices(pdev, req_driver->name);
-}
-EXPORT_SYMBOL(drm_aperture_remove_conflicting_pci_framebuffers);
diff --git a/include/drm/drm_aperture.h b/include/drm/drm_aperture.h
deleted file mode 100644
index cbe33b49fd5d..000000000000
--- a/include/drm/drm_aperture.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/* SPDX-License-Identifier: MIT */
-
-#ifndef _DRM_APERTURE_H_
-#define _DRM_APERTURE_H_
-
-#include <linux/types.h>
-
-struct drm_device;
-struct drm_driver;
-struct pci_dev;
-
-int devm_aperture_acquire_from_firmware(struct drm_device *dev, resource_size_t base,
- resource_size_t size);
-
-int drm_aperture_remove_conflicting_framebuffers(resource_size_t base, resource_size_t size,
- 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
- * @req_driver: requesting DRM driver
- *
- * This function removes all graphics device drivers. Use this function on systems
- * that can have their framebuffer located anywhere in memory.
- *
- * Returns:
- * 0 on success, or a negative errno code otherwise
- */
-static inline int
-drm_aperture_remove_framebuffers(const struct drm_driver *req_driver)
-{
- return drm_aperture_remove_conflicting_framebuffers(0, (resource_size_t)-1,
- req_driver);
-}
-
-#endif
--
2.46.0
^ permalink raw reply related [flat|nested] 38+ messages in thread* RE: [PATCH 28/28] drm: Remove DRM aperture helpers
2024-09-30 13:03 ` [PATCH 28/28] drm: Remove DRM " Thomas Zimmermann
@ 2024-09-30 14:06 ` Deucher, Alexander
0 siblings, 0 replies; 38+ messages in thread
From: Deucher, Alexander @ 2024-09-30 14:06 UTC (permalink / raw)
To: Thomas Zimmermann, javierm@redhat.com, airlied@gmail.com,
simona@ffwll.ch, maarten.lankhorst@linux.intel.com,
mripard@kernel.org
Cc: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org,
intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org,
Jonathan Corbet
[Public]
> -----Original Message-----
> From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of Thomas
> Zimmermann
> Sent: Monday, September 30, 2024 9:03 AM
> To: javierm@redhat.com; airlied@gmail.com; simona@ffwll.ch;
> maarten.lankhorst@linux.intel.com; mripard@kernel.org
> Cc: dri-devel@lists.freedesktop.org; amd-gfx@lists.freedesktop.org; intel-
> gfx@lists.freedesktop.org; intel-xe@lists.freedesktop.org; Thomas Zimmermann
> <tzimmermann@suse.de>; Jonathan Corbet <corbet@lwn.net>
> Subject: [PATCH 28/28] drm: Remove DRM aperture helpers
>
> The DRM aperture helpers are wrappers around video helpers from
> <linux/aperture.h>. There are no callers of these functions. Remove them entirely.
>
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
> Cc: Jonathan Corbet <corbet@lwn.net>
Series is:
Acked-by: Alex Deucher <alexander.deucher@amd.com>
> ---
> Documentation/gpu/drm-internals.rst | 12 --
> MAINTAINERS | 2 -
> drivers/gpu/drm/Makefile | 1 -
> drivers/gpu/drm/drm_aperture.c | 192 ----------------------------
> include/drm/drm_aperture.h | 38 ------
> 5 files changed, 245 deletions(-)
> delete mode 100644 drivers/gpu/drm/drm_aperture.c delete mode 100644
> include/drm/drm_aperture.h
>
> diff --git a/Documentation/gpu/drm-internals.rst b/Documentation/gpu/drm-
> internals.rst
> index 11d9a5730fb2..cb9ae282771c 100644
> --- a/Documentation/gpu/drm-internals.rst
> +++ b/Documentation/gpu/drm-internals.rst
> @@ -75,18 +75,6 @@ Module Initialization .. kernel-doc::
> include/drm/drm_module.h
> :doc: overview
>
> -Managing Ownership of the Framebuffer Aperture
> -----------------------------------------------
> -
> -.. kernel-doc:: drivers/gpu/drm/drm_aperture.c
> - :doc: overview
> -
> -.. kernel-doc:: include/drm/drm_aperture.h
> - :internal:
> -
> -.. kernel-doc:: drivers/gpu/drm/drm_aperture.c
> - :export:
> -
> Device Instance and Driver Handling
> -----------------------------------
>
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 5a0b7bfb6315..e71e12085a9f 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -7097,12 +7097,10 @@ M: Javier Martinez Canillas <javierm@redhat.com>
> L: dri-devel@lists.freedesktop.org
> S: Maintained
> T: git https://gitlab.freedesktop.org/drm/misc/kernel.git
> -F: drivers/gpu/drm/drm_aperture.c
> F: drivers/gpu/drm/tiny/ofdrm.c
> F: drivers/gpu/drm/tiny/simpledrm.c
> F: drivers/video/aperture.c
> F: drivers/video/nomodeset.c
> -F: include/drm/drm_aperture.h
> F: include/linux/aperture.h
> F: include/video/nomodeset.h
>
> diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile index
> 3894f43f6d47..31d8bf60a2fd 100644
> --- a/drivers/gpu/drm/Makefile
> +++ b/drivers/gpu/drm/Makefile
> @@ -34,7 +34,6 @@ endif
> subdir-ccflags-$(CONFIG_DRM_WERROR) += -Werror
>
> drm-y := \
> - drm_aperture.o \
> drm_atomic.o \
> drm_atomic_uapi.o \
> drm_auth.o \
> diff --git a/drivers/gpu/drm/drm_aperture.c b/drivers/gpu/drm/drm_aperture.c deleted
> file mode 100644 index 5729f3bb4398..000000000000
> --- a/drivers/gpu/drm/drm_aperture.c
> +++ /dev/null
> @@ -1,192 +0,0 @@
> -// SPDX-License-Identifier: MIT
> -
> -#include <linux/aperture.h>
> -#include <linux/platform_device.h>
> -
> -#include <drm/drm_aperture.h>
> -#include <drm/drm_drv.h>
> -#include <drm/drm_print.h>
> -
> -/**
> - * DOC: overview
> - *
> - * A graphics device might be supported by different drivers, but only one
> - * driver can be active at any given time. Many systems load a generic
> - * graphics drivers, such as EFI-GOP or VESA, early during the boot process.
> - * During later boot stages, they replace the generic driver with a dedicated,
> - * hardware-specific driver. To take over the device the dedicated driver
> - * first has to remove the generic driver. DRM aperture functions manage
> - * ownership of DRM framebuffer memory and hand-over between drivers.
> - *
> - * DRM drivers should call drm_aperture_remove_conflicting_framebuffers()
> - * at the top of their probe function. The function removes any generic
> - * driver that is currently associated with the given framebuffer memory.
> - * If the framebuffer is located at PCI BAR 0, the rsp code looks as in the
> - * example given below.
> - *
> - * .. code-block:: c
> - *
> - * static const struct drm_driver example_driver = {
> - * ...
> - * };
> - *
> - * static int remove_conflicting_framebuffers(struct pci_dev *pdev)
> - * {
> - * resource_size_t base, size;
> - * int ret;
> - *
> - * base = pci_resource_start(pdev, 0);
> - * size = pci_resource_len(pdev, 0);
> - *
> - * return drm_aperture_remove_conflicting_framebuffers(base, size,
> - * &example_driver);
> - * }
> - *
> - * static int probe(struct pci_dev *pdev)
> - * {
> - * int ret;
> - *
> - * // Remove any generic drivers...
> - * ret = remove_conflicting_framebuffers(pdev);
> - * if (ret)
> - * return ret;
> - *
> - * // ... and initialize the hardware.
> - * ...
> - *
> - * drm_dev_register();
> - *
> - * return 0;
> - * }
> - *
> - * PCI device drivers should call
> - * drm_aperture_remove_conflicting_pci_framebuffers() and let it detect the
> - * framebuffer apertures automatically. Device drivers without knowledge of
> - * the framebuffer's location shall call drm_aperture_remove_framebuffers(),
> - * which removes all drivers for known framebuffer.
> - *
> - * Drivers that are susceptible to being removed by other drivers, such as
> - * generic EFI or VESA drivers, have to register themselves as owners of their
> - * given framebuffer memory. Ownership of the framebuffer memory is achieved
> - * by calling devm_aperture_acquire_from_firmware(). On success, the driver
> - * is the owner of the framebuffer range. The function fails if the
> - * framebuffer is already owned by another driver. See below for an example.
> - *
> - * .. code-block:: c
> - *
> - * static int acquire_framebuffers(struct drm_device *dev, struct platform_device
> *pdev)
> - * {
> - * resource_size_t base, size;
> - *
> - * mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> - * if (!mem)
> - * return -EINVAL;
> - * base = mem->start;
> - * size = resource_size(mem);
> - *
> - * return devm_acquire_aperture_from_firmware(dev, base, size);
> - * }
> - *
> - * static int probe(struct platform_device *pdev)
> - * {
> - * struct drm_device *dev;
> - * int ret;
> - *
> - * // ... Initialize the device...
> - * dev = devm_drm_dev_alloc();
> - * ...
> - *
> - * // ... and acquire ownership of the framebuffer.
> - * ret = acquire_framebuffers(dev, pdev);
> - * if (ret)
> - * return ret;
> - *
> - * drm_dev_register(dev, 0);
> - *
> - * return 0;
> - * }
> - *
> - * The generic driver is now subject to forced removal by other drivers. This
> - * only works for platform drivers that support hot unplug.
> - * When a driver calls drm_aperture_remove_conflicting_framebuffers() et al.
> - * for the registered framebuffer range, the aperture helpers call
> - * platform_device_unregister() and the generic driver unloads itself. It
> - * may not access the device's registers, framebuffer memory, ROM, etc
> - * afterwards.
> - */
> -
> -/**
> - * devm_aperture_acquire_from_firmware - Acquires ownership of a firmware
> framebuffer
> - * on behalf of a DRM driver.
> - * @dev: the DRM device to own the framebuffer memory
> - * @base: the framebuffer's byte offset in physical memory
> - * @size: the framebuffer size in bytes
> - *
> - * Installs the given device as the new owner of the framebuffer. The function
> - * expects the framebuffer to be provided by a platform device that has been
> - * set up by firmware. Firmware can be any generic interface, such as EFI,
> - * VESA, VGA, etc. If the native hardware driver takes over ownership of the
> - * framebuffer range, the firmware state gets lost. Aperture helpers will then
> - * unregister the platform device automatically. Acquired apertures are
> - * released automatically if the underlying device goes away.
> - *
> - * The function fails if the framebuffer range, or parts of it, is currently
> - * owned by another driver. To evict current owners, callers should use
> - * drm_aperture_remove_conflicting_framebuffers() et al. before calling this
> - * function. The function also fails if the given device is not a platform
> - * device.
> - *
> - * Returns:
> - * 0 on success, or a negative errno value otherwise.
> - */
> -int devm_aperture_acquire_from_firmware(struct drm_device *dev, resource_size_t
> base,
> - resource_size_t size)
> -{
> - struct platform_device *pdev;
> -
> - if (drm_WARN_ON(dev, !dev_is_platform(dev->dev)))
> - return -EINVAL;
> -
> - pdev = to_platform_device(dev->dev);
> -
> - return devm_aperture_acquire_for_platform_device(pdev, base, size);
> -}
> -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
> - * @req_driver: requesting DRM driver
> - *
> - * This function removes graphics device drivers which use the memory range
> described by
> - * @base and @size.
> - *
> - * Returns:
> - * 0 on success, or a negative errno code otherwise
> - */
> -int drm_aperture_remove_conflicting_framebuffers(resource_size_t base,
> resource_size_t size,
> - const struct drm_driver *req_driver)
> -{
> - return aperture_remove_conflicting_devices(base, size, req_driver->name);
> -}
> -EXPORT_SYMBOL(drm_aperture_remove_conflicting_framebuffers);
> -
> -/**
> - * drm_aperture_remove_conflicting_pci_framebuffers - remove existing
> framebuffers for PCI devices
> - * @pdev: PCI device
> - * @req_driver: requesting DRM driver
> - *
> - * This function removes graphics device drivers using the memory range
> configured
> - * for any of @pdev's memory bars. The function assumes that a PCI device with
> - * shadowed ROM drives a primary display and so kicks out vga16fb.
> - *
> - * Returns:
> - * 0 on success, or a negative errno code otherwise
> - */
> -int drm_aperture_remove_conflicting_pci_framebuffers(struct pci_dev *pdev,
> - const struct drm_driver *req_driver)
> -{
> - return aperture_remove_conflicting_pci_devices(pdev, req_driver->name);
> -}
> -EXPORT_SYMBOL(drm_aperture_remove_conflicting_pci_framebuffers);
> diff --git a/include/drm/drm_aperture.h b/include/drm/drm_aperture.h deleted file
> mode 100644 index cbe33b49fd5d..000000000000
> --- a/include/drm/drm_aperture.h
> +++ /dev/null
> @@ -1,38 +0,0 @@
> -/* SPDX-License-Identifier: MIT */
> -
> -#ifndef _DRM_APERTURE_H_
> -#define _DRM_APERTURE_H_
> -
> -#include <linux/types.h>
> -
> -struct drm_device;
> -struct drm_driver;
> -struct pci_dev;
> -
> -int devm_aperture_acquire_from_firmware(struct drm_device *dev, resource_size_t
> base,
> - resource_size_t size);
> -
> -int drm_aperture_remove_conflicting_framebuffers(resource_size_t base,
> resource_size_t size,
> - 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
> - * @req_driver: requesting DRM driver
> - *
> - * This function removes all graphics device drivers. Use this function on systems
> - * that can have their framebuffer located anywhere in memory.
> - *
> - * Returns:
> - * 0 on success, or a negative errno code otherwise
> - */
> -static inline int
> -drm_aperture_remove_framebuffers(const struct drm_driver *req_driver) -{
> - return drm_aperture_remove_conflicting_framebuffers(0, (resource_size_t)-1,
> - req_driver);
> -}
> -
> -#endif
> --
> 2.46.0
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: [PATCH 00/28] drm: Remove DRM aperture helpers
2024-09-30 13:02 [PATCH 00/28] drm: Remove DRM aperture helpers Thomas Zimmermann
` (27 preceding siblings ...)
2024-09-30 13:03 ` [PATCH 28/28] drm: Remove DRM " Thomas Zimmermann
@ 2024-09-30 13:26 ` Javier Martinez Canillas
2024-10-21 12:17 ` (subset) " Dmitry Baryshkov
29 siblings, 0 replies; 38+ messages in thread
From: Javier Martinez Canillas @ 2024-09-30 13:26 UTC (permalink / raw)
To: Thomas Zimmermann, airlied, simona, maarten.lankhorst, mripard
Cc: dri-devel, amd-gfx, intel-gfx, intel-xe, Thomas Zimmermann
Thomas Zimmermann <tzimmermann@suse.de> writes:
Hello Thomas,
> DRM's aperture helpers are merely wrappers around the respective
> helpers in drivers/video/. The DRM interface existed first, but was
> later generalized for use with fbdev and a few other graphics-related
> places in the kernel. It is time to remove the DRM wrappers and call
> the video helpers directly.
>
> No functional changes intended. This series should replace one interface
> with another. Individual patches could go into the various trees and the
> DRM wrappers can be removed when all driver changes have been merged.
>
Thanks for doing this cleanup. Makes a lot of sense for me to drop it.
For the whole series:
Acked-by: Javier Martinez Canillas <javierm@redhat.com>
--
Best regards,
Javier Martinez Canillas
Core Platforms
Red Hat
^ permalink raw reply [flat|nested] 38+ messages in thread* Re: (subset) [PATCH 00/28] drm: Remove DRM aperture helpers
2024-09-30 13:02 [PATCH 00/28] drm: Remove DRM aperture helpers Thomas Zimmermann
` (28 preceding siblings ...)
2024-09-30 13:26 ` [PATCH 00/28] " Javier Martinez Canillas
@ 2024-10-21 12:17 ` Dmitry Baryshkov
29 siblings, 0 replies; 38+ messages in thread
From: Dmitry Baryshkov @ 2024-10-21 12:17 UTC (permalink / raw)
To: javierm, airlied, simona, maarten.lankhorst, mripard,
Thomas Zimmermann
Cc: dri-devel, amd-gfx, intel-gfx, intel-xe
On Mon, 30 Sep 2024 15:02:58 +0200, Thomas Zimmermann wrote:
> DRM's aperture helpers are merely wrappers around the respective
> helpers in drivers/video/. The DRM interface existed first, but was
> later generalized for use with fbdev and a few other graphics-related
> places in the kernel. It is time to remove the DRM wrappers and call
> the video helpers directly.
>
> No functional changes intended. This series should replace one interface
> with another. Individual patches could go into the various trees and the
> DRM wrappers can be removed when all driver changes have been merged.
>
> [...]
Applied, thanks!
[11/28] drm/msm: Use video aperture helpers
https://gitlab.freedesktop.org/lumag/msm/-/commit/42170670ee76
Best regards,
--
Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
^ permalink raw reply [flat|nested] 38+ messages in thread