amd-gfx.lists.freedesktop.org archive mirror
 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,
	"Alex Deucher" <alexander.deucher@amd.com>,
	"Alexandre Demers" <alexandre.f.demers@gmail.com>,
	"Rodrigo Siqueira" <siqueira@igalia.com>,
	"Leo Liu" <Leo.Liu@amd.com>
Subject: Re: [PATCH 05/16] drm/amdgpu/ttm: Use GART helper to map VRAM pages (v2)
Date: Tue, 04 Nov 2025 16:11:08 +0100	[thread overview]
Message-ID: <2a99b4d9433889742782f76a0d7cf5e6a9dac8c2.camel@gmail.com> (raw)
In-Reply-To: <6814cde4-0b65-4873-a006-ee52520a8fa2@amd.com>

On Tue, 2025-11-04 at 14:33 +0100, Christian König wrote:
> On 11/3/25 23:23, Timur Kristóf wrote:
> > Use the GART helper function introduced in the previous commit
> > to map the VRAM pages of the transfer window to GART.
> > No functional changes, just code cleanup.
> > 
> > Split this into a separate commit to make it easier to bisect,
> > in case there are problems in the future.
> > 
> > Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
> 
> Reviewed-by: Christian König <christian.koenig@amd.com>
> 
> Could also be squashed into commit #4. Otherwise commit #5 just adds
> unused functionality.
> 
> But not a must have from my side.
> 
> Regards,
> Christian.

I prefer to keep the two commits separate to make it easier to bisect
and troubleshoot. In case there are any problems with it, commit #5 can
be reverted without regressing the VCE1 functionality.

Thanks,
Timur

> 
> > ---
> >  drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 12 ++----------
> >  1 file changed, 2 insertions(+), 10 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> > b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> > index e226c3aff7d7..84f9d5a57d03 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> > @@ -188,7 +188,6 @@ static int amdgpu_ttm_map_buffer(struct
> > ttm_buffer_object *bo,
> >  	struct amdgpu_job *job;
> >  	void *cpu_addr;
> >  	uint64_t flags;
> > -	unsigned int i;
> >  	int r;
> >  
> >  	BUG_ON(adev->mman.buffer_funcs->copy_max_bytes <
> > @@ -254,16 +253,9 @@ static int amdgpu_ttm_map_buffer(struct
> > ttm_buffer_object *bo,
> >  		dma_addr = &bo->ttm->dma_address[mm_cur->start >>
> > PAGE_SHIFT];
> >  		amdgpu_gart_map(adev, 0, num_pages, dma_addr,
> > flags, cpu_addr);
> >  	} else {
> > -		dma_addr_t dma_address;
> > -
> > -		dma_address = mm_cur->start;
> > -		dma_address += adev->vm_manager.vram_base_offset;
> > +		u64 pa = mm_cur->start + adev-
> > >vm_manager.vram_base_offset;
> >  
> > -		for (i = 0; i < num_pages; ++i) {
> > -			amdgpu_gart_map(adev, i << PAGE_SHIFT, 1,
> > &dma_address,
> > -					flags, cpu_addr);
> > -			dma_address += PAGE_SIZE;
> > -		}
> > +		amdgpu_gart_map_vram_range(adev, pa, 0, num_pages,
> > flags, cpu_addr);
> >  	}
> >  
> >  	dma_fence_put(amdgpu_job_submit(job));

  reply	other threads:[~2025-11-04 15:11 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-03 22:23 [PATCH 00/16] drm/amdgpu: Support VCE1 IP block (v2) Timur Kristóf
2025-11-03 22:23 ` [PATCH 01/16] drm/amdgpu/gmc: Don't hardcode GART page count before GTT Timur Kristóf
2025-11-04 13:23   ` Christian König
2025-11-04 15:08     ` Pierre-Eric Pelloux-Prayer
2025-11-04 15:24       ` Christian König
2025-11-04 15:37         ` Pierre-Eric Pelloux-Prayer
2025-11-04 15:26       ` Timur Kristóf
2025-11-04 17:10         ` Timur Kristóf
2025-11-03 22:23 ` [PATCH 02/16] drm/amdgpu/gmc6: Place gart at low address range Timur Kristóf
2025-11-03 22:23 ` [PATCH 03/16] drm/amdgpu/gmc6: Add GART space for VCPU BO (v2) Timur Kristóf
2025-11-03 22:23 ` [PATCH 04/16] drm/amdgpu/gart: Add helper to bind VRAM pages (v2) Timur Kristóf
2025-11-04 13:32   ` Christian König
2025-11-03 22:23 ` [PATCH 05/16] drm/amdgpu/ttm: Use GART helper to map " Timur Kristóf
2025-11-04 13:33   ` Christian König
2025-11-04 15:11     ` Timur Kristóf [this message]
2025-11-03 22:23 ` [PATCH 06/16] drm/amdgpu/vce: Clear VCPU BO before copying firmware to it (v2) Timur Kristóf
2025-11-03 22:23 ` [PATCH 07/16] drm/amdgpu/vce: Move firmware load to amdgpu_vce_early_init Timur Kristóf
2025-11-03 22:23 ` [PATCH 08/16] drm/amdgpu/vce: Save/restore and pin VCPU BO for all VCE (v2) Timur Kristóf
2025-11-03 22:23 ` [PATCH 09/16] drm/amdgpu/si, cik, vi: Verify IP block when querying video codecs (v2) Timur Kristóf
2025-11-04 13:44   ` Christian König
2025-11-04 15:16     ` [PATCH 09/16] drm/amdgpu/si,cik,vi: " Timur Kristóf
2025-11-04 15:27       ` [PATCH 09/16] drm/amdgpu/si, cik, vi: " Alex Deucher
2025-11-04 15:29         ` Christian König
2025-11-04 15:33           ` Alex Deucher
2025-11-03 22:23 ` [PATCH 10/16] drm/amdgpu/vce1: Clean up register definitions Timur Kristóf
2025-11-03 22:23 ` [PATCH 11/16] drm/amdgpu/vce1: Load VCE1 firmware Timur Kristóf
2025-11-03 22:23 ` [PATCH 12/16] drm/amdgpu/vce1: Implement VCE1 IP block (v2) Timur Kristóf
2025-11-04 13:51   ` Christian König
2025-11-03 22:23 ` [PATCH 13/16] drm/amdgpu/vce1: Ensure VCPU BO is in lower 32-bit address space (v2) Timur Kristóf
2025-11-03 22:23 ` [PATCH 14/16] drm/amd/pm/si: Hook up VCE1 to SI DPM Timur Kristóf
2025-11-03 22:23 ` [PATCH 15/16] drm/amdgpu/vce1: Enable VCE1 on Tahiti, Pitcairn, Cape Verde GPUs Timur Kristóf
2025-11-03 22:23 ` [PATCH 16/16] drm/amdgpu/vce1: Workaround PLL timeout on FirePro W9000 Timur Kristóf

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=2a99b4d9433889742782f76a0d7cf5e6a9dac8c2.camel@gmail.com \
    --to=timur.kristof@gmail.com \
    --cc=Leo.Liu@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).