AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Timur Kristóf" <timur.kristof@gmail.com>
To: amd-gfx@lists.freedesktop.org, alexander.deucher@amd.com,
	christian.koenig@amd.com
Cc: "Timur Kristóf" <timur.kristof@gmail.com>
Subject: [PATCH 5/7] drm/amdgpu/vce1: Check if VRAM address is lower than GART.
Date: Mon, 20 Apr 2026 14:10:42 +0200	[thread overview]
Message-ID: <20260420121044.155030-6-timur.kristof@gmail.com> (raw)
In-Reply-To: <20260420121044.155030-1-timur.kristof@gmail.com>

Previously, I had assumed this was not possible
so it was OK to not handle it, but now we got a report
from a user who has a board that is configured this way.

When the VCPU BO is already located in a low 32-bit address
in VRAM (eg. when VRAM is mapped to the low address space),
don't do the workaround.

Fixes: 66a80158aa2a ("amdgpu/vce: use amdgpu_gtt_mgr_alloc_entries")
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
---
 drivers/gpu/drm/amd/amdgpu/vce_v1_0.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/vce_v1_0.c b/drivers/gpu/drm/amd/amdgpu/vce_v1_0.c
index 35caef5a8102e..b7b6096c1a1fd 100644
--- a/drivers/gpu/drm/amd/amdgpu/vce_v1_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/vce_v1_0.c
@@ -538,6 +538,9 @@ static int vce_v1_0_ensure_vcpu_bo_32bit_addr(struct amdgpu_device *adev)
 	u64 vce_gart_start_offs;
 	int r;
 
+	if (adev->gmc.vram_start < adev->gmc.gart_start)
+		return amdgpu_bo_gpu_offset(adev->vce.vcpu_bo) <= max_vcpu_bo_addr ? 0 : -EINVAL;
+
 	r = amdgpu_gtt_mgr_alloc_entries(&adev->mman.gtt_mgr,
 					 &adev->vce.gart_node, num_pages, 0,
 					 DRM_MM_INSERT_LOW);
-- 
2.53.0


  parent reply	other threads:[~2026-04-20 12:10 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-20 12:10 [PATCH 0/7] VCE1 fixes Timur Kristóf
2026-04-20 12:10 ` [PATCH 1/7] drm/amdgpu: Add alignment to amdgpu_gtt_mgr_alloc_entries() Timur Kristóf
2026-04-20 12:16   ` Christian König
2026-04-20 12:10 ` [PATCH 2/7] drm/amdgpu/vce: Align VCPU BO to nearest power of two Timur Kristóf
2026-04-20 13:52   ` Christian König
2026-04-20 12:10 ` [PATCH 3/7] drm/amdgpu/vce1: Correct firmware offset mask Timur Kristóf
2026-04-20 12:23   ` Christian König
2026-04-20 13:49     ` Timur Kristóf
2026-04-20 12:10 ` [PATCH 4/7] drm/amdgpu/vce1: Remove superfluous address check Timur Kristóf
2026-04-20 12:23   ` Christian König
2026-04-20 12:10 ` Timur Kristóf [this message]
2026-04-20 12:25   ` [PATCH 5/7] drm/amdgpu/vce1: Check if VRAM address is lower than GART Christian König
2026-04-20 12:10 ` [PATCH 6/7] drm/amdgpu/vce1: Don't repeat GTT MGR node allocation Timur Kristóf
2026-04-20 12:25   ` Christian König
2026-04-20 12:10 ` [PATCH 7/7] drm/amdgpu/vce1: Align VCPU BO GART address to nearest power of two Timur Kristóf
2026-04-20 12:27   ` 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=20260420121044.155030-6-timur.kristof@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox