From: Mika Kahola <mika.kahola@intel.com>
To: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH i-g-t v3 1/7] lib/igt_kms: Add forcing TEST_ONLY for atomic commits
Date: Thu, 23 Mar 2017 14:31:11 +0200 [thread overview]
Message-ID: <1490272271.9258.3.camel@intel.com> (raw)
In-Reply-To: <f3ceb414-9cee-9537-2999-b0a8e17c890c@linux.intel.com>
On Wed, 2017-03-08 at 15:59 +0100, Maarten Lankhorst wrote:
> Op 01-02-17 om 14:18 schreef Mika Kahola:
> >
> > Add an option to force atomic commits to do commits with TEST_ONLY
> > flag
> > first before doing the actual commit.
> >
> > Signed-off-by: Mika Kahola <mika.kahola@intel.com>
> > ---
> > lib/igt_kms.c | 18 +++++++++++++++++-
> > lib/igt_kms.h | 1 +
> > 2 files changed, 18 insertions(+), 1 deletion(-)
> >
> > diff --git a/lib/igt_kms.c b/lib/igt_kms.c
> > index 4ba6316..c513ef8 100644
> > --- a/lib/igt_kms.c
> > +++ b/lib/igt_kms.c
> > @@ -2453,7 +2453,23 @@ static int igt_atomic_commit(igt_display_t
> > *display, uint32_t flags, void *user_
> > igt_atomic_prepare_connector_commit(output, req);
> > }
> >
> > - ret = drmModeAtomicCommit(display->drm_fd, req, flags,
> > user_data);
> > + if (display->force_test_atomic &&
> > + !(flags & DRM_MODE_ATOMIC_TEST_ONLY)) {
> > + unsigned int test_flags = flags &
> > ~DRM_MODE_PAGE_FLIP_EVENT;
> > + int test_ret;
> > +
> > + test_flags |= DRM_MODE_ATOMIC_TEST_ONLY;
> > +
> > + test_ret = drmModeAtomicCommit(display->drm_fd,
> > req, test_flags, user_data);
> > + ret = drmModeAtomicCommit(display->drm_fd, req,
> > flags, user_data);
> > +
> > + if (test_ret)
> > + igt_assert_eq(test_ret, ret);
> > + else
> > + igt_assert(ret != -EINVAL);
> > + } else
> > + ret = drmModeAtomicCommit(display->drm_fd, req,
> > flags, user_data);
> > +
> > drmModeAtomicFree(req);
> > return ret;
> >
> > diff --git a/lib/igt_kms.h b/lib/igt_kms.h
> > index 2562618..e45fc21 100644
> > --- a/lib/igt_kms.h
> > +++ b/lib/igt_kms.h
> > @@ -338,6 +338,7 @@ struct igt_display {
> > igt_pipe_t *pipes;
> > bool has_cursor_plane;
> > bool is_atomic;
> > + bool force_test_atomic;
> > };
> >
> > void igt_display_init(igt_display_t *display, int drm_fd);
> Sorry, didn't notice it before but force_test_atomic is a big
> behavioral switch that
> might force other tests to potentially fail. If this a subtest fails
> and the flag is
> not explictly cleared. This is also why you need to set it separately
> even if false.
So for this test it would be adequate if we clear this flag in case of
error? I'll spin another round of this patch series. It also requires
some rebasing too.
>
> I really wish there was a igt_subtest_exit_handler, I could remove a
> lot of boilerplate in the KMS tests with that.
>
> My personal wishlist for it:
> - Complete all sw_sync fences
> - Remove all allocated pipe_crc's, so next test won't fail due to fd
> already being assigned.
> - Clean igt_display_t with a synchronous commit.
> - Clear any pending drm events without blocking.
> - Remove any leftover framebuffers allocated in the subtest. This may
> fail if fb's become
> invalid, like in the kms_rmfb test.
>
This would be nice. Asserts may leave things in unstable state.
> Be careful with dereferencing fb's, the previous pointer may not be
> valid any more if it
> was allocated on the stack. It should probably require an extra
> memory allocation during
> fb alloc to keep track.
>
> This would allow us to kill most of the teardown boilerplate in igt
> kms tests, and increases
> reliability when a subtest fails, the next subtest is a lot more
> likely to succeed.
>
> ~Maarten
>
--
Mika Kahola - Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2017-03-23 12:29 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-01 13:18 [PATCH i-g-t v3 0/7] Validate TEST_ONLY correctness against full atomic commit Mika Kahola
2017-02-01 13:18 ` [PATCH i-g-t v3 1/7] lib/igt_kms: Add forcing TEST_ONLY for atomic commits Mika Kahola
2017-03-08 14:59 ` Maarten Lankhorst
2017-03-23 12:31 ` Mika Kahola [this message]
2017-02-01 13:18 ` [PATCH i-g-t v3 2/7] tests/kms_plane_multiple: Add TEST_ONLY flag Mika Kahola
2017-02-01 13:18 ` [PATCH i-g-t v3 3/7] tests/kms_atomic_transition: " Mika Kahola
2017-02-01 13:18 ` [PATCH i-g-t v3 4/7] tests/kms_plane_scaling: " Mika Kahola
2017-02-01 13:18 ` [PATCH i-g-t v3 5/7] tests/kms_rotation_crc: " Mika Kahola
2017-02-01 13:18 ` [PATCH i-g-t v3 6/7] tests/kms_plane_lowres: " Mika Kahola
2017-02-01 13:18 ` [PATCH i-g-t v3 7/7] tests/kms_cursor_legacy: " Mika Kahola
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=1490272271.9258.3.camel@intel.com \
--to=mika.kahola@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=maarten.lankhorst@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