All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Christian König" <christian.koenig@amd.com>
To: "Timur Kristóf" <timur.kristof@gmail.com>, amd-gfx@lists.freedesktop.org
Cc: alexander.deucher@amd.com
Subject: Re: [PATCH 1/4] drm/amdgpu: Fix allocating extra dwords for rings
Date: Tue, 2 Sep 2025 08:41:09 +0200	[thread overview]
Message-ID: <cb030737-e602-4bdd-aef2-cb5fc79ee2ca@amd.com> (raw)
In-Reply-To: <20250901100012.439155-1-timur.kristof@gmail.com>

On 01.09.25 12:00, Timur Kristóf wrote:
> The amdgpu_bo_create_kernel function takes a byte count,
> so we need to multiply the extra dword count by four.
> (The ring_size is already in bytes so that one is correct here.)

Good catch, it just doesn't make a difference in practice since everything is rounded up to 4k anyway.

But I'm really wondering if we shouldn't replace the extra_dw with extra_bytes instead.

It should only be used by some multimedia engines anyway.

Regards,
Christian.

> 
> Fixes: c8c1a1d2ef04 ("drm/amdgpu: define and add extra dword for jpeg ring")
> Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | 11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
> index 6379bb25bf5c..13f0f0209cbe 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
> @@ -364,11 +364,12 @@ int amdgpu_ring_init(struct amdgpu_device *adev, struct amdgpu_ring *ring,
>  
>  	/* Allocate ring buffer */
>  	if (ring->ring_obj == NULL) {
> -		r = amdgpu_bo_create_kernel(adev, ring->ring_size + ring->funcs->extra_dw, PAGE_SIZE,
> -					    AMDGPU_GEM_DOMAIN_GTT,
> -					    &ring->ring_obj,
> -					    &ring->gpu_addr,
> -					    (void **)&ring->ring);
> +		r = amdgpu_bo_create_kernel(adev, ring->ring_size + ring->funcs->extra_dw * 4,
> +						PAGE_SIZE,
> +						AMDGPU_GEM_DOMAIN_GTT,
> +						&ring->ring_obj,
> +						&ring->gpu_addr,
> +						(void **)&ring->ring);
>  		if (r) {
>  			dev_err(adev->dev, "(%d) ring create failed\n", r);
>  			kvfree(ring->ring_backup);


  parent reply	other threads:[~2025-09-02  6:41 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
2025-09-02  6:41 ` Christian König [this message]
2025-09-02  8:26   ` [PATCH 1/4] drm/amdgpu: Fix allocating extra dwords for rings 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=cb030737-e602-4bdd-aef2-cb5fc79ee2ca@amd.com \
    --to=christian.koenig@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=timur.kristof@gmail.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.