All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Timur Kristóf" <timur.kristof@gmail.com>
To: "Christian König" <christian.koenig@amd.com>,
	amd-gfx@lists.freedesktop.org
Cc: alexander.deucher@amd.com
Subject: Re: [PATCH 4/4] drm/amdgpu: Set SDMA v3 copy_max_bytes to 0x3fff00
Date: Tue, 02 Sep 2025 09:52:57 +0200	[thread overview]
Message-ID: <2281608ed8fedfc58aee3449fff1f8df28e3e36a.camel@gmail.com> (raw)
In-Reply-To: <7c10ac6d-93a8-41c9-900c-50261893d482@amd.com>

On Tue, 2025-09-02 at 08:45 +0200, Christian König wrote:
> On 01.09.25 12:00, Timur Kristóf wrote:
> > SDMA v3-v5 can copy almost 4 MiB in a single copy operation.
> > Use the	same value as PAL and Mesa for copy_max_bytes.
> > 
> > For reference, see oss2DmaCmdBuffer.cpp	in PAL:
> > "Due to HW limitation, the maximum count may not be 2^n-1,
> > can only be 2^n - 1 - start_addr[4:2]"
> 
> Is that public available? If yes better reference AMDVLK here.

I only have access to public code, so that's all I can reference.

AMDVLK uses PAL so I assume the same would apply to it as well.
The above comment is in oss2DmaCmdBuffer.cpp here:
https://github.com/GPUOpen-Drivers/pal/blob/bcec463efe5260776d486a5e3da0c549bc0a75d2/src/core/hw/ossip/oss2/oss2DmaCmdBuffer.cpp#L308



> 
> Apart from that looks good to me.
> 
> Regards,
> Christian.
> 
> > 
> > See also sid.h in Mesa:
> > "There is apparently an undocumented HW limitation that
> > prevents the HW from copying the last 255 bytes of (1 << 22) - 1"
> > 
> > Fixes: dfe5c2b76b2a ("drm/amdgpu: Correct bytes limit for SDMA 3.0
> > copy and fill")
> > Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
> > ---
> >  drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
> > b/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
> > index 1c076bd1cf73..9302cf0b5e4b 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
> > @@ -1659,11 +1659,11 @@ static void
> > sdma_v3_0_emit_fill_buffer(struct amdgpu_ib *ib,
> >  }
> >  
> >  static const struct amdgpu_buffer_funcs sdma_v3_0_buffer_funcs = {
> > -	.copy_max_bytes = 0x3fffe0, /* not 0x3fffff due to HW
> > limitation */
> > +	.copy_max_bytes = 0x3fff00, /* not 0x3fffff due to HW
> > limitation */
> >  	.copy_num_dw = 7,
> >  	.emit_copy_buffer = sdma_v3_0_emit_copy_buffer,
> >  
> > -	.fill_max_bytes = 0x3fffe0, /* not 0x3fffff due to HW
> > limitation */
> > +	.fill_max_bytes = 0x3fff00, /* not 0x3fffff due to HW
> > limitation */
> >  	.fill_num_dw = 5,
> >  	.emit_fill_buffer = sdma_v3_0_emit_fill_buffer,
> >  };

  reply	other threads:[~2025-09-02  7:53 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-01 10:00 [PATCH 1/4] drm/amdgpu: Fix allocating extra dwords for rings Timur Kristóf
2025-09-01 10:00 ` [PATCH 2/4] drm/amdgpu: Clarify that BO size is in bytes in comments Timur Kristóf
2025-09-02  6:43   ` Christian König
2025-09-02  8:08     ` Timur Kristóf
2025-09-02 11:10       ` Christian König
2025-09-02 11:28         ` Timur Kristóf
2025-09-01 10:00 ` [PATCH 3/4] drm/amdgpu: Fill extra dwords with NOPs Timur Kristóf
2025-09-01 10:13   ` Tvrtko Ursulin
2025-09-02 11:30     ` Timur Kristóf
2025-09-02 11:34       ` Christian König
2025-09-02 11:39       ` Tvrtko Ursulin
2025-09-02  6:39   ` Christian König
2025-09-02  7:42     ` Timur Kristóf
2025-09-02  9:54       ` Christian König
2025-09-02 10:10         ` Timur Kristóf
2025-09-01 10:00 ` [PATCH 4/4] drm/amdgpu: Set SDMA v3 copy_max_bytes to 0x3fff00 Timur Kristóf
2025-09-02  6:45   ` Christian König
2025-09-02  7:52     ` Timur Kristóf [this message]
2025-09-02  6:41 ` [PATCH 1/4] drm/amdgpu: Fix allocating extra dwords for rings Christian König
2025-09-02  8:26   ` Timur Kristóf
2025-09-02 11:20     ` Christian König

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=2281608ed8fedfc58aee3449fff1f8df28e3e36a.camel@gmail.com \
    --to=timur.kristof@gmail.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=christian.koenig@amd.com \
    /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 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.