Skip to content

Commit 8b68788

Browse files
committed
Merge tag 'amd-drm-fixes-6.10-2024-07-11' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes
amd-drm-fixes-6.10-2024-07-11: amdgpu: - PSR-SU fix - Reseved VMID fix Signed-off-by: Dave Airlie <[email protected]> From: Alex Deucher <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 parents 85e23c6 + dc1000b commit 8b68788

File tree

4 files changed

+30
-2
lines changed

4 files changed

+30
-2
lines changed

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1093,6 +1093,21 @@ static int amdgpu_cs_vm_handling(struct amdgpu_cs_parser *p)
10931093
unsigned int i;
10941094
int r;
10951095

1096+
/*
1097+
* We can't use gang submit on with reserved VMIDs when the VM changes
1098+
* can't be invalidated by more than one engine at the same time.
1099+
*/
1100+
if (p->gang_size > 1 && !p->adev->vm_manager.concurrent_flush) {
1101+
for (i = 0; i < p->gang_size; ++i) {
1102+
struct drm_sched_entity *entity = p->entities[i];
1103+
struct drm_gpu_scheduler *sched = entity->rq->sched;
1104+
struct amdgpu_ring *ring = to_amdgpu_ring(sched);
1105+
1106+
if (amdgpu_vmid_uses_reserved(vm, ring->vm_hub))
1107+
return -EINVAL;
1108+
}
1109+
}
1110+
10961111
r = amdgpu_vm_clear_freed(adev, vm, NULL);
10971112
if (r)
10981113
return r;

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

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ int amdgpu_vmid_grab(struct amdgpu_vm *vm, struct amdgpu_ring *ring,
406406
if (r || !idle)
407407
goto error;
408408

409-
if (vm->reserved_vmid[vmhub] || (enforce_isolation && (vmhub == AMDGPU_GFXHUB(0)))) {
409+
if (amdgpu_vmid_uses_reserved(vm, vmhub)) {
410410
r = amdgpu_vmid_grab_reserved(vm, ring, job, &id, fence);
411411
if (r || !id)
412412
goto error;
@@ -456,6 +456,19 @@ int amdgpu_vmid_grab(struct amdgpu_vm *vm, struct amdgpu_ring *ring,
456456
return r;
457457
}
458458

459+
/*
460+
* amdgpu_vmid_uses_reserved - check if a VM will use a reserved VMID
461+
* @vm: the VM to check
462+
* @vmhub: the VMHUB which will be used
463+
*
464+
* Returns: True if the VM will use a reserved VMID.
465+
*/
466+
bool amdgpu_vmid_uses_reserved(struct amdgpu_vm *vm, unsigned int vmhub)
467+
{
468+
return vm->reserved_vmid[vmhub] ||
469+
(enforce_isolation && (vmhub == AMDGPU_GFXHUB(0)));
470+
}
471+
459472
int amdgpu_vmid_alloc_reserved(struct amdgpu_device *adev,
460473
unsigned vmhub)
461474
{

drivers/gpu/drm/amd/amdgpu/amdgpu_ids.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ void amdgpu_pasid_free_delayed(struct dma_resv *resv,
7878

7979
bool amdgpu_vmid_had_gpu_reset(struct amdgpu_device *adev,
8080
struct amdgpu_vmid *id);
81+
bool amdgpu_vmid_uses_reserved(struct amdgpu_vm *vm, unsigned int vmhub);
8182
int amdgpu_vmid_alloc_reserved(struct amdgpu_device *adev,
8283
unsigned vmhub);
8384
void amdgpu_vmid_free_reserved(struct amdgpu_device *adev,

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10048,7 +10048,6 @@ static int dm_update_crtc_state(struct amdgpu_display_manager *dm,
1004810048
}
1004910049

1005010050
/* Update Freesync settings. */
10051-
reset_freesync_config_for_crtc(dm_new_crtc_state);
1005210051
get_freesync_config_for_crtc(dm_new_crtc_state,
1005310052
dm_new_conn_state);
1005410053

0 commit comments

Comments
 (0)