[PATCH] prime_mmap: Limit aperture testing to machines with an aperture
Kamil Konieczny
kamil.konieczny at linux.intel.com
Tue Apr 15 08:48:33 UTC 2025
Hi Pravalika,
On 2025-04-14 at 15:56:40 +0530, Pravalika Gurram wrote:
> From: Chris Wilson <chris.p.wilson at linux.intel.com>
>
> The test_aperture_limit looks at the handling of internal GGTT mmaps for
> the dmabuf and checking what happens if we try to mmap more than we can
> fit inside the aperture. Thus if we have no aperture, there is no corner
> case regarding the mmapable aperture that requires validation.
>
> Signed-off-by: Chris Wilson <chris.p.wilson at linux.intel.com>
> Signed-off-by: Pravalika Gurram <pravalika.gurram at intel.com>
> ---
> tests/intel/prime_mmap.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/tests/intel/prime_mmap.c b/tests/intel/prime_mmap.c
> index 6de54b840..ae0c74dfe 100644
> --- a/tests/intel/prime_mmap.c
> +++ b/tests/intel/prime_mmap.c
> @@ -490,6 +490,10 @@ test_aperture_limit(uint32_t region, uint64_t size)
> uint64_t size1 = (gem_mappable_aperture_size(fd) * 7) / 8;
> uint64_t size2 = (gem_mappable_aperture_size(fd) * 3) / 8;
>
> + igt_require(gem_has_mappable_ggtt(fd));
> + igt_require(size1 >= size2);
> + igt_require(size2 >= size);
> +
Looks good.
> handle1 = gem_create(fd, size1);
> dma_buf_fd1 = prime_handle_to_fd_for_mmap(fd, handle1);
> igt_assert(errno == 0);
> @@ -498,7 +502,7 @@ test_aperture_limit(uint32_t region, uint64_t size)
> fill_bo_cpu(ptr1, size);
> igt_assert(memcmp(ptr1, pattern, sizeof(pattern)) == 0);
>
> - handle2 = gem_create(fd, size1);
> + handle2 = gem_create(fd, size2);
After a second read this looks like a separate fix, especially
that it is not described in commit.
Please split this into a separate patch.
Regards,
Kamil
> dma_buf_fd2 = prime_handle_to_fd_for_mmap(fd, handle2);
> igt_assert(errno == 0);
> ptr2 = mmap(NULL, size2, PROT_READ | PROT_WRITE, MAP_SHARED, dma_buf_fd2, 0);
> --
> 2.34.1
>
More information about the igt-dev
mailing list