AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Michel Dänzer" <michel.daenzer@mailbox.org>
To: Alex Deucher <alexdeucher@gmail.com>,
	Alex Deucher <alexander.deucher@amd.com>
Cc: amd-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/amdgpu: always allocate cleared VRAM for GEM allocations
Date: Mon, 29 Jul 2024 12:42:05 +0200	[thread overview]
Message-ID: <efd8495a-d869-4314-acfb-d3e704c68cda@mailbox.org> (raw)
In-Reply-To: <CADnq5_PGaR=0bqmXckwY8HpgCj5MxCJ4Qc1JP=QR9Lnb7AES6w@mail.gmail.com>

On 2024-07-26 17:25, Alex Deucher wrote:
> On Fri, Jul 26, 2024 at 9:50 AM Alex Deucher <alexander.deucher@amd.com> wrote:
>>
>> 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;
> 
> Alternatively, we can set AMDGPU_GEM_CREATE_VRAM_WIPE_ON_RELEASE here,
> although for cases like reboots, we probably want clear on create.

I agree. Thanks for doing this!

Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>


BTW, maybe this allows reducing the use of AMDGPU_GEM_CREATE_VRAM_WIPE_ON_RELEASE, or even eliminating it altogether? Does this leave any way for user space to access uncleared VRAM?


-- 
Earthling Michel Dänzer            |                  https://redhat.com
Libre software enthusiast          |         Mesa and Xwayland developer


  reply	other threads:[~2024-07-29 10:49 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

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=efd8495a-d869-4314-acfb-d3e704c68cda@mailbox.org \
    --to=michel.daenzer@mailbox.org \
    --cc=alexander.deucher@amd.com \
    --cc=alexdeucher@gmail.com \
    --cc=amd-gfx@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