All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/hisilicon: Fixed pcie resource conflict using the general API
@ 2020-02-21  5:55 ` Tian Tao
  0 siblings, 0 replies; 9+ messages in thread
From: Tian Tao @ 2020-02-21  5:55 UTC (permalink / raw)
  To: puck.chen, airlied, daniel, tzimmermann, kraxel,
	alexander.deucher, tglx, dri-devel, xinliang.liu, linux-kernel
  Cc: linuxarm

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@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;
+
 
 	dev = drm_dev_alloc(&hibmc_driver, &pdev->dev);
 	if (IS_ERR(dev)) {
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH] drm/hisilicon: Fixed pcie resource conflict using the general API
@ 2020-02-21  5:55 ` Tian Tao
  0 siblings, 0 replies; 9+ messages in thread
From: Tian Tao @ 2020-02-21  5:55 UTC (permalink / raw)
  To: puck.chen, airlied, daniel, tzimmermann, kraxel,
	alexander.deucher, tglx, dri-devel, xinliang.liu, linux-kernel
  Cc: linuxarm

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@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;
+
 
 	dev = drm_dev_alloc(&hibmc_driver, &pdev->dev);
 	if (IS_ERR(dev)) {
-- 
2.7.4

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH] drm/hisilicon: Fixed pcie resource conflict using the general API
  2020-02-21  5:55 ` Tian Tao
  (?)
@ 2020-02-21  7:06 ` Xinliang Liu
  2020-02-21  8:52     ` Thomas Zimmermann
  -1 siblings, 1 reply; 9+ messages in thread
From: Xinliang Liu @ 2020-02-21  7:06 UTC (permalink / raw)
  To: Tian Tao
  Cc: airlied, puck.chen, linux-kernel, dri-devel, linuxarm, kraxel,
	tzimmermann, alexander.deucher, tglx


[-- Attachment #1.1: Type: text/plain, Size: 2083 bytes --]

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.

Thanks,
-Xinliang

[1] https://anongit.freedesktop.org/git/drm-misc.git

On Fri, 21 Feb 2020 at 13:56, Tian Tao <tiantao6@hisilicon.com> 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@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;
> +
>
>         dev = drm_dev_alloc(&hibmc_driver, &pdev->dev);
>         if (IS_ERR(dev)) {
> --
> 2.7.4
>
>

[-- Attachment #1.2: Type: text/html, Size: 3169 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] drm/hisilicon: Fixed pcie resource conflict using the general API
  2020-02-21  7:06 ` Xinliang Liu
@ 2020-02-21  8:52     ` Thomas Zimmermann
  0 siblings, 0 replies; 9+ messages in thread
From: Thomas Zimmermann @ 2020-02-21  8:52 UTC (permalink / raw)
  To: Xinliang Liu, Tian Tao
  Cc: puck.chen, airlied, Daniel Vetter, kraxel, alexander.deucher,
	tglx, dri-devel, linux-kernel, linuxarm


[-- Attachment #1.1: Type: text/plain, Size: 3115 bytes --]

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@hisilicon.com
> <mailto:tiantao6@hisilicon.com>> 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@hisilicon.com
>     <mailto:tiantao6@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;
>     +
> 
>             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 #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] drm/hisilicon: Fixed pcie resource conflict using the general API
@ 2020-02-21  8:52     ` Thomas Zimmermann
  0 siblings, 0 replies; 9+ messages in thread
From: Thomas Zimmermann @ 2020-02-21  8:52 UTC (permalink / raw)
  To: Xinliang Liu, Tian Tao
  Cc: airlied, puck.chen, linux-kernel, dri-devel, linuxarm, kraxel,
	alexander.deucher, tglx


[-- Attachment #1.1.1: Type: text/plain, Size: 3115 bytes --]

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@hisilicon.com
> <mailto:tiantao6@hisilicon.com>> 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@hisilicon.com
>     <mailto:tiantao6@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;
>     +
> 
>             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 #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] drm/hisilicon: Fixed pcie resource conflict using the general API
  2020-02-21  5:55 ` Tian Tao
@ 2020-02-21  8:55   ` Thomas Zimmermann
  -1 siblings, 0 replies; 9+ messages in thread
From: Thomas Zimmermann @ 2020-02-21  8:55 UTC (permalink / raw)
  To: Tian Tao, puck.chen, airlied, daniel, kraxel, alexander.deucher,
	tglx, dri-devel, xinliang.liu, linux-kernel
  Cc: linuxarm


[-- Attachment #1.1: Type: text/plain, Size: 1994 bytes --]

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


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] drm/hisilicon: Fixed pcie resource conflict using the general API
@ 2020-02-21  8:55   ` Thomas Zimmermann
  0 siblings, 0 replies; 9+ messages in thread
From: Thomas Zimmermann @ 2020-02-21  8:55 UTC (permalink / raw)
  To: Tian Tao, puck.chen, airlied, daniel, kraxel, alexander.deucher,
	tglx, dri-devel, xinliang.liu, linux-kernel
  Cc: linuxarm


[-- Attachment #1.1.1: Type: text/plain, Size: 1994 bytes --]

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


[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] drm/hisilicon: Fixed pcie resource conflict using the general API
  2020-02-21  8:52     ` Thomas Zimmermann
@ 2020-02-21  8:56       ` tiantao (H)
  -1 siblings, 0 replies; 9+ messages in thread
From: tiantao (H) @ 2020-02-21  8:56 UTC (permalink / raw)
  To: Thomas Zimmermann, Xinliang Liu, Tian Tao
  Cc: puck.chen, airlied, Daniel Vetter, kraxel, alexander.deucher,
	tglx, dri-devel, linux-kernel, linuxarm

Sorry,my mistake. I sent the wrong patch, please ignore the patch below

在 2020/2/21 16:52, Thomas Zimmermann 写道:
> 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@hisilicon.com
>> <mailto:tiantao6@hisilicon.com>> 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@hisilicon.com
>>      <mailto:tiantao6@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;
>>      +
>>
>>              dev = drm_dev_alloc(&hibmc_driver, &pdev->dev);
>>              if (IS_ERR(dev)) {
>>      --
>>      2.7.4
>>
> 


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] drm/hisilicon: Fixed pcie resource conflict using the general API
@ 2020-02-21  8:56       ` tiantao (H)
  0 siblings, 0 replies; 9+ messages in thread
From: tiantao (H) @ 2020-02-21  8:56 UTC (permalink / raw)
  To: Thomas Zimmermann, Xinliang Liu, Tian Tao
  Cc: airlied, puck.chen, linux-kernel, dri-devel, linuxarm, kraxel,
	alexander.deucher, tglx

Sorry,my mistake. I sent the wrong patch, please ignore the patch below

在 2020/2/21 16:52, Thomas Zimmermann 写道:
> 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@hisilicon.com
>> <mailto:tiantao6@hisilicon.com>> 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@hisilicon.com
>>      <mailto:tiantao6@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;
>>      +
>>
>>              dev = drm_dev_alloc(&hibmc_driver, &pdev->dev);
>>              if (IS_ERR(dev)) {
>>      --
>>      2.7.4
>>
> 

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-02-21 11:15 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-21  5:55 [PATCH] drm/hisilicon: Fixed pcie resource conflict using the general API Tian Tao
2020-02-21  5:55 ` Tian Tao
2020-02-21  7:06 ` Xinliang Liu
2020-02-21  8:52   ` Thomas Zimmermann
2020-02-21  8:52     ` Thomas Zimmermann
2020-02-21  8:56     ` tiantao (H)
2020-02-21  8:56       ` tiantao (H)
2020-02-21  8:55 ` Thomas Zimmermann
2020-02-21  8:55   ` Thomas Zimmermann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.