Skip to content

Commit 94034b3

Browse files
jiadozhualexdeucher
authored andcommitted
drm/amdgpu: Program gds backup address as zero if no gds allocated
It is firmware requirement to set gds_backup_addrlo and gds_backup_addrhi of DE meta both zero if no gds partition is allocated for the frame. Signed-off-by: Jiadong Zhu <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]> Cc: [email protected] # 6.3.x
1 parent 1dbcf77 commit 94034b3

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -755,7 +755,7 @@ static void gfx_v9_0_set_rlc_funcs(struct amdgpu_device *adev);
755755
static int gfx_v9_0_get_cu_info(struct amdgpu_device *adev,
756756
struct amdgpu_cu_info *cu_info);
757757
static uint64_t gfx_v9_0_get_gpu_clock_counter(struct amdgpu_device *adev);
758-
static void gfx_v9_0_ring_emit_de_meta(struct amdgpu_ring *ring, bool resume);
758+
static void gfx_v9_0_ring_emit_de_meta(struct amdgpu_ring *ring, bool resume, bool usegds);
759759
static u64 gfx_v9_0_ring_get_rptr_compute(struct amdgpu_ring *ring);
760760
static void gfx_v9_0_query_ras_error_count(struct amdgpu_device *adev,
761761
void *ras_error_status);
@@ -5127,7 +5127,8 @@ static void gfx_v9_0_ring_emit_ib_gfx(struct amdgpu_ring *ring,
51275127
gfx_v9_0_ring_emit_de_meta(ring,
51285128
(!amdgpu_sriov_vf(ring->adev) &&
51295129
flags & AMDGPU_IB_PREEMPTED) ?
5130-
true : false);
5130+
true : false,
5131+
job->gds_size > 0 && job->gds_base != 0);
51315132
}
51325133

51335134
amdgpu_ring_write(ring, header);
@@ -5402,7 +5403,7 @@ static int gfx_v9_0_ring_preempt_ib(struct amdgpu_ring *ring)
54025403
return r;
54035404
}
54045405

5405-
static void gfx_v9_0_ring_emit_de_meta(struct amdgpu_ring *ring, bool resume)
5406+
static void gfx_v9_0_ring_emit_de_meta(struct amdgpu_ring *ring, bool resume, bool usegds)
54065407
{
54075408
struct amdgpu_device *adev = ring->adev;
54085409
struct v9_de_ib_state de_payload = {0};
@@ -5433,8 +5434,10 @@ static void gfx_v9_0_ring_emit_de_meta(struct amdgpu_ring *ring, bool resume)
54335434
PAGE_SIZE);
54345435
}
54355436

5436-
de_payload.gds_backup_addrlo = lower_32_bits(gds_addr);
5437-
de_payload.gds_backup_addrhi = upper_32_bits(gds_addr);
5437+
if (usegds) {
5438+
de_payload.gds_backup_addrlo = lower_32_bits(gds_addr);
5439+
de_payload.gds_backup_addrhi = upper_32_bits(gds_addr);
5440+
}
54385441

54395442
cnt = (sizeof(de_payload) >> 2) + 4 - 2;
54405443
amdgpu_ring_write(ring, PACKET3(PACKET3_WRITE_DATA, cnt));

0 commit comments

Comments
 (0)