Skip to contentSkip to conversation

xe_copy: Add memset/memcpy test checks.

PATCH In review Sobin Thomas 2 participants 3 messages Jul 10, 2025 – Jul 14, 2025

lore
Share & tools
lore
#0 lore raw

v3 cover xe_copy: Add memset/memcpy test checks.

Added checks for platforms with graphics_ver < 20 (e.g. PVC) in memcpy and memset for tests with extended parameters.

This update includes:

- Handling of tests for PAGE_COPY mode (memcpy) and larger-sized writes (memset).
- On platforms with graphics_ver < 20, memset is limited to a maximum fill width of U18-1 and memcopy tests using page copy is skipped.
- Any values greater than 0x3FFFF will now be skipped for memset-linear to prevent overflows or undefined behavior.

Sobin Thomas (1):
tests/intel/xe_copy : Add check for memset and memcpy tests.

 tests/intel/xe_copy_basic.c | 5 +++++
 1 file changed, 5 insertions(+)
Signature · 1 line
2.34.1
#1 lore raw

PATCH v3 1/1 tests/intel/xe_copy : Add memset/memcpy

Added the check for platforms (graphics_ver < 20) like PVC for xe memcpy and memset for some tests (like xe-memset-linear) with extended parameters.

---
 tests/intel/xe_copy_basic.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
tests/intel/xe_copy_basic.c +10 -0
index 5a050b82c..2996a496b 100644
@@ -261,6 +261,7 @@ const char *help_str =
 igt_main_args("b", NULL, help_str, opt_handler, NULL)
 {
 	int fd;
+	uint16_t dev_id;
 	struct igt_collection *set, *regions;
 	uint32_t region;
 	struct rect linear[] = { { 0, 0xfd, 1, MODE_BYTE },
@@ -274,6 +275,7 @@ igt_main_args("b", NULL, help_str, opt_handler, NULL)
 
 	igt_fixture {
 		fd = drm_open_driver(DRIVER_XE);
+		dev_id = intel_get_drm_devid(fd);
 		xe_device_get(fd);
 		set = xe_get_memory_region_set(fd,
 					       DRM_XE_MEM_REGION_CLASS_SYSMEM,
@@ -293,6 +295,7 @@ igt_main_args("b", NULL, help_str, opt_handler, NULL)
 	for (int i = 0; i < ARRAY_SIZE(page); i++) {
 		igt_subtest_f("mem-page-copy-%u", page[i].width) {
 			igt_require(blt_has_mem_copy(fd));
+			igt_require(intel_get_device_info(dev_id)->graphics_ver >= 20);
 			for_each_variation_r(regions, 1, set) {
 				region = igt_collection_get_value(regions, 0);
 				copy_test(fd, &page[i], MEM_COPY, region);
@@ -312,6 +315,13 @@ igt_main_args("b", NULL, help_str, opt_handler, NULL)
 
 	for (int i = 0; i < ARRAY_SIZE(linear); i++) {
 		igt_subtest_f("mem-set-linear-0x%x", linear[i].width) {
+			/* Skip mem-set-linear test for values greater than
+			 * 0x3FFFF. As hardware with graphics_ver<20 support
+			 * till 0x3FFFF.
+			 */
+			if ((linear[i].width > 0x3ffff) &&
+				   (intel_get_device_info(dev_id)->graphics_ver < 20))
+				igt_skip("Skipping: width exceeds 18-bit limit on gfx_ver < 20.");
 			igt_require(blt_has_mem_set(fd));
 			for_each_variation_r(regions, 1, set) {
 				region = igt_collection_get_value(regions, 0);
Signature · 1 line
2.34.1
#2 lore raw

Re: [PATCH v3 i-g-t 1/1] tests/intel/xe_copy : Add memset/memcpy

On Thu, Jul 10, 2025 at 12:58:52PM +0000, Sobin Thomas wrote:

Subject: [PATCH v3 i-g-t 1/1] tests/intel/xe_copy : Add memset/memcpy

is not correct, please fix. I keep my r-b for the code.

--
Zbigniew

Quoted 54 lines

Added the check for platforms (graphics_ver < 20) like PVC for xe memcpy and memset for some tests (like xe-memset-linear) with extended parameters.

---
 tests/intel/xe_copy_basic.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
tests/intel/xe_copy_basic.c +10 -0
index 5a050b82c..2996a496b 100644
@@ -261,6 +261,7 @@ const char *help_str =
 igt_main_args("b", NULL, help_str, opt_handler, NULL)
 {
 	int fd;
+	uint16_t dev_id;
 	struct igt_collection *set, *regions;
 	uint32_t region;
 	struct rect linear[] = { { 0, 0xfd, 1, MODE_BYTE },
@@ -274,6 +275,7 @@ igt_main_args("b", NULL, help_str, opt_handler, NULL)
 
 	igt_fixture {
 		fd = drm_open_driver(DRIVER_XE);
+		dev_id = intel_get_drm_devid(fd);
 		xe_device_get(fd);
 		set = xe_get_memory_region_set(fd,
 					       DRM_XE_MEM_REGION_CLASS_SYSMEM,
@@ -293,6 +295,7 @@ igt_main_args("b", NULL, help_str, opt_handler, NULL)
 	for (int i = 0; i < ARRAY_SIZE(page); i++) {
 		igt_subtest_f("mem-page-copy-%u", page[i].width) {
 			igt_require(blt_has_mem_copy(fd));
+			igt_require(intel_get_device_info(dev_id)->graphics_ver >= 20);
 			for_each_variation_r(regions, 1, set) {
 				region = igt_collection_get_value(regions, 0);
 				copy_test(fd, &page[i], MEM_COPY, region);
@@ -312,6 +315,13 @@ igt_main_args("b", NULL, help_str, opt_handler, NULL)
 
 	for (int i = 0; i < ARRAY_SIZE(linear); i++) {
 		igt_subtest_f("mem-set-linear-0x%x", linear[i].width) {
+			/* Skip mem-set-linear test for values greater than
+			 * 0x3FFFF. As hardware with graphics_ver<20 support
+			 * till 0x3FFFF.
+			 */
+			if ((linear[i].width > 0x3ffff) &&
+				   (intel_get_device_info(dev_id)->graphics_ver < 20))
+				igt_skip("Skipping: width exceeds 18-bit limit on gfx_ver < 20.");
 			igt_require(blt_has_mem_set(fd));
 			for_each_variation_r(regions, 1, set) {
 				region = igt_collection_get_value(regions, 0);
Signature · 1 line
2.34.1