diff mbox

drm/amdgpu: set snooped flags only on system addresses v2

Message ID 1449232375-20752-1-git-send-email-deathsimple@vodafone.de (mailing list archive)
State New, archived
Headers show

Commit Message

Christian König Dec. 4, 2015, 12:32 p.m. UTC
From: Christian König <christian.koenig@amd.com>

Not necessary for VRAM.

v2: no need to check if ttm is NULL.

Signed-off-by: Christian König <christian.koenig@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Comments

Alex Deucher Dec. 4, 2015, 6:07 p.m. UTC | #1
On Fri, Dec 4, 2015 at 7:32 AM, Christian König <deathsimple@vodafone.de> wrote:
> From: Christian König <christian.koenig@amd.com>
>
> Not necessary for VRAM.
>
> v2: no need to check if ttm is NULL.
>
> Signed-off-by: Christian König <christian.koenig@amd.com>

Applied the series.  thanks!

Alex

> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> index 8051cb9..8a1752f 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> @@ -801,11 +801,12 @@ uint32_t amdgpu_ttm_tt_pte_flags(struct amdgpu_device *adev, struct ttm_tt *ttm,
>         if (mem && mem->mem_type != TTM_PL_SYSTEM)
>                 flags |= AMDGPU_PTE_VALID;
>
> -       if (mem && mem->mem_type == TTM_PL_TT)
> +       if (mem && mem->mem_type == TTM_PL_TT) {
>                 flags |= AMDGPU_PTE_SYSTEM;
>
> -       if (!ttm || ttm->caching_state == tt_cached)
> -               flags |= AMDGPU_PTE_SNOOPED;
> +               if (ttm->caching_state == tt_cached)
> +                       flags |= AMDGPU_PTE_SNOOPED;
> +       }
>
>         if (adev->asic_type >= CHIP_TOPAZ)
>                 flags |= AMDGPU_PTE_EXECUTABLE;
> --
> 2.5.0
>
diff mbox

Patch

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
index 8051cb9..8a1752f 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
@@ -801,11 +801,12 @@  uint32_t amdgpu_ttm_tt_pte_flags(struct amdgpu_device *adev, struct ttm_tt *ttm,
 	if (mem && mem->mem_type != TTM_PL_SYSTEM)
 		flags |= AMDGPU_PTE_VALID;
 
-	if (mem && mem->mem_type == TTM_PL_TT)
+	if (mem && mem->mem_type == TTM_PL_TT) {
 		flags |= AMDGPU_PTE_SYSTEM;
 
-	if (!ttm || ttm->caching_state == tt_cached)
-		flags |= AMDGPU_PTE_SNOOPED;
+		if (ttm->caching_state == tt_cached)
+			flags |= AMDGPU_PTE_SNOOPED;
+	}
 
 	if (adev->asic_type >= CHIP_TOPAZ)
 		flags |= AMDGPU_PTE_EXECUTABLE;