Linux ARM-MSM sub-architecture
 help / color / mirror / Atom feed
From: Abhinav Kumar <quic_abhinavk@quicinc.com>
To: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
	Paloma Arellano <quic_parellan@quicinc.com>
Cc: <freedreno@lists.freedesktop.org>,
	<linux-arm-msm@vger.kernel.org>,
	<dri-devel@lists.freedesktop.org>, <robdclark@gmail.com>,
	<seanpaul@chromium.org>, <swboyd@chromium.org>,
	<quic_jesszhan@quicinc.com>, <marijn.suijten@somainline.org>,
	<steev@kali.org>
Subject: Re: [PATCH v3 1/2] drm/msm/dpu: Modify vblank_refcount if error in callback
Date: Fri, 1 Dec 2023 11:14:27 -0800	[thread overview]
Message-ID: <730d7e5b-e748-465d-cfee-06bfdcee5844@quicinc.com> (raw)
In-Reply-To: <CAA8EJpqGx3eQ3o6bJhv3OBmHqtp67x8ODupZgKfSLSfFcRRmHQ@mail.gmail.com>



On 11/30/2023 11:45 PM, Dmitry Baryshkov wrote:
> On Fri, 1 Dec 2023 at 03:41, Paloma Arellano <quic_parellan@quicinc.com> wrote:
>>
>> When the irq callback returns a value other than zero,
>> modify vblank_refcount by performing the inverse
>> operation of its corresponding if-else condition.
> 
> I think it might be better to follow Bjorn's suggestion: once we have
> the lock, we don't need atomics at all.
> Then you rearrange the code to set the new value after getting return
> code from dpu_core_irq_register_callback() /
> dpu_core_irq_unregister_callback().
> 

Even if we drop the atomics, we will have to replace it with a simple 
refcount. The refcount checks will be before calling 
dpu_core_irq_register_callback() / dpu_core_irq_unregister_callback().

So we will still need the corresponding inverse refcount when either of 
those calls fail but just that they wont be atomics.

Am I missing something here?

>>
>> Signed-off-by: Paloma Arellano <quic_parellan@quicinc.com>
>> ---
>>   drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c | 9 +++++++--
>>   drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c | 9 +++++++--
>>   2 files changed, 14 insertions(+), 4 deletions(-)
> 

  reply	other threads:[~2023-12-01 19:14 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-01  1:40 [PATCH v3 0/2] Stabilize use of vblank_refcount Paloma Arellano
2023-12-01  1:40 ` [PATCH v3 1/2] drm/msm/dpu: Modify vblank_refcount if error in callback Paloma Arellano
2023-12-01  7:45   ` Dmitry Baryshkov
2023-12-01 19:14     ` Abhinav Kumar [this message]
2023-12-01 21:13       ` Dmitry Baryshkov
2023-12-01  1:40 ` [PATCH v3 2/2] drm/msm/dpu: Add mutex lock in control vblank irq Paloma Arellano
2023-12-01  3:47   ` Bjorn Andersson
2023-12-01  8:34     ` Dmitry Baryshkov
2023-12-01 16:22       ` Bjorn Andersson
2023-12-01 19:43         ` Abhinav Kumar
2023-12-04  3:31           ` Bjorn Andersson
2023-12-04 19:22             ` Abhinav Kumar
2023-12-06  3:51               ` Bjorn Andersson
2023-12-06 17:25                 ` Abhinav Kumar
2023-12-01  7:41 ` [PATCH v3 0/2] Stabilize use of vblank_refcount Dmitry Baryshkov
2023-12-01 20:11   ` Paloma Arellano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=730d7e5b-e748-465d-cfee-06bfdcee5844@quicinc.com \
    --to=quic_abhinavk@quicinc.com \
    --cc=dmitry.baryshkov@linaro.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=freedreno@lists.freedesktop.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=marijn.suijten@somainline.org \
    --cc=quic_jesszhan@quicinc.com \
    --cc=quic_parellan@quicinc.com \
    --cc=robdclark@gmail.com \
    --cc=seanpaul@chromium.org \
    --cc=steev@kali.org \
    --cc=swboyd@chromium.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox