public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Ramalingam C <ramalingam.c@intel.com>, igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH i-g-t] tests/i915/gem_mmap: test for non pagealingned mmaps
Date: Mon, 8 Apr 2019 17:01:00 +0100	[thread overview]
Message-ID: <0af7234a-5e45-c0fb-3f27-6201ee7fa15b@linux.intel.com> (raw)
In-Reply-To: <20190408155038.2389-1-ramalingam.c@intel.com>


On 08/04/2019 16:50, Ramalingam C wrote:
> Kernel supports the non page aligned mmaps. Hence this new subtest

s/Kernel/i915/ to make Chris happy. Maybe also expand with "by mistake" 
and clarify this applies only to CPU WC mmap flavour.

Unless Chris is objecting to testing this to start with?

> helps to maintain the sanity of such support.
> 
> Signed-off-by: Ramalingam C <ramalingam.c@intel.com>
> ---
>   tests/i915/gem_mmap.c | 15 +++++++++++++++
>   1 file changed, 15 insertions(+)
> 
> diff --git a/tests/i915/gem_mmap.c b/tests/i915/gem_mmap.c
> index 1f5348d9133b..f66d8b896268 100644
> --- a/tests/i915/gem_mmap.c
> +++ b/tests/i915/gem_mmap.c
> @@ -228,6 +228,21 @@ igt_main
>   		}
>   	}
>   
> +	igt_subtest("page_nonaligned") {
> +		struct drm_i915_gem_mmap arg = {
> +			.handle = gem_create(fd, PAGE_SIZE),
> +			.size = PAGE_SIZE - 5,
> +			.flags = I915_MMAP_WC,
> +		};
> +
> +		igt_debug("Trying to mmap page nonaligned size : %'"PRIu64"\n",
> +			  (unsigned long)arg.size);

PRIu64 does not match unsigned long on 32-bit I think.

But more importantly we normally don't bother with such debug messages 
especially when test is so trivial. So I'd just remove it.

> +		igt_assert_eq(mmap_ioctl(fd, &arg), 0);
> +
> +		gem_close(fd, arg.handle);
> +		munmap(from_user_pointer(arg.addr_ptr), PAGE_SIZE - 5);

Nitpick, add a local "const size_t mmap_size = PAGE_SIZE - 5" and then 
you don't have to repeat the value.

> +	}
> +
>   	igt_subtest("basic") {
>   		struct drm_i915_gem_mmap arg = {
>   			.handle = gem_create(fd, OBJECT_SIZE),
> 

Otherwise looks good to me.

Regards,

Tvrtko
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  parent reply	other threads:[~2019-04-08 16:01 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-08 15:50 [igt-dev] [PATCH i-g-t] tests/i915/gem_mmap: test for non pagealingned mmaps Ramalingam C
2019-04-08 15:52 ` Chris Wilson
2019-04-08 16:01   ` C, Ramalingam
2019-04-08 16:01 ` Tvrtko Ursulin [this message]
2019-04-08 16:10   ` Chris Wilson
2019-04-08 16:18     ` Tvrtko Ursulin
2019-04-08 17:17 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2019-04-08 20:11 ` [igt-dev] ✗ Fi.CI.IGT: 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=0af7234a-5e45-c0fb-3f27-6201ee7fa15b@linux.intel.com \
    --to=tvrtko.ursulin@linux.intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=ramalingam.c@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