[Intel-gfx] [PATCH 2/2] drm/amdgpu: Use per-device driver_features to disable atomic

2018-09-13 Thread Ville Syrjala
From: Ville Syrjälä 

Disable atomic on a per-device basis instead of for all devices.
Made possible by the new device.driver_features thing.

Cc: Alex Deucher 
Cc: "Christian König" 
Cc: "David (ChunMing) Zhou" 
Cc: Harry Wentland 
Cc: Michel Dänzer 
Suggested-by: Michel Dänzer 
Signed-off-by: Ville Syrjälä 
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 12 
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
index 6870909da926..8c1db96be070 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
@@ -816,17 +816,13 @@ static int amdgpu_pci_probe(struct pci_dev *pdev,
if (ret)
return ret;
 
-   /* warn the user if they mix atomic and non-atomic capable GPUs */
-   if ((kms_driver.driver_features & DRIVER_ATOMIC) && !supports_atomic)
-   DRM_ERROR("Mixing atomic and non-atomic capable GPUs!\n");
-   /* support atomic early so the atomic debugfs stuff gets created */
-   if (supports_atomic)
-   kms_driver.driver_features |= DRIVER_ATOMIC;
-
dev = drm_dev_alloc(&kms_driver, &pdev->dev);
if (IS_ERR(dev))
return PTR_ERR(dev);
 
+   if (!supports_atomic)
+   dev->driver_features &= ~DRIVER_ATOMIC;
+
ret = pci_enable_device(pdev);
if (ret)
goto err_free;
@@ -1078,7 +1074,7 @@ amdgpu_get_crtc_scanout_position(struct drm_device *dev, 
unsigned int pipe,
 
 static struct drm_driver kms_driver = {
.driver_features =
-   DRIVER_USE_AGP |
+   DRIVER_USE_AGP | DRIVER_ATOMIC |
DRIVER_HAVE_IRQ | DRIVER_IRQ_SHARED | DRIVER_GEM |
DRIVER_PRIME | DRIVER_RENDER | DRIVER_MODESET | DRIVER_SYNCOBJ,
.load = amdgpu_driver_load_kms,
-- 
2.16.4

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH 2/2] drm/amdgpu: Use per-device driver_features to disable atomic

2018-09-20 Thread Harry Wentland
On 2018-09-13 12:31 PM, Ville Syrjala wrote:
> From: Ville Syrjälä 
> 
> Disable atomic on a per-device basis instead of for all devices.
> Made possible by the new device.driver_features thing.
> 
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: "David (ChunMing) Zhou" 
> Cc: Harry Wentland 
> Cc: Michel Dänzer 
> Suggested-by: Michel Dänzer 
> Signed-off-by: Ville Syrjälä 

Reviewed-by: Harry Wentland 

Harry

> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 12 
>  1 file changed, 4 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c 
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> index 6870909da926..8c1db96be070 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> @@ -816,17 +816,13 @@ static int amdgpu_pci_probe(struct pci_dev *pdev,
>   if (ret)
>   return ret;
>  
> - /* warn the user if they mix atomic and non-atomic capable GPUs */
> - if ((kms_driver.driver_features & DRIVER_ATOMIC) && !supports_atomic)
> - DRM_ERROR("Mixing atomic and non-atomic capable GPUs!\n");
> - /* support atomic early so the atomic debugfs stuff gets created */
> - if (supports_atomic)
> - kms_driver.driver_features |= DRIVER_ATOMIC;
> -
>   dev = drm_dev_alloc(&kms_driver, &pdev->dev);
>   if (IS_ERR(dev))
>   return PTR_ERR(dev);
>  
> + if (!supports_atomic)
> + dev->driver_features &= ~DRIVER_ATOMIC;
> +
>   ret = pci_enable_device(pdev);
>   if (ret)
>   goto err_free;
> @@ -1078,7 +1074,7 @@ amdgpu_get_crtc_scanout_position(struct drm_device 
> *dev, unsigned int pipe,
>  
>  static struct drm_driver kms_driver = {
>   .driver_features =
> - DRIVER_USE_AGP |
> + DRIVER_USE_AGP | DRIVER_ATOMIC |
>   DRIVER_HAVE_IRQ | DRIVER_IRQ_SHARED | DRIVER_GEM |
>   DRIVER_PRIME | DRIVER_RENDER | DRIVER_MODESET | DRIVER_SYNCOBJ,
>   .load = amdgpu_driver_load_kms,
> 
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH 2/2] drm/amdgpu: Use per-device driver_features to disable atomic

2018-09-13 Thread Michel Dänzer
On 2018-09-13 6:31 p.m., Ville Syrjala wrote:
> From: Ville Syrjälä 
> 
> Disable atomic on a per-device basis instead of for all devices.
> Made possible by the new device.driver_features thing.
> 
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: "David (ChunMing) Zhou" 
> Cc: Harry Wentland 
> Cc: Michel Dänzer 
> Suggested-by: Michel Dänzer 
> Signed-off-by: Ville Syrjälä 
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 12 
>  1 file changed, 4 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c 
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> index 6870909da926..8c1db96be070 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> @@ -816,17 +816,13 @@ static int amdgpu_pci_probe(struct pci_dev *pdev,
>   if (ret)
>   return ret;
>  
> - /* warn the user if they mix atomic and non-atomic capable GPUs */
> - if ((kms_driver.driver_features & DRIVER_ATOMIC) && !supports_atomic)
> - DRM_ERROR("Mixing atomic and non-atomic capable GPUs!\n");
> - /* support atomic early so the atomic debugfs stuff gets created */
> - if (supports_atomic)
> - kms_driver.driver_features |= DRIVER_ATOMIC;
> -
>   dev = drm_dev_alloc(&kms_driver, &pdev->dev);
>   if (IS_ERR(dev))
>   return PTR_ERR(dev);
>  
> + if (!supports_atomic)
> + dev->driver_features &= ~DRIVER_ATOMIC;
> +
>   ret = pci_enable_device(pdev);
>   if (ret)
>   goto err_free;
> @@ -1078,7 +1074,7 @@ amdgpu_get_crtc_scanout_position(struct drm_device 
> *dev, unsigned int pipe,
>  
>  static struct drm_driver kms_driver = {
>   .driver_features =
> - DRIVER_USE_AGP |
> + DRIVER_USE_AGP | DRIVER_ATOMIC |
>   DRIVER_HAVE_IRQ | DRIVER_IRQ_SHARED | DRIVER_GEM |
>   DRIVER_PRIME | DRIVER_RENDER | DRIVER_MODESET | DRIVER_SYNCOBJ,
>   .load = amdgpu_driver_load_kms,
> 

Thanks Ville for taking care of this!

Reviewed-by: Michel Dänzer 

If Alex agrees, probably best to push this to drm-misc-next as well.


-- 
Earthling Michel Dänzer   |   http://www.amd.com
Libre software enthusiast | Mesa and X developer
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH 2/2] drm/amdgpu: Use per-device driver_features to disable atomic

2018-09-13 Thread Alex Deucher
On Thu, Sep 13, 2018 at 12:39 PM Michel Dänzer  wrote:
>
> On 2018-09-13 6:31 p.m., Ville Syrjala wrote:
> > From: Ville Syrjälä 
> >
> > Disable atomic on a per-device basis instead of for all devices.
> > Made possible by the new device.driver_features thing.
> >
> > Cc: Alex Deucher 
> > Cc: "Christian König" 
> > Cc: "David (ChunMing) Zhou" 
> > Cc: Harry Wentland 
> > Cc: Michel Dänzer 
> > Suggested-by: Michel Dänzer 
> > Signed-off-by: Ville Syrjälä 
> > ---
> >  drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 12 
> >  1 file changed, 4 insertions(+), 8 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c 
> > b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> > index 6870909da926..8c1db96be070 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> > @@ -816,17 +816,13 @@ static int amdgpu_pci_probe(struct pci_dev *pdev,
> >   if (ret)
> >   return ret;
> >
> > - /* warn the user if they mix atomic and non-atomic capable GPUs */
> > - if ((kms_driver.driver_features & DRIVER_ATOMIC) && !supports_atomic)
> > - DRM_ERROR("Mixing atomic and non-atomic capable GPUs!\n");
> > - /* support atomic early so the atomic debugfs stuff gets created */
> > - if (supports_atomic)
> > - kms_driver.driver_features |= DRIVER_ATOMIC;
> > -
> >   dev = drm_dev_alloc(&kms_driver, &pdev->dev);
> >   if (IS_ERR(dev))
> >   return PTR_ERR(dev);
> >
> > + if (!supports_atomic)
> > + dev->driver_features &= ~DRIVER_ATOMIC;
> > +
> >   ret = pci_enable_device(pdev);
> >   if (ret)
> >   goto err_free;
> > @@ -1078,7 +1074,7 @@ amdgpu_get_crtc_scanout_position(struct drm_device 
> > *dev, unsigned int pipe,
> >
> >  static struct drm_driver kms_driver = {
> >   .driver_features =
> > - DRIVER_USE_AGP |
> > + DRIVER_USE_AGP | DRIVER_ATOMIC |
> >   DRIVER_HAVE_IRQ | DRIVER_IRQ_SHARED | DRIVER_GEM |
> >   DRIVER_PRIME | DRIVER_RENDER | DRIVER_MODESET | DRIVER_SYNCOBJ,
> >   .load = amdgpu_driver_load_kms,
> >
>
> Thanks Ville for taking care of this!
>
> Reviewed-by: Michel Dänzer 
>
> If Alex agrees, probably best to push this to drm-misc-next as well.
>

Reviewed-by: Alex Deucher 

Please go ahead and merge through drm-misc.

Thanks!

Alex

>
> --
> Earthling Michel Dänzer   |   http://www.amd.com
> Libre software enthusiast | Mesa and X developer
> ___
> dri-devel mailing list
> dri-de...@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH 2/2] drm/amdgpu: Use per-device driver_features to disable atomic

2018-09-13 Thread Ville Syrjälä
On Thu, Sep 13, 2018 at 12:40:20PM -0400, Alex Deucher wrote:
> On Thu, Sep 13, 2018 at 12:39 PM Michel Dänzer  wrote:
> >
> > On 2018-09-13 6:31 p.m., Ville Syrjala wrote:
> > > From: Ville Syrjälä 
> > >
> > > Disable atomic on a per-device basis instead of for all devices.
> > > Made possible by the new device.driver_features thing.
> > >
> > > Cc: Alex Deucher 
> > > Cc: "Christian König" 
> > > Cc: "David (ChunMing) Zhou" 
> > > Cc: Harry Wentland 
> > > Cc: Michel Dänzer 
> > > Suggested-by: Michel Dänzer 
> > > Signed-off-by: Ville Syrjälä 
> > > ---
> > >  drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 12 
> > >  1 file changed, 4 insertions(+), 8 deletions(-)
> > >
> > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c 
> > > b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> > > index 6870909da926..8c1db96be070 100644
> > > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> > > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> > > @@ -816,17 +816,13 @@ static int amdgpu_pci_probe(struct pci_dev *pdev,
> > >   if (ret)
> > >   return ret;
> > >
> > > - /* warn the user if they mix atomic and non-atomic capable GPUs */
> > > - if ((kms_driver.driver_features & DRIVER_ATOMIC) && 
> > > !supports_atomic)
> > > - DRM_ERROR("Mixing atomic and non-atomic capable GPUs!\n");
> > > - /* support atomic early so the atomic debugfs stuff gets created */
> > > - if (supports_atomic)
> > > - kms_driver.driver_features |= DRIVER_ATOMIC;
> > > -
> > >   dev = drm_dev_alloc(&kms_driver, &pdev->dev);
> > >   if (IS_ERR(dev))
> > >   return PTR_ERR(dev);
> > >
> > > + if (!supports_atomic)
> > > + dev->driver_features &= ~DRIVER_ATOMIC;
> > > +
> > >   ret = pci_enable_device(pdev);
> > >   if (ret)
> > >   goto err_free;
> > > @@ -1078,7 +1074,7 @@ amdgpu_get_crtc_scanout_position(struct drm_device 
> > > *dev, unsigned int pipe,
> > >
> > >  static struct drm_driver kms_driver = {
> > >   .driver_features =
> > > - DRIVER_USE_AGP |
> > > + DRIVER_USE_AGP | DRIVER_ATOMIC |
> > >   DRIVER_HAVE_IRQ | DRIVER_IRQ_SHARED | DRIVER_GEM |
> > >   DRIVER_PRIME | DRIVER_RENDER | DRIVER_MODESET | DRIVER_SYNCOBJ,
> > >   .load = amdgpu_driver_load_kms,
> > >
> >
> > Thanks Ville for taking care of this!
> >
> > Reviewed-by: Michel Dänzer 
> >
> > If Alex agrees, probably best to push this to drm-misc-next as well.
> >
> 
> Reviewed-by: Alex Deucher 
> 
> Please go ahead and merge through drm-misc.
> 
> Thanks!

You are welcome, and thanks for the r-bs. Pushed.

-- 
Ville Syrjälä
Intel
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx