[PATCH i-g-t] lib/amdgpu: change sdma limit check
vitaly prosyak
vprosyak at amd.com
Wed Oct 16 02:06:03 UTC 2024
The change looks good to me
Reviewed-by: Vitaly Prosyak <vitaly.prosyak at amd.com>
On 2024-10-14 01:05, Jesse.zhang at amd.com wrote:
> This sdma limit is only for mi100.
>
> Signed-off-by: Jesse Zhang <Jesse.Zhang at amd.com>
> ---
> lib/amdgpu/amd_ip_blocks.c | 11 +++++++----
> lib/amdgpu/amd_ip_blocks.h | 2 ++
> 2 files changed, 9 insertions(+), 4 deletions(-)
>
> diff --git a/lib/amdgpu/amd_ip_blocks.c b/lib/amdgpu/amd_ip_blocks.c
> index f22a322e5..df603618b 100644
> --- a/lib/amdgpu/amd_ip_blocks.c
> +++ b/lib/amdgpu/amd_ip_blocks.c
> @@ -190,8 +190,9 @@ sdma_ring_copy_linear(const struct amdgpu_ip_funcs *func,
> SDMA_COPY_SUB_OPCODE_LINEAR,
> context->secure ? 0x4 : 0);
> if (func->family_id >= AMDGPU_FAMILY_AI) {
> - /* For FAMILY AI, the maximum copy range supported by sdma is 4MB */
> - if (func->family_id >= AMDGPU_FAMILY_AI && context->write_length > 0x3fffff) {
> + /* For mi100, the maximum copy range supported by sdma is 4MB */
> + if (func->family_id == AMDGPU_FAMILY_AI && func->chip_external_rev == 0x33
> + && context->write_length > 0x3fffff) {
> context->pm4[i++] = 0x3fffff;
> igt_warn("sdma copy count exceeds the maximum limit of 4MB\n");
> } else {
> @@ -855,9 +856,11 @@ int setup_amdgpu_ip_blocks(uint32_t major, uint32_t minor, struct amdgpu_gpu_inf
> * TO DO: move family id as a parameter into IP functions and
> * remove it as a field
> */
> - for (int i = 0; i < amdgpu_ips.num_ip_blocks; i++)
> + for (int i = 0; i < amdgpu_ips.num_ip_blocks; i++) {
> amdgpu_ips.ip_blocks[i]->funcs->family_id = amdinfo->family_id;
> -
> + amdgpu_ips.ip_blocks[i]->funcs->chip_external_rev = amdinfo->chip_external_rev;
> + amdgpu_ips.ip_blocks[i]->funcs->chip_rev = amdinfo->chip_rev;
> + }
> /* extra precaution if re-factor again */
> igt_assert_eq(gfx_v8_x_ip_block.major, 8);
> igt_assert_eq(compute_v8_x_ip_block.major, 8);
> diff --git a/lib/amdgpu/amd_ip_blocks.h b/lib/amdgpu/amd_ip_blocks.h
> index 679e2ea46..109d36602 100644
> --- a/lib/amdgpu/amd_ip_blocks.h
> +++ b/lib/amdgpu/amd_ip_blocks.h
> @@ -133,6 +133,8 @@ struct amdgpu_ring_context {
>
> struct amdgpu_ip_funcs {
> uint32_t family_id;
> + uint32_t chip_external_rev;
> + uint32_t chip_rev;
> uint32_t align_mask;
> uint32_t nop;
> uint32_t deadbeaf;
More information about the igt-dev
mailing list