drm/msm/dpu: Add mutex lock in control vblank irq
authorPaloma Arellano <quic_parellan@quicinc.com>
Tue, 12 Dec 2023 23:10:58 +0000 (15:10 -0800)
committerDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Thu, 14 Dec 2023 07:27:45 +0000 (09:27 +0200)
commit45284ff733e4caf6c118aae5131eb7e7cf3eea5a
tree9dcebd06d37a0a8512c9e86091ebe0352bb101f5
parent341fb24a67663ec0e6b8cd012a3892d92d133349
drm/msm/dpu: Add mutex lock in control vblank irq

Add a mutex lock to control vblank irq to synchronize vblank
enable/disable operations happening from different threads to prevent
race conditions while registering/unregistering the vblank irq callback.

v4: -Removed vblank_ctl_lock from dpu_encoder_virt, so it is only a
    parameter of dpu_encoder_phys.
    -Switch from atomic refcnt to a simple int counter as mutex has
    now been added
v3: Mistakenly did not change wording in last version. It is done now.
v2: Slightly changed wording of commit message

Signed-off-by: Paloma Arellano <quic_parellan@quicinc.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Patchwork: https://patchwork.freedesktop.org/patch/571854/
Link: https://lore.kernel.org/r/20231212231101.9240-2-quic_parellan@quicinc.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys.h
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c