Re: [PATCH] drm/amdgpu: only allow scatter/gather display with DC

2018-01-15 Thread Harry Wentland
On 2018-01-12 02:58 PM, Alex Deucher wrote:
> Check if DC is enabled before allowing scanout buffers
> to be pinned in system memory.
> 
> Signed-off-by: Alex Deucher 

Reviewed-by: Harry Wentland 

Harry

> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 5 -
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c 
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
> index 8ede2645a06c..859942552e9f 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
> @@ -507,9 +507,12 @@ uint32_t amdgpu_display_framebuffer_domains(struct 
> amdgpu_device *adev)
>  {
>   uint32_t domain = AMDGPU_GEM_DOMAIN_VRAM;
>  
> +#if defined(CONFIG_DRM_AMD_DC)
>   if (adev->asic_type >= CHIP_CARRIZO && adev->asic_type < CHIP_RAVEN &&
> - adev->flags & AMD_IS_APU)
> + adev->flags & AMD_IS_APU &&
> + amdgpu_device_asic_has_dc_support(adev->asic_type))
>   domain |= AMDGPU_GEM_DOMAIN_GTT;
> +#endif
>  
>   return domain;
>  }
> 
___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


Re: [PATCH] drm/amdgpu: only allow scatter/gather display with DC

2018-01-12 Thread Deucher, Alexander
I think you are getting lucky with the pageflip buffers always ending up in 
vram.  Also, the legacy dce code (e.g., dce_v11_0.c) always pins in vram for 
modesets.


Alex



From: Li, Samuel
Sent: Friday, January 12, 2018 4:35 PM
To: Koenig, Christian; Alex Deucher; amd-gfx@lists.freedesktop.org
Cc: Deucher, Alexander
Subject: RE: [PATCH] drm/amdgpu: only allow scatter/gather display with DC

Somehow my test case seems working although DC not enabled?


Regards,
Samuel Li


> -Original Message-
> From: amd-gfx [mailto:amd-gfx-boun...@lists.freedesktop.org] On Behalf
> Of Christian König
> Sent: Friday, January 12, 2018 4:03 PM
> To: Alex Deucher <alexdeuc...@gmail.com>; amd-
> g...@lists.freedesktop.org
> Cc: Deucher, Alexander <alexander.deuc...@amd.com>
> Subject: Re: [PATCH] drm/amdgpu: only allow scatter/gather display with DC
>
> Am 12.01.2018 um 20:58 schrieb Alex Deucher:
> > Check if DC is enabled before allowing scanout buffers to be pinned in
> > system memory.
> >
> > Signed-off-by: Alex Deucher <alexander.deuc...@amd.com>
>
> Reviewed-by: Christian König <christian.koe...@amd.com>
>
> > ---
> >   drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 5 -
> >   1 file changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
> > b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
> > index 8ede2645a06c..859942552e9f 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
> > @@ -507,9 +507,12 @@ uint32_t
> amdgpu_display_framebuffer_domains(struct amdgpu_device *adev)
> >   {
> >  uint32_t domain = AMDGPU_GEM_DOMAIN_VRAM;
> >
> > +#if defined(CONFIG_DRM_AMD_DC)
> >  if (adev->asic_type >= CHIP_CARRIZO && adev->asic_type <
> CHIP_RAVEN &&
> > -   adev->flags & AMD_IS_APU)
> > +   adev->flags & AMD_IS_APU &&
> > +   amdgpu_device_asic_has_dc_support(adev->asic_type))
> >  domain |= AMDGPU_GEM_DOMAIN_GTT;
> > +#endif
> >
> >  return domain;
> >   }
>
> ___
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


RE: [PATCH] drm/amdgpu: only allow scatter/gather display with DC

2018-01-12 Thread Li, Samuel
Somehow my test case seems working although DC not enabled?

Regards,
Samuel Li


> -Original Message-
> From: amd-gfx [mailto:amd-gfx-boun...@lists.freedesktop.org] On Behalf
> Of Christian König
> Sent: Friday, January 12, 2018 4:03 PM
> To: Alex Deucher <alexdeuc...@gmail.com>; amd-
> g...@lists.freedesktop.org
> Cc: Deucher, Alexander <alexander.deuc...@amd.com>
> Subject: Re: [PATCH] drm/amdgpu: only allow scatter/gather display with DC
> 
> Am 12.01.2018 um 20:58 schrieb Alex Deucher:
> > Check if DC is enabled before allowing scanout buffers to be pinned in
> > system memory.
> >
> > Signed-off-by: Alex Deucher <alexander.deuc...@amd.com>
> 
> Reviewed-by: Christian König <christian.koe...@amd.com>
> 
> > ---
> >   drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 5 -
> >   1 file changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
> > b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
> > index 8ede2645a06c..859942552e9f 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
> > @@ -507,9 +507,12 @@ uint32_t
> amdgpu_display_framebuffer_domains(struct amdgpu_device *adev)
> >   {
> > uint32_t domain = AMDGPU_GEM_DOMAIN_VRAM;
> >
> > +#if defined(CONFIG_DRM_AMD_DC)
> > if (adev->asic_type >= CHIP_CARRIZO && adev->asic_type <
> CHIP_RAVEN &&
> > -   adev->flags & AMD_IS_APU)
> > +   adev->flags & AMD_IS_APU &&
> > +   amdgpu_device_asic_has_dc_support(adev->asic_type))
> > domain |= AMDGPU_GEM_DOMAIN_GTT;
> > +#endif
> >
> > return domain;
> >   }
> 
> ___
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


Re: [PATCH] drm/amdgpu: only allow scatter/gather display with DC

2018-01-12 Thread Christian König

Am 12.01.2018 um 20:58 schrieb Alex Deucher:

Check if DC is enabled before allowing scanout buffers
to be pinned in system memory.

Signed-off-by: Alex Deucher 


Reviewed-by: Christian König 


---
  drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 5 -
  1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
index 8ede2645a06c..859942552e9f 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
@@ -507,9 +507,12 @@ uint32_t amdgpu_display_framebuffer_domains(struct 
amdgpu_device *adev)
  {
uint32_t domain = AMDGPU_GEM_DOMAIN_VRAM;
  
+#if defined(CONFIG_DRM_AMD_DC)

if (adev->asic_type >= CHIP_CARRIZO && adev->asic_type < CHIP_RAVEN &&
-   adev->flags & AMD_IS_APU)
+   adev->flags & AMD_IS_APU &&
+   amdgpu_device_asic_has_dc_support(adev->asic_type))
domain |= AMDGPU_GEM_DOMAIN_GTT;
+#endif
  
  	return domain;

  }


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