From: Maxime Ripard <mripard@kernel.org>
To: Abhinav Kumar <quic_abhinavk@quicinc.com>
Cc: dri-devel@lists.freedesktop.org,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Thomas Zimmermann <tzimmermann@suse.de>,
David Airlie <airlied@gmail.com>,
Daniel Vetter <daniel@ffwll.ch>,
linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org,
robdclark@gmail.com, dmitry.baryshkov@linaro.org,
quic_jesszhan@quicinc.com, linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH] drm: allow encoder mode_set even when connectors change for crtc
Date: Tue, 10 Sep 2024 10:40:38 +0200 [thread overview]
Message-ID: <20240910-liberal-platinum-scorpion-d43cff@houat> (raw)
In-Reply-To: <33f29f1c-157a-424e-89c6-c1549a2d6403@quicinc.com>
[-- Attachment #1: Type: text/plain, Size: 2955 bytes --]
Hi,
On Mon, Sep 09, 2024 at 12:59:47PM GMT, Abhinav Kumar wrote:
> On 9/9/2024 6:37 AM, Maxime Ripard wrote:
> > Hi,
> >
> > On Thu, Sep 05, 2024 at 03:11:24PM GMT, Abhinav Kumar wrote:
> > > In certain use-cases, a CRTC could switch between two encoders
> > > and because the mode being programmed on the CRTC remains
> > > the same during this switch, the CRTC's mode_changed remains false.
> > > In such cases, the encoder's mode_set also gets skipped.
> > >
> > > Skipping mode_set on the encoder for such cases could cause an issue
> > > because even though the same CRTC mode was being used, the encoder
> > > type could have changed like the CRTC could have switched from a
> > > real time encoder to a writeback encoder OR vice-versa.
> > >
> > > Allow encoder's mode_set to happen even when connectors changed on a
> > > CRTC and not just when the mode changed.
> > >
> > > Signed-off-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
> >
> > The patch and rationale looks sane to me, but we should really add kunit
> > tests for that scenarii.
> >
>
> Thanks for the review.
>
> We have a IGT for recreating this scenario and thats how this issue was
> captured
>
> kms_writeback --run-subtest writeback-check-output -c <primary display mode>
>
> We had added an option ( 'c' - custom mode) a couple of yrs ago to allow
> writeback to be tested using any mode the user passes in (https://lore.kernel.org/r/all/YuJhGkkxah9U6FGx@platvala-desk.ger.corp.intel.com/T/)
>
> If we pass in the same resolution as the primary RT display, this scenario
> always happens as the CRTC switches between RT encoder and WB encoder. Hope
> that addresses some of the concern.
Unless it can easily be run in some sort of CI loop by anyone
contributing to that part of the kernel, it doesn't.
Don't get me wrong, it's a great feature, but it doesn't help making
sure that issue never creeps back in.
> Regarding KUnit tests, I have a couple of questions:
>
> 1) This is more of a run-time scenario where CRTC switch happens, does this
> qualify for a KUnit or perhaps I am missing something.
We've been using kunit to perform integration tests in the kernel too,
so I would say that it definitely qualifies.
> 2) Is there any existing KUnit test file under drm/tests for validating
> drm_atomic_helper_commit_modeset_disables() /
> drm_atomic_helper_commit_modeset_enables() path because this will fall under
> that bucket. I didnt find any matching case where we can extend this.
We don't have that at the moment, but we shouldn't be too far off. The
HDMI framework I contributed some months ago for example has all the
mode checking infrastructure in kunit. So you already have some way to
create a driver, a new state, modify that state and check it.
The only thing missing in your case is being able to commit it and check
that it has run, which shouldn't be too hard
Maxime
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 273 bytes --]
next prev parent reply other threads:[~2024-09-10 8:40 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-05 22:11 Abhinav Kumar
2024-09-09 13:37 ` Maxime Ripard
2024-09-09 19:59 ` Abhinav Kumar
2024-09-10 8:40 ` Maxime Ripard [this message]
2024-09-12 0:54 ` Abhinav Kumar
2024-09-25 13:49 ` Maxime Ripard
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=20240910-liberal-platinum-scorpion-d43cff@houat \
--to=mripard@kernel.org \
--cc=airlied@gmail.com \
--cc=daniel@ffwll.ch \
--cc=dmitry.baryshkov@linaro.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=maarten.lankhorst@linux.intel.com \
--cc=quic_abhinavk@quicinc.com \
--cc=quic_jesszhan@quicinc.com \
--cc=robdclark@gmail.com \
--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®