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

From: Thomas Zimmermann
Date: Fri Feb 21 2020 - 03:52:12 EST


Hi

Am 21.02.20 um 08:06 schrieb Xinliang Liu:
> Hi tao,
> Are you sending a wrong patch?
> Function hibmc_remove_framebuffers is added by your prior reviewing patch.
> Please send patch based onÂdrm-misc-next branch[1] or linux-next.

There's drm_fb_helper_remove_conflicting_pci_framebuffers() which
already implements the functionality. I asked to try using it instead of
creating an own implementation.

Best regards
Thomas

>
> Thanks,
> -Xinliang
>
> [1]Âhttps://anongit.freedesktop.org/git/drm-misc.git
>
> On Fri, 21 Feb 2020 at 13:56, Tian Tao <tiantao6@xxxxxxxxxxxxx
> <mailto:tiantao6@xxxxxxxxxxxxx>> wrote:
>
> 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@xxxxxxxxxxxxx
> <mailto:tiantao6@xxxxxxxxxxxxx>>
> ---
> Â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;
> +
>
> Â Â Â Â dev = drm_dev_alloc(&hibmc_driver, &pdev->dev);
> Â Â Â Â if (IS_ERR(dev)) {
> --
> 2.7.4
>

--
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

Attachment: signature.asc
Description: OpenPGP digital signature