[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <cb4b9ffe-ef4c-3925-af69-2c8cd541ff06@quicinc.com>
Date: Wed, 22 Jun 2022 10:43:33 -0700
From: Jessica Zhang <quic_jesszhan@...cinc.com>
To: Stephen Boyd <swboyd@...omium.org>,
Rob Clark <robdclark@...il.com>,
Abhinav Kumar <quic_abhinavk@...cinc.com>,
Dmitry Baryshkov <dmitry.baryshkov@...aro.org>
CC: Sean Paul <sean@...rly.run>, Mark Yacoub <markyacoub@...omium.org>,
<linux-kernel@...r.kernel.org>, <dri-devel@...ts.freedesktop.org>,
<patches@...ts.linux.dev>, <freedreno@...ts.freedesktop.org>
Subject: Re: [Freedreno] [PATCH] drm/msm/dpu: Increment vsync_cnt before
waking up userspace
On 6/21/2022 7:38 PM, Stephen Boyd wrote:
> The 'vsync_cnt' is used to count the number of frames for a crtc.
> Unfortunately, we increment the count after waking up userspace via
> dpu_crtc_vblank_callback() calling drm_crtc_handle_vblank().
> drm_crtc_handle_vblank() wakes up userspace processes that have called
> drm_wait_vblank_ioctl(), and if that ioctl is expecting the count to
> increase it won't.
>
> Increment the count before calling into the drm APIs so that we don't
> have to worry about ordering the increment with anything else in drm.
> This fixes a software video decode test that fails to see frame counts
> increase on Trogdor boards.
>
> Cc: Mark Yacoub <markyacoub@...omium.org>
> Cc: Jessica Zhang <quic_jesszhan@...cinc.com>
> Fixes: 885455d6bf82 ("drm/msm: Change dpu_crtc_get_vblank_counter to use vsync count.")
> Signed-off-by: Stephen Boyd <swboyd@...omium.org>
Tested-by: Jessica Zhang <quic_jesszhan@...cinc.com> # Trogdor (sc7180)
> ---
> drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> index 3a462e327e0e..a1b8c4592943 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> @@ -1251,12 +1251,13 @@ static void dpu_encoder_vblank_callback(struct drm_encoder *drm_enc,
> DPU_ATRACE_BEGIN("encoder_vblank_callback");
> dpu_enc = to_dpu_encoder_virt(drm_enc);
>
> + atomic_inc(&phy_enc->vsync_cnt);
> +
> spin_lock_irqsave(&dpu_enc->enc_spinlock, lock_flags);
> if (dpu_enc->crtc)
> dpu_crtc_vblank_callback(dpu_enc->crtc);
> spin_unlock_irqrestore(&dpu_enc->enc_spinlock, lock_flags);
>
> - atomic_inc(&phy_enc->vsync_cnt);
> DPU_ATRACE_END("encoder_vblank_callback");
> }
>
>
> base-commit: f2906aa863381afb0015a9eb7fefad885d4e5a56
> --
> https://chromeos.dev
>
Powered by blists - more mailing lists