From: "Souza, Jose" <jose.souza@intel.com>
To: "igt-dev@lists.freedesktop.org" <igt-dev@lists.freedesktop.org>,
"Pandiyan, Dhinakaran" <dhinakaran.pandiyan@intel.com>
Cc: "Vivi, Rodrigo" <rodrigo.vivi@intel.com>
Subject: Re: [igt-dev] [PATCH i-g-t 10/10] tests/psr: Add the same test coverage that we have for PSR1 to PSR2
Date: Thu, 17 Jan 2019 23:05:33 +0000 [thread overview]
Message-ID: <e880b793ece181d36dd3624fd250209c0d175207.camel@intel.com> (raw)
In-Reply-To: <732d6d7f45300740009bef2c922c7cd5d551cfbb.camel@intel.com>
[-- Attachment #1.1: Type: text/plain, Size: 11600 bytes --]
On Thu, 2019-01-17 at 13:51 -0800, Dhinakaran Pandiyan wrote:
> On Thu, 2019-01-17 at 13:43 -0800, Souza, Jose wrote:
> > On Tue, 2019-01-15 at 22:44 -0800, Dhinakaran Pandiyan wrote:
> > > On Fri, 2019-01-11 at 17:46 -0800, José Roberto de Souza wrote:
> > > > The main tests for PSR1 check if hardware tracking is detecting
> > > > changes in planes when modifing it in different ways and now
> > > > those tests will also run for PSR2 if supported by source and
> > > > sink.
> > > >
> > > > Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> > > > Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
> > > > Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
> > > > ---
> > > > tests/kms_psr.c | 119
> > > > ++++++++++++++++++++++++++++++++++++++++++++
> > > > ----
> > > > 1 file changed, 110 insertions(+), 9 deletions(-)
> > > >
> > > > diff --git a/tests/kms_psr.c b/tests/kms_psr.c
> > > > index 8f2ef89c..b2202cd3 100644
> > > > --- a/tests/kms_psr.c
> > > > +++ b/tests/kms_psr.c
> > > > @@ -61,6 +61,7 @@ typedef struct {
> > > > int debugfs_fd;
> > > > enum operations op;
> > > > int test_plane_id;
> > > > + enum psr_mode op_psr_mode;
> > > > uint32_t devid;
> > > > uint32_t crtc_id;
> > > > igt_display_t display;
> > > > @@ -72,6 +73,7 @@ typedef struct {
> > > > drmModeModeInfo *mode;
> > > > igt_output_t *output;
> > > > bool with_psr_disabled;
> > > > + bool supports_psr2;
> > > > } data_t;
> > > >
> > > > static void create_cursor_fb(data_t *data)
> > > > @@ -190,10 +192,10 @@ static void fill_render(data_t *data,
> > > > uint32_t
> > > > handle, unsigned char color)
> > > > gem_bo_busy(data->drm_fd, handle);
> > > > }
> > > >
> > > > -static bool sink_support(data_t *data)
> > > > +static bool sink_support(data_t *data, enum psr_mode mode)
> > > > {
> > > > return data->with_psr_disabled ||
> > > > - psr_sink_support(data->debugfs_fd, PSR_MODE_1);
> > > > + psr_sink_support(data->debugfs_fd, mode);
> > > > }
> > > >
> > > > static bool psr_wait_entry_if_enabled(data_t *data)
> > > > @@ -201,7 +203,23 @@ static bool
> > > > psr_wait_entry_if_enabled(data_t
> > > > *data)
> > > > if (data->with_psr_disabled)
> > > > return true;
> > > >
> > > > - return psr_wait_entry(data->debugfs_fd, PSR_MODE_1);
> > > > + return psr_wait_entry(data->debugfs_fd, data-
> > > > >op_psr_mode);
> > > > +}
> > > > +
> > > > +static bool psr_wait_update_if_enabled(data_t *data)
> > > > +{
> > > > + if (data->with_psr_disabled)
> > > > + return true;
> > > > +
> > > > + return psr_wait_update(data->debugfs_fd, data-
> > > > >op_psr_mode);
> > > > +}
> > > > +
> > > > +static bool psr_enable_if_enabled(data_t *data)
> > >
> > > This function name is quite confusing. What do you think of using
> > > macros like this
> > >
> > > #define PSR_WAIT_ENTRY(data, mode)
> > > return data->with_psr_disabled || psr_wait_entry(data-
> > > > debugfs_fd, mode);
> > >
> > > ...
> >
> > I'm happy with both approaches but I guess we can change that in a
> > patch on top of this one.
> >
> > >
> > > > +{
> > > > + if (data->with_psr_disabled)
> > > > + return true;
> > > > +
> > > > + return psr_enable(data->debugfs_fd, data->op_psr_mode);
> > > > }
> > > >
> > > > static inline void manual(const char *expected)
> > > > @@ -291,7 +309,7 @@ static void run_test(data_t *data)
> > > > expected = "screen GREEN";
> > > > break;
> > > > }
> > > > - igt_assert(psr_wait_update(data->debugfs_fd,
> > > > PSR_MODE_1));
> > > > + igt_assert(psr_wait_update_if_enabled(data));
> > > > manual(expected);
> > > > }
> > > >
> > > > @@ -369,6 +387,7 @@ static void setup_test_plane(data_t *data,
> > > > int
> > > > test_plane)
> > > >
> > > > static void test_setup(data_t *data)
> > > > {
> > > > + psr_enable_if_enabled(data);
> > > > setup_test_plane(data, data->test_plane_id);
> > > > igt_assert(psr_wait_entry_if_enabled(data));
> > > > }
> > > > @@ -399,7 +418,7 @@ static int opt_handler(int opt, int
> > > > opt_index,
> > > > void *_data)
> > > > int main(int argc, char *argv[])
> > > > {
> > > > const char *help_str =
> > > > - " --no-psr\tRun test without PSR.";
> > > > + " --no-psr\tRun test without PSR/PSR2.";
> > > > static struct option long_options[] = {
> > > > {"no-psr", 0, 0, 'n'},
> > > > { 0, 0, 0, 0 }
> > > > @@ -417,12 +436,15 @@ int main(int argc, char *argv[])
> > > > kmstest_set_vt_graphics_mode();
> > > > data.devid = intel_get_drm_devid(data.drm_fd);
> > > >
> > > > - if (!data.with_psr_disabled)
> > > > - psr_enable(data.debugfs_fd,
> > > > PSR_MODE_1);
> > > > -
> > > > - igt_require_f(sink_support(&data),
> > > > + igt_require_f(sink_support(&data, PSR_MODE_1),
> > > > "Sink does not support PSR\n");
> > > >
> > > > + if (sink_support(&data, PSR_MODE_2)) {
> > > > + data.op_psr_mode = PSR_MODE_2;
> > > > + psr_enable_if_enabled(&data);
> > >
> > > There is another enable in test_setup() that the PSR2 subtests
> > > call.
> > > Why do we need two?
> >
> > Here I'm enabling by hand to check if source and sink support PSR2
> > so
> > data.supports_psr2 is set with the right value and we skip the PSR2
> > tests when not supported.
>
> How do you distinguish that from a true failure where PSR2 should
> have
> got enabled but it doesn't?
We can't distinguish but after the first CI reports if a machine that
had PSR2 tests running suddenly start to skip PSR2 tests it will be
reported by CI.
> >
> > > > + data.supports_psr2 =
> > > > psr_wait_entry_if_enabled(&data);
> > > > + }
> > > > +
> > > > data.bufmgr =
> > > > drm_intel_bufmgr_gem_init(data.drm_fd,
> > > > 4096);
> > > > igt_assert(data.bufmgr);
> > > > drm_intel_bufmgr_gem_enable_reuse(data.bufmgr);
> > > > @@ -431,12 +453,31 @@ int main(int argc, char *argv[])
> > > > }
> > > >
> > > > igt_subtest("basic") {
> > > > + data.op_psr_mode = PSR_MODE_1;
> > > > + data.test_plane_id = DRM_PLANE_TYPE_PRIMARY;
> > > > + test_setup(&data);
> > > > + test_cleanup(&data);
> > > > + }
> > >
> > > Run this in a loop (PSR_MODE_1...PSR_MODE_2) instead of repeating
> > > the
> > > same calls?
> >
> > I think have separated tests is better because CI reports will show
> > what version of PSR has a regression, we can run specific tests
> > while
> > debuging...
>
> Calling igt_subtest() in a loop should generate separate subtests
> iiuc.
Ohh now I got what you want to do, looks good I will change to this.
But we will need to generate PSR2 tests for every machine, as the
igt_fixture() do not run when getting the list of subtests and CI
probably uses that to split the tests through the shards.
>
> > > > +
> > > > + igt_subtest("psr2_basic") {
> > > > + igt_require(data.supports_psr2);
> > >
> > > We don't have to generate this subtest if the sink does not
> > > support
> > > PSR2. kms_frontbuffer_tracking generates subtests dynamically, we
> > > can
> > > use the same approach here.
> > >
> > > > + data.op_psr_mode = PSR_MODE_2;
> > > > data.test_plane_id = DRM_PLANE_TYPE_PRIMARY;
> > > > test_setup(&data);
> > > > test_cleanup(&data);
> > > > }
> > > >
> > > > igt_subtest("no_drrs") {
> > > > + data.op_psr_mode = PSR_MODE_1;
> > > > + data.test_plane_id = DRM_PLANE_TYPE_PRIMARY;
> > > > + test_setup(&data);
> > > > + igt_assert(drrs_disabled(&data));
> > > > + test_cleanup(&data);
> > > > + }
> > > > +
> > > > + igt_subtest("psr2_no_drrs") {
> > > > + igt_require(data.supports_psr2);
> > > > + data.op_psr_mode = PSR_MODE_2;
> > > > data.test_plane_id = DRM_PLANE_TYPE_PRIMARY;
> > > > test_setup(&data);
> > > > igt_assert(drrs_disabled(&data));
> > > > @@ -445,6 +486,17 @@ int main(int argc, char *argv[])
> > > >
> > > > for (op = PAGE_FLIP; op <= RENDER; op++) {
> > > > igt_subtest_f("primary_%s", op_str(op)) {
> > > > + data.op_psr_mode = PSR_MODE_1;
> > > > + data.op = op;
> > > > + data.test_plane_id =
> > > > DRM_PLANE_TYPE_PRIMARY;
> > > > + test_setup(&data);
> > > > + run_test(&data);
> > > > + test_cleanup(&data);
> > > > + }
> > > > +
> > > > + igt_subtest_f("psr2_primary_%s", op_str(op)) {
> > > > + igt_require(data.supports_psr2);
> > > > + data.op_psr_mode = PSR_MODE_2;
> > > > data.op = op;
> > > > data.test_plane_id =
> > > > DRM_PLANE_TYPE_PRIMARY;
> > > > test_setup(&data);
> > > > @@ -455,6 +507,18 @@ int main(int argc, char *argv[])
> > > >
> > > > for (op = MMAP_GTT; op <= PLANE_ONOFF; op++) {
> > > > igt_subtest_f("sprite_%s", op_str(op)) {
> > > > + igt_require(data.supports_psr2);
> > > > + data.op_psr_mode = PSR_MODE_1;
> > > > + data.op = op;
> > > > + data.test_plane_id =
> > > > DRM_PLANE_TYPE_OVERLAY;
> > > > + test_setup(&data);
> > > > + run_test(&data);
> > > > + test_cleanup(&data);
> > > > + }
> > > > +
> > > > + igt_subtest_f("psr2_sprite_%s", op_str(op)) {
> > > > + igt_require(data.supports_psr2);
> > > > + data.op_psr_mode = PSR_MODE_2;
> > > > data.op = op;
> > > > data.test_plane_id =
> > > > DRM_PLANE_TYPE_OVERLAY;
> > > > test_setup(&data);
> > > > @@ -465,6 +529,17 @@ int main(int argc, char *argv[])
> > > >
> > > > for (op = MMAP_GTT; op <= PLANE_ONOFF; op++) {
> > > > igt_subtest_f("cursor_%s", op_str(op)) {
> > > > + data.op_psr_mode = PSR_MODE_1;
> > > > + data.op = op;
> > > > + data.test_plane_id =
> > > > DRM_PLANE_TYPE_CURSOR;
> > > > + test_setup(&data);
> > > > + run_test(&data);
> > > > + test_cleanup(&data);
> > > > + }
> > > > +
> > > > + igt_subtest_f("psr2_cursor_%s", op_str(op)) {
> > > > + igt_require(data.supports_psr2);
> > > > + data.op_psr_mode = PSR_MODE_2;
> > > > data.op = op;
> > > > data.test_plane_id =
> > > > DRM_PLANE_TYPE_CURSOR;
> > > > test_setup(&data);
> > > > @@ -474,6 +549,18 @@ int main(int argc, char *argv[])
> > > > }
> > > >
> > > > igt_subtest_f("dpms") {
> > > > + data.op_psr_mode = PSR_MODE_1;
> > > > + data.op = RENDER;
> > > > + data.test_plane_id = DRM_PLANE_TYPE_PRIMARY;
> > > > + test_setup(&data);
> > > > + dpms_off_on(&data);
> > > > + run_test(&data);
> > > > + test_cleanup(&data);
> > > > + }
> > > > +
> > > > + igt_subtest_f("psr2_dpms") {
> > > > + igt_require(data.supports_psr2);
> > > > + data.op_psr_mode = PSR_MODE_2;
> > > > data.op = RENDER;
> > > > data.test_plane_id = DRM_PLANE_TYPE_PRIMARY;
> > > > test_setup(&data);
> > > > @@ -483,6 +570,20 @@ int main(int argc, char *argv[])
> > > > }
> > > >
> > > > igt_subtest_f("suspend") {
> > > > + data.op_psr_mode = PSR_MODE_1;
> > > > + data.op = PLANE_ONOFF;
> > > > + data.test_plane_id = DRM_PLANE_TYPE_CURSOR;
> > > > + test_setup(&data);
> > > > + igt_system_suspend_autoresume(SUSPEND_STATE_MEM
> > > > ,
> > > > + SUSPEND_TEST_NONE
> > > > );
> > > > + igt_assert(psr_wait_entry_if_enabled(&data));
> > > > + run_test(&data);
> > > > + test_cleanup(&data);
> > > > + }
> > > > +
> > > > + igt_subtest_f("psr2_suspend") {
> > > > + igt_require(data.supports_psr2);
> > > > + data.op_psr_mode = PSR_MODE_2;
> > > > data.op = PLANE_ONOFF;
> > > > data.test_plane_id = DRM_PLANE_TYPE_CURSOR;
> > > > test_setup(&data);
[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
[-- Attachment #2: Type: text/plain, Size: 154 bytes --]
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
next prev parent reply other threads:[~2019-01-17 23:05 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-12 1:45 [igt-dev] [PATCH i-g-t 01/10] lib/psr: Add a macro with the maximum lenght of i915_edp_psr_status and use it José Roberto de Souza
2019-01-12 1:45 ` [igt-dev] [PATCH i-g-t 02/10] tests/psr: Share the code check if sink supports PSR José Roberto de Souza
2019-01-12 1:46 ` [igt-dev] [PATCH i-g-t 03/10] lib/psr: Add support to new modified i915_edp_psr_status output José Roberto de Souza
2019-01-14 18:26 ` Rodrigo Vivi
2019-01-12 1:46 ` [igt-dev] [PATCH i-g-t 04/10] lib/psr: Only care about DEEP_SLEEP state for PSR2 José Roberto de Souza
2019-01-12 1:46 ` [igt-dev] [PATCH i-g-t 05/10] lib/psr: Rename psr_wait_exit to psr_wait_update José Roberto de Souza
2019-01-16 4:55 ` Dhinakaran Pandiyan
2019-01-12 1:46 ` [igt-dev] [PATCH i-g-t 06/10] lib/psr: Make psr_wait_entry and psr_wait_update aware of the PSR version tested José Roberto de Souza
2019-01-16 5:19 ` Dhinakaran Pandiyan
2019-01-17 1:59 ` Souza, Jose
2019-01-12 1:46 ` [igt-dev] [PATCH i-g-t 07/10] lib/psr: Drop support to old kernels without new PSR debugfs interface José Roberto de Souza
2019-01-16 5:21 ` Dhinakaran Pandiyan
2019-01-17 2:07 ` Souza, Jose
2019-01-17 2:16 ` Dhinakaran Pandiyan
2019-01-17 21:17 ` Souza, Jose
2019-01-17 9:50 ` Petri Latvala
2019-01-12 1:46 ` [igt-dev] [PATCH i-g-t 08/10] lib/psr: Add PSR2 support to the remaning psr functions José Roberto de Souza
2019-01-16 5:33 ` Dhinakaran Pandiyan
2019-01-17 2:14 ` Souza, Jose
2019-01-17 2:27 ` Dhinakaran Pandiyan
2019-01-12 1:46 ` [igt-dev] [PATCH i-g-t 09/10] test/psr: Add a generic function to setup each test José Roberto de Souza
2019-01-12 1:46 ` [igt-dev] [PATCH i-g-t 10/10] tests/psr: Add the same test coverage that we have for PSR1 to PSR2 José Roberto de Souza
2019-01-14 18:25 ` Rodrigo Vivi
2019-01-16 6:44 ` Dhinakaran Pandiyan
2019-01-17 21:43 ` Souza, Jose
2019-01-17 21:51 ` Dhinakaran Pandiyan
2019-01-17 23:05 ` Souza, Jose [this message]
2019-01-17 23:09 ` Pandiyan, Dhinakaran
2019-01-17 23:41 ` Souza, Jose
2019-01-12 2:32 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,01/10] lib/psr: Add a macro with the maximum lenght of i915_edp_psr_status and use it Patchwork
2019-01-12 8:48 ` [igt-dev] ✓ Fi.CI.IGT: " 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=e880b793ece181d36dd3624fd250209c0d175207.camel@intel.com \
--to=jose.souza@intel.com \
--cc=dhinakaran.pandiyan@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=rodrigo.vivi@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