public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
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 v2] tests: Validate TEST_ONLY correctness against full atomic commit
Date: Mon, 30 Jan 2017 15:22:04 +0200	[thread overview]
Message-ID: <1485782524.9014.144.camel@intel.com> (raw)
In-Reply-To: <07573726-6cca-00f6-43a1-6ab3a502ba68@linux.intel.com>

On Mon, 2017-01-30 at 13:43 +0100, Maarten Lankhorst wrote:
> Op 30-01-17 om 12:37 schreef Mika Kahola:
> > 
> > Validate atomic commit correctness before actual commit.
> > 
> > For: VIZ-6956
> > 
> > v2: Add flag to toggle TEST_ONLY for atomic commit.
> >     Remove DRM_MODE_PAGE_FLIP_EVENT flag, if enabled, before trying
> > atomic
> >     commit with TEST_ONLY flag (Maarten)
> > 
> > Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> > 
> > Signed-off-by: Mika Kahola <mika.kahola@intel.com>
> > <snip>
> Hey,
> 
> Way too complicated, I thought of something like this instead too run
> a whole test with TEST_ONLY.
Ok, let's go with this approach. 

To follow JIRA description for this test I was thinking to add yet
another subtest for each kms_* that tests first with TEST_ONLY flag and
if that fails with -EINVAL then test with the real deal.

> diff --git a/lib/igt_kms.c b/lib/igt_kms.c
> index 77de678e121b..c935203f5b5c 100644
> --- a/lib/igt_kms.c
> +++ b/lib/igt_kms.c
> @@ -2332,7 +2332,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 81be77f5a16f..8ac7eb074fe7 100644
> --- a/lib/igt_kms.h
> +++ b/lib/igt_kms.h
> @@ -335,7 +335,7 @@ struct igt_display {
>  	igt_output_t *outputs;
>  	igt_pipe_t *pipes;
>  	bool has_cursor_plane;
> -	bool is_atomic;
> +	bool is_atomic, force_test_atomic;
>  };
>  
>  void igt_display_init(igt_display_t *display, int drm_fd);
> 
-- 
Mika Kahola - Intel OTC

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2017-01-30 13:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-30 11:37 [PATCH i-g-t v2] tests: Validate TEST_ONLY correctness against full atomic commit Mika Kahola
2017-01-30 12:43 ` Maarten Lankhorst
2017-01-30 13:22   ` Mika Kahola [this message]
2017-01-30 14:16     ` Maarten Lankhorst

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=1485782524.9014.144.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