lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8394943c-8d51-df67-1603-6f37ac26a730@linaro.org>
Date:   Wed, 22 Jun 2022 20:41:57 +0300
From:   Dmitry Baryshkov <dmitry.baryshkov@...aro.org>
To:     Rob Clark <robdclark@...il.com>,
        Abhinav Kumar <quic_abhinavk@...cinc.com>
Cc:     Stephen Boyd <swboyd@...omium.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        patches@...ts.linux.dev, Sean Paul <sean@...rly.run>,
        dri-devel <dri-devel@...ts.freedesktop.org>,
        freedreno <freedreno@...ts.freedesktop.org>,
        Mark Yacoub <markyacoub@...omium.org>,
        Jessica Zhang <quic_jesszhan@...cinc.com>
Subject: Re: [PATCH] drm/msm/dpu: Increment vsync_cnt before waking up
 userspace

On 22/06/2022 20:33, Rob Clark wrote:
> On Wed, Jun 22, 2022 at 10:24 AM Abhinav Kumar
> <quic_abhinavk@...cinc.com> wrote:
>>
>>
>>
>> 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>
>>
>> This is right, we should increment before drm_crtc_handle_vblank() as
>> that will query the vblank counter. This also matches what we do
>> downstream, hence
>>
>> Reviewed-by: Abhinav Kumar <quic_abhinavk@...cinc.com>
>>
>> One small nit though, shouldnt the fixes tag be
>>
>> 25fdd5933e4c ("drm/msm: Add SDM845 DPU support")
> 
> *Kinda*.. but the sw vblank counter wasn't used for reporting frame nr
> to userspace until 885455d6bf82.  You could possibly list both,
> perhaps, but 885455d6bf82 is the important one for folks backporting
> to stable kernels to be aware of

I'd agree, the original Fixes tag seems good to me.

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@...aro.org>


-- 
With best wishes
Dmitry

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ