dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: "Christian König" <ckoenig.leichtzumerken@gmail.com>
Cc: ray.huang@amd.com, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 4/4] drm/ttm: optimize ttm pool shrinker a bit
Date: Tue, 19 Jan 2021 15:10:14 +0100	[thread overview]
Message-ID: <YAboRgKfYWLUSTzc@phenom.ffwll.local> (raw)
In-Reply-To: <20210119121821.2320-4-christian.koenig@amd.com>

On Tue, Jan 19, 2021 at 01:18:21PM +0100, Christian König wrote:
> Only initialize the DMA coherent pools if they are used.
> 
> Signed-off-by: Christian König <christian.koenig@amd.com>

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

> ---
>  drivers/gpu/drm/ttm/ttm_pool.c | 23 ++++++++++++++++-------
>  1 file changed, 16 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/gpu/drm/ttm/ttm_pool.c b/drivers/gpu/drm/ttm/ttm_pool.c
> index 98ecb9c9842c..e0617717113f 100644
> --- a/drivers/gpu/drm/ttm/ttm_pool.c
> +++ b/drivers/gpu/drm/ttm/ttm_pool.c
> @@ -505,10 +505,12 @@ void ttm_pool_init(struct ttm_pool *pool, struct device *dev,
>  	pool->use_dma_alloc = use_dma_alloc;
>  	pool->use_dma32 = use_dma32;
>  
> -	for (i = 0; i < TTM_NUM_CACHING_TYPES; ++i)
> -		for (j = 0; j < MAX_ORDER; ++j)
> -			ttm_pool_type_init(&pool->caching[i].orders[j],
> -					   pool, i, j);
> +	if (use_dma_alloc) {
> +		for (i = 0; i < TTM_NUM_CACHING_TYPES; ++i)
> +			for (j = 0; j < MAX_ORDER; ++j)
> +				ttm_pool_type_init(&pool->caching[i].orders[j],
> +						   pool, i, j);
> +	}
>  }
>  EXPORT_SYMBOL(ttm_pool_init);
>  
> @@ -524,9 +526,11 @@ void ttm_pool_fini(struct ttm_pool *pool)
>  {
>  	unsigned int i, j;
>  
> -	for (i = 0; i < TTM_NUM_CACHING_TYPES; ++i)
> -		for (j = 0; j < MAX_ORDER; ++j)
> -			ttm_pool_type_fini(&pool->caching[i].orders[j]);
> +	if (pool->use_dma_alloc) {
> +		for (i = 0; i < TTM_NUM_CACHING_TYPES; ++i)
> +			for (j = 0; j < MAX_ORDER; ++j)
> +				ttm_pool_type_fini(&pool->caching[i].orders[j]);
> +	}
>  }
>  EXPORT_SYMBOL(ttm_pool_fini);
>  
> @@ -631,6 +635,11 @@ int ttm_pool_debugfs(struct ttm_pool *pool, struct seq_file *m)
>  {
>  	unsigned int i;
>  
> +	if (!pool->use_dma_alloc) {
> +		seq_puts(m, "unused\n");
> +		return 0;
> +	}
> +
>  	ttm_pool_debugfs_header(m);
>  
>  	spin_lock(&shrinker_lock);
> -- 
> 2.25.1
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2021-01-19 14:10 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-19 12:18 [PATCH 1/4] drm/ttm: add debugfs directory v2 Christian König
2021-01-19 12:18 ` [PATCH 2/4] drm/ttm: add a debugfs file for the global page pools Christian König
2021-01-19 14:02   ` Daniel Vetter
2021-01-19 12:18 ` [PATCH 3/4] drm/ttm: add debugfs entry to test pool shrinker v2 Christian König
2021-01-19 14:07   ` Daniel Vetter
2021-01-19 12:18 ` [PATCH 4/4] drm/ttm: optimize ttm pool shrinker a bit Christian König
2021-01-19 14:10   ` Daniel Vetter [this message]
  -- strict thread matches above, loose matches on Subject: below --
2020-12-18 17:55 [PATCH 1/4] drm/ttm: add debugfs directory v2 Christian König
2020-12-18 17:55 ` [PATCH 4/4] drm/ttm: optimize ttm pool shrinker a bit Christian König
2020-12-22 13:51   ` Daniel Vetter
2021-01-07 12:49     ` Christian König
2021-01-07 16:38       ` Daniel Vetter
2021-01-19 12:11         ` Christian König
2021-01-19 13:22           ` Daniel Vetter
2020-11-17 16:33 [PATCH 1/4] drm/ttm/drivers: remove unecessary ttm_module.h include Christian König
2020-11-17 16:33 ` [PATCH 4/4] drm/ttm: optimize ttm pool shrinker a bit Christian König

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YAboRgKfYWLUSTzc@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=ckoenig.leichtzumerken@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=ray.huang@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox