[PATCH] drm: Make drm_pci_agp_init legacy
Sam Ravnborg
sam at ravnborg.org
Sat Mar 7 10:13:40 UTC 2020
Hi Chris.
On Sat, Mar 07, 2020 at 09:37:02AM +0000, Chris Wilson wrote:
> Pull the drm_pci_agp_init() underneath the legacy ifdeffry alongside its
> only caller.
>
> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
I dunno this code - but patch is obviously correct.
This diff is a bit weird as it shows that another function is moved.
But it makes sense looking at drm_pci.c
Acked-by: Sam Ravnborg <sam at ravnborg.org>
> ---
> drivers/gpu/drm/drm_pci.c | 24 ++++++++++++------------
> 1 file changed, 12 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_pci.c b/drivers/gpu/drm/drm_pci.c
> index 5218475ad7e7..81aa21561982 100644
> --- a/drivers/gpu/drm/drm_pci.c
> +++ b/drivers/gpu/drm/drm_pci.c
> @@ -166,6 +166,18 @@ int drm_irq_by_busid(struct drm_device *dev, void *data,
> return drm_pci_irq_by_busid(dev, p);
> }
>
> +void drm_pci_agp_destroy(struct drm_device *dev)
> +{
> + if (dev->agp) {
> + arch_phys_wc_del(dev->agp->agp_mtrr);
> + drm_legacy_agp_clear(dev);
> + kfree(dev->agp);
> + dev->agp = NULL;
> + }
> +}
> +
> +#ifdef CONFIG_DRM_LEGACY
> +
> static void drm_pci_agp_init(struct drm_device *dev)
> {
> if (drm_core_check_feature(dev, DRIVER_USE_AGP)) {
> @@ -180,18 +192,6 @@ static void drm_pci_agp_init(struct drm_device *dev)
> }
> }
>
> -void drm_pci_agp_destroy(struct drm_device *dev)
> -{
> - if (dev->agp) {
> - arch_phys_wc_del(dev->agp->agp_mtrr);
> - drm_legacy_agp_clear(dev);
> - kfree(dev->agp);
> - dev->agp = NULL;
> - }
> -}
> -
> -#ifdef CONFIG_DRM_LEGACY
> -
> static int drm_get_pci_dev(struct pci_dev *pdev,
> const struct pci_device_id *ent,
> struct drm_driver *driver)
> --
> 2.20.1
>
> _______________________________________________
> dri-devel mailing list
> dri-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
More information about the dri-devel
mailing list