Linux ARM-MSM sub-architecture
 help / color / mirror / Atom feed
From: Abhinav Kumar <quic_abhinavk@quicinc.com>
To: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Cc: <freedreno@lists.freedesktop.org>,
	Bjorn Andersson <andersson@kernel.org>,
	<dri-devel@lists.freedesktop.org>,
	Stephen Boyd <swboyd@chromium.org>,
	Konrad Dybcio <konrad.dybcio@linaro.org>,
	<linux-arm-msm@vger.kernel.org>,
	Marijn Suijten <marijn.suijten@somainline.org>,
	Sean Paul <sean@poorly.run>
Subject: Re: [PATCH 5/8] drm/msm/dpu: drop the dpu_core_perf_crtc_update()'s stop_req param
Date: Mon, 3 Jul 2023 15:55:42 -0700	[thread overview]
Message-ID: <ecad5268-e867-c472-40d1-e22ad102ba99@quicinc.com> (raw)
In-Reply-To: <CAA8EJprDwLhVQv1peOt71t-RTDBx2k72WqS0kpOsQudav=dhtw@mail.gmail.com>



On 7/3/2023 3:53 PM, Dmitry Baryshkov wrote:
> On Tue, 4 Jul 2023 at 01:37, Abhinav Kumar <quic_abhinavk@quicinc.com> wrote:
>>
>>
>>
>> On 6/19/2023 5:08 PM, Dmitry Baryshkov wrote:
>>> The stop_req is true only in the dpu_crtc_disable() case, when
>>> crtc->enable has already been set to false. This renders the stop_req
>>> argument useless. Remove it completely.
>>>
>>
>> What about the enable case?
>>
>> That time dpu_crtc->enabled  will be false but you need valid clock and
>> BW that time when you want to enable.
> 
> Maybe I'm missing something here. The driver sets dpu_crtc->enabled in
> atomic_enable, while dpu_core_perf_crtc_update() is called further,
> during atomic_flush, or from the CRTC event handler. And both these
> cases have stop_req as false.
> 

But the first enable will happen with a commit too right?

Thats the one I am referring to.

>>
>>> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
>>> ---
>>>    drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c | 12 ++++++------
>>>    drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.h |  3 +--
>>>    drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c      |  6 +++---
>>>    3 files changed, 10 insertions(+), 11 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c
>>> index f8d5c87d0915..773e641eab28 100644
>>> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c
>>> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c
>>> @@ -277,7 +277,7 @@ static u64 _dpu_core_perf_get_core_clk_rate(struct dpu_kms *kms)
>>>    }
>>>
>>>    int dpu_core_perf_crtc_update(struct drm_crtc *crtc,
>>> -             int params_changed, bool stop_req)
>>> +                           int params_changed)
>>>    {
>>>        struct dpu_core_perf_params *new, *old;
>>>        bool update_bus = false, update_clk = false;
>>> @@ -301,13 +301,13 @@ int dpu_core_perf_crtc_update(struct drm_crtc *crtc,
>>>        dpu_crtc = to_dpu_crtc(crtc);
>>>        dpu_cstate = to_dpu_crtc_state(crtc->state);
>>>
>>> -     DRM_DEBUG_ATOMIC("crtc:%d stop_req:%d core_clk:%llu\n",
>>> -                     crtc->base.id, stop_req, kms->perf.core_clk_rate);
>>> +     DRM_DEBUG_ATOMIC("crtc:%d enabled:%d core_clk:%llu\n",
>>> +                     crtc->base.id, crtc->enabled, kms->perf.core_clk_rate);
>>>
>>>        old = &dpu_crtc->cur_perf;
>>>        new = &dpu_cstate->new_perf;
>>>
>>> -     if (crtc->enabled && !stop_req) {
>>> +     if (crtc->enabled) {
>>>                /*
>>>                 * cases for bus bandwidth update.
>>>                 * 1. new bandwidth vote - "ab or ib vote" is higher
>>> @@ -337,7 +337,7 @@ int dpu_core_perf_crtc_update(struct drm_crtc *crtc,
>>>        }
>>>
>>>        trace_dpu_perf_crtc_update(crtc->base.id, new->bw_ctl,
>>> -             new->core_clk_rate, stop_req, update_bus, update_clk);
>>> +             new->core_clk_rate, !crtc->enabled, update_bus, update_clk);
>>>
>>>        if (update_bus) {
>>>                ret = _dpu_core_perf_crtc_update_bus(kms, crtc);
>>> @@ -355,7 +355,7 @@ int dpu_core_perf_crtc_update(struct drm_crtc *crtc,
>>>        if (update_clk) {
>>>                clk_rate = _dpu_core_perf_get_core_clk_rate(kms);
>>>
>>> -             trace_dpu_core_perf_update_clk(kms->dev, stop_req, clk_rate);
>>> +             trace_dpu_core_perf_update_clk(kms->dev, !crtc->enabled, clk_rate);
>>>
>>>                clk_rate = min(clk_rate, kms->perf.max_core_clk_rate);
>>>                ret = dev_pm_opp_set_rate(&kms->pdev->dev, clk_rate);
>>> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.h
>>> index 2bf7836f79bb..c29ec72984b8 100644
>>> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.h
>>> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.h
>>> @@ -58,11 +58,10 @@ int dpu_core_perf_crtc_check(struct drm_crtc *crtc,
>>>     * dpu_core_perf_crtc_update - update performance of the given crtc
>>>     * @crtc: Pointer to crtc
>>>     * @params_changed: true if crtc parameters are modified
>>> - * @stop_req: true if this is a stop request
>>>     * return: zero if success, or error code otherwise
>>>     */
>>>    int dpu_core_perf_crtc_update(struct drm_crtc *crtc,
>>> -             int params_changed, bool stop_req);
>>> +                           int params_changed);
>>>
>>>    /**
>>>     * dpu_core_perf_crtc_release_bw - release bandwidth of the given crtc
>>> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
>>> index ff5d306b95ed..214229d11e3e 100644
>>> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
>>> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
>>> @@ -718,7 +718,7 @@ static void dpu_crtc_frame_event_cb(void *data, u32 event)
>>>    void dpu_crtc_complete_commit(struct drm_crtc *crtc)
>>>    {
>>>        trace_dpu_crtc_complete_commit(DRMID(crtc));
>>> -     dpu_core_perf_crtc_update(crtc, 0, false);
>>> +     dpu_core_perf_crtc_update(crtc, 0);
>>>        _dpu_crtc_complete_flip(crtc);
>>>    }
>>>
>>> @@ -884,7 +884,7 @@ static void dpu_crtc_atomic_flush(struct drm_crtc *crtc,
>>>                return;
>>>
>>>        /* update performance setting before crtc kickoff */
>>> -     dpu_core_perf_crtc_update(crtc, 1, false);
>>> +     dpu_core_perf_crtc_update(crtc, 1);
>>>
>>>        /*
>>>         * Final plane updates: Give each plane a chance to complete all
>>> @@ -1100,7 +1100,7 @@ static void dpu_crtc_disable(struct drm_crtc *crtc,
>>>                atomic_set(&dpu_crtc->frame_pending, 0);
>>>        }
>>>
>>> -     dpu_core_perf_crtc_update(crtc, 0, true);
>>> +     dpu_core_perf_crtc_update(crtc, 0);
>>>
>>>        drm_for_each_encoder_mask(encoder, crtc->dev, crtc->state->encoder_mask)
>>>                dpu_encoder_register_frame_event_callback(encoder, NULL, NULL);
> 
> 
> 

  reply	other threads:[~2023-07-03 22:55 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-20  0:08 [PATCH 0/8] drm/msm/dpu: cleanup dpu_core_perf module Dmitry Baryshkov
2023-06-20  0:08 ` [PATCH 1/8] drm/msm/dpu: drop enum dpu_core_perf_data_bus_id Dmitry Baryshkov
2023-06-20 10:35   ` Konrad Dybcio
2023-07-03 21:30   ` Abhinav Kumar
2023-06-20  0:08 ` [PATCH 2/8] drm/msm/dpu: drop performance tuning modes Dmitry Baryshkov
2023-06-20 10:45   ` Konrad Dybcio
2023-07-03 21:40   ` Abhinav Kumar
2023-07-03 22:20     ` Dmitry Baryshkov
2023-07-03 22:26       ` Abhinav Kumar
2023-07-03 22:36         ` Dmitry Baryshkov
2023-06-20  0:08 ` [PATCH 3/8] drm/msm/dpu: drop dpu_core_perf_params::max_per_pipe_ib Dmitry Baryshkov
2023-06-20 10:46   ` Konrad Dybcio
2023-06-20 10:53     ` Dmitry Baryshkov
2023-07-03 21:53   ` Abhinav Kumar
2023-06-20  0:08 ` [PATCH 4/8] drm/msm/dpu: rework indentation in dpu_core_perf Dmitry Baryshkov
2023-06-20 10:47   ` Konrad Dybcio
2023-07-03 22:01   ` Abhinav Kumar
2023-06-20  0:08 ` [PATCH 5/8] drm/msm/dpu: drop the dpu_core_perf_crtc_update()'s stop_req param Dmitry Baryshkov
2023-07-03 22:37   ` Abhinav Kumar
2023-07-03 22:53     ` Dmitry Baryshkov
2023-07-03 22:55       ` Abhinav Kumar [this message]
2023-07-03 23:01         ` Dmitry Baryshkov
2023-07-03 23:16           ` Abhinav Kumar
2023-07-04  0:28             ` Dmitry Baryshkov
2023-07-04  0:31               ` Abhinav Kumar
2023-06-20  0:08 ` [PATCH 6/8] drm/msm/dpu: use dpu_perf_cfg in DPU core_perf code Dmitry Baryshkov
2023-06-20 10:55   ` Konrad Dybcio
2023-06-20 11:18     ` Dmitry Baryshkov
2023-06-20 11:31       ` Konrad Dybcio
2023-07-04  0:46         ` Abhinav Kumar
2023-06-20  0:08 ` [PATCH 7/8] drm/msm/dpu: drop dpu_core_perf_destroy() Dmitry Baryshkov
2023-06-20 10:56   ` Konrad Dybcio
2023-07-03 22:57   ` Abhinav Kumar
2023-07-03 22:59     ` Dmitry Baryshkov
2023-07-04  0:19       ` Abhinav Kumar
2023-07-04 14:31         ` Dmitry Baryshkov
2023-06-20  0:08 ` [PATCH 8/8] drm/msm/dpu: remove unused fields from struct dpu_core_perf Dmitry Baryshkov
2023-06-20 10:56   ` Konrad Dybcio
2023-07-04  0:25   ` Abhinav Kumar

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=ecad5268-e867-c472-40d1-e22ad102ba99@quicinc.com \
    --to=quic_abhinavk@quicinc.com \
    --cc=andersson@kernel.org \
    --cc=dmitry.baryshkov@linaro.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=freedreno@lists.freedesktop.org \
    --cc=konrad.dybcio@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=marijn.suijten@somainline.org \
    --cc=sean@poorly.run \
    --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