[igt-dev] [PATCH i-g-t] i915/gem_mmap: Modified offset in subtest "bad-size"

Chris Wilson chris at chris-wilson.co.uk
Thu Sep 3 12:55:06 UTC 2020


Quoting apoorva1.singh at intel.com (2020-09-02 16:24:23)
> From: Apoorva Singh <apoorva1.singh at intel.com>
> 
> Subtest "bad-size" should keep valid/good offset
> corresponding to buffer object being mapped.
> Currently, subtest will pass for any value of size
> provided as the offset value itself will not allow
> to map any size of memory which defies the purpose
> of this subtest.
> 
> The subtest should not pass due to bad offset value
> while it should pass only due to bad size provided.
> 
> Signed-off-by: Apoorva Singh <apoorva1.singh at intel.com>
> Cc: Melkaveri, Arjun <arjun.melkaveri at intel.com>
> Cc: Chris Wilson <chris at chris-wilson.co.uk>
> Cc: Priyanka Dandamudi <priyanka.dandamudi at intel.com>
> ---
>  tests/i915/gem_mmap.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tests/i915/gem_mmap.c b/tests/i915/gem_mmap.c
> index f8cf052e..73ffac91 100644
> --- a/tests/i915/gem_mmap.c
> +++ b/tests/i915/gem_mmap.c
> @@ -218,7 +218,7 @@ igt_main
>                 for (int i = 0; i < ARRAY_SIZE(bad_size); i++) {
>                         struct drm_i915_gem_mmap arg = {
>                                 .handle = gem_create(fd, 4096),
> -                               .offset = 4096,
> +                               .offset = 0,

Ah, I see what we had in mind; we wanted to check for overflow handling.

When in doubt do both.
-Chris


More information about the igt-dev mailing list