From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: "Jason-JH Lin (林睿祥)" <Jason-JH.Lin@mediatek.com>
Cc: "karthik.b.s@intel.com" <karthik.b.s@intel.com>,
"swati2.sharma@intel.com" <swati2.sharma@intel.com>,
"jani.nikula@intel.com" <jani.nikula@intel.com>,
"navaremanasi@google.com" <navaremanasi@google.com>,
"Singo Chang (張興國)" <Singo.Chang@mediatek.com>,
"gildekel@google.com" <gildekel@google.com>,
"Nancy Lin (林欣螢)" <Nancy.Lin@mediatek.com>,
"Paul-pl Chen (陳柏霖)" <Paul-pl.Chen@mediatek.com>,
"igt-dev@lists.freedesktop.org" <igt-dev@lists.freedesktop.org>,
"kamil.konieczny@linux.intel.com"
<kamil.konieczny@linux.intel.com>,
Project_Global_Chrome_Upstream_Group
<Project_Global_Chrome_Upstream_Group@mediatek.com>,
"fshao@chromium.org" <fshao@chromium.org>,
"markyacoub@chromium.org" <markyacoub@chromium.org>
Subject: Re: [PATCH i-g-t 2/2] tests/kms_setmode: Disable CPU deep sleep for accurate vblank timestamps
Date: Thu, 21 May 2026 13:39:15 +0300 [thread overview]
Message-ID: <ag7g07pHLWgPViVh@intel.com> (raw)
In-Reply-To: <53284b68be0216eab50946da686968691fa59a56.camel@mediatek.com>
On Thu, May 21, 2026 at 03:01:25AM +0000, Jason-JH Lin (林睿祥) wrote:
> On Wed, 2026-05-20 at 16:50 +0300, Ville Syrjälä wrote:
> > On Wed, May 20, 2026 at 02:46:26PM +0800, Jason-JH Lin wrote:
> > > Use igt_disable_cpu_deep_sleep() to prevent CPU wakeup latency that
> > > affects vblank timestamp acquisition.
> > >
> > > This addresses vblank timing stability issues on MediaTek platforms
> > > where CPU entering idle states can cause ~200us timestamp jitter
> > > and
> > > test failures.
> >
> > Can't you fix the kernel to generate accurate timestamps?
> >
>
> Hi Ville,
>
> Thanks for the feedback.
>
> Currently, the kernel timestamp itself is accurate. The issue is that
> even though the vblank IRQ fires accurately, the timestamp captured by
> DRM core via ktime_get() in drm_crtc_get_last_vbltimestamp() cannot
> avoid the delay(randomly ~200us) introduced by the CPU idle exit
> sequence before the IRQ handler can actually execute.
>
> After looking into this further, I referenced how Intel handles vblank
> timestamps and noticed they use
> drm_crtc_vblank_helper_get_vblank_timestamp() together with
> get_scanout_position() to calculate accurate timestamps by compensating
> for IRQ handling delays. Please correct me if I'm wrong :)
>
> However, this approach requires the hardware to provide scanline
> position information. On MediaTek platforms, this has not been fully
> validated yet, so disabling CPU deep idle states seems to be the most
> appropriate solution for now.
Then you should probably do that in the kernel, or not at all. I don't
think adding hacks to make tests pass makes any sense because then what
you are testing doesn't match any real world use scenario at all.
So all you are doing is sweeping the problem under the carpet during
testing, but the problem still remains and will still be hit during
actual use.
> We will evaluate the feasibility of properly implementing
> get_scanout_position() and improving our vblank timestamp accuracy
> afterwards.
>
> Best regards,
> Jason-JH Lin
--
Ville Syrjälä
Intel
next prev parent reply other threads:[~2026-05-21 10:39 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-20 6:46 [PATCH i-g-t 0/2] Add CPU idle state control for accurate vblank timing Jason-JH Lin
2026-05-20 6:46 ` [PATCH i-g-t 1/2] lib/igt_kms: Add igt_disable_cpu_deep_sleep() to control CPU C-states Jason-JH Lin
2026-05-20 9:48 ` Kamil Konieczny
2026-05-20 10:17 ` Jason-JH Lin (林睿祥)
2026-05-20 16:55 ` Kamil Konieczny
2026-05-21 3:04 ` Jason-JH Lin (林睿祥)
2026-05-20 6:46 ` [PATCH i-g-t 2/2] tests/kms_setmode: Disable CPU deep sleep for accurate vblank timestamps Jason-JH Lin
2026-05-20 9:45 ` Kamil Konieczny
2026-05-20 10:05 ` Jason-JH Lin (林睿祥)
2026-05-20 13:50 ` Ville Syrjälä
2026-05-21 3:01 ` Jason-JH Lin (林睿祥)
2026-05-21 10:39 ` Ville Syrjälä [this message]
2026-05-22 2:59 ` Jason-JH Lin (林睿祥)
2026-05-22 5:27 ` Jason-JH Lin (林睿祥)
2026-05-22 18:14 ` Ville Syrjälä
2026-05-23 6:01 ` Jason-JH Lin (林睿祥)
2026-05-25 13:07 ` Mark Yacoub
2026-05-27 15:49 ` Jason-JH Lin (林睿祥)
2026-05-27 17:58 ` Ville Syrjälä
2026-05-29 3:03 ` Jason-JH Lin (林睿祥)
2026-05-20 7:17 ` ✓ Xe.CI.BAT: success for Add CPU idle state control for accurate vblank timing Patchwork
2026-05-20 7:35 ` ✓ i915.CI.BAT: " Patchwork
2026-05-20 14:38 ` ✓ Xe.CI.FULL: " Patchwork
2026-05-21 9:26 ` ✓ i915.CI.Full: " Patchwork
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=ag7g07pHLWgPViVh@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=Jason-JH.Lin@mediatek.com \
--cc=Nancy.Lin@mediatek.com \
--cc=Paul-pl.Chen@mediatek.com \
--cc=Project_Global_Chrome_Upstream_Group@mediatek.com \
--cc=Singo.Chang@mediatek.com \
--cc=fshao@chromium.org \
--cc=gildekel@google.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=jani.nikula@intel.com \
--cc=kamil.konieczny@linux.intel.com \
--cc=karthik.b.s@intel.com \
--cc=markyacoub@chromium.org \
--cc=navaremanasi@google.com \
--cc=swati2.sharma@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.