* [PATCH 1/2] drm/amdgpu: add gtt print like vram when dump mm table V2
@ 2017-04-20 3:47 Chunming Zhou
[not found] ` <1492660056-11346-1-git-send-email-David1.Zhou-5C7GfCeVMHo@public.gmane.org>
0 siblings, 1 reply; 6+ messages in thread
From: Chunming Zhou @ 2017-04-20 3:47 UTC (permalink / raw)
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Chunming Zhou
Change-Id: If0474e24e14d237d2d55731871c5ceb11e5a3601
Signed-off-by: Chunming Zhou <David1.Zhou@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c | 9 +++++++++
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 10 +++++++++-
2 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c
index 69ab2ee..f586cb7 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c
@@ -136,6 +136,15 @@ int amdgpu_gtt_mgr_alloc(struct ttm_mem_type_manager *man,
return r;
}
+void amdgpu_gtt_mgr_print(struct seq_file *m, struct ttm_mem_type_manager *man)
+{
+ struct amdgpu_device *adev = amdgpu_ttm_adev(man->bdev);
+ struct amdgpu_gtt_mgr *mgr = man->priv;
+
+ seq_printf(m, "man size:%llu pages, gtt available:%llu pages, usage:%lluMB\n",
+ man->size, mgr->available, (u64)atomic64_read(&adev->gtt_usage) >> 20);
+
+}
/**
* amdgpu_gtt_mgr_new - allocate a new node
*
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
index c3112b6..2b402d2 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
@@ -1540,6 +1540,8 @@ int amdgpu_fill_buffer(struct amdgpu_bo *bo,
#if defined(CONFIG_DEBUG_FS)
+extern void amdgpu_gtt_mgr_print(struct seq_file *m, struct ttm_mem_type_manager
+ *man);
static int amdgpu_mm_dump_table(struct seq_file *m, void *data)
{
struct drm_info_node *node = (struct drm_info_node *)m->private;
@@ -1553,11 +1555,17 @@ static int amdgpu_mm_dump_table(struct seq_file *m, void *data)
spin_lock(&glob->lru_lock);
ret = drm_mm_dump_table(m, mm);
spin_unlock(&glob->lru_lock);
- if (ttm_pl == TTM_PL_VRAM)
+ switch (ttm_pl) {
+ case TTM_PL_VRAM:
seq_printf(m, "man size:%llu pages, ram usage:%lluMB, vis usage:%lluMB\n",
adev->mman.bdev.man[ttm_pl].size,
(u64)atomic64_read(&adev->vram_usage) >> 20,
(u64)atomic64_read(&adev->vram_vis_usage) >> 20);
+ break;
+ case TTM_PL_TT:
+ amdgpu_gtt_mgr_print(m, &adev->mman.bdev.man[TTM_PL_TT]);
+ break;
+ }
return ret;
}
--
1.9.1
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply related [flat|nested] 6+ messages in thread[parent not found: <1492660056-11346-1-git-send-email-David1.Zhou-5C7GfCeVMHo@public.gmane.org>]
* [PATCH 2/2] drm/amdgpu: increase gtt size to 3GB by default [not found] ` <1492660056-11346-1-git-send-email-David1.Zhou-5C7GfCeVMHo@public.gmane.org> @ 2017-04-20 3:47 ` Chunming Zhou [not found] ` <1492660056-11346-2-git-send-email-David1.Zhou-5C7GfCeVMHo@public.gmane.org> 2017-04-20 12:54 ` [PATCH 1/2] drm/amdgpu: add gtt print like vram when dump mm table V2 Alex Deucher 1 sibling, 1 reply; 6+ messages in thread From: Chunming Zhou @ 2017-04-20 3:47 UTC (permalink / raw) To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Chunming Zhou Change-Id: Icdf2486a2d1116e71dc8958cda679a4a83838489 Signed-off-by: Chunming Zhou <David1.Zhou@amd.com> --- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c index d74a406..8f201a3 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c @@ -65,7 +65,7 @@ #define KMS_DRIVER_PATCHLEVEL 0 int amdgpu_vram_limit = 0; -int amdgpu_gart_size = -1; /* auto */ +int amdgpu_gart_size = 3072; /* 3GB by default */ int amdgpu_moverate = -1; /* auto */ int amdgpu_benchmarking = 0; int amdgpu_testing = 0; -- 1.9.1 _______________________________________________ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx ^ permalink raw reply related [flat|nested] 6+ messages in thread
[parent not found: <1492660056-11346-2-git-send-email-David1.Zhou-5C7GfCeVMHo@public.gmane.org>]
* Re: [PATCH 2/2] drm/amdgpu: increase gtt size to 3GB by default [not found] ` <1492660056-11346-2-git-send-email-David1.Zhou-5C7GfCeVMHo@public.gmane.org> @ 2017-04-20 12:43 ` Alex Deucher [not found] ` <CADnq5_P+Cb8-LF0b=LwueCGfTsdBvczeTcMgB2W85Kv7s1G20w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> 0 siblings, 1 reply; 6+ messages in thread From: Alex Deucher @ 2017-04-20 12:43 UTC (permalink / raw) To: Chunming Zhou; +Cc: amd-gfx list On Wed, Apr 19, 2017 at 11:47 PM, Chunming Zhou <David1.Zhou@amd.com> wrote: > Change-Id: Icdf2486a2d1116e71dc8958cda679a4a83838489 > Signed-off-by: Chunming Zhou <David1.Zhou@amd.com> > --- > drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c > index d74a406..8f201a3 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c > @@ -65,7 +65,7 @@ > #define KMS_DRIVER_PATCHLEVEL 0 > > int amdgpu_vram_limit = 0; > -int amdgpu_gart_size = -1; /* auto */ > +int amdgpu_gart_size = 3072; /* 3GB by default */ This breaks the auto setting. Please add a global define for gtt size (e.g., AMDGPU_DEFAULT_GTT_SIZE_MB) and switch the gmc modules to use that rather than the hardcoded 1024ULL. Alex > int amdgpu_moverate = -1; /* auto */ > int amdgpu_benchmarking = 0; > int amdgpu_testing = 0; > -- > 1.9.1 > > _______________________________________________ > amd-gfx mailing list > amd-gfx@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/amd-gfx _______________________________________________ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx ^ permalink raw reply [flat|nested] 6+ messages in thread
[parent not found: <CADnq5_P+Cb8-LF0b=LwueCGfTsdBvczeTcMgB2W85Kv7s1G20w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>]
* Re: [PATCH 2/2] drm/amdgpu: increase gtt size to 3GB by default [not found] ` <CADnq5_P+Cb8-LF0b=LwueCGfTsdBvczeTcMgB2W85Kv7s1G20w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> @ 2017-04-20 12:58 ` Christian König [not found] ` <c82c2217-8008-c449-7ad0-8c97d8cc6e39-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org> 0 siblings, 1 reply; 6+ messages in thread From: Christian König @ 2017-04-20 12:58 UTC (permalink / raw) To: Alex Deucher, Chunming Zhou; +Cc: amd-gfx list Am 20.04.2017 um 14:43 schrieb Alex Deucher: > On Wed, Apr 19, 2017 at 11:47 PM, Chunming Zhou <David1.Zhou@amd.com> wrote: >> Change-Id: Icdf2486a2d1116e71dc8958cda679a4a83838489 >> Signed-off-by: Chunming Zhou <David1.Zhou@amd.com> >> --- >> drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c >> index d74a406..8f201a3 100644 >> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c >> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c >> @@ -65,7 +65,7 @@ >> #define KMS_DRIVER_PATCHLEVEL 0 >> >> int amdgpu_vram_limit = 0; >> -int amdgpu_gart_size = -1; /* auto */ >> +int amdgpu_gart_size = 3072; /* 3GB by default */ > This breaks the auto setting. Please add a global define for gtt size > (e.g., AMDGPU_DEFAULT_GTT_SIZE_MB) and switch the gmc modules to use > that rather than the hardcoded 1024ULL. I think this change isn't necessary any more. Looks like I've found and fixed the root cause of the issue with "drm/amdgpu: fix amdgpu_ttm_bo_eviction_valuable". Please test that patch if your test case now works without any additional changes. Christian. > > Alex > >> int amdgpu_moverate = -1; /* auto */ >> int amdgpu_benchmarking = 0; >> int amdgpu_testing = 0; >> -- >> 1.9.1 >> >> _______________________________________________ >> amd-gfx mailing list >> amd-gfx@lists.freedesktop.org >> https://lists.freedesktop.org/mailman/listinfo/amd-gfx > _______________________________________________ > amd-gfx mailing list > amd-gfx@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/amd-gfx _______________________________________________ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx ^ permalink raw reply [flat|nested] 6+ messages in thread
[parent not found: <c82c2217-8008-c449-7ad0-8c97d8cc6e39-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>]
* Re: [PATCH 2/2] drm/amdgpu: increase gtt size to 3GB by default [not found] ` <c82c2217-8008-c449-7ad0-8c97d8cc6e39-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org> @ 2017-04-21 8:25 ` zhoucm1 0 siblings, 0 replies; 6+ messages in thread From: zhoucm1 @ 2017-04-21 8:25 UTC (permalink / raw) To: Christian König, Alex Deucher; +Cc: amd-gfx list On 2017年04月20日 20:58, Christian König wrote: > Am 20.04.2017 um 14:43 schrieb Alex Deucher: >> On Wed, Apr 19, 2017 at 11:47 PM, Chunming Zhou <David1.Zhou@amd.com> >> wrote: >>> Change-Id: Icdf2486a2d1116e71dc8958cda679a4a83838489 >>> Signed-off-by: Chunming Zhou <David1.Zhou@amd.com> >>> --- >>> drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 2 +- >>> 1 file changed, 1 insertion(+), 1 deletion(-) >>> >>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c >>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c >>> index d74a406..8f201a3 100644 >>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c >>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c >>> @@ -65,7 +65,7 @@ >>> #define KMS_DRIVER_PATCHLEVEL 0 >>> >>> int amdgpu_vram_limit = 0; >>> -int amdgpu_gart_size = -1; /* auto */ >>> +int amdgpu_gart_size = 3072; /* 3GB by default */ >> This breaks the auto setting. Please add a global define for gtt size >> (e.g., AMDGPU_DEFAULT_GTT_SIZE_MB) and switch the gmc modules to use >> that rather than the hardcoded 1024ULL. > > I think this change isn't necessary any more. > > Looks like I've found and fixed the root cause of the issue with > "drm/amdgpu: fix amdgpu_ttm_bo_eviction_valuable". > > Please test that patch if your test case now works without any > additional changes. the result is same, since game needs more than 2GB memory totally. Regards, David Zhou > > Christian. > >> >> Alex >> >>> int amdgpu_moverate = -1; /* auto */ >>> int amdgpu_benchmarking = 0; >>> int amdgpu_testing = 0; >>> -- >>> 1.9.1 >>> >>> _______________________________________________ >>> amd-gfx mailing list >>> amd-gfx@lists.freedesktop.org >>> https://lists.freedesktop.org/mailman/listinfo/amd-gfx >> _______________________________________________ >> amd-gfx mailing list >> amd-gfx@lists.freedesktop.org >> https://lists.freedesktop.org/mailman/listinfo/amd-gfx > > _______________________________________________ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] drm/amdgpu: add gtt print like vram when dump mm table V2 [not found] ` <1492660056-11346-1-git-send-email-David1.Zhou-5C7GfCeVMHo@public.gmane.org> 2017-04-20 3:47 ` [PATCH 2/2] drm/amdgpu: increase gtt size to 3GB by default Chunming Zhou @ 2017-04-20 12:54 ` Alex Deucher 1 sibling, 0 replies; 6+ messages in thread From: Alex Deucher @ 2017-04-20 12:54 UTC (permalink / raw) To: Chunming Zhou; +Cc: amd-gfx list On Wed, Apr 19, 2017 at 11:47 PM, Chunming Zhou <David1.Zhou@amd.com> wrote: > Change-Id: If0474e24e14d237d2d55731871c5ceb11e5a3601 > Signed-off-by: Chunming Zhou <David1.Zhou@amd.com> > Reviewed-by: Christian König <christian.koenig@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> > --- > drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c | 9 +++++++++ > drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 10 +++++++++- > 2 files changed, 18 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c > index 69ab2ee..f586cb7 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c > @@ -136,6 +136,15 @@ int amdgpu_gtt_mgr_alloc(struct ttm_mem_type_manager *man, > return r; > } > > +void amdgpu_gtt_mgr_print(struct seq_file *m, struct ttm_mem_type_manager *man) > +{ > + struct amdgpu_device *adev = amdgpu_ttm_adev(man->bdev); > + struct amdgpu_gtt_mgr *mgr = man->priv; > + > + seq_printf(m, "man size:%llu pages, gtt available:%llu pages, usage:%lluMB\n", > + man->size, mgr->available, (u64)atomic64_read(&adev->gtt_usage) >> 20); > + > +} > /** > * amdgpu_gtt_mgr_new - allocate a new node > * > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c > index c3112b6..2b402d2 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c > @@ -1540,6 +1540,8 @@ int amdgpu_fill_buffer(struct amdgpu_bo *bo, > > #if defined(CONFIG_DEBUG_FS) > > +extern void amdgpu_gtt_mgr_print(struct seq_file *m, struct ttm_mem_type_manager > + *man); > static int amdgpu_mm_dump_table(struct seq_file *m, void *data) > { > struct drm_info_node *node = (struct drm_info_node *)m->private; > @@ -1553,11 +1555,17 @@ static int amdgpu_mm_dump_table(struct seq_file *m, void *data) > spin_lock(&glob->lru_lock); > ret = drm_mm_dump_table(m, mm); > spin_unlock(&glob->lru_lock); > - if (ttm_pl == TTM_PL_VRAM) > + switch (ttm_pl) { > + case TTM_PL_VRAM: > seq_printf(m, "man size:%llu pages, ram usage:%lluMB, vis usage:%lluMB\n", > adev->mman.bdev.man[ttm_pl].size, > (u64)atomic64_read(&adev->vram_usage) >> 20, > (u64)atomic64_read(&adev->vram_vis_usage) >> 20); > + break; > + case TTM_PL_TT: > + amdgpu_gtt_mgr_print(m, &adev->mman.bdev.man[TTM_PL_TT]); > + break; > + } > return ret; > } > > -- > 1.9.1 > > _______________________________________________ > amd-gfx mailing list > amd-gfx@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/amd-gfx _______________________________________________ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2017-04-21 8:25 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-20 3:47 [PATCH 1/2] drm/amdgpu: add gtt print like vram when dump mm table V2 Chunming Zhou
[not found] ` <1492660056-11346-1-git-send-email-David1.Zhou-5C7GfCeVMHo@public.gmane.org>
2017-04-20 3:47 ` [PATCH 2/2] drm/amdgpu: increase gtt size to 3GB by default Chunming Zhou
[not found] ` <1492660056-11346-2-git-send-email-David1.Zhou-5C7GfCeVMHo@public.gmane.org>
2017-04-20 12:43 ` Alex Deucher
[not found] ` <CADnq5_P+Cb8-LF0b=LwueCGfTsdBvczeTcMgB2W85Kv7s1G20w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-04-20 12:58 ` Christian König
[not found] ` <c82c2217-8008-c449-7ad0-8c97d8cc6e39-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2017-04-21 8:25 ` zhoucm1
2017-04-20 12:54 ` [PATCH 1/2] drm/amdgpu: add gtt print like vram when dump mm table V2 Alex Deucher
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox