All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: Antonio Argenziano <antonio.argenziano@intel.com>,
	igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [RFC 4/4] tests/i915/prime_mmap: Add WC correctness test
Date: Tue, 12 Mar 2019 22:07:15 +0000	[thread overview]
Message-ID: <155242843480.30003.8353634050531903202@skylake-alporthouse-com> (raw)
In-Reply-To: <20190312215738.5598-5-antonio.argenziano@intel.com>

Quoting Antonio Argenziano (2019-03-12 21:57:38)
> Signed-off-by: Antonio Argenziano <antonio.argenziano@intel.com>
> ---
>  tests/prime_mmap.c | 36 ++++++++++++++++++++++++++++++++++--
>  1 file changed, 34 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/prime_mmap.c b/tests/prime_mmap.c
> index fc985784..d3833f91 100644
> --- a/tests/prime_mmap.c
> +++ b/tests/prime_mmap.c
> @@ -73,7 +73,7 @@ fill_bo_cpu(char *ptr)
>  }
>  
>  static void
> -test_correct(void)
> +test_correct_gtt(void)
>  {
>         int dma_buf_fd;
>         char *ptr1, *ptr2;
> @@ -101,6 +101,37 @@ test_correct(void)
>         gem_close(fd, handle);
>  }
>  
> +static void
> +test_correct_wc(void)
> +{
> +       int dma_buf_fd;
> +       char *ptr1, *ptr2;
> +       uint32_t handle;
> +
> +       gem_require_mmap_wc(fd);
> +
> +       handle = gem_create(fd, BO_SIZE);
> +       fill_bo(handle, BO_SIZE);
> +
> +       dma_buf_fd = prime_handle_to_fd(fd, handle);
> +       igt_assert(errno == 0);
> +
> +       /* Check correctness vs WC mapping */
> +       ptr1 = gem_mmap__wc(fd, handle, 0, BO_SIZE, PROT_READ);
> +       ptr2 = mmap(NULL, BO_SIZE, PROT_READ, MAP_SHARED, dma_buf_fd, 0);

But both for read. Where's the write through one mmap, check it arrives
in the second.

memcmp(ptr1, ptr2) just reduces to
memcmp(ptr1, pattern) || memcmp(ptr2, pattern)

The fault handling in the kernel is no different between those two.
-Chris
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  reply	other threads:[~2019-03-12 22:07 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-12 21:57 [igt-dev] [RFC 0/4] Improve mmap interface coverage Antonio Argenziano
2019-03-12 21:57 ` [igt-dev] [RFC 1/4] tests/i915/gem_mmap_gtt: Add invalid parameters test Antonio Argenziano
2019-03-12 22:04   ` Chris Wilson
2019-03-12 22:11     ` Antonio Argenziano
2019-03-12 22:18       ` Chris Wilson
2019-03-12 21:57 ` [igt-dev] [RFC 2/4] tests/i915/gem_mmap: Add invalid parameters tests Antonio Argenziano
2019-03-12 22:02   ` Chris Wilson
2019-03-12 22:13     ` Antonio Argenziano
2019-03-13 22:18     ` Antonio Argenziano
2019-03-13 22:52       ` Chris Wilson
2019-03-12 21:57 ` [igt-dev] [RFC 3/4] tests/i915/gem_mmap_wc: Add invalid params tests Antonio Argenziano
2019-03-12 21:57 ` [igt-dev] [RFC 4/4] tests/i915/prime_mmap: Add WC correctness test Antonio Argenziano
2019-03-12 22:07   ` Chris Wilson [this message]
2019-03-13 13:38 ` [igt-dev] ✓ Fi.CI.BAT: success for Improve mmap interface coverage Patchwork
2019-03-13 16:12 ` [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=155242843480.30003.8353634050531903202@skylake-alporthouse-com \
    --to=chris@chris-wilson.co.uk \
    --cc=antonio.argenziano@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    /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.