Skip to content

Commit 2e7ec6b

Browse files
Krishna Manikandanrobclark
authored andcommitted
drm/msm/dpu: allow initialization of encoder locks during encoder init
In the current implementation, mutex initialization for encoder mutex locks are done during encoder setup. This can lead to scenarios where the lock is used before it is initialized. Move mutex_init to dpu_encoder_init to avoid this. Signed-off-by: Krishna Manikandan <[email protected]> Signed-off-by: Rob Clark <[email protected]>
1 parent aa47272 commit 2e7ec6b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2140,7 +2140,6 @@ int dpu_encoder_setup(struct drm_device *dev, struct drm_encoder *enc,
21402140

21412141
dpu_enc = to_dpu_encoder_virt(enc);
21422142

2143-
mutex_init(&dpu_enc->enc_lock);
21442143
ret = dpu_encoder_setup_display(dpu_enc, dpu_kms, disp_info);
21452144
if (ret)
21462145
goto fail;
@@ -2155,7 +2154,6 @@ int dpu_encoder_setup(struct drm_device *dev, struct drm_encoder *enc,
21552154
0);
21562155

21572156

2158-
mutex_init(&dpu_enc->rc_lock);
21592157
INIT_DELAYED_WORK(&dpu_enc->delayed_off_work,
21602158
dpu_encoder_off_work);
21612159
dpu_enc->idle_timeout = IDLE_TIMEOUT;
@@ -2200,6 +2198,8 @@ struct drm_encoder *dpu_encoder_init(struct drm_device *dev,
22002198

22012199
spin_lock_init(&dpu_enc->enc_spinlock);
22022200
dpu_enc->enabled = false;
2201+
mutex_init(&dpu_enc->enc_lock);
2202+
mutex_init(&dpu_enc->rc_lock);
22032203

22042204
return &dpu_enc->base;
22052205
}

0 commit comments

Comments
 (0)