Skip to content

Commit

Permalink
drm/amd/display: release spinlock before committing updates to stream
Browse files Browse the repository at this point in the history
Currently, amdgpu_do_flip() spinlocks crtc->dev->event_lock and
releases it only after committing updates to the stream.

dc_commit_updates_for_stream() should be moved out of
spinlock for the below reasons:

1. event_lock is supposed to protect access to acrct->pflip_status _only_
2. dc_commit_updates_for_stream() has potential sleep's
   and also its not appropriate to be  in an atomic state
   for such long sequences of code.

Signed-off-by: Shirish S <[email protected]>
Suggested-by: Andrey Grodzovsky <[email protected]>
Reviewed-by: Michel Dänzer <[email protected]>
Reviewed-by: Harry Wentland <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
Cc: [email protected]
  • Loading branch information
Shirish S authored and alexdeucher committed Jun 27, 2018
1 parent 62d5b8e commit 4de9f38
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
Original file line number Diff line number Diff line change
Expand Up @@ -3928,10 +3928,11 @@ static void amdgpu_dm_do_flip(struct drm_crtc *crtc,
if (acrtc->base.state->event)
prepare_flip_isr(acrtc);

spin_unlock_irqrestore(&crtc->dev->event_lock, flags);

surface_updates->surface = dc_stream_get_status(acrtc_state->stream)->plane_states[0];
surface_updates->flip_addr = &addr;


dc_commit_updates_for_stream(adev->dm.dc,
surface_updates,
1,
Expand All @@ -3944,9 +3945,6 @@ static void amdgpu_dm_do_flip(struct drm_crtc *crtc,
__func__,
addr.address.grph.addr.high_part,
addr.address.grph.addr.low_part);


spin_unlock_irqrestore(&crtc->dev->event_lock, flags);
}

/*
Expand Down

0 comments on commit 4de9f38

Please sign in to comment.