From: "Chauhan, Madhav" <Madhav.Chauhan@amd.com>
To: "Koenig, Christian" <Christian.Koenig@amd.com>,
"dri-devel@lists.freedesktop.org"
<dri-devel@lists.freedesktop.org>
Cc: "Huang, Ray" <Ray.Huang@amd.com>
Subject: RE: [PATCH 01/13] drm/ttm: nuke ttm_tt_set_(un)populated again
Date: Mon, 26 Oct 2020 19:26:47 +0000 [thread overview]
Message-ID: <BL0PR12MB24339657E46BC7B5E489D7869C190@BL0PR12MB2433.namprd12.prod.outlook.com> (raw)
In-Reply-To: <19351dd7-02a1-ec4f-ae26-dd568bb4b2dc@gmail.com>
[AMD Public Use]
-----Original Message-----
From: Christian König <ckoenig.leichtzumerken@gmail.com>
Sent: Monday, October 26, 2020 7:14 PM
To: Chauhan, Madhav <Madhav.Chauhan@amd.com>; dri-devel@lists.freedesktop.org
Cc: Huang, Ray <Ray.Huang@amd.com>
Subject: Re: [PATCH 01/13] drm/ttm: nuke ttm_tt_set_(un)populated again
Am 26.10.20 um 14:36 schrieb Chauhan, Madhav:
> [AMD Public Use]
>
> -----Original Message-----
> From: Christian König <ckoenig.leichtzumerken@gmail.com>
> Sent: Sunday, October 25, 2020 9:11 PM
> To: Chauhan, Madhav <Madhav.Chauhan@amd.com>; dri-devel@lists.freedesktop.org
> Cc: Huang, Ray <Ray.Huang@amd.com>
> Subject: [PATCH 01/13] drm/ttm: nuke ttm_tt_set_(un)populated again
>
> Neither page allocation backend nor the driver should mess with that.
>
> Looks fine to me: Reviewed-by: Madhav Chauhan <madhav.chauhan@amd.com>
Just for this patch or the series?
Complete series looks good to me now. Series, Reviewed-by: Madhav Chauhan <madhav.chauhan@amd.com>
Will be doing MHT 3.0/3.1 offscreen/regression analysis to find the impact of this optimized allocator and update
If found any issues.
Regards,
Madhav
Christian.
>
> Signed-off-by: Christian König <christian.koenig@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 2 --
> drivers/gpu/drm/nouveau/nouveau_bo.c | 1 -
> drivers/gpu/drm/radeon/radeon_ttm.c | 2 --
> drivers/gpu/drm/ttm/ttm_page_alloc.c | 2 --
> drivers/gpu/drm/ttm/ttm_page_alloc_dma.c | 2 --
> drivers/gpu/drm/ttm/ttm_tt.c | 11 +++++++----
> include/drm/ttm/ttm_tt.h | 10 ----------
> 7 files changed, 7 insertions(+), 23 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> index 62f9194b1dd1..169468572930 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> @@ -1363,7 +1363,6 @@ static int amdgpu_ttm_tt_populate(struct ttm_bo_device *bdev,
> return -ENOMEM;
>
> ttm->page_flags |= TTM_PAGE_FLAG_SG;
> - ttm_tt_set_populated(ttm);
> return 0;
> }
>
> @@ -1383,7 +1382,6 @@ static int amdgpu_ttm_tt_populate(struct ttm_bo_device *bdev,
> drm_prime_sg_to_page_addr_arrays(ttm->sg, ttm->pages,
> gtt->ttm.dma_address,
> ttm->num_pages);
> - ttm_tt_set_populated(ttm);
> return 0;
> }
>
> diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c
> index acff82afe260..06a1f4c4e96e 100644
> --- a/drivers/gpu/drm/nouveau/nouveau_bo.c
> +++ b/drivers/gpu/drm/nouveau/nouveau_bo.c
> @@ -1321,7 +1321,6 @@ nouveau_ttm_tt_populate(struct ttm_bo_device *bdev,
> /* make userspace faulting work */
> drm_prime_sg_to_page_addr_arrays(ttm->sg, ttm->pages,
> ttm_dma->dma_address, ttm->num_pages);
> - ttm_tt_set_populated(ttm);
> return 0;
> }
>
> diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c b/drivers/gpu/drm/radeon/radeon_ttm.c
> index 321c09d20c6c..75fa2f55186b 100644
> --- a/drivers/gpu/drm/radeon/radeon_ttm.c
> +++ b/drivers/gpu/drm/radeon/radeon_ttm.c
> @@ -670,14 +670,12 @@ static int radeon_ttm_tt_populate(struct ttm_bo_device *bdev,
> return -ENOMEM;
>
> ttm->page_flags |= TTM_PAGE_FLAG_SG;
> - ttm_tt_set_populated(ttm);
> return 0;
> }
>
> if (slave && ttm->sg) {
> drm_prime_sg_to_page_addr_arrays(ttm->sg, ttm->pages,
> gtt->ttm.dma_address, ttm->num_pages);
> - ttm_tt_set_populated(ttm);
> return 0;
> }
>
> diff --git a/drivers/gpu/drm/ttm/ttm_page_alloc.c b/drivers/gpu/drm/ttm/ttm_page_alloc.c
> index c8f6790962b9..04099dddce16 100644
> --- a/drivers/gpu/drm/ttm/ttm_page_alloc.c
> +++ b/drivers/gpu/drm/ttm/ttm_page_alloc.c
> @@ -1041,7 +1041,6 @@ ttm_pool_unpopulate_helper(struct ttm_tt *ttm, unsigned mem_count_update)
> put_pages:
> ttm_put_pages(ttm->pages, ttm->num_pages, ttm->page_flags,
> ttm->caching);
> - ttm_tt_set_unpopulated(ttm);
> }
>
> int ttm_pool_populate(struct ttm_tt *ttm, struct ttm_operation_ctx *ctx) @@ -1080,7 +1079,6 @@ int ttm_pool_populate(struct ttm_tt *ttm, struct ttm_operation_ctx *ctx)
> }
> }
>
> - ttm_tt_set_populated(ttm);
> return 0;
> }
> EXPORT_SYMBOL(ttm_pool_populate);
> diff --git a/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c b/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c
> index 6625b43f6256..85dad69419f6 100644
> --- a/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c
> +++ b/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c
> @@ -983,7 +983,6 @@ int ttm_dma_populate(struct ttm_dma_tt *ttm_dma, struct device *dev,
> }
> }
>
> - ttm_tt_set_populated(ttm);
> return 0;
> }
> EXPORT_SYMBOL_GPL(ttm_dma_populate);
> @@ -1077,7 +1076,6 @@ void ttm_dma_unpopulate(struct ttm_dma_tt *ttm_dma, struct device *dev)
> /* shrink pool if necessary (only on !is_cached pools)*/
> if (npages)
> ttm_dma_page_pool_free(pool, npages, false);
> - ttm_tt_set_unpopulated(ttm);
> }
> EXPORT_SYMBOL_GPL(ttm_dma_unpopulate);
>
> diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c index 3e5dd6271d4c..beb1e878fed9 100644
> --- a/drivers/gpu/drm/ttm/ttm_tt.c
> +++ b/drivers/gpu/drm/ttm/ttm_tt.c
> @@ -138,7 +138,6 @@ static void ttm_tt_init_fields(struct ttm_tt *ttm,
> ttm->num_pages = bo->num_pages;
> ttm->caching = ttm_cached;
> ttm->page_flags = page_flags;
> - ttm_tt_set_unpopulated(ttm);
> ttm->swap_storage = NULL;
> ttm->sg = bo->sg;
> ttm->caching = caching;
> @@ -334,9 +333,12 @@ int ttm_tt_populate(struct ttm_bo_device *bdev,
> ret = bdev->driver->ttm_tt_populate(bdev, ttm, ctx);
> else
> ret = ttm_pool_populate(ttm, ctx);
> - if (!ret)
> - ttm_tt_add_mapping(bdev, ttm);
> - return ret;
> + if (ret)
> + return ret;
> +
> + ttm_tt_add_mapping(bdev, ttm);
> + ttm->page_flags |= TTM_PAGE_FLAG_PRIV_POPULATED;
> + return 0;
> }
> EXPORT_SYMBOL(ttm_tt_populate);
>
> @@ -365,4 +367,5 @@ void ttm_tt_unpopulate(struct ttm_bo_device *bdev,
> bdev->driver->ttm_tt_unpopulate(bdev, ttm);
> else
> ttm_pool_unpopulate(ttm);
> + ttm->page_flags &= ~TTM_PAGE_FLAG_PRIV_POPULATED;
> }
> diff --git a/include/drm/ttm/ttm_tt.h b/include/drm/ttm/ttm_tt.h index e042dec5e6c1..e3e60c1da754 100644
> --- a/include/drm/ttm/ttm_tt.h
> +++ b/include/drm/ttm/ttm_tt.h
> @@ -72,16 +72,6 @@ static inline bool ttm_tt_is_populated(struct ttm_tt *tt)
> return tt->page_flags & TTM_PAGE_FLAG_PRIV_POPULATED; }
>
> -static inline void ttm_tt_set_unpopulated(struct ttm_tt *tt) -{
> - tt->page_flags &= ~TTM_PAGE_FLAG_PRIV_POPULATED;
> -}
> -
> -static inline void ttm_tt_set_populated(struct ttm_tt *tt) -{
> - tt->page_flags |= TTM_PAGE_FLAG_PRIV_POPULATED;
> -}
> -
> /**
> * struct ttm_dma_tt
> *
> --
> 2.17.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2020-10-26 19:26 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-25 15:40 drm/ttm: new TT backend allocation pool Christian König
2020-10-25 15:40 ` [PATCH 01/13] drm/ttm: nuke ttm_tt_set_(un)populated again Christian König
2020-10-26 4:43 ` Dave Airlie
2020-10-26 13:36 ` Chauhan, Madhav
2020-10-26 13:43 ` Christian König
2020-10-26 19:26 ` Chauhan, Madhav [this message]
2020-10-28 11:40 ` Chauhan, Madhav
2020-10-25 15:40 ` [PATCH 02/13] drm/ttm: move swapin out of page alloc backend Christian König
2020-10-25 15:40 ` [PATCH 03/13] drm/ttm: make num_pages uint32_t Christian König
2020-10-25 15:40 ` [PATCH 04/13] drm/ttm: merge ttm_dma_tt back into ttm_tt Christian König
2020-10-25 15:40 ` [PATCH 05/13] drm/ttm: new TT backend allocation pool Christian König
2020-10-25 18:35 ` kernel test robot
2020-10-25 19:01 ` kernel test robot
2020-10-25 19:01 ` [RFC PATCH] drm/ttm: ttm_pool_apply_caching() can be static kernel test robot
2020-10-26 9:56 ` [PATCH 05/13] drm/ttm: new TT backend allocation pool kernel test robot
2020-10-25 15:40 ` [PATCH 06/13] drm/ttm: wire up the new pool as default one Christian König
2020-10-25 15:40 ` [PATCH 07/13] drm/amdgpu: switch to new allocator Christian König
2020-10-25 15:40 ` [PATCH 08/13] drm/radeon: " Christian König
2020-10-25 15:40 ` [PATCH 09/13] drm/nouveau: " Christian König
2020-10-25 15:40 ` [PATCH 10/13] drm/vmwgfx: " Christian König
2020-10-25 15:40 ` [PATCH 11/13] drm/qxl: drop ttm_page_alloc.h include Christian König
2020-10-25 15:40 ` [PATCH 12/13] drm/vram_helpers: " Christian König
2020-10-25 15:41 ` [PATCH 13/13] drm/ttm: nuke old page allocator Christian König
2020-10-26 5:23 ` drm/ttm: new TT backend allocation pool Dave Airlie
2020-10-26 12:01 ` Christian König
2020-10-26 12:15 ` Daniel Vetter
2020-10-26 13:45 ` Huang Rui
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=BL0PR12MB24339657E46BC7B5E489D7869C190@BL0PR12MB2433.namprd12.prod.outlook.com \
--to=madhav.chauhan@amd.com \
--cc=Christian.Koenig@amd.com \
--cc=Ray.Huang@amd.com \
--cc=dri-devel@lists.freedesktop.org \
/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;
as well as URLs for NNTP newsgroup(s).