Skip to contentSkip to conversation

drm/amdgpu/sdma4.0: adjust SDMA limits

PATCH In review Alex Deucher 3 participants 9 messages Feb 19 – Feb 20

Subsystems (2)
lore
Share & tools
lore

Alex Deucher

author maintainer
#0 lore raw

PATCH 1/7 drm/amdgpu/sdma4.0: adjust SDMA limits

SDMA 4.4.x has increased transfer limits.

v2: fix harder, use shifts to make it more obvious

Cc Vitaly Prosyak <[email protected]>
---
 drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c +16 -3
index a35d9951e22a9..44f0f23e11484 100644
@@ -2604,18 +2604,31 @@ static void sdma_v4_0_emit_fill_buffer(struct amdgpu_ib *ib,
 }
 
 static const struct amdgpu_buffer_funcs sdma_v4_0_buffer_funcs = {
-	.copy_max_bytes = 0x400000,
+	.copy_max_bytes = 1 << 22,
 	.copy_num_dw = 7,
 	.emit_copy_buffer = sdma_v4_0_emit_copy_buffer,
 
-	.fill_max_bytes = 0x400000,
+	.fill_max_bytes = 1 << 22,
+	.fill_num_dw = 5,
+	.emit_fill_buffer = sdma_v4_0_emit_fill_buffer,
+};
+
+static const struct amdgpu_buffer_funcs sdma_v4_4_buffer_funcs = {
+	.copy_max_bytes = 1 << 30,
+	.copy_num_dw = 7,
+	.emit_copy_buffer = sdma_v4_0_emit_copy_buffer,
+
+	.fill_max_bytes = 1 << 30,
 	.fill_num_dw = 5,
 	.emit_fill_buffer = sdma_v4_0_emit_fill_buffer,
 };
 
 static void sdma_v4_0_set_buffer_funcs(struct amdgpu_device *adev)
 {
-	adev->mman.buffer_funcs = &sdma_v4_0_buffer_funcs;
+	if (amdgpu_ip_version(adev, SDMA0_HWIP, 0) >= IP_VERSION(4, 4, 0))
+		adev->mman.buffer_funcs = &sdma_v4_4_buffer_funcs;
+	else
+		adev->mman.buffer_funcs = &sdma_v4_0_buffer_funcs;
 	if (adev->sdma.has_page_queue)
 		adev->mman.buffer_funcs_ring = &adev->sdma.instance[0].page;
 	else
Signature · 1 line
2.53.0
author maintainer
#1 lore raw

PATCH 2/7 drm/amdgpu/sdma4.4: adjust SDMA limits

SDMA 4.4.x has increased transfer limits.

v2: fix harder, use shifts to make it more obvious

Cc Vitaly Prosyak <[email protected]>
---
 drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c +2 -2
index 7f77367848d43..78bdfed0a7fd3 100644
@@ -2305,11 +2305,11 @@ static void sdma_v4_4_2_emit_fill_buffer(struct amdgpu_ib *ib,
 }
 
 static const struct amdgpu_buffer_funcs sdma_v4_4_2_buffer_funcs = {
-	.copy_max_bytes = 0x400000,
+	.copy_max_bytes = 1 << 30,
 	.copy_num_dw = 7,
 	.emit_copy_buffer = sdma_v4_4_2_emit_copy_buffer,
 
-	.fill_max_bytes = 0x400000,
+	.fill_max_bytes = 1 << 30,
 	.fill_num_dw = 5,
 	.emit_fill_buffer = sdma_v4_4_2_emit_fill_buffer,
 };
Signature · 1 line
2.53.0
author maintainer
#2 lore raw

PATCH 3/7 drm/amdgpu/sdma5.0: adjust SDMA limits

In reply to Alex Deucher

SDMA 5.0 has increased transfer limits.

Cc Vitaly Prosyak <[email protected]>
---
 drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c +2 -2
index 52f4e9e099cbf..0b83598cd9980 100644
@@ -2041,11 +2041,11 @@ static void sdma_v5_0_emit_fill_buffer(struct amdgpu_ib *ib,
 }
 
 static const struct amdgpu_buffer_funcs sdma_v5_0_buffer_funcs = {
-	.copy_max_bytes = 0x400000,
+	.copy_max_bytes = 1 << 30,
 	.copy_num_dw = 7,
 	.emit_copy_buffer = sdma_v5_0_emit_copy_buffer,
 
-	.fill_max_bytes = 0x400000,
+	.fill_max_bytes = 1 << 30,
 	.fill_num_dw = 5,
 	.emit_fill_buffer = sdma_v5_0_emit_fill_buffer,
 };
Signature · 1 line
2.53.0
#3 lore raw

Re: [PATCH 3/7] drm/amdgpu/sdma5.0: adjust SDMA limits

Quoted 2 lines · Alex Deucher

SDMA 5.0 has increased transfer limits.

The current limits are correct as is for 5.0. Dropping this patch.

Alex

Quoted 28 lines
Cc Vitaly Prosyak <[email protected]>
---
 drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c +2 -3
index 52f4e9e099cbf..0b83598cd9980 100644
@@ -2041,11 +2041,11 @@ static void sdma_v5_0_emit_fill_buffer(struct amdgpu_ib *ib,
 }
 
 static const struct amdgpu_buffer_funcs sdma_v5_0_buffer_funcs = {
-       .copy_max_bytes = 0x400000,
+       .copy_max_bytes = 1 << 30,
        .copy_num_dw = 7,
        .emit_copy_buffer = sdma_v5_0_emit_copy_buffer,
 
-       .fill_max_bytes = 0x400000,
+       .fill_max_bytes = 1 << 30,
        .fill_num_dw = 5,
        .emit_fill_buffer = sdma_v5_0_emit_fill_buffer,
 };
--

2.53.0

author maintainer
#4 lore raw

PATCH 4/7 drm/amdgpu/sdma5.2: adjust SDMA limits

In reply to Alex Deucher

SDMA 5.2.x has increased transfer limits.

v2: fix harder, use shifts to make it more obvious
v3: align const fill with PAL limits
v4: re-align with hw limits

Cc Vitaly Prosyak <[email protected]>
---
 drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c +2 -2
index 491fe14ec0ba4..e7e53fdb9f8ae 100644
@@ -2045,11 +2045,11 @@ static void sdma_v5_2_emit_fill_buffer(struct amdgpu_ib *ib,
 }
 
 static const struct amdgpu_buffer_funcs sdma_v5_2_buffer_funcs = {
-	.copy_max_bytes = 0x400000,
+	.copy_max_bytes = 1 << 30,
 	.copy_num_dw = 7,
 	.emit_copy_buffer = sdma_v5_2_emit_copy_buffer,
 
-	.fill_max_bytes = 0x400000,
+	.fill_max_bytes = 1 << 30, /* HW supports 1 << 30, but PAL uses 1 << 22 */
 	.fill_num_dw = 5,
 	.emit_fill_buffer = sdma_v5_2_emit_fill_buffer,
 };
Signature · 1 line
2.53.0
author maintainer
#5 lore raw

PATCH 5/7 drm/amdgpu/sdma6.0: adjust SDMA limits

In reply to Alex Deucher

SDMA 6.x has increased transfer limits.

v2: fix harder, use shifts to make it more obvious

Cc Vitaly Prosyak <[email protected]>
---
 drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c +2 -2
index 2643364328498..b005672f2f96b 100644
@@ -1884,11 +1884,11 @@ static void sdma_v6_0_emit_fill_buffer(struct amdgpu_ib *ib,
 }
 
 static const struct amdgpu_buffer_funcs sdma_v6_0_buffer_funcs = {
-	.copy_max_bytes = 0x400000,
+	.copy_max_bytes = 1 << 30,
 	.copy_num_dw = 7,
 	.emit_copy_buffer = sdma_v6_0_emit_copy_buffer,
 
-	.fill_max_bytes = 0x400000,
+	.fill_max_bytes = 1 << 30,
 	.fill_num_dw = 5,
 	.emit_fill_buffer = sdma_v6_0_emit_fill_buffer,
 };
Signature · 1 line
2.53.0
author maintainer
#6 lore raw

PATCH 6/7 drm/amdgpu/sdma7.0: adjust SDMA limits

In reply to Alex Deucher

SDMA 7.0 has increased transfer limits.

v2: fix harder, use shifts to make it more obvious

Cc Vitaly Prosyak <[email protected]>
---
 drivers/gpu/drm/amd/amdgpu/sdma_v7_0.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/sdma_v7_0.c +2 -2
index f938be0524cd1..5679a94d0815e 100644
@@ -1835,10 +1835,10 @@ static void sdma_v7_0_emit_fill_buffer(struct amdgpu_ib *ib,
 }
 
 static const struct amdgpu_buffer_funcs sdma_v7_0_buffer_funcs = {
-	.copy_max_bytes = 0x400000,
+	.copy_max_bytes = 1 << 30,
 	.copy_num_dw = 8,
 	.emit_copy_buffer = sdma_v7_0_emit_copy_buffer,
-	.fill_max_bytes = 0x400000,
+	.fill_max_bytes = 1 << 30,
 	.fill_num_dw = 5,
 	.emit_fill_buffer = sdma_v7_0_emit_fill_buffer,
 };
Signature · 1 line
2.53.0
author maintainer
#7 lore raw

PATCH 7/7 drm/amdgpu/sdma7.1: adjust SDMA limits

In reply to Alex Deucher

SDMA 7.1 has increased transfer limits.

Cc Vitaly Prosyak <[email protected]>
---
 drivers/gpu/drm/amd/amdgpu/sdma_v7_1.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/sdma_v7_1.c +2 -2
index 3de76afe3e454..03bf1f86098f1 100644
@@ -1745,10 +1745,10 @@ static void sdma_v7_1_emit_fill_buffer(struct amdgpu_ib *ib,
 }
 
 static const struct amdgpu_buffer_funcs sdma_v7_1_buffer_funcs = {
-	.copy_max_bytes = 0x400000,
+	.copy_max_bytes = 1 << 30,
 	.copy_num_dw = 8,
 	.emit_copy_buffer = sdma_v7_1_emit_copy_buffer,
-	.fill_max_bytes = 0x400000,
+	.fill_max_bytes = 1 << 30,
 	.fill_num_dw = 5,
 	.emit_fill_buffer = sdma_v7_1_emit_fill_buffer,
 };
Signature · 1 line
2.53.0
Reviewed-by on v1 1/7
#8 lore raw
In reply to Alex Deucher

The entire series of 7 patches looks good to me.

Yes — for SDMA 5.0 the maximum COPY transfer size should be 1 << 22 (0x400000). I validated the limits using the new IGT tests.

Quoted 49 lines · Alex Deucher

SDMA 4.4.x has increased transfer limits.

v2: fix harder, use shifts to make it more obvious

Cc Vitaly Prosyak <[email protected]>
---
 drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c +16 -3
index a35d9951e22a9..44f0f23e11484 100644
@@ -2604,18 +2604,31 @@ static void sdma_v4_0_emit_fill_buffer(struct amdgpu_ib *ib,
 }
 
 static const struct amdgpu_buffer_funcs sdma_v4_0_buffer_funcs = {
-	.copy_max_bytes = 0x400000,
+	.copy_max_bytes = 1 << 22,
 	.copy_num_dw = 7,
 	.emit_copy_buffer = sdma_v4_0_emit_copy_buffer,
 
-	.fill_max_bytes = 0x400000,
+	.fill_max_bytes = 1 << 22,
+	.fill_num_dw = 5,
+	.emit_fill_buffer = sdma_v4_0_emit_fill_buffer,
+};
+
+static const struct amdgpu_buffer_funcs sdma_v4_4_buffer_funcs = {
+	.copy_max_bytes = 1 << 30,
+	.copy_num_dw = 7,
+	.emit_copy_buffer = sdma_v4_0_emit_copy_buffer,
+
+	.fill_max_bytes = 1 << 30,
 	.fill_num_dw = 5,
 	.emit_fill_buffer = sdma_v4_0_emit_fill_buffer,
 };
 
 static void sdma_v4_0_set_buffer_funcs(struct amdgpu_device *adev)
 {
-	adev->mman.buffer_funcs = &sdma_v4_0_buffer_funcs;
+	if (amdgpu_ip_version(adev, SDMA0_HWIP, 0) >= IP_VERSION(4, 4, 0))
+		adev->mman.buffer_funcs = &sdma_v4_4_buffer_funcs;
+	else
+		adev->mman.buffer_funcs = &sdma_v4_0_buffer_funcs;
 	if (adev->sdma.has_page_queue)
 		adev->mman.buffer_funcs_ring = &adev->sdma.instance[0].page;
 	else