mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
To: Jun Nie <jun.nie@linaro.org>
Cc: Rob Clark <robdclark@gmail.com>,
	Abhinav Kumar <quic_abhinavk@quicinc.com>,
	Sean Paul <sean@poorly.run>,
	Marijn Suijten <marijn.suijten@somainline.org>,
	David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
	Jessica Zhang <quic_jesszhan@quicinc.com>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org,
	freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v9 01/14] drm/atomic-helper: Add crtc check before checking plane
Date: Fri, 9 May 2025 18:18:40 +0300	[thread overview]
Message-ID: <6cfc706f-4909-4121-9849-a37e4769ab2f@oss.qualcomm.com> (raw)
In-Reply-To: <CABymUCMuiKQwtuYW-HX4bwyTR4awm4scwXTWNzVCEmyQsQ29aA@mail.gmail.com>

On 09/05/2025 06:08, Jun Nie wrote:
> Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> 于2025年5月8日周四 18:47写道:
>>
>> On Tue, May 06, 2025 at 11:47:31PM +0800, Jun Nie wrote:
>>> Some display controller support flexible CRTC and DMA, such as the display
>>> controllers in snapdragon SoCs. CRTC can be implemented with several mixers
>>> in parallel, and plane fetching can be implemented with several DMA under
>>> umberala of a virtual drm plane.
>>>
>>> The mixer number is decided per panel resolution and clock rate constrain
>>> first, which happens in CRTC side. Then plane is split per mixer number
>>> and configure DMA accordingly.
>>
>> Here you are describing a behaviour of one particular driver as a reason
>> to change the framework.
> 
> Yeah, the specific driver requires a change in framework. Maybe the
> comment is not
> proper?

Yes. Explain how does that benefit the framework / other drivers. 
Otherwise the answer would be as simple as 'replace 
drm_atomic_helper_check_planes() in your driver'.

>>
>>>
>>> To support such forthcoming usage case, CRTC checking shall happen before
>>> checking plane. Add the checking in the drm_atomic_helper_check_modeset().
>>
>> So, now drivers will get two calls to atomic_check(), one coming in
>> circumstances which were not expected by the drivers before. Are you
>> sure that this won't break anything?
> 
> Yes, it is a concern. Is there any way to limit the change in
> framework to specific
> driver with a flag, such as DRM_FLAG_CHECK_CRTC_BEFORE_PLANE?

Definitely not with a flag. You can try adding a new helper callback, 
but I don't know how DRM core maintainers would react to it.

>>
>>>
>>> Signed-off-by: Jun Nie <jun.nie@linaro.org>
>>> ---
>>>   drivers/gpu/drm/drm_atomic_helper.c | 19 +++++++++++++++++++
>>>   1 file changed, 19 insertions(+)
>>>
>>> diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
>>> index 5302ab3248985d3e0a47e40fd3deb7ad0d9f775b..5bca4c9683838c38574c8cb7c0bc9d57960314fe 100644
>>> --- a/drivers/gpu/drm/drm_atomic_helper.c
>>> +++ b/drivers/gpu/drm/drm_atomic_helper.c
>>> @@ -816,6 +816,25 @@ drm_atomic_helper_check_modeset(struct drm_device *dev,
>>>                        return ret;
>>>        }
>>>
>>> +     for_each_new_crtc_in_state(state, crtc, new_crtc_state, i) {
>>> +             const struct drm_crtc_helper_funcs *funcs;
>>> +
>>> +             funcs = crtc->helper_private;
>>> +
>>> +             if (!funcs || !funcs->atomic_check)
>>> +                     continue;
>>> +
>>> +             ret = funcs->atomic_check(crtc, state);
>>> +             if (ret) {
>>> +                     drm_dbg_atomic(crtc->dev,
>>> +                                    "[CRTC:%d:%s] atomic driver check failed\n",
>>> +                                    crtc->base.id, crtc->name);
>>> +                     return ret;
>>> +             }
>>> +     }
>>> +
>>> +
>>> +
>>
>> Too many empty lines. But the main quesiton is: why are you calling it
>> before mode_valid()? According to your description a better place would
>> be in drm_atomic_helper_check_planes().
>>
> Agree, that's the proper function. Will remove the empty line in next version.
> 
>>>        ret = mode_valid(state);
>>>        if (ret)
>>>                return ret;
>>>
>>> --
>>> 2.34.1
>>>
>>
>> --
>> With best wishes
>> Dmitry
>>


-- 
With best wishes
Dmitry

  reply	other threads:[~2025-05-09 15:18 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-06 15:47 [PATCH v9 00/14] drm/msm/dpu: Support quad pipe with dual-DSI Jun Nie
2025-05-06 15:47 ` [PATCH v9 01/14] drm/atomic-helper: Add crtc check before checking plane Jun Nie
2025-05-08 10:47   ` Dmitry Baryshkov
2025-05-09  3:08     ` Jun Nie
2025-05-09 15:18       ` Dmitry Baryshkov [this message]
2025-05-06 15:47 ` [PATCH v9 02/14] drm/msm/dpu: check every pipe per capability Jun Nie
2025-05-08 18:38   ` Jessica Zhang
2025-05-06 15:47 ` [PATCH v9 03/14] drm/msm/dpu: polish log for resource allocation Jun Nie
2025-05-06 15:47 ` [PATCH v9 04/14] drm/msm/dpu: decide right side per last bit Jun Nie
2025-05-06 15:47 ` [PATCH v9 05/14] drm/msm/dpu: fix mixer number counter on allocation Jun Nie
2025-05-06 15:47 ` [PATCH v9 06/14] drm/msm/dpu: bind correct pingpong for quad pipe Jun Nie
2025-05-06 15:47 ` [PATCH v9 07/14] drm/msm/dpu: Add pipe as trace argument Jun Nie
2025-05-06 15:47 ` [PATCH v9 08/14] drm/msm/dpu: handle pipes as array Jun Nie
2025-05-08 18:00   ` Jessica Zhang
2025-05-06 15:47 ` [PATCH v9 09/14] drm/msm/dpu: split PIPES_PER_STAGE definition per plane and mixer Jun Nie
2025-05-08 20:42   ` Jessica Zhang
2025-05-08 20:55     ` Jessica Zhang
2025-05-23 10:03       ` Jun Nie
2025-05-06 15:47 ` [PATCH v9 10/14] drm/msm/dpu: Use dedicated WB number definition Jun Nie
2025-05-08 13:10   ` Dmitry Baryshkov
2025-05-08 18:03   ` Jessica Zhang
2025-05-06 15:47 ` [PATCH v9 11/14] drm/msm/dpu: blend pipes per mixer pairs config Jun Nie
2025-05-08 20:53   ` Jessica Zhang
2025-05-06 15:47 ` [PATCH v9 12/14] drm/msm/dpu: support SSPP assignment for quad-pipe case Jun Nie
2025-05-08 18:51   ` Jessica Zhang
2025-05-06 15:47 ` [PATCH v9 13/14] drm/msm/dpu: support plane splitting in " Jun Nie
2025-05-08 21:24   ` Jessica Zhang
2025-05-23 10:21     ` Jun Nie
2025-05-06 15:47 ` [PATCH v9 14/14] drm/msm/dpu: Enable quad-pipe for DSC and dual-DSI case Jun Nie
2025-05-08 21:30   ` Jessica Zhang

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=6cfc706f-4909-4121-9849-a37e4769ab2f@oss.qualcomm.com \
    --to=dmitry.baryshkov@oss.qualcomm.com \
    --cc=airlied@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=freedreno@lists.freedesktop.org \
    --cc=jun.nie@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=marijn.suijten@somainline.org \
    --cc=mripard@kernel.org \
    --cc=quic_abhinavk@quicinc.com \
    --cc=quic_jesszhan@quicinc.com \
    --cc=robdclark@gmail.com \
    --cc=sean@poorly.run \
    --cc=simona@ffwll.ch \
    --cc=tzimmermann@suse.de \
    /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

all inboxes | Powered by JetHome®