* [PATCH] drm/amdgpu: Limit the maximum size of contiguous VRAM that can be encapsulated by an instance of DRM memory node
@ 2021-01-28 17:43 Ramesh Errabolu
2021-01-29 11:27 ` Christian König
0 siblings, 1 reply; 2+ messages in thread
From: Ramesh Errabolu @ 2021-01-28 17:43 UTC (permalink / raw)
To: amd-gfx; +Cc: Ramesh Errabolu
[Why]
Enable 1:1 mapping between VRAM of a DRM node and a scatterlist node
[How]
Ensure construction of DRM node to not exceed specified limit
Signed-off-by: Ramesh Errabolu <Ramesh.Errabolu@amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c
index 20747d8b1135..21d18efca277 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c
@@ -476,6 +476,9 @@ static int amdgpu_vram_mgr_new(struct ttm_resource_manager *man,
for (i = 0; pages_left >= pages_per_node; ++i) {
unsigned long pages = rounddown_pow_of_two(pages_left);
+ /* Limit maximum size to 2GB due to SG table limitations */
+ pages = min(pages, (2UL << (30 - PAGE_SHIFT)));
+
r = drm_mm_insert_node_in_range(mm, &nodes[i], pages,
pages_per_node, 0,
place->fpfn, lpfn,
--
2.29.2
_______________________________________________
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: Limit the maximum size of contiguous VRAM that can be encapsulated by an instance of DRM memory node
2021-01-28 17:43 [PATCH] drm/amdgpu: Limit the maximum size of contiguous VRAM that can be encapsulated by an instance of DRM memory node Ramesh Errabolu
@ 2021-01-29 11:27 ` Christian König
0 siblings, 0 replies; 2+ messages in thread
From: Christian König @ 2021-01-29 11:27 UTC (permalink / raw)
To: Ramesh Errabolu, amd-gfx
Am 28.01.21 um 18:43 schrieb Ramesh Errabolu:
> [Why]
> Enable 1:1 mapping between VRAM of a DRM node and a scatterlist node
>
> [How]
> Ensure construction of DRM node to not exceed specified limit
>
> Signed-off-by: Ramesh Errabolu <Ramesh.Errabolu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c
> index 20747d8b1135..21d18efca277 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c
> @@ -476,6 +476,9 @@ static int amdgpu_vram_mgr_new(struct ttm_resource_manager *man,
> for (i = 0; pages_left >= pages_per_node; ++i) {
> unsigned long pages = rounddown_pow_of_two(pages_left);
>
> + /* Limit maximum size to 2GB due to SG table limitations */
> + pages = min(pages, (2UL << (30 - PAGE_SHIFT)));
> +
> r = drm_mm_insert_node_in_range(mm, &nodes[i], pages,
> pages_per_node, 0,
> place->fpfn, lpfn,
_______________________________________________
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:[~2021-01-29 11:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-01-28 17:43 [PATCH] drm/amdgpu: Limit the maximum size of contiguous VRAM that can be encapsulated by an instance of DRM memory node Ramesh Errabolu
2021-01-29 11:27 ` Christian König
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.