[igt-dev] [PATCH i-g-t] xe/xe_mmap: Optimise code to use xe_bo_mmap

Bommu, Krishnaiah krishnaiah.bommu at intel.com
Tue Jul 4 06:01:11 UTC 2023


On 04-07-2023 10:57, priyanka.dandamudi at intel.com wrote:
> From: Priyanka Dandamudi<priyanka.dandamudi at intel.com>
>
> Optimise code to use xe_bo_mmap.
>
> Cc: Bommu Krishnaiah<krishnaiah.bommu at intel.com>
> Signed-off-by: Priyanka Dandamudi<priyanka.dandamudi at intel.com>
> ---
>   tests/xe/xe_mmap.c | 5 +----
>   1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/tests/xe/xe_mmap.c b/tests/xe/xe_mmap.c
> index 664ed54fc..7fe8f73a4 100644
> --- a/tests/xe/xe_mmap.c
> +++ b/tests/xe/xe_mmap.c
> @@ -46,11 +46,8 @@ test_mmap(int fd, uint32_t flags)
>   	igt_require_f(flags, "Device doesn't support such memory region\n");
>   
>   	bo = xe_bo_create_flags(fd, 0, 4096, flags);
> -	mmo = xe_bo_mmap_offset(fd, bo);
> -
> -	map = mmap(NULL, 4096, PROT_WRITE, MAP_SHARED, fd, mmo);
> -	igt_assert(map != MAP_FAILED);
>   
> +	map = xe_bo_map(fd, bo, 4096);
>   	strcpy(map, "Write some data to the BO!");
>   
>   	munmap(map, 4096);

Changes looks good to me

Reviewed-by: Bommu Krishnaiah krishnaiah.bommu at intel.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/igt-dev/attachments/20230704/c5953c97/attachment-0001.htm>


More information about the igt-dev mailing list