All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/radeon: drop ttm two ended allocation
@ 2015-03-17 15:59 Alex Deucher
  2015-03-17 16:13 ` Christian König
  2015-03-17 17:51 ` Thomas Hellstrom
  0 siblings, 2 replies; 3+ messages in thread
From: Alex Deucher @ 2015-03-17 15:59 UTC (permalink / raw)
  To: dri-devel; +Cc: Alex Deucher, stable

radeon_bo_create() calls radeon_ttm_placement_from_domain()
before ttm_bo_init() is called.  radeon_ttm_placement_from_domain()
uses the ttm bo size to determine when to select top down
allocation but since the ttm bo is not initialized yet the
check is always false.  It only took affect when buffers
were validated later.  It also seemed to regress suspend
and resume on some systems possibly due to it not
taking affect in radeon_bo_create().

radeon_bo_create() and radeon_ttm_placement_from_domain()
need to be reworked substantially for this to be optimally
effective.  Re-enable it at that point.

Noticed-by: Oded Gabbay <oded.gabbay@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
---
 drivers/gpu/drm/radeon/radeon_object.c | 11 -----------
 1 file changed, 11 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_object.c b/drivers/gpu/drm/radeon/radeon_object.c
index 43e0994..318165d 100644
--- a/drivers/gpu/drm/radeon/radeon_object.c
+++ b/drivers/gpu/drm/radeon/radeon_object.c
@@ -173,17 +173,6 @@ void radeon_ttm_placement_from_domain(struct radeon_bo *rbo, u32 domain)
 		else
 			rbo->placements[i].lpfn = 0;
 	}
-
-	/*
-	 * Use two-ended allocation depending on the buffer size to
-	 * improve fragmentation quality.
-	 * 512kb was measured as the most optimal number.
-	 */
-	if (rbo->tbo.mem.size > 512 * 1024) {
-		for (i = 0; i < c; i++) {
-			rbo->placements[i].flags |= TTM_PL_FLAG_TOPDOWN;
-		}
-	}
 }
 
 int radeon_bo_create(struct radeon_device *rdev,
-- 
1.8.3.1

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

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

* Re: [PATCH] drm/radeon: drop ttm two ended allocation
  2015-03-17 15:59 [PATCH] drm/radeon: drop ttm two ended allocation Alex Deucher
@ 2015-03-17 16:13 ` Christian König
  2015-03-17 17:51 ` Thomas Hellstrom
  1 sibling, 0 replies; 3+ messages in thread
From: Christian König @ 2015-03-17 16:13 UTC (permalink / raw)
  To: Alex Deucher, dri-devel; +Cc: Alex Deucher, stable

On 17.03.2015 16:59, Alex Deucher wrote:
> radeon_bo_create() calls radeon_ttm_placement_from_domain()
> before ttm_bo_init() is called.  radeon_ttm_placement_from_domain()
> uses the ttm bo size to determine when to select top down
> allocation but since the ttm bo is not initialized yet the
> check is always false.  It only took affect when buffers
> were validated later.  It also seemed to regress suspend
> and resume on some systems possibly due to it not
> taking affect in radeon_bo_create().
>
> radeon_bo_create() and radeon_ttm_placement_from_domain()
> need to be reworked substantially for this to be optimally
> effective.  Re-enable it at that point.
>
> Noticed-by: Oded Gabbay <oded.gabbay@amd.com>
> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
> Cc: stable@vger.kernel.org

Reviewed-by: Christian König <christian.koenig@amd.com>

> ---
>   drivers/gpu/drm/radeon/radeon_object.c | 11 -----------
>   1 file changed, 11 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_object.c b/drivers/gpu/drm/radeon/radeon_object.c
> index 43e0994..318165d 100644
> --- a/drivers/gpu/drm/radeon/radeon_object.c
> +++ b/drivers/gpu/drm/radeon/radeon_object.c
> @@ -173,17 +173,6 @@ void radeon_ttm_placement_from_domain(struct radeon_bo *rbo, u32 domain)
>   		else
>   			rbo->placements[i].lpfn = 0;
>   	}
> -
> -	/*
> -	 * Use two-ended allocation depending on the buffer size to
> -	 * improve fragmentation quality.
> -	 * 512kb was measured as the most optimal number.
> -	 */
> -	if (rbo->tbo.mem.size > 512 * 1024) {
> -		for (i = 0; i < c; i++) {
> -			rbo->placements[i].flags |= TTM_PL_FLAG_TOPDOWN;
> -		}
> -	}
>   }
>   
>   int radeon_bo_create(struct radeon_device *rdev,

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

* Re: [PATCH] drm/radeon: drop ttm two ended allocation
  2015-03-17 15:59 [PATCH] drm/radeon: drop ttm two ended allocation Alex Deucher
  2015-03-17 16:13 ` Christian König
@ 2015-03-17 17:51 ` Thomas Hellstrom
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Hellstrom @ 2015-03-17 17:51 UTC (permalink / raw)
  To: Alex Deucher; +Cc: dri-devel, Alex Deucher, stable

On 03/17/2015 04:59 PM, Alex Deucher wrote:
> radeon_bo_create() calls radeon_ttm_placement_from_domain()
> before ttm_bo_init() is called.  radeon_ttm_placement_from_domain()
> uses the ttm bo size to determine when to select top down
> allocation but since the ttm bo is not initialized yet the
> check is always false.  It only took affect when buffers
> were validated later.  It also seemed to regress suspend
> and resume on some systems possibly due to it not
> taking affect in radeon_bo_create().
>
> radeon_bo_create() and radeon_ttm_placement_from_domain()
> need to be reworked substantially for this to be optimally
> effective.  Re-enable it at that point.
>
> Noticed-by: Oded Gabbay <oded.gabbay@amd.com>
> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
> Cc: stable@vger.kernel.org

Minor nitpick: s/take affect/take effect/

/Thomas


> ---
>  drivers/gpu/drm/radeon/radeon_object.c | 11 -----------
>  1 file changed, 11 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_object.c b/drivers/gpu/drm/radeon/radeon_object.c
> index 43e0994..318165d 100644
> --- a/drivers/gpu/drm/radeon/radeon_object.c
> +++ b/drivers/gpu/drm/radeon/radeon_object.c
> @@ -173,17 +173,6 @@ void radeon_ttm_placement_from_domain(struct radeon_bo *rbo, u32 domain)
>  		else
>  			rbo->placements[i].lpfn = 0;
>  	}
> -
> -	/*
> -	 * Use two-ended allocation depending on the buffer size to
> -	 * improve fragmentation quality.
> -	 * 512kb was measured as the most optimal number.
> -	 */
> -	if (rbo->tbo.mem.size > 512 * 1024) {
> -		for (i = 0; i < c; i++) {
> -			rbo->placements[i].flags |= TTM_PL_FLAG_TOPDOWN;
> -		}
> -	}
>  }
>  
>  int radeon_bo_create(struct radeon_device *rdev,

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

end of thread, other threads:[~2015-03-17 17:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-17 15:59 [PATCH] drm/radeon: drop ttm two ended allocation Alex Deucher
2015-03-17 16:13 ` Christian König
2015-03-17 17:51 ` Thomas Hellstrom

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.