Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Jason-JH Lin (林睿祥)" <Jason-JH.Lin@mediatek.com>
To: "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>,
	"ville.syrjala@linux.intel.com" <ville.syrjala@linux.intel.com>,
	Project_Global_Chrome_Upstream_Group
	<Project_Global_Chrome_Upstream_Group@mediatek.com>,
	"gildekel@google.com" <gildekel@google.com>,
	"navaremanasi@google.com" <navaremanasi@google.com>,
	"igt-dev@lists.freedesktop.org" <igt-dev@lists.freedesktop.org>,
	"Paul-pl Chen (陳柏霖)" <Paul-pl.Chen@mediatek.com>,
	"kamil.konieczny@linux.intel.com"
	<kamil.konieczny@linux.intel.com>,
	"Lancelot Wu (吳瑋晟)" <Lancelot.Wu@mediatek.com>,
	"fshao@chromium.org" <fshao@chromium.org>,
	"markyacoub@chromium.org" <markyacoub@chromium.org>
Subject: Re: [PATCH i-g-t v2 2/2] tests/kms_setmode: Add basic-no-cpu-idle subtest
Date: Thu, 9 Jul 2026 16:16:24 +0000	[thread overview]
Message-ID: <9aaaa3237e1d5496f556b0a66a7fb86a19efd706.camel@mediatek.com> (raw)
In-Reply-To: <20260709140509.4utfunjpn4uaejup@kamilkon-DESK.igk.intel.com>

On Thu, 2026-07-09 at 16:05 +0200, Kamil Konieczny wrote:
> Hi Jason-JH,
> On 2026-06-21 at 16:43:28 +0800, Jason-JH Lin wrote:
> > Add a new subtest that disables CPU deep sleep to eliminate wakeup
> > latency interference during vblank timestamp verification.
> > 
> > This allows platforms without get_scanout_position() to verify
> > their
> > timestamp accuracy is correct, separate from CPU idle interference.
> > 
> > The original "basic" test remains unchanged to detect any timestamp
> > issues including CPU idle interference, while "basic-no-cpu-idle"
> > specifically tests timestamp accuracy without external
> > interference.
> > 
> > Once get_scanout_position() is implemented, the vblank timestamp
> > will be accurately compensated regardless of CPU idle states.
> > 
> > Signed-off-by: Jason-JH Lin <jason-jh.lin@mediatek.com>
> > ---
> >  tests/kms_setmode.c | 32 ++++++++++++++++++++++++++++++++
> >  1 file changed, 32 insertions(+)
> > 
> > diff --git a/tests/kms_setmode.c b/tests/kms_setmode.c
> > index 3adc4534ce88..e5f2c4fee141 100644
> > --- a/tests/kms_setmode.c
> > +++ b/tests/kms_setmode.c
> > @@ -42,6 +42,7 @@
> >  #include <math.h>
> >  
> >  #include "i915/intel_drrs.h"
> > +#include "igt_pm.h"
> >  #include "xe/xe_query.h"
> >  
> >  /**
> > @@ -49,6 +50,13 @@
> >   * Description: Tests the vblank timing by iterating through all
> > valid crtc/connector
> >   *              combinations
> >   *
> > + * SUBTEST: basic-no-cpu-idle
> > + * Description: Tests vblank timing with CPU deep sleep disabled
> > to verify
> > + *              timestamp accuracy without CPU idle interference.
> > This test
> > + *              is for platforms lacking HW/SW
> > get_scanout_position() support,
> > + *              allowing them to verify vblank timestamp
> > correctness without
> > + *              external CPU wakeup latency interference.
> > + *
> >   * SUBTEST: basic-clone-single-crtc
> >   * Description: Test allows the use of a single CRTC for two
> > connectors, such as VGA/HDMI,
> >   *		VGA/DP, and HDMI/HDMI
> > @@ -1106,6 +1114,30 @@ int igt_main_args("det:", NULL, help_str,
> > opt_handler, NULL)
> >  		}
> >  	}
> >  
> > +	/*
> > +	 * This subtest disables CPU deep sleep to eliminate
> > wakeup latency
> > +	 * interference during vblank timestamp verification.
> > +	 *
> > +	 * NOTE: This is for platforms that have not yet
> > implemented
> > +	 * get_scanout_position(). Once get_scanout_position() is
> > properly
> > +	 * implemented, the vblank timestamp will be accurately
> > compensated
> > +	 * regardless of CPU idle states, and this test becomes
> > redundant
> > +	 * with the standard "basic" test.
> > +	 */
> > +	igt_describe("Tests vblank timing with CPU deep sleep
> > disabled");
> > +	igt_subtest_with_dynamic("basic-no-cpu-idle") {
> > +		struct test_config tconf = {
> > +			.flags		= TEST_TIMINGS,
> > +			.name		= "basic-no-cpu-idle",
> > +			.resources	= drm_resources,
> > +		};
> > +
> > +		igt_require_f(igt_pm_disable_cpu_deep_sleep(),
> > +			      "Platform does not support CPU idle
> > control\n");
> > +		run_test(&tconf);
> > +		igt_pm_enable_cpu_deep_sleep();
> 
> Seems ok but this enable will be skipped in case of test fail.
> imho you should add enabling to at_exit path.
> 

Thanks for the review! I initially thought the enable call was only
needed when disable succeeded, but I missed the case where run_test()
fails midway after a successful disable.

I'll add igt_install_exit_handler() to ensure
igt_pm_enable_cpu_deep_sleep() is always called after a successful
disable, regardless of test outcome.

E,g.
        igt_require_f(igt_pm_disable_cpu_deep_sleep(),
                  "Platform does not support CPU idle control\n");
+       igt_install_exit_handler(restore_cpu_deep_sleep);
        run_test(&tconf);
-       igt_pm_enable_cpu_deep_sleep();

Regards,
Jasdon-JH Lin


> Regards,
> Kamil
> 
> > +	}
> > +
> >  	igt_fixture() {
> >  		drmModeFreeResources(drm_resources);
> >  		drm_close_driver(drm_fd);
> > -- 
> > 2.43.0
> > 


  reply	other threads:[~2026-07-09 16:17 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-21  8:43 [PATCH i-g-t v2 0/2] Add CPU idle state control for accurate vblank timing Jason-JH Lin
2026-06-21  8:43 ` [PATCH i-g-t v2 1/2] lib/igt_pm: Add CPU idle state control for vblank timing stability Jason-JH Lin
2026-06-21  8:43 ` [PATCH i-g-t v2 2/2] tests/kms_setmode: Add basic-no-cpu-idle subtest Jason-JH Lin
2026-06-24 19:35   ` Manasi Navare
2026-07-08 22:35     ` Manasi Navare
2026-07-09 14:05   ` Kamil Konieczny
2026-07-09 16:16     ` Jason-JH Lin (林睿祥) [this message]
2026-06-22 17:59 ` ✓ i915.CI.BAT: success for Add CPU idle state control for accurate vblank timing (rev2) Patchwork
2026-06-22 18:04 ` ✓ Xe.CI.BAT: " Patchwork
2026-06-22 21:13 ` ✓ Xe.CI.FULL: " Patchwork
2026-06-22 23:54 ` ✗ i915.CI.Full: failure " 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=9aaaa3237e1d5496f556b0a66a7fb86a19efd706.camel@mediatek.com \
    --to=jason-jh.lin@mediatek.com \
    --cc=Lancelot.Wu@mediatek.com \
    --cc=Paul-pl.Chen@mediatek.com \
    --cc=Project_Global_Chrome_Upstream_Group@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 \
    --cc=ville.syrjala@linux.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox