devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
To: Vinod Polimera <vpolimer@qti.qualcomm.com>
Cc: "Kalyan Thota (QUIC)" <quic_kalyant@quicinc.com>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"Sankeerth Billakanti (QUIC)" <quic_sbillaka@quicinc.com>,
	"dianders@chromium.org" <dianders@chromium.org>,
	"Bjorn Andersson (QUIC)" <quic_bjorande@quicinc.com>,
	"Abhinav Kumar (QUIC)" <quic_abhinavk@quicinc.com>,
	"Vishnuvardhan Prodduturi (QUIC)" <quic_vproddut@quicinc.com>,
	"linux-arm-msm@vger.kernel.org" <linux-arm-msm@vger.kernel.org>,
	"Kuogee Hsieh (QUIC)" <quic_khsieh@quicinc.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	"Vinod Polimera (QUIC)" <quic_vpolimer@quicinc.com>,
	"swboyd@chromium.org" <swboyd@chromium.org>,
	"freedreno@lists.freedesktop.org"
	<freedreno@lists.freedesktop.org>
Subject: Re: [PATCH v1 3/3] msm: skip the atomic commit of self refresh while PSR running
Date: Fri, 19 May 2023 19:42:31 +0300	[thread overview]
Message-ID: <e4824511-1148-83ee-b6e9-4f819e655f32@linaro.org> (raw)
In-Reply-To: <CAA8EJprj5cmB_STfv45NDCJ_e=aWfwMgaNmGkQBqFa8fQq6gQw@mail.gmail.com>

On 03/04/2023 19:11, Dmitry Baryshkov wrote:
> On Mon, 3 Apr 2023 at 15:01, Vinod Polimera <vpolimer@qti.qualcomm.com> wrote:
>>
>>> On Fri, 31 Mar 2023 at 16:59, Vinod Polimera <quic_vpolimer@quicinc.com>
>>> wrote:
>>>>
>>>> In certain CPU stress conditions, there can be a delay in scheduling commit
>>>> work and it was observed that PSR commit from a different work queue
>>> was
>>>> scheduled. Avoid these commits as display is already in PSR mode.
>>>>
>>>> Signed-off-by: Vinod Polimera <quic_vpolimer@quicinc.com>
>>>> ---
>>>>   drivers/gpu/drm/msm/msm_atomic.c | 3 +++
>>>>   1 file changed, 3 insertions(+)
>>>>
>>>> diff --git a/drivers/gpu/drm/msm/msm_atomic.c
>>> b/drivers/gpu/drm/msm/msm_atomic.c
>>>> index 645fe53..f8141bb 100644
>>>> --- a/drivers/gpu/drm/msm/msm_atomic.c
>>>> +++ b/drivers/gpu/drm/msm/msm_atomic.c
>>>> @@ -192,6 +192,9 @@ int msm_atomic_check(struct drm_device *dev,
>>> struct drm_atomic_state *state)
>>>>                          new_crtc_state->mode_changed = true;
>>>>                          state->allow_modeset = true;
>>>>                  }
>>>> +
>>>> +               if (old_crtc_state->self_refresh_active && new_crtc_state-
>>>> self_refresh_active)
>>>> +                       return -EINVAL;
>>>
>>> EINVAL here means that atomic_check will fail if both old and new
>>> states are in SR mode. For example, there might be a mode set for
>>> another CRTC (while keeping this one in SR mode). I don't think this
>>> is correct. We should skip/shortcut the commit, that's true. But I
>>> doubt that returning an error here is a proper way to do this. Please
>>> correct me if I'm wrong.
>>
>> If there is a modeset on same crtc with a different connector. The new_crtc_state will not have self_refresh_active set.
>> Self_refresh_active is set from the helper library, which will duplicate the old_state and just adds self_refresh_active to true and active to false.
>> so we can be confident that if we are checking for self_refresh_active status then it should be coming from the library call.
>>
>> Also the EINVAL is returned to the self_refresh library API and the function will be retired.
> 
> Maybe I misunderstand you here. However, in this way EINVAL is
> returned to drm_atomic_check_only() and not to the SR code.

Unless anybody objects, I'm going to drop this patch now. The issue 
should be solved in the framework itself.

> 
>> And self_refresh_active is cleared on every commit : https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/drivers/gpu/drm/drm_atomic_state_helper.c#n158
> 
> And this means that this check will not trigger at all, if I'm not
> mistaken. You've added code to msm_atomic_check(), so
> drm_self_refresh_helper_alter_state() was not called (yet) and thus
> new_crtc_state->self_refresh_active is set to false, fresh after
> crtc's duplicate_state.
> 
> --
> With best wishes
> Dmitry

-- 
With best wishes
Dmitry


  reply	other threads:[~2023-05-19 16:42 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-31 13:58 [PATCH v1 0/3] Fixes for PSR Vinod Polimera
2023-03-31 13:58 ` [PATCH v1 1/3] drm/msm/dpu: set dirty_fb flag while in self refresh mode Vinod Polimera
2023-03-31 14:45   ` Dmitry Baryshkov
2023-04-03 14:53     ` Vinod Polimera
2023-04-03 16:18     ` Dmitry Baryshkov
2023-04-05  1:43   ` Doug Anderson
2023-03-31 13:58 ` [PATCH v1 2/3] msm/disp/dpu: allow atomic_check in PSR usecase Vinod Polimera
2023-03-31 14:46   ` Dmitry Baryshkov
2023-04-05  1:43   ` Doug Anderson
2023-03-31 13:58 ` [PATCH v1 3/3] msm: skip the atomic commit of self refresh while PSR running Vinod Polimera
2023-03-31 14:58   ` Dmitry Baryshkov
2023-04-03 12:01     ` Vinod Polimera
2023-04-03 16:11       ` Dmitry Baryshkov
2023-05-19 16:42         ` Dmitry Baryshkov [this message]
2023-04-03 15:28   ` Dmitry Baryshkov
2023-04-05 11:38 ` [PATCH v1 0/3] Fixes for PSR Dmitry Baryshkov

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=e4824511-1148-83ee-b6e9-4f819e655f32@linaro.org \
    --to=dmitry.baryshkov@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dianders@chromium.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=freedreno@lists.freedesktop.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=quic_abhinavk@quicinc.com \
    --cc=quic_bjorande@quicinc.com \
    --cc=quic_kalyant@quicinc.com \
    --cc=quic_khsieh@quicinc.com \
    --cc=quic_sbillaka@quicinc.com \
    --cc=quic_vpolimer@quicinc.com \
    --cc=quic_vproddut@quicinc.com \
    --cc=swboyd@chromium.org \
    --cc=vpolimer@qti.qualcomm.com \
    /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;
as well as URLs for NNTP newsgroup(s).