On 04-07-2023 10:57, priyanka.dandamudi@intel.com wrote:
From: Priyanka Dandamudi <priyanka.dandamudi@intel.com>

Optimise code to use xe_bo_mmap.

Cc: Bommu Krishnaiah <krishnaiah.bommu@intel.com>
Signed-off-by: Priyanka Dandamudi <priyanka.dandamudi@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@intel.com