AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: always allocate cleared VRAM for GEM allocations
@ 2024-07-26 13:41 Alex Deucher
  2024-07-26 15:25 ` Alex Deucher
  0 siblings, 1 reply; 13+ messages in thread
From: Alex Deucher @ 2024-07-26 13:41 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alex Deucher

This adds allocation latency, but aligns better with user
expectations.  The latency should improve with the drm buddy
clearing patches that Arun has been working on.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
index ebb3f87ef4f6..768840e8937d 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
@@ -347,6 +347,10 @@ int amdgpu_gem_create_ioctl(struct drm_device *dev, void *data,
 		return -EINVAL;
 	}
 
+	/* always clear VRAM */
+	if (args->in.domains & AMDGPU_GEM_DOMAIN_VRAM)
+		flags |= AMDGPU_GEM_CREATE_VRAM_CLEARED;
+
 	/* create a gem object to contain this object in */
 	if (args->in.domains & (AMDGPU_GEM_DOMAIN_GDS |
 	    AMDGPU_GEM_DOMAIN_GWS | AMDGPU_GEM_DOMAIN_OA)) {
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 13+ messages in thread
* [PATCH] drm/amdgpu: always allocate cleared VRAM for GEM allocations
@ 2024-08-23 13:36 Alex Deucher
  2024-08-23 14:01 ` Christian König
  0 siblings, 1 reply; 13+ messages in thread
From: Alex Deucher @ 2024-08-23 13:36 UTC (permalink / raw)
  To: amd-gfx
  Cc: Alex Deucher, Michel Dänzer, Arunpravin Paneer Selvam,
	Christian König

This adds allocation latency, but aligns better with user
expectations.  The latency should improve with the drm buddy
clearing patches that Arun has been working on.

In addition this fixes the high CPU spikes seen when doing
wipe on release.

Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/3528
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
Cc: Christian König <christian.koenig@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
index 1f149c9e2177..16af465f1c01 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
@@ -349,6 +349,10 @@ int amdgpu_gem_create_ioctl(struct drm_device *dev, void *data,
 		return -EINVAL;
 	}
 
+	/* always clear VRAM */
+	if (args->in.domains & AMDGPU_GEM_DOMAIN_VRAM)
+		flags |= AMDGPU_GEM_CREATE_VRAM_CLEARED;
+
 	/* create a gem object to contain this object in */
 	if (args->in.domains & (AMDGPU_GEM_DOMAIN_GDS |
 	    AMDGPU_GEM_DOMAIN_GWS | AMDGPU_GEM_DOMAIN_OA)) {
-- 
2.46.0


^ permalink raw reply related	[flat|nested] 13+ messages in thread
* [PATCH] drm/amdgpu: always allocate cleared VRAM for GEM allocations
@ 2024-08-29 17:26 Alex Deucher
  2024-08-29 18:09 ` Paneer Selvam, Arunpravin
  0 siblings, 1 reply; 13+ messages in thread
From: Alex Deucher @ 2024-08-29 17:26 UTC (permalink / raw)
  To: amd-gfx
  Cc: Alex Deucher, Michel Dänzer, Arunpravin Paneer Selvam,
	Christian König

This adds allocation latency, but aligns better with user
expectations.  The latency should improve with the drm buddy
clearing patches that Arun has been working on.

In addition this fixes the high CPU spikes seen when doing
wipe on release.

v2: always set AMDGPU_GEM_CREATE_VRAM_CLEARED (Christian)

Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/3528
Fixes: a68c7eaa7a8f ("drm/amdgpu: Enable clear page functionality")
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com> (v1)
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
Cc: Christian König <christian.koenig@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
index 1f149c9e2177..8794661b0bfa 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
@@ -349,6 +349,9 @@ int amdgpu_gem_create_ioctl(struct drm_device *dev, void *data,
 		return -EINVAL;
 	}
 
+	/* always clear VRAM */
+	flags |= AMDGPU_GEM_CREATE_VRAM_CLEARED;
+
 	/* create a gem object to contain this object in */
 	if (args->in.domains & (AMDGPU_GEM_DOMAIN_GDS |
 	    AMDGPU_GEM_DOMAIN_GWS | AMDGPU_GEM_DOMAIN_OA)) {
-- 
2.46.0


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

end of thread, other threads:[~2024-09-10  6:10 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-26 13:41 [PATCH] drm/amdgpu: always allocate cleared VRAM for GEM allocations Alex Deucher
2024-07-26 15:25 ` Alex Deucher
2024-07-29 10:42   ` Michel Dänzer
2024-07-29 11:14     ` Christian König
2024-07-29 15:41       ` Michel Dänzer
  -- strict thread matches above, loose matches on Subject: below --
2024-08-23 13:36 Alex Deucher
2024-08-23 14:01 ` Christian König
2024-08-29 17:26 Alex Deucher
2024-08-29 18:09 ` Paneer Selvam, Arunpravin
2024-09-06 14:07   ` Marek Olšák
2024-09-06 17:53     ` Alex Deucher
2024-09-06 18:50       ` Marek Olšák
2024-09-10  6:10     ` Paneer Selvam, Arunpravin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox