All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: fix BO move offsets
@ 2016-09-21  7:39 Christian König
       [not found] ` <1474443568-5786-1-git-send-email-deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Christian König @ 2016-09-21  7:39 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

From: Christian König <christian.koenig@amd.com>

It's pretty pointless to get the offset first and then initialize it.

Should fix issues with the new GTT manager.

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

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
index db89a28..219f056 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
@@ -272,8 +272,6 @@ static int amdgpu_move_blit(struct ttm_buffer_object *bo,
 
 	adev = amdgpu_get_adev(bo->bdev);
 	ring = adev->mman.buffer_funcs_ring;
-	old_start = (u64)old_mem->start << PAGE_SHIFT;
-	new_start = (u64)new_mem->start << PAGE_SHIFT;
 
 	switch (old_mem->mem_type) {
 	case TTM_PL_TT:
@@ -282,6 +280,7 @@ static int amdgpu_move_blit(struct ttm_buffer_object *bo,
 			return r;
 
 	case TTM_PL_VRAM:
+		old_start = (u64)old_mem->start << PAGE_SHIFT;
 		old_start += bo->bdev->man[old_mem->mem_type].gpu_offset;
 		break;
 	default:
@@ -295,6 +294,7 @@ static int amdgpu_move_blit(struct ttm_buffer_object *bo,
 			return r;
 
 	case TTM_PL_VRAM:
+		new_start = (u64)new_mem->start << PAGE_SHIFT;
 		new_start += bo->bdev->man[new_mem->mem_type].gpu_offset;
 		break;
 	default:
-- 
2.5.0

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

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

* Re: [PATCH] drm/amdgpu: fix BO move offsets
       [not found] ` <1474443568-5786-1-git-send-email-deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
@ 2016-09-21  8:38   ` Michel Dänzer
  0 siblings, 0 replies; 2+ messages in thread
From: Michel Dänzer @ 2016-09-21  8:38 UTC (permalink / raw)
  To: Christian König; +Cc: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

On 21/09/16 04:39 PM, Christian König wrote:
> From: Christian König <christian.koenig@amd.com>
> 
> It's pretty pointless to get the offset first and then initialize it.
> 
> Should fix issues with the new GTT manager.
> 
> Signed-off-by: Christian König <christian.koenig@amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> index db89a28..219f056 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> @@ -272,8 +272,6 @@ static int amdgpu_move_blit(struct ttm_buffer_object *bo,
>  
>  	adev = amdgpu_get_adev(bo->bdev);
>  	ring = adev->mman.buffer_funcs_ring;
> -	old_start = (u64)old_mem->start << PAGE_SHIFT;
> -	new_start = (u64)new_mem->start << PAGE_SHIFT;
>  
>  	switch (old_mem->mem_type) {
>  	case TTM_PL_TT:
> @@ -282,6 +280,7 @@ static int amdgpu_move_blit(struct ttm_buffer_object *bo,
>  			return r;
>  
>  	case TTM_PL_VRAM:
> +		old_start = (u64)old_mem->start << PAGE_SHIFT;
>  		old_start += bo->bdev->man[old_mem->mem_type].gpu_offset;
>  		break;
>  	default:
> @@ -295,6 +294,7 @@ static int amdgpu_move_blit(struct ttm_buffer_object *bo,
>  			return r;
>  
>  	case TTM_PL_VRAM:
> +		new_start = (u64)new_mem->start << PAGE_SHIFT;
>  		new_start += bo->bdev->man[new_mem->mem_type].gpu_offset;
>  		break;
>  	default:
> 

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>


P.S. This code could use /* fall through */ comments at the end of
switch cases without break.

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

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

end of thread, other threads:[~2016-09-21  8:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-21  7:39 [PATCH] drm/amdgpu: fix BO move offsets Christian König
     [not found] ` <1474443568-5786-1-git-send-email-deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2016-09-21  8:38   ` Michel Dänzer

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.