diff options
author | Dave Airlie <airlied@redhat.com> | 2016-04-15 01:10:39 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2016-04-21 20:42:25 -0400 |
commit | c7e1c59a18ef84df09c06bd484e4ee470f839f92 (patch) | |
tree | 7caf1eed8c28e95ea8ac04912df93770f7877045 | |
parent | 9cd47424fb410e478e5a97e83ac10263c13ed65c (diff) |
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 <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r-- | drivers/gpu/drm/drm_crtc.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index b088840582cc..bbf7ce4ead99 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c | |||
@@ -3445,11 +3445,11 @@ int drm_mode_addfb2(struct drm_device *dev, | |||
3445 | if (IS_ERR(fb)) | 3445 | if (IS_ERR(fb)) |
3446 | return PTR_ERR(fb); | 3446 | return PTR_ERR(fb); |
3447 | 3447 | ||
3448 | /* Transfer ownership to the filp for reaping on close */ | ||
3449 | |||
3450 | DRM_DEBUG_KMS("[FB:%d]\n", fb->base.id); | 3448 | DRM_DEBUG_KMS("[FB:%d]\n", fb->base.id); |
3451 | mutex_lock(&file_priv->fbs_lock); | ||
3452 | r->fb_id = fb->base.id; | 3449 | r->fb_id = fb->base.id; |
3450 | |||
3451 | /* Transfer ownership to the filp for reaping on close */ | ||
3452 | mutex_lock(&file_priv->fbs_lock); | ||
3453 | list_add(&fb->filp_head, &file_priv->fbs); | 3453 | list_add(&fb->filp_head, &file_priv->fbs); |
3454 | mutex_unlock(&file_priv->fbs_lock); | 3454 | mutex_unlock(&file_priv->fbs_lock); |
3455 | 3455 | ||