Skip to content

Commit c7e1c59

Browse files
committed
drm/mode: reduce lock hold in addfb2
No need to hold the lock while assigning the variable. Daniel wrote: "Not sure why exactly I put that under the lock, but the only thing that can race here is rmfb while addfb2 is still doing it's thing, with a correctly guess (easy to do since they're fully deterministic) fb_id." Reviewed-by: Daniel Vetter <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
1 parent 9cd4742 commit c7e1c59

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/gpu/drm/drm_crtc.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3445,11 +3445,11 @@ int drm_mode_addfb2(struct drm_device *dev,
34453445
if (IS_ERR(fb))
34463446
return PTR_ERR(fb);
34473447

3448-
/* Transfer ownership to the filp for reaping on close */
3449-
34503448
DRM_DEBUG_KMS("[FB:%d]\n", fb->base.id);
3451-
mutex_lock(&file_priv->fbs_lock);
34523449
r->fb_id = fb->base.id;
3450+
3451+
/* Transfer ownership to the filp for reaping on close */
3452+
mutex_lock(&file_priv->fbs_lock);
34533453
list_add(&fb->filp_head, &file_priv->fbs);
34543454
mutex_unlock(&file_priv->fbs_lock);
34553455

0 commit comments

Comments
 (0)