mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
drm/msm: use drm_crtc_vblank_waitqueue()
We have drm_crtc_vblank_waitqueue() to get the wait_queue_head_t pointer for a vblank. Use it instead of poking at dev->vblank[] directly. Due to the macro maze of wait_event_timeout() that uses the address-of operator on the argument, we have to pass it in with the indirection operator. Cc: Rob Clark <robin.clark@oss.qualcomm.com> Cc: Dmitry Baryshkov <lumag@kernel.org> Cc: Abhinav Kumar <abhinav.kumar@linux.dev> Cc: Jessica Zhang <jesszhan0024@gmail.com> Cc: Sean Paul <sean@poorly.run> Cc: Marijn Suijten <marijn.suijten@somainline.org> Cc: linux-arm-msm@vger.kernel.org Cc: freedreno@lists.freedesktop.org Acked-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> Link: https://patch.msgid.link/5917fd537f4a775a1c135a68f294df3917980943.1762513240.git.jani.nikula@intel.com Signed-off-by: Jani Nikula <jani.nikula@intel.com>
This commit is contained in:
@@ -527,13 +527,14 @@ static void mdp4_crtc_wait_for_flush_done(struct drm_crtc *crtc)
|
||||
struct drm_device *dev = crtc->dev;
|
||||
struct mdp4_crtc *mdp4_crtc = to_mdp4_crtc(crtc);
|
||||
struct mdp4_kms *mdp4_kms = get_kms(crtc);
|
||||
wait_queue_head_t *queue = drm_crtc_vblank_waitqueue(crtc);
|
||||
int ret;
|
||||
|
||||
ret = drm_crtc_vblank_get(crtc);
|
||||
if (ret)
|
||||
return;
|
||||
|
||||
ret = wait_event_timeout(dev->vblank[drm_crtc_index(crtc)].queue,
|
||||
ret = wait_event_timeout(*queue,
|
||||
!(mdp4_read(mdp4_kms, REG_MDP4_OVERLAY_FLUSH) &
|
||||
mdp4_crtc->flushed_mask),
|
||||
msecs_to_jiffies(50));
|
||||
|
||||
@@ -1234,6 +1234,7 @@ static void mdp5_crtc_wait_for_flush_done(struct drm_crtc *crtc)
|
||||
struct mdp5_crtc *mdp5_crtc = to_mdp5_crtc(crtc);
|
||||
struct mdp5_crtc_state *mdp5_cstate = to_mdp5_crtc_state(crtc->state);
|
||||
struct mdp5_ctl *ctl = mdp5_cstate->ctl;
|
||||
wait_queue_head_t *queue = drm_crtc_vblank_waitqueue(crtc);
|
||||
int ret;
|
||||
|
||||
/* Should not call this function if crtc is disabled. */
|
||||
@@ -1244,7 +1245,7 @@ static void mdp5_crtc_wait_for_flush_done(struct drm_crtc *crtc)
|
||||
if (ret)
|
||||
return;
|
||||
|
||||
ret = wait_event_timeout(dev->vblank[drm_crtc_index(crtc)].queue,
|
||||
ret = wait_event_timeout(*queue,
|
||||
((mdp5_ctl_get_commit_status(ctl) &
|
||||
mdp5_crtc->flushed_mask) == 0),
|
||||
msecs_to_jiffies(50));
|
||||
|
||||
Reference in New Issue
Block a user