public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Antonio Argenziano <antonio.argenziano@intel.com>
To: igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH i-g-t] i915/gem_tiled_w[bc]: Tighten computation of upper bound
Date: Thu, 14 Mar 2019 14:24:32 -0700	[thread overview]
Message-ID: <ec49afb6-5c43-234b-439b-7228f5f818a0@intel.com> (raw)
In-Reply-To: <20190314174913.2633-1-chris@chris-wilson.co.uk>



On 14/03/19 10:49, Chris Wilson wrote:
> Fix the off-by-one in computing the last page that caused us to try and
> mmap the page beyond the end of the object.

Ah, that explains the failures.

Reviewed-by: Antonio Argenziano <antonio.argenziano@intel.com>

> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> ---
>   tests/i915/gem_tiled_wb.c | 4 ++--
>   tests/i915/gem_tiled_wc.c | 4 ++--
>   2 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/tests/i915/gem_tiled_wb.c b/tests/i915/gem_tiled_wb.c
> index 67d54bd30..827c2d9d6 100644
> --- a/tests/i915/gem_tiled_wb.c
> +++ b/tests/i915/gem_tiled_wb.c
> @@ -174,8 +174,8 @@ igt_simple_main
>   			len = size;
>   		}
>   
> -		first_page = offset & ~(PAGE_SIZE-1);
> -		last_page = (offset + len + PAGE_SIZE) & ~(PAGE_SIZE-1);
> +		first_page = offset & -PAGE_SIZE;
> +		last_page = (offset + len + PAGE_SIZE - 1) & -PAGE_SIZE;
>   		offset -= first_page;
>   
>   		linear = gem_mmap__cpu(fd, handle, first_page, last_page - first_page, PROT_READ);
> diff --git a/tests/i915/gem_tiled_wc.c b/tests/i915/gem_tiled_wc.c
> index 21390729d..67ebbc940 100644
> --- a/tests/i915/gem_tiled_wc.c
> +++ b/tests/i915/gem_tiled_wc.c
> @@ -149,8 +149,8 @@ igt_simple_main
>   			len = size;
>   		}
>   
> -		first_page = offset & ~(PAGE_SIZE-1);
> -		last_page = (offset + len + PAGE_SIZE) & ~(PAGE_SIZE-1);
> +		first_page = offset & -PAGE_SIZE;
> +		last_page = (offset + len + PAGE_SIZE - 1) & -PAGE_SIZE;
>   
>   		linear = gem_mmap__wc(fd, handle, first_page, last_page - first_page, PROT_READ);
>   
> 
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  parent reply	other threads:[~2019-03-14 21:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-14 17:49 [igt-dev] [PATCH i-g-t] i915/gem_tiled_w[bc]: Tighten computation of upper bound Chris Wilson
2019-03-14 18:26 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2019-03-14 21:24 ` Antonio Argenziano [this message]
2019-03-15  3:00 ` [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=ec49afb6-5c43-234b-439b-7228f5f818a0@intel.com \
    --to=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox