From: "Timur Kristóf" <timur.kristof@gmail.com>
To: "Christian König" <christian.koenig@amd.com>,
amd-gfx@lists.freedesktop.org,
"Alex Deucher" <alexander.deucher@amd.com>,
"Alexandre Demers" <alexandre.f.demers@gmail.com>,
"Rodrigo Siqueira" <siqueira@igalia.com>
Cc: "Pelloux-Prayer, Pierre-Eric" <Pierre-eric.Pelloux-prayer@amd.com>
Subject: Re: [PATCH 01/14] drm/amdgpu/gmc: Don't hardcode GART page count before GTT
Date: Wed, 29 Oct 2025 12:41:14 +0100 [thread overview]
Message-ID: <2d5377e280e58e86d7c9cdda5497143ec853c263.camel@gmail.com> (raw)
In-Reply-To: <f1e7e9ff-5314-4ace-9ced-42110ea791be@amd.com>
On Wed, 2025-10-29 at 11:00 +0100, Christian König wrote:
> On 10/28/25 23:06, Timur Kristóf wrote:
> > GART contains some pages in its address space that come before
> > the GTT and are used for BO copies.
> >
> > Instead of hardcoding the size of the GART space before GTT,
> > make it a field in the amdgpu_gmc struct. This allows us to map
> > more things in GART before GTT.
> >
> > Split this into a separate patch to make it easier to bisect,
> > in case there are any errors in the future.
>
> Pierre-Eric has been working on something similar.
>
> On the newer HW generations we need more transfer windows since we
> want to utilize more DMA engines for copies and clears.
>
> My suggestion is that we just make AMDGPU_GTT_NUM_TRANSFER_WINDOWS
> depend on adev and so the HW generation and then reserve one extra
> transfer window for this workaround on SI.
I think the best would be to leave this patch as-is to avoid conflicts
with Pierre-Eric's work. After that work lands, we can revisit this
workaround.
Does that sound reasonable to you?
>
> Regards,
> Christian.
>
> >
> > Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
> > ---
> > drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 2 ++
> > drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h | 1 +
> > drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c | 2 +-
> > 3 files changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c
> > b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c
> > index 97b562a79ea8..bf31bd022d6d 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c
> > @@ -325,6 +325,8 @@ void amdgpu_gmc_gart_location(struct
> > amdgpu_device *adev, struct amdgpu_gmc *mc,
> > break;
> > }
> >
> > + mc->num_gart_pages_before_gtt =
> > + AMDGPU_GTT_MAX_TRANSFER_SIZE *
> > AMDGPU_GTT_NUM_TRANSFER_WINDOWS;
> > mc->gart_start &= ~(four_gb - 1);
> > mc->gart_end = mc->gart_start + mc->gart_size - 1;
> > dev_info(adev->dev, "GART: %lluM 0x%016llX - 0x%016llX\n",
> > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h
> > b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h
> > index 55097ca10738..568eed3eb557 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h
> > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h
> > @@ -266,6 +266,7 @@ struct amdgpu_gmc {
> > u64 fb_end;
> > unsigned vram_width;
> > u64 real_vram_size;
> > + u32 num_gart_pages_before_gtt;
> > int vram_mtrr;
> > u64 mc_mask;
> > const struct firmware *fw; /* MC firmware */
> > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c
> > b/drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c
> > index 0760e70402ec..4c2563a70c2b 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c
> > @@ -283,7 +283,7 @@ int amdgpu_gtt_mgr_init(struct amdgpu_device
> > *adev, uint64_t gtt_size)
> >
> > ttm_resource_manager_init(man, &adev->mman.bdev,
> > gtt_size);
> >
> > - start = AMDGPU_GTT_MAX_TRANSFER_SIZE *
> > AMDGPU_GTT_NUM_TRANSFER_WINDOWS;
> > + start = adev->gmc.num_gart_pages_before_gtt;
> > size = (adev->gmc.gart_size >> PAGE_SHIFT) - start;
> > drm_mm_init(&mgr->mm, start, size);
> > spin_lock_init(&mgr->lock);
next prev parent reply other threads:[~2025-10-29 11:41 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-28 22:06 [PATCH 00/14] drm/amdgpu: Support VCE1 IP block Timur Kristóf
2025-10-28 22:06 ` [PATCH 01/14] drm/amdgpu/gmc: Don't hardcode GART page count before GTT Timur Kristóf
2025-10-29 10:00 ` Christian König
2025-10-29 11:41 ` Timur Kristóf [this message]
2025-10-28 22:06 ` [PATCH 02/14] drm/amdgpu/gmc6: Place gart at low address range Timur Kristóf
2025-10-29 10:00 ` Christian König
2025-10-28 22:06 ` [PATCH 03/14] drm/amdgpu/gmc6: Add GART space for VCPU BO Timur Kristóf
2025-10-29 10:05 ` Christian König
2025-10-29 11:26 ` Timur Kristóf
2025-10-28 22:06 ` [PATCH 04/14] drm/amdgpu/gart: Add helper to bind VRAM BO Timur Kristóf
2025-10-29 10:16 ` Christian König
2025-10-29 10:57 ` Timur Kristóf
2025-10-28 22:06 ` [PATCH 05/14] drm/amdgpu/vce: Clear VCPU BO before copying firmware to it Timur Kristóf
2025-10-29 10:19 ` Christian König
2025-10-29 10:48 ` Timur Kristóf
2025-10-28 22:06 ` [PATCH 06/14] drm/amdgpu/vce: Move firmware load to amdgpu_vce_early_init Timur Kristóf
2025-10-29 10:26 ` Christian König
2025-10-29 17:16 ` Liu, Leo
2025-10-28 22:06 ` [PATCH 07/14] drm/amdgpu/si, cik, vi: Verify IP block when querying video codecs Timur Kristóf
2025-10-29 10:35 ` Christian König
2025-10-29 10:54 ` [PATCH 07/14] drm/amdgpu/si,cik,vi: " Timur Kristóf
2025-10-28 22:06 ` [PATCH 08/14] drm/amdgpu/vce1: Clean up register definitions Timur Kristóf
2025-10-29 11:23 ` Christian König
2025-10-28 22:06 ` [PATCH 09/14] drm/amdgpu/vce1: Load VCE1 firmware Timur Kristóf
2025-10-29 11:28 ` Christian König
2025-10-28 22:06 ` [PATCH 10/14] drm/amdgpu/vce1: Implement VCE1 IP block Timur Kristóf
2025-10-29 11:38 ` Christian König
2025-10-29 22:48 ` Timur Kristóf
2025-10-30 11:12 ` Christian König
2025-10-30 13:47 ` Timur Kristóf
2025-10-30 13:56 ` Christian König
2025-10-28 22:06 ` [PATCH 11/14] drm/amdgpu/vce1: Ensure VCPU BO is in lower 32-bit address space Timur Kristóf
2025-10-29 11:41 ` Christian König
2025-10-28 22:06 ` [PATCH 12/14] drm/amd/pm/si: Hook up VCE1 to SI DPM Timur Kristóf
2025-10-29 11:47 ` Christian König
2025-10-28 22:06 ` [PATCH 13/14] drm/amdgpu/vce1: Enable VCE1 on Tahiti, Pitcairn, Cape Verde GPUs Timur Kristóf
2025-10-29 11:51 ` Christian König
2025-10-28 22:06 ` [PATCH 14/14] drm/amdgpu/vce1: Tolerate VCE PLL timeout better Timur Kristóf
2025-10-29 12:02 ` Christian König
2025-10-29 19:46 ` Deucher, Alexander
2025-11-03 16:01 ` timur.kristof
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=2d5377e280e58e86d7c9cdda5497143ec853c263.camel@gmail.com \
--to=timur.kristof@gmail.com \
--cc=Pierre-eric.Pelloux-prayer@amd.com \
--cc=alexander.deucher@amd.com \
--cc=alexandre.f.demers@gmail.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=christian.koenig@amd.com \
--cc=siqueira@igalia.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).