drm/msm/dpu: allow initialization of encoder locks during encoder init
[ Upstream commit 2e7ec6b5297157efabb50e5f82adc628cf90296c ] 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 <mkrishn@codeaurora.org> Signed-off-by: Rob Clark <robdclark@chromium.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
5d6891a5a6
commit
0885be75f1
@ -2185,7 +2185,6 @@ int dpu_encoder_setup(struct drm_device *dev, struct drm_encoder *enc,
|
||||
|
||||
dpu_enc = to_dpu_encoder_virt(enc);
|
||||
|
||||
mutex_init(&dpu_enc->enc_lock);
|
||||
ret = dpu_encoder_setup_display(dpu_enc, dpu_kms, disp_info);
|
||||
if (ret)
|
||||
goto fail;
|
||||
@ -2200,7 +2199,6 @@ int dpu_encoder_setup(struct drm_device *dev, struct drm_encoder *enc,
|
||||
0);
|
||||
|
||||
|
||||
mutex_init(&dpu_enc->rc_lock);
|
||||
INIT_DELAYED_WORK(&dpu_enc->delayed_off_work,
|
||||
dpu_encoder_off_work);
|
||||
dpu_enc->idle_timeout = IDLE_TIMEOUT;
|
||||
@ -2245,6 +2243,8 @@ struct drm_encoder *dpu_encoder_init(struct drm_device *dev,
|
||||
|
||||
spin_lock_init(&dpu_enc->enc_spinlock);
|
||||
dpu_enc->enabled = false;
|
||||
mutex_init(&dpu_enc->enc_lock);
|
||||
mutex_init(&dpu_enc->rc_lock);
|
||||
|
||||
return &dpu_enc->base;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user