[PATCH] drm/hisilicon: Fixed pcie resource conflict using the general API

Thomas Zimmermann tzimmermann at suse.de
Fri Feb 21 08:55:57 UTC 2020


Hi

Am 21.02.20 um 06:55 schrieb Tian Tao:
> the kernel provide the drm_fb_helper_remove_conflicting_pci_framebuffer
> to remvoe the pcie resource conflict,there is no need to driver it again.
> 
> Signed-off-by: Tian Tao <tiantao6 at hisilicon.com>
> ---
>  drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 22 +++++-----------------
>  1 file changed, 5 insertions(+), 17 deletions(-)
> 
> diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
> index 7ebe831..0f7dba7 100644
> --- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
> +++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
> @@ -47,22 +47,6 @@ static irqreturn_t hibmc_drm_interrupt(int irq, void *arg)
>  	return IRQ_HANDLED;
>  }
>  
> -static void hibmc_remove_framebuffers(struct pci_dev *pdev)
> -{
> -	struct apertures_struct *ap;
> -
> -	ap = alloc_apertures(1);
> -	if (!ap)
> -		return;
> -
> -	ap->ranges[0].base = pci_resource_start(pdev, 0);
> -	ap->ranges[0].size = pci_resource_len(pdev, 0);
> -
> -	drm_fb_helper_remove_conflicting_framebuffers(ap, "hibmcdrmfb", false);
> -
> -	kfree(ap);
> -}
> -
>  static struct drm_driver hibmc_driver = {
>  	.driver_features	= DRIVER_GEM | DRIVER_MODESET | DRIVER_ATOMIC,
>  	.fops			= &hibmc_fops,
> @@ -343,7 +327,11 @@ static int hibmc_pci_probe(struct pci_dev *pdev,
>  	struct drm_device *dev;
>  	int ret;
>  
> -	hibmc_remove_framebuffers(pdev);
> +	ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev,
> +								"hibmcdrmfb");
> +	if (ret)
> +		return ret;
> +
>  

Only one empty line please. With this change

Acked-by: Thomas Zimmermann <tzimmermann at suse.de>


>  	dev = drm_dev_alloc(&hibmc_driver, &pdev->dev);
>  	if (IS_ERR(dev)) {
> 

-- 
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20200221/25f20628/attachment.sig>


More information about the dri-devel mailing list