[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230608173243.GA1207429@bhelgaas>
Date: Thu, 8 Jun 2023 12:32:43 -0500
From: Bjorn Helgaas <helgaas@...nel.org>
To: Sui Jingfeng <15330273260@....cn>
Cc: Lucas Stach <l.stach@...gutronix.de>,
Russell King <linux+etnaviv@...linux.org.uk>,
Christian Gmeiner <christian.gmeiner@...il.com>,
David Airlie <airlied@...il.com>,
Daniel Vetter <daniel@...ll.ch>, Li Yi <liyi@...ngson.cn>,
linux-kernel@...r.kernel.org, etnaviv@...ts.freedesktop.org,
dri-devel@...ts.freedesktop.org,
Sui Jingfeng <suijingfeng@...ngson.cn>,
Philipp Zabel <p.zabel@...gutronix.de>,
Bjorn Helgaas <bhelgaas@...gle.com>
Subject: Re: [PATCH v8 6/8] drm/etnaviv: add driver support for the PCI
devices
On Wed, Jun 07, 2023 at 06:55:49PM +0800, Sui Jingfeng wrote:
> From: Sui Jingfeng <suijingfeng@...ngson.cn>
>
> This patch adds PCI driver support on top of what we already have. Take
> the GC1000 in LS7A1000/LS2K1000 as the first instance of the PCI device
> driver. There is only one GPU core for the GC1000 in the LS7A1000 and
> LS2K1000. Therefore, component frameworks can be avoided.
> +#ifdef CONFIG_DRM_ETNAVIV_PCI_DRIVER
> +#include "etnaviv_pci_drv.h"
> +#endif
With trivial stubs for etnaviv_register_pci_driver() and
etnaviv_unregister_pci_driver(), I think you could get rid of all
these #ifdefs.
> +void etnaviv_drm_unbind(struct device *dev, bool component)
> {
> struct etnaviv_drm_private *priv = etna_private_ptr;
> struct drm_device *drm = priv->drm;
> @@ -746,6 +750,12 @@ static int __init etnaviv_init(void)
> if (ret != 0)
> goto unregister_gpu_driver;
>
> +#ifdef CONFIG_DRM_ETNAVIV_PCI_DRIVER
> + ret = etnaviv_register_pci_driver();
> + if (ret != 0)
> + goto unregister_platform_driver;
> +#endif
> +
> /*
> * If the DT contains at least one available GPU device, instantiate
> * the DRM platform device.
> @@ -763,7 +773,7 @@ static int __init etnaviv_init(void)
> break;
> }
>
> - return 0;
> + return ret;
>
> unregister_platform_driver:
> platform_driver_unregister(&etnaviv_platform_driver);
> @@ -778,6 +788,10 @@ static void __exit etnaviv_exit(void)
> etnaviv_destroy_platform_device(&etnaviv_platform_device);
> platform_driver_unregister(&etnaviv_platform_driver);
> platform_driver_unregister(&etnaviv_gpu_driver);
> +
> +#ifdef CONFIG_DRM_ETNAVIV_PCI_DRIVER
> + etnaviv_unregister_pci_driver();
> +#endif
> +static const struct pci_device_id etnaviv_pci_id_lists[] = {
> + {PCI_VENDOR_ID_LOONGSON, 0x7a15, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
> + {PCI_VENDOR_ID_LOONGSON, 0x7a05, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
PCI_VDEVICE()
Bjorn
Powered by blists - more mailing lists