* [igt-dev] [PATCH i-g-t 0/3] Remove gem_get_batch_size()
@ 2022-09-27 9:17 Zbigniew Kempczyński
2022-09-27 9:17 ` [igt-dev] [PATCH i-g-t 1/3] tests/prime_mmap: Use batch sizes appropriate for regions Zbigniew Kempczyński
` (3 more replies)
0 siblings, 4 replies; 10+ messages in thread
From: Zbigniew Kempczyński @ 2022-09-27 9:17 UTC (permalink / raw)
To: igt-dev
Remove gem_get_batch_size() as it is confusing - object size returned
by the kernel might differ than this function suggests.
Cc: Kamil Konieczny <kamil.konieczny@linux.intel.com>
Zbigniew Kempczyński (3):
tests/prime_mmap: Use batch sizes appropriate for regions
tests/gem_exec_basic: Don't use hardcoded batch size
lib/intel_memory_region: Remove function which returns batch size in
regions
lib/i915/intel_memory_region.c | 14 --------
lib/i915/intel_memory_region.h | 1 -
tests/i915/gem_exec_basic.c | 10 +++---
tests/prime_mmap.c | 59 ++++++++++++++++------------------
4 files changed, 33 insertions(+), 51 deletions(-)
--
2.34.1
^ permalink raw reply [flat|nested] 10+ messages in thread
* [igt-dev] [PATCH i-g-t 1/3] tests/prime_mmap: Use batch sizes appropriate for regions
2022-09-27 9:17 [igt-dev] [PATCH i-g-t 0/3] Remove gem_get_batch_size() Zbigniew Kempczyński
@ 2022-09-27 9:17 ` Zbigniew Kempczyński
2022-09-27 15:11 ` Kamil Konieczny
2022-09-27 16:57 ` Kamil Konieczny
2022-09-27 9:17 ` [igt-dev] [PATCH i-g-t 2/3] tests/gem_exec_basic: Don't use hardcoded batch size Zbigniew Kempczyński
` (2 subsequent siblings)
3 siblings, 2 replies; 10+ messages in thread
From: Zbigniew Kempczyński @ 2022-09-27 9:17 UTC (permalink / raw)
To: igt-dev
Stop using gem_get_batch_size() as it returns hardcoded values which
makes confusion regarding minimum object size in different regions.
Use real object size instead which is more suitable.
Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
Cc: Kamil Konieczny <kamil.konieczny@linux.intel.com>
---
tests/prime_mmap.c | 59 ++++++++++++++++++++++------------------------
1 file changed, 28 insertions(+), 31 deletions(-)
diff --git a/tests/prime_mmap.c b/tests/prime_mmap.c
index d53185ff10..bc19f68c98 100644
--- a/tests/prime_mmap.c
+++ b/tests/prime_mmap.c
@@ -81,13 +81,13 @@ fill_bo_cpu(char *ptr, size_t size)
}
static void
-test_correct(uint32_t region, int size)
+test_correct(uint32_t region, uint64_t size)
{
int dma_buf_fd;
char *ptr1, *ptr2;
uint32_t handle;
- handle = gem_create_in_memory_regions(fd, size, region);
+ igt_assert(__gem_create_in_memory_regions(fd, &handle, &size, region) == 0);
fill_bo(handle, size);
dma_buf_fd = prime_handle_to_fd(fd, handle);
@@ -110,13 +110,13 @@ test_correct(uint32_t region, int size)
}
static void
-test_map_unmap(uint32_t region, int size)
+test_map_unmap(uint32_t region, uint64_t size)
{
int dma_buf_fd;
char *ptr;
uint32_t handle;
- handle = gem_create_in_memory_regions(fd, size, region);
+ igt_assert(__gem_create_in_memory_regions(fd, &handle, &size, region) == 0);
fill_bo(handle, size);
dma_buf_fd = prime_handle_to_fd(fd, handle);
@@ -139,13 +139,13 @@ test_map_unmap(uint32_t region, int size)
/* prime and then unprime and then prime again the same handle */
static void
-test_reprime(uint32_t region, int size)
+test_reprime(uint32_t region, uint64_t size)
{
int dma_buf_fd;
char *ptr;
uint32_t handle;
- handle = gem_create_in_memory_regions(fd, size, region);
+ igt_assert(__gem_create_in_memory_regions(fd, &handle, &size, region) == 0);
fill_bo(handle, size);
dma_buf_fd = prime_handle_to_fd(fd, handle);
@@ -171,13 +171,13 @@ test_reprime(uint32_t region, int size)
/* map from another process */
static void
-test_forked(uint32_t region, int size)
+test_forked(uint32_t region, uint64_t size)
{
int dma_buf_fd;
char *ptr;
uint32_t handle;
- handle = gem_create_in_memory_regions(fd, size, region);
+ igt_assert(__gem_create_in_memory_regions(fd, &handle, &size, region) == 0);
fill_bo(handle, size);
dma_buf_fd = prime_handle_to_fd(fd, handle);
@@ -197,13 +197,13 @@ test_forked(uint32_t region, int size)
/* test simple CPU write */
static void
-test_correct_cpu_write(uint32_t region, int size)
+test_correct_cpu_write(uint32_t region, uint64_t size)
{
int dma_buf_fd;
char *ptr;
uint32_t handle;
- handle = gem_create_in_memory_regions(fd, size, region);
+ igt_assert(__gem_create_in_memory_regions(fd, &handle, &size, region) == 0);
dma_buf_fd = prime_handle_to_fd_for_mmap(fd, handle);
@@ -227,13 +227,13 @@ test_correct_cpu_write(uint32_t region, int size)
/* map from another process and then write using CPU */
static void
-test_forked_cpu_write(uint32_t region, int size)
+test_forked_cpu_write(uint32_t region, uint64_t size)
{
int dma_buf_fd;
char *ptr;
uint32_t handle;
- handle = gem_create_in_memory_regions(fd, size, region);
+ igt_assert(__gem_create_in_memory_regions(fd, &handle, &size, region) == 0);
dma_buf_fd = prime_handle_to_fd_for_mmap(fd, handle);
@@ -255,13 +255,13 @@ test_forked_cpu_write(uint32_t region, int size)
}
static void
-test_refcounting(uint32_t region, int size)
+test_refcounting(uint32_t region, uint64_t size)
{
int dma_buf_fd;
char *ptr;
uint32_t handle;
- handle = gem_create_in_memory_regions(fd, size, region);
+ igt_assert(__gem_create_in_memory_regions(fd, &handle, &size, region) == 0);
fill_bo(handle, size);
dma_buf_fd = prime_handle_to_fd(fd, handle);
@@ -278,13 +278,13 @@ test_refcounting(uint32_t region, int size)
/* dup before mmap */
static void
-test_dup(uint32_t region, int size)
+test_dup(uint32_t region, uint64_t size)
{
int dma_buf_fd;
char *ptr;
uint32_t handle;
- handle = gem_create_in_memory_regions(fd, size, region);
+ igt_assert(__gem_create_in_memory_regions(fd, &handle, &size, region) == 0);
fill_bo(handle, size);
dma_buf_fd = dup(prime_handle_to_fd(fd, handle));
@@ -331,7 +331,7 @@ static bool has_userptr(void)
/* test for mmap(dma_buf_export(userptr)) */
static void
-test_userptr(uint32_t region, int size)
+test_userptr(uint32_t region, uint64_t size)
{
int ret, dma_buf_fd;
void *ptr;
@@ -365,7 +365,7 @@ free_userptr:
}
static void
-test_errors(uint32_t region, int size)
+test_errors(uint32_t region, uint64_t size)
{
int i, dma_buf_fd;
char *ptr;
@@ -374,7 +374,7 @@ test_errors(uint32_t region, int size)
DRM_RDWR - 1, DRM_RDWR + 1};
/* Test for invalid flags */
- handle = gem_create_in_memory_regions(fd, size, region);
+ igt_assert(__gem_create_in_memory_regions(fd, &handle, &size, region) == 0);
for (i = 0; i < ARRAY_SIZE(invalid_flags); i++) {
prime_handle_to_fd_no_assert(handle, invalid_flags[i], &dma_buf_fd);
igt_assert_eq(errno, EINVAL);
@@ -383,7 +383,7 @@ test_errors(uint32_t region, int size)
gem_close(fd, handle);
/* Close gem object before priming */
- handle = gem_create_in_memory_regions(fd, size, region);
+ igt_assert(__gem_create_in_memory_regions(fd, &handle, &size, region) == 0);
fill_bo(handle, size);
gem_close(fd, handle);
prime_handle_to_fd_no_assert(handle, DRM_CLOEXEC, &dma_buf_fd);
@@ -391,7 +391,7 @@ test_errors(uint32_t region, int size)
errno = 0;
/* close fd before mapping */
- handle = gem_create_in_memory_regions(fd, size, region);
+ igt_assert(__gem_create_in_memory_regions(fd, &handle, &size, region) == 0);
fill_bo(handle, size);
dma_buf_fd = prime_handle_to_fd(fd, handle);
igt_assert(errno == 0);
@@ -402,7 +402,7 @@ test_errors(uint32_t region, int size)
gem_close(fd, handle);
/* Map too big */
- handle = gem_create_in_memory_regions(fd, size, region);
+ igt_assert(__gem_create_in_memory_regions(fd, &handle, &size, region) == 0);
fill_bo(handle, size);
dma_buf_fd = prime_handle_to_fd(fd, handle);
igt_assert(errno == 0);
@@ -413,7 +413,7 @@ test_errors(uint32_t region, int size)
gem_close(fd, handle);
/* Overlapping the end of the buffer */
- handle = gem_create_in_memory_regions(fd, size, region);
+ igt_assert(__gem_create_in_memory_regions(fd, &handle, &size, region) == 0);
dma_buf_fd = prime_handle_to_fd(fd, handle);
igt_assert(errno == 0);
ptr = mmap(NULL, size, PROT_READ, MAP_SHARED, dma_buf_fd, size / 2);
@@ -425,7 +425,7 @@ test_errors(uint32_t region, int size)
/* Test for invalid flags on sync ioctl */
static void
-test_invalid_sync_flags(uint32_t region, int size)
+test_invalid_sync_flags(uint32_t region, uint64_t size)
{
int i, dma_buf_fd;
uint32_t handle;
@@ -435,7 +435,7 @@ test_invalid_sync_flags(uint32_t region, int size)
LOCAL_DMA_BUF_SYNC_RW + 1,
LOCAL_DMA_BUF_SYNC_VALID_FLAGS_MASK + 1};
- handle = gem_create_in_memory_regions(fd, size, region);
+ igt_assert(__gem_create_in_memory_regions(fd, &handle, &size, region) == 0);
dma_buf_fd = prime_handle_to_fd(fd, handle);
for (i = 0; i < sizeof(invalid_flags) / sizeof(invalid_flags[0]); i++) {
memset(&sync, 0, sizeof(sync));
@@ -448,7 +448,7 @@ test_invalid_sync_flags(uint32_t region, int size)
}
static void
-test_aperture_limit(uint32_t region, int size)
+test_aperture_limit(uint32_t region, uint64_t size)
{
int dma_buf_fd1, dma_buf_fd2;
char *ptr1, *ptr2;
@@ -506,7 +506,7 @@ igt_main
struct drm_i915_query_memory_regions *query_info;
struct {
const char *name;
- void (*fn)(uint32_t, int);
+ void (*fn)(uint32_t, uint64_t);
uint32_t skip;
} tests[] = {
{ "test_correct", test_correct },
@@ -524,7 +524,6 @@ igt_main
};
uint32_t region;
char *ext;
- int size;
int i;
igt_fixture {
@@ -545,13 +544,11 @@ igt_main
igt_subtest_with_dynamic(tests[i].name) {
for_each_combination(regions, 1, dma_buf_set) {
region = igt_collection_get_value(regions, 0);
- size = gem_get_batch_size(fd, MEMORY_TYPE_FROM_REGION(region));
- size = max(size, BO_SIZE);
if (check_skip(tests[i].skip, region))
continue;
ext = memregion_dynamic_subtest_name(regions);
igt_dynamic_f("%s-%s", tests[i].name, ext)
- tests[i].fn(region, size);
+ tests[i].fn(region, BO_SIZE);
free(ext);
}
}
--
2.34.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [igt-dev] [PATCH i-g-t 2/3] tests/gem_exec_basic: Don't use hardcoded batch size
2022-09-27 9:17 [igt-dev] [PATCH i-g-t 0/3] Remove gem_get_batch_size() Zbigniew Kempczyński
2022-09-27 9:17 ` [igt-dev] [PATCH i-g-t 1/3] tests/prime_mmap: Use batch sizes appropriate for regions Zbigniew Kempczyński
@ 2022-09-27 9:17 ` Zbigniew Kempczyński
2022-09-27 16:59 ` Kamil Konieczny
2022-09-27 9:17 ` [igt-dev] [PATCH i-g-t 3/3] lib/intel_memory_region: Remove function which returns batch size in regions Zbigniew Kempczyński
2022-09-27 13:14 ` [igt-dev] ✗ Fi.CI.BAT: failure for Remove gem_get_batch_size() Patchwork
3 siblings, 1 reply; 10+ messages in thread
From: Zbigniew Kempczyński @ 2022-09-27 9:17 UTC (permalink / raw)
To: igt-dev
Instead of using hardcoded batch size use kernel altered object size.
Change allows removing confusing gem_get_batch_size() function.
Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
Cc: Kamil Konieczny <kamil.konieczny@linux.intel.com>
---
tests/i915/gem_exec_basic.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/tests/i915/gem_exec_basic.c b/tests/i915/gem_exec_basic.c
index ab4c159764..ca4fc7b961 100644
--- a/tests/i915/gem_exec_basic.c
+++ b/tests/i915/gem_exec_basic.c
@@ -28,12 +28,12 @@
IGT_TEST_DESCRIPTION("Basic sanity check of execbuf-ioctl rings.");
-static uint32_t batch_create(int fd, uint32_t batch_size, uint32_t region)
+static uint32_t batch_create(int fd, uint64_t *batch_size, uint32_t region)
{
const uint32_t bbe = MI_BATCH_BUFFER_END;
uint32_t handle;
- handle = gem_create_in_memory_regions(fd, batch_size, region);
+ igt_assert(__gem_create_in_memory_regions(fd, &handle, batch_size, region) == 0);
gem_write(fd, handle, 0, &bbe, sizeof(bbe));
return handle;
@@ -44,7 +44,7 @@ igt_main
const struct intel_execution_engine2 *e;
struct drm_i915_query_memory_regions *query_info;
struct igt_collection *regions, *set;
- uint32_t batch_size;
+ uint64_t batch_size;
const intel_ctx_t *ctx;
int fd = -1;
@@ -71,9 +71,9 @@ igt_main
struct drm_i915_gem_exec_object2 exec;
uint32_t region = igt_collection_get_value(regions, 0);
- batch_size = gem_get_batch_size(fd, MEMORY_TYPE_FROM_REGION(region));
+ batch_size = 4096;
memset(&exec, 0, sizeof(exec));
- exec.handle = batch_create(fd, batch_size, region);
+ exec.handle = batch_create(fd, &batch_size, region);
for_each_ctx_engine(fd, ctx, e) {
igt_dynamic_f("%s-%s", e->name, sub_name) {
--
2.34.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [igt-dev] [PATCH i-g-t 3/3] lib/intel_memory_region: Remove function which returns batch size in regions
2022-09-27 9:17 [igt-dev] [PATCH i-g-t 0/3] Remove gem_get_batch_size() Zbigniew Kempczyński
2022-09-27 9:17 ` [igt-dev] [PATCH i-g-t 1/3] tests/prime_mmap: Use batch sizes appropriate for regions Zbigniew Kempczyński
2022-09-27 9:17 ` [igt-dev] [PATCH i-g-t 2/3] tests/gem_exec_basic: Don't use hardcoded batch size Zbigniew Kempczyński
@ 2022-09-27 9:17 ` Zbigniew Kempczyński
2022-09-27 14:44 ` Kamil Konieczny
2022-09-27 13:14 ` [igt-dev] ✗ Fi.CI.BAT: failure for Remove gem_get_batch_size() Patchwork
3 siblings, 1 reply; 10+ messages in thread
From: Zbigniew Kempczyński @ 2022-09-27 9:17 UTC (permalink / raw)
To: igt-dev
Function gem_get_batch_size() is confusing as it might return different
size thus deceiving reader of object real size created in different
memory regions.
Let's remove it and enforce igt user to be aware altered by kernel size
where it is necessary.
Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
Cc: Kamil Konieczny <kamil.konieczny@linux.intel.com>
---
lib/i915/intel_memory_region.c | 14 --------------
lib/i915/intel_memory_region.h | 1 -
2 files changed, 15 deletions(-)
diff --git a/lib/i915/intel_memory_region.c b/lib/i915/intel_memory_region.c
index 568bace949..d80cb3a061 100644
--- a/lib/i915/intel_memory_region.c
+++ b/lib/i915/intel_memory_region.c
@@ -92,20 +92,6 @@ const char *get_memory_region_name(uint32_t region)
igt_assert_f(false, "Unknown memory region");
}
-/**
- * gem_get_batch_size:
- * @fd: open i915 drm file descriptor
- * @mem_region_type: used memory_region type
- *
- * With introduction of LMEM we observe different page sizes for those two
- * memory regions. Without this helper funtion we may be prone to forget
- * about setting proper page size.
- */
-uint32_t gem_get_batch_size(int fd, uint8_t mem_region_type)
-{
- return (mem_region_type == I915_MEMORY_CLASS_DEVICE) ? 65536 : 4096;
-}
-
/**
* gem_get_query_memory_regions:
* @fd: open i915 drm file descriptor
diff --git a/lib/i915/intel_memory_region.h b/lib/i915/intel_memory_region.h
index fd04df83b5..425bda0ec7 100644
--- a/lib/i915/intel_memory_region.h
+++ b/lib/i915/intel_memory_region.h
@@ -56,7 +56,6 @@
bool gem_has_query_support(int fd);
const char *get_memory_region_name(uint32_t region);
-uint32_t gem_get_batch_size(int fd, uint8_t mem_region_type);
struct drm_i915_query_memory_regions *gem_get_query_memory_regions(int fd);
--
2.34.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [igt-dev] ✗ Fi.CI.BAT: failure for Remove gem_get_batch_size()
2022-09-27 9:17 [igt-dev] [PATCH i-g-t 0/3] Remove gem_get_batch_size() Zbigniew Kempczyński
` (2 preceding siblings ...)
2022-09-27 9:17 ` [igt-dev] [PATCH i-g-t 3/3] lib/intel_memory_region: Remove function which returns batch size in regions Zbigniew Kempczyński
@ 2022-09-27 13:14 ` Patchwork
3 siblings, 0 replies; 10+ messages in thread
From: Patchwork @ 2022-09-27 13:14 UTC (permalink / raw)
To: Zbigniew Kempczyński; +Cc: igt-dev
[-- Attachment #1: Type: text/plain, Size: 6227 bytes --]
== Series Details ==
Series: Remove gem_get_batch_size()
URL : https://patchwork.freedesktop.org/series/109109/
State : failure
== Summary ==
CI Bug Log - changes from CI_DRM_12188 -> IGTPW_7848
====================================================
Summary
-------
**FAILURE**
Serious unknown changes coming with IGTPW_7848 absolutely need to be
verified manually.
If you think the reported changes have nothing to do with the changes
introduced in IGTPW_7848, please notify your bug team to allow them
to document this new failure mode, which will reduce false positives in CI.
External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7848/index.html
Participating hosts (46 -> 45)
------------------------------
Additional (1): fi-tgl-dsi
Missing (2): fi-icl-u2 fi-bdw-samus
Possible new issues
-------------------
Here are the unknown changes that may have been introduced in IGTPW_7848:
### IGT changes ###
#### Possible regressions ####
* igt@i915_selftest@live@hangcheck:
- fi-snb-2600: [PASS][1] -> [INCOMPLETE][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12188/fi-snb-2600/igt@i915_selftest@live@hangcheck.html
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7848/fi-snb-2600/igt@i915_selftest@live@hangcheck.html
Known issues
------------
Here are the changes found in IGTPW_7848 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@i915_selftest@live@gt_heartbeat:
- fi-bxt-dsi: [PASS][3] -> [DMESG-FAIL][4] ([i915#5334])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12188/fi-bxt-dsi/igt@i915_selftest@live@gt_heartbeat.html
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7848/fi-bxt-dsi/igt@i915_selftest@live@gt_heartbeat.html
#### Possible fixes ####
* igt@gem_exec_suspend@basic-s3@lmem0:
- {bat-dg2-11}: [DMESG-WARN][5] ([i915#6816]) -> [PASS][6]
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12188/bat-dg2-11/igt@gem_exec_suspend@basic-s3@lmem0.html
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7848/bat-dg2-11/igt@gem_exec_suspend@basic-s3@lmem0.html
* igt@i915_pm_rpm@module-reload:
- fi-cfl-8109u: [DMESG-FAIL][7] ([i915#62]) -> [PASS][8]
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12188/fi-cfl-8109u/igt@i915_pm_rpm@module-reload.html
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7848/fi-cfl-8109u/igt@i915_pm_rpm@module-reload.html
* igt@i915_selftest@live@late_gt_pm:
- fi-cfl-8109u: [DMESG-WARN][9] ([i915#5904]) -> [PASS][10] +30 similar issues
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12188/fi-cfl-8109u/igt@i915_selftest@live@late_gt_pm.html
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7848/fi-cfl-8109u/igt@i915_selftest@live@late_gt_pm.html
* igt@i915_selftest@live@slpc:
- {bat-rpls-1}: [DMESG-FAIL][11] ([i915#6367]) -> [PASS][12]
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12188/bat-rpls-1/igt@i915_selftest@live@slpc.html
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7848/bat-rpls-1/igt@i915_selftest@live@slpc.html
* igt@i915_suspend@basic-s2idle-without-i915:
- fi-cfl-8109u: [DMESG-WARN][13] ([i915#5904] / [i915#62]) -> [PASS][14]
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12188/fi-cfl-8109u/igt@i915_suspend@basic-s2idle-without-i915.html
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7848/fi-cfl-8109u/igt@i915_suspend@basic-s2idle-without-i915.html
* igt@kms_frontbuffer_tracking@basic:
- fi-cfl-8109u: [DMESG-WARN][15] ([i915#62]) -> [PASS][16] +12 similar issues
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12188/fi-cfl-8109u/igt@kms_frontbuffer_tracking@basic.html
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7848/fi-cfl-8109u/igt@kms_frontbuffer_tracking@basic.html
* igt@kms_pipe_crc_basic@suspend-read-crc@pipe-d-dp-2:
- {bat-dg2-11}: [FAIL][17] ([i915#6818]) -> [PASS][18] +1 similar issue
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12188/bat-dg2-11/igt@kms_pipe_crc_basic@suspend-read-crc@pipe-d-dp-2.html
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7848/bat-dg2-11/igt@kms_pipe_crc_basic@suspend-read-crc@pipe-d-dp-2.html
{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).
[fdo#109284]: https://bugs.freedesktop.org/show_bug.cgi?id=109284
[fdo#109285]: https://bugs.freedesktop.org/show_bug.cgi?id=109285
[fdo#109295]: https://bugs.freedesktop.org/show_bug.cgi?id=109295
[fdo#110189]: https://bugs.freedesktop.org/show_bug.cgi?id=110189
[fdo#111827]: https://bugs.freedesktop.org/show_bug.cgi?id=111827
[i915#2190]: https://gitlab.freedesktop.org/drm/intel/issues/2190
[i915#2867]: https://gitlab.freedesktop.org/drm/intel/issues/2867
[i915#3301]: https://gitlab.freedesktop.org/drm/intel/issues/3301
[i915#3555]: https://gitlab.freedesktop.org/drm/intel/issues/3555
[i915#4103]: https://gitlab.freedesktop.org/drm/intel/issues/4103
[i915#4312]: https://gitlab.freedesktop.org/drm/intel/issues/4312
[i915#4613]: https://gitlab.freedesktop.org/drm/intel/issues/4613
[i915#5334]: https://gitlab.freedesktop.org/drm/intel/issues/5334
[i915#5904]: https://gitlab.freedesktop.org/drm/intel/issues/5904
[i915#62]: https://gitlab.freedesktop.org/drm/intel/issues/62
[i915#6367]: https://gitlab.freedesktop.org/drm/intel/issues/6367
[i915#6816]: https://gitlab.freedesktop.org/drm/intel/issues/6816
[i915#6818]: https://gitlab.freedesktop.org/drm/intel/issues/6818
[i915#6856]: https://gitlab.freedesktop.org/drm/intel/issues/6856
Build changes
-------------
* CI: CI-20190529 -> None
* IGT: IGT_6665 -> IGTPW_7848
CI-20190529: 20190529
CI_DRM_12188: d3a12118c4b988939d25628396f33f8d83593ec1 @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_7848: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7848/index.html
IGT_6665: aecdb7ff269899b13b127bfa595d091af9781d94 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7848/index.html
[-- Attachment #2: Type: text/html, Size: 6376 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [igt-dev] [PATCH i-g-t 3/3] lib/intel_memory_region: Remove function which returns batch size in regions
2022-09-27 9:17 ` [igt-dev] [PATCH i-g-t 3/3] lib/intel_memory_region: Remove function which returns batch size in regions Zbigniew Kempczyński
@ 2022-09-27 14:44 ` Kamil Konieczny
0 siblings, 0 replies; 10+ messages in thread
From: Kamil Konieczny @ 2022-09-27 14:44 UTC (permalink / raw)
To: igt-dev
Hi Zbigniew,
On 2022-09-27 at 11:17:27 +0200, Zbigniew Kempczyński wrote:
> Function gem_get_batch_size() is confusing as it might return different
> size thus deceiving reader of object real size created in different
> memory regions.
>
> Let's remove it and enforce igt user to be aware altered by kernel size
> where it is necessary.
Maybe some word reoder here: to be aware that kernel may alter size
where it is necessary.
>
> Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
> Cc: Kamil Konieczny <kamil.konieczny@linux.intel.com>
Reviewed-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>
> ---
> lib/i915/intel_memory_region.c | 14 --------------
> lib/i915/intel_memory_region.h | 1 -
> 2 files changed, 15 deletions(-)
>
> diff --git a/lib/i915/intel_memory_region.c b/lib/i915/intel_memory_region.c
> index 568bace949..d80cb3a061 100644
> --- a/lib/i915/intel_memory_region.c
> +++ b/lib/i915/intel_memory_region.c
> @@ -92,20 +92,6 @@ const char *get_memory_region_name(uint32_t region)
> igt_assert_f(false, "Unknown memory region");
> }
>
> -/**
> - * gem_get_batch_size:
> - * @fd: open i915 drm file descriptor
> - * @mem_region_type: used memory_region type
> - *
> - * With introduction of LMEM we observe different page sizes for those two
> - * memory regions. Without this helper funtion we may be prone to forget
> - * about setting proper page size.
> - */
> -uint32_t gem_get_batch_size(int fd, uint8_t mem_region_type)
> -{
> - return (mem_region_type == I915_MEMORY_CLASS_DEVICE) ? 65536 : 4096;
> -}
> -
> /**
> * gem_get_query_memory_regions:
> * @fd: open i915 drm file descriptor
> diff --git a/lib/i915/intel_memory_region.h b/lib/i915/intel_memory_region.h
> index fd04df83b5..425bda0ec7 100644
> --- a/lib/i915/intel_memory_region.h
> +++ b/lib/i915/intel_memory_region.h
> @@ -56,7 +56,6 @@
> bool gem_has_query_support(int fd);
>
> const char *get_memory_region_name(uint32_t region);
> -uint32_t gem_get_batch_size(int fd, uint8_t mem_region_type);
>
> struct drm_i915_query_memory_regions *gem_get_query_memory_regions(int fd);
>
> --
> 2.34.1
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [igt-dev] [PATCH i-g-t 1/3] tests/prime_mmap: Use batch sizes appropriate for regions
2022-09-27 9:17 ` [igt-dev] [PATCH i-g-t 1/3] tests/prime_mmap: Use batch sizes appropriate for regions Zbigniew Kempczyński
@ 2022-09-27 15:11 ` Kamil Konieczny
2022-09-27 16:12 ` Zbigniew Kempczyński
2022-09-27 16:57 ` Kamil Konieczny
1 sibling, 1 reply; 10+ messages in thread
From: Kamil Konieczny @ 2022-09-27 15:11 UTC (permalink / raw)
To: igt-dev
Hi Zbigniew,
On 2022-09-27 at 11:17:25 +0200, Zbigniew Kempczyński wrote:
> Stop using gem_get_batch_size() as it returns hardcoded values which
> makes confusion regarding minimum object size in different regions.
>
> Use real object size instead which is more suitable.
>
> Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
> Cc: Kamil Konieczny <kamil.konieczny@linux.intel.com>
> ---
> tests/prime_mmap.c | 59 ++++++++++++++++++++++------------------------
> 1 file changed, 28 insertions(+), 31 deletions(-)
>
> diff --git a/tests/prime_mmap.c b/tests/prime_mmap.c
> index d53185ff10..bc19f68c98 100644
> --- a/tests/prime_mmap.c
> +++ b/tests/prime_mmap.c
> @@ -81,13 +81,13 @@ fill_bo_cpu(char *ptr, size_t size)
> }
>
> static void
> -test_correct(uint32_t region, int size)
> +test_correct(uint32_t region, uint64_t size)
> {
> int dma_buf_fd;
> char *ptr1, *ptr2;
> uint32_t handle;
>
> - handle = gem_create_in_memory_regions(fd, size, region);
> + igt_assert(__gem_create_in_memory_regions(fd, &handle, &size, region) == 0);
What about changing this function and moving assert there ?
So it will look like:
handle = gem_create_in_memory_regions(fd, &size, region);
Regards,
Kamil
> fill_bo(handle, size);
>
> dma_buf_fd = prime_handle_to_fd(fd, handle);
> @@ -110,13 +110,13 @@ test_correct(uint32_t region, int size)
> }
>
> static void
> -test_map_unmap(uint32_t region, int size)
> +test_map_unmap(uint32_t region, uint64_t size)
> {
> int dma_buf_fd;
> char *ptr;
> uint32_t handle;
>
> - handle = gem_create_in_memory_regions(fd, size, region);
> + igt_assert(__gem_create_in_memory_regions(fd, &handle, &size, region) == 0);
> fill_bo(handle, size);
>
> dma_buf_fd = prime_handle_to_fd(fd, handle);
> @@ -139,13 +139,13 @@ test_map_unmap(uint32_t region, int size)
>
> /* prime and then unprime and then prime again the same handle */
> static void
> -test_reprime(uint32_t region, int size)
> +test_reprime(uint32_t region, uint64_t size)
> {
> int dma_buf_fd;
> char *ptr;
> uint32_t handle;
>
> - handle = gem_create_in_memory_regions(fd, size, region);
> + igt_assert(__gem_create_in_memory_regions(fd, &handle, &size, region) == 0);
> fill_bo(handle, size);
>
> dma_buf_fd = prime_handle_to_fd(fd, handle);
> @@ -171,13 +171,13 @@ test_reprime(uint32_t region, int size)
>
> /* map from another process */
> static void
> -test_forked(uint32_t region, int size)
> +test_forked(uint32_t region, uint64_t size)
> {
> int dma_buf_fd;
> char *ptr;
> uint32_t handle;
>
> - handle = gem_create_in_memory_regions(fd, size, region);
> + igt_assert(__gem_create_in_memory_regions(fd, &handle, &size, region) == 0);
> fill_bo(handle, size);
>
> dma_buf_fd = prime_handle_to_fd(fd, handle);
> @@ -197,13 +197,13 @@ test_forked(uint32_t region, int size)
>
> /* test simple CPU write */
> static void
> -test_correct_cpu_write(uint32_t region, int size)
> +test_correct_cpu_write(uint32_t region, uint64_t size)
> {
> int dma_buf_fd;
> char *ptr;
> uint32_t handle;
>
> - handle = gem_create_in_memory_regions(fd, size, region);
> + igt_assert(__gem_create_in_memory_regions(fd, &handle, &size, region) == 0);
>
> dma_buf_fd = prime_handle_to_fd_for_mmap(fd, handle);
>
> @@ -227,13 +227,13 @@ test_correct_cpu_write(uint32_t region, int size)
>
> /* map from another process and then write using CPU */
> static void
> -test_forked_cpu_write(uint32_t region, int size)
> +test_forked_cpu_write(uint32_t region, uint64_t size)
> {
> int dma_buf_fd;
> char *ptr;
> uint32_t handle;
>
> - handle = gem_create_in_memory_regions(fd, size, region);
> + igt_assert(__gem_create_in_memory_regions(fd, &handle, &size, region) == 0);
>
> dma_buf_fd = prime_handle_to_fd_for_mmap(fd, handle);
>
> @@ -255,13 +255,13 @@ test_forked_cpu_write(uint32_t region, int size)
> }
>
> static void
> -test_refcounting(uint32_t region, int size)
> +test_refcounting(uint32_t region, uint64_t size)
> {
> int dma_buf_fd;
> char *ptr;
> uint32_t handle;
>
> - handle = gem_create_in_memory_regions(fd, size, region);
> + igt_assert(__gem_create_in_memory_regions(fd, &handle, &size, region) == 0);
> fill_bo(handle, size);
>
> dma_buf_fd = prime_handle_to_fd(fd, handle);
> @@ -278,13 +278,13 @@ test_refcounting(uint32_t region, int size)
>
> /* dup before mmap */
> static void
> -test_dup(uint32_t region, int size)
> +test_dup(uint32_t region, uint64_t size)
> {
> int dma_buf_fd;
> char *ptr;
> uint32_t handle;
>
> - handle = gem_create_in_memory_regions(fd, size, region);
> + igt_assert(__gem_create_in_memory_regions(fd, &handle, &size, region) == 0);
> fill_bo(handle, size);
>
> dma_buf_fd = dup(prime_handle_to_fd(fd, handle));
> @@ -331,7 +331,7 @@ static bool has_userptr(void)
>
> /* test for mmap(dma_buf_export(userptr)) */
> static void
> -test_userptr(uint32_t region, int size)
> +test_userptr(uint32_t region, uint64_t size)
> {
> int ret, dma_buf_fd;
> void *ptr;
> @@ -365,7 +365,7 @@ free_userptr:
> }
>
> static void
> -test_errors(uint32_t region, int size)
> +test_errors(uint32_t region, uint64_t size)
> {
> int i, dma_buf_fd;
> char *ptr;
> @@ -374,7 +374,7 @@ test_errors(uint32_t region, int size)
> DRM_RDWR - 1, DRM_RDWR + 1};
>
> /* Test for invalid flags */
> - handle = gem_create_in_memory_regions(fd, size, region);
> + igt_assert(__gem_create_in_memory_regions(fd, &handle, &size, region) == 0);
> for (i = 0; i < ARRAY_SIZE(invalid_flags); i++) {
> prime_handle_to_fd_no_assert(handle, invalid_flags[i], &dma_buf_fd);
> igt_assert_eq(errno, EINVAL);
> @@ -383,7 +383,7 @@ test_errors(uint32_t region, int size)
> gem_close(fd, handle);
>
> /* Close gem object before priming */
> - handle = gem_create_in_memory_regions(fd, size, region);
> + igt_assert(__gem_create_in_memory_regions(fd, &handle, &size, region) == 0);
> fill_bo(handle, size);
> gem_close(fd, handle);
> prime_handle_to_fd_no_assert(handle, DRM_CLOEXEC, &dma_buf_fd);
> @@ -391,7 +391,7 @@ test_errors(uint32_t region, int size)
> errno = 0;
>
> /* close fd before mapping */
> - handle = gem_create_in_memory_regions(fd, size, region);
> + igt_assert(__gem_create_in_memory_regions(fd, &handle, &size, region) == 0);
> fill_bo(handle, size);
> dma_buf_fd = prime_handle_to_fd(fd, handle);
> igt_assert(errno == 0);
> @@ -402,7 +402,7 @@ test_errors(uint32_t region, int size)
> gem_close(fd, handle);
>
> /* Map too big */
> - handle = gem_create_in_memory_regions(fd, size, region);
> + igt_assert(__gem_create_in_memory_regions(fd, &handle, &size, region) == 0);
> fill_bo(handle, size);
> dma_buf_fd = prime_handle_to_fd(fd, handle);
> igt_assert(errno == 0);
> @@ -413,7 +413,7 @@ test_errors(uint32_t region, int size)
> gem_close(fd, handle);
>
> /* Overlapping the end of the buffer */
> - handle = gem_create_in_memory_regions(fd, size, region);
> + igt_assert(__gem_create_in_memory_regions(fd, &handle, &size, region) == 0);
> dma_buf_fd = prime_handle_to_fd(fd, handle);
> igt_assert(errno == 0);
> ptr = mmap(NULL, size, PROT_READ, MAP_SHARED, dma_buf_fd, size / 2);
> @@ -425,7 +425,7 @@ test_errors(uint32_t region, int size)
>
> /* Test for invalid flags on sync ioctl */
> static void
> -test_invalid_sync_flags(uint32_t region, int size)
> +test_invalid_sync_flags(uint32_t region, uint64_t size)
> {
> int i, dma_buf_fd;
> uint32_t handle;
> @@ -435,7 +435,7 @@ test_invalid_sync_flags(uint32_t region, int size)
> LOCAL_DMA_BUF_SYNC_RW + 1,
> LOCAL_DMA_BUF_SYNC_VALID_FLAGS_MASK + 1};
>
> - handle = gem_create_in_memory_regions(fd, size, region);
> + igt_assert(__gem_create_in_memory_regions(fd, &handle, &size, region) == 0);
> dma_buf_fd = prime_handle_to_fd(fd, handle);
> for (i = 0; i < sizeof(invalid_flags) / sizeof(invalid_flags[0]); i++) {
> memset(&sync, 0, sizeof(sync));
> @@ -448,7 +448,7 @@ test_invalid_sync_flags(uint32_t region, int size)
> }
>
> static void
> -test_aperture_limit(uint32_t region, int size)
> +test_aperture_limit(uint32_t region, uint64_t size)
> {
> int dma_buf_fd1, dma_buf_fd2;
> char *ptr1, *ptr2;
> @@ -506,7 +506,7 @@ igt_main
> struct drm_i915_query_memory_regions *query_info;
> struct {
> const char *name;
> - void (*fn)(uint32_t, int);
> + void (*fn)(uint32_t, uint64_t);
> uint32_t skip;
> } tests[] = {
> { "test_correct", test_correct },
> @@ -524,7 +524,6 @@ igt_main
> };
> uint32_t region;
> char *ext;
> - int size;
> int i;
>
> igt_fixture {
> @@ -545,13 +544,11 @@ igt_main
> igt_subtest_with_dynamic(tests[i].name) {
> for_each_combination(regions, 1, dma_buf_set) {
> region = igt_collection_get_value(regions, 0);
> - size = gem_get_batch_size(fd, MEMORY_TYPE_FROM_REGION(region));
> - size = max(size, BO_SIZE);
> if (check_skip(tests[i].skip, region))
> continue;
> ext = memregion_dynamic_subtest_name(regions);
> igt_dynamic_f("%s-%s", tests[i].name, ext)
> - tests[i].fn(region, size);
> + tests[i].fn(region, BO_SIZE);
> free(ext);
> }
> }
> --
> 2.34.1
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [igt-dev] [PATCH i-g-t 1/3] tests/prime_mmap: Use batch sizes appropriate for regions
2022-09-27 15:11 ` Kamil Konieczny
@ 2022-09-27 16:12 ` Zbigniew Kempczyński
0 siblings, 0 replies; 10+ messages in thread
From: Zbigniew Kempczyński @ 2022-09-27 16:12 UTC (permalink / raw)
To: Kamil Konieczny, igt-dev
On Tue, Sep 27, 2022 at 05:11:08PM +0200, Kamil Konieczny wrote:
> Hi Zbigniew,
>
> On 2022-09-27 at 11:17:25 +0200, Zbigniew Kempczyński wrote:
> > Stop using gem_get_batch_size() as it returns hardcoded values which
> > makes confusion regarding minimum object size in different regions.
> >
> > Use real object size instead which is more suitable.
> >
> > Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
> > Cc: Kamil Konieczny <kamil.konieczny@linux.intel.com>
> > ---
> > tests/prime_mmap.c | 59 ++++++++++++++++++++++------------------------
> > 1 file changed, 28 insertions(+), 31 deletions(-)
> >
> > diff --git a/tests/prime_mmap.c b/tests/prime_mmap.c
> > index d53185ff10..bc19f68c98 100644
> > --- a/tests/prime_mmap.c
> > +++ b/tests/prime_mmap.c
> > @@ -81,13 +81,13 @@ fill_bo_cpu(char *ptr, size_t size)
> > }
> >
> > static void
> > -test_correct(uint32_t region, int size)
> > +test_correct(uint32_t region, uint64_t size)
> > {
> > int dma_buf_fd;
> > char *ptr1, *ptr2;
> > uint32_t handle;
> >
> > - handle = gem_create_in_memory_regions(fd, size, region);
> > + igt_assert(__gem_create_in_memory_regions(fd, &handle, &size, region) == 0);
>
> What about changing this function and moving assert there ?
> So it will look like:
> handle = gem_create_in_memory_regions(fd, &size, region);
>
I wondered about this but my primary goal here was to remove gem_get_batch_size()
instead of refactoring (__|)gem_create_in_memory_regions().
I'm aware we use side effect of detected alignment along with allocator + gem
create in local memory. I mean gem_create_in_memory_regions() returns only
handle and silently drops any change in object size. Until discrete we got
page granularity and we used relocations so size change was not so important
as the kernel is aware of object size. Problem occured when we started using
allocator for which size is important - we don't want to overlap object if
the kernel will adjust (increase) object size. Taking max alignment for all
regions allowed us to move forward without changing size -> &size in
gem_create_in_memory_regions(). Of course I got nothing against to refactor
this and make all of this code safe regardless size so if you have time
you're welcome to do this.
--
Zbigniew
> Regards,
> Kamil
>
> > fill_bo(handle, size);
> >
> > dma_buf_fd = prime_handle_to_fd(fd, handle);
> > @@ -110,13 +110,13 @@ test_correct(uint32_t region, int size)
> > }
> >
> > static void
> > -test_map_unmap(uint32_t region, int size)
> > +test_map_unmap(uint32_t region, uint64_t size)
> > {
> > int dma_buf_fd;
> > char *ptr;
> > uint32_t handle;
> >
> > - handle = gem_create_in_memory_regions(fd, size, region);
> > + igt_assert(__gem_create_in_memory_regions(fd, &handle, &size, region) == 0);
> > fill_bo(handle, size);
> >
> > dma_buf_fd = prime_handle_to_fd(fd, handle);
> > @@ -139,13 +139,13 @@ test_map_unmap(uint32_t region, int size)
> >
> > /* prime and then unprime and then prime again the same handle */
> > static void
> > -test_reprime(uint32_t region, int size)
> > +test_reprime(uint32_t region, uint64_t size)
> > {
> > int dma_buf_fd;
> > char *ptr;
> > uint32_t handle;
> >
> > - handle = gem_create_in_memory_regions(fd, size, region);
> > + igt_assert(__gem_create_in_memory_regions(fd, &handle, &size, region) == 0);
> > fill_bo(handle, size);
> >
> > dma_buf_fd = prime_handle_to_fd(fd, handle);
> > @@ -171,13 +171,13 @@ test_reprime(uint32_t region, int size)
> >
> > /* map from another process */
> > static void
> > -test_forked(uint32_t region, int size)
> > +test_forked(uint32_t region, uint64_t size)
> > {
> > int dma_buf_fd;
> > char *ptr;
> > uint32_t handle;
> >
> > - handle = gem_create_in_memory_regions(fd, size, region);
> > + igt_assert(__gem_create_in_memory_regions(fd, &handle, &size, region) == 0);
> > fill_bo(handle, size);
> >
> > dma_buf_fd = prime_handle_to_fd(fd, handle);
> > @@ -197,13 +197,13 @@ test_forked(uint32_t region, int size)
> >
> > /* test simple CPU write */
> > static void
> > -test_correct_cpu_write(uint32_t region, int size)
> > +test_correct_cpu_write(uint32_t region, uint64_t size)
> > {
> > int dma_buf_fd;
> > char *ptr;
> > uint32_t handle;
> >
> > - handle = gem_create_in_memory_regions(fd, size, region);
> > + igt_assert(__gem_create_in_memory_regions(fd, &handle, &size, region) == 0);
> >
> > dma_buf_fd = prime_handle_to_fd_for_mmap(fd, handle);
> >
> > @@ -227,13 +227,13 @@ test_correct_cpu_write(uint32_t region, int size)
> >
> > /* map from another process and then write using CPU */
> > static void
> > -test_forked_cpu_write(uint32_t region, int size)
> > +test_forked_cpu_write(uint32_t region, uint64_t size)
> > {
> > int dma_buf_fd;
> > char *ptr;
> > uint32_t handle;
> >
> > - handle = gem_create_in_memory_regions(fd, size, region);
> > + igt_assert(__gem_create_in_memory_regions(fd, &handle, &size, region) == 0);
> >
> > dma_buf_fd = prime_handle_to_fd_for_mmap(fd, handle);
> >
> > @@ -255,13 +255,13 @@ test_forked_cpu_write(uint32_t region, int size)
> > }
> >
> > static void
> > -test_refcounting(uint32_t region, int size)
> > +test_refcounting(uint32_t region, uint64_t size)
> > {
> > int dma_buf_fd;
> > char *ptr;
> > uint32_t handle;
> >
> > - handle = gem_create_in_memory_regions(fd, size, region);
> > + igt_assert(__gem_create_in_memory_regions(fd, &handle, &size, region) == 0);
> > fill_bo(handle, size);
> >
> > dma_buf_fd = prime_handle_to_fd(fd, handle);
> > @@ -278,13 +278,13 @@ test_refcounting(uint32_t region, int size)
> >
> > /* dup before mmap */
> > static void
> > -test_dup(uint32_t region, int size)
> > +test_dup(uint32_t region, uint64_t size)
> > {
> > int dma_buf_fd;
> > char *ptr;
> > uint32_t handle;
> >
> > - handle = gem_create_in_memory_regions(fd, size, region);
> > + igt_assert(__gem_create_in_memory_regions(fd, &handle, &size, region) == 0);
> > fill_bo(handle, size);
> >
> > dma_buf_fd = dup(prime_handle_to_fd(fd, handle));
> > @@ -331,7 +331,7 @@ static bool has_userptr(void)
> >
> > /* test for mmap(dma_buf_export(userptr)) */
> > static void
> > -test_userptr(uint32_t region, int size)
> > +test_userptr(uint32_t region, uint64_t size)
> > {
> > int ret, dma_buf_fd;
> > void *ptr;
> > @@ -365,7 +365,7 @@ free_userptr:
> > }
> >
> > static void
> > -test_errors(uint32_t region, int size)
> > +test_errors(uint32_t region, uint64_t size)
> > {
> > int i, dma_buf_fd;
> > char *ptr;
> > @@ -374,7 +374,7 @@ test_errors(uint32_t region, int size)
> > DRM_RDWR - 1, DRM_RDWR + 1};
> >
> > /* Test for invalid flags */
> > - handle = gem_create_in_memory_regions(fd, size, region);
> > + igt_assert(__gem_create_in_memory_regions(fd, &handle, &size, region) == 0);
> > for (i = 0; i < ARRAY_SIZE(invalid_flags); i++) {
> > prime_handle_to_fd_no_assert(handle, invalid_flags[i], &dma_buf_fd);
> > igt_assert_eq(errno, EINVAL);
> > @@ -383,7 +383,7 @@ test_errors(uint32_t region, int size)
> > gem_close(fd, handle);
> >
> > /* Close gem object before priming */
> > - handle = gem_create_in_memory_regions(fd, size, region);
> > + igt_assert(__gem_create_in_memory_regions(fd, &handle, &size, region) == 0);
> > fill_bo(handle, size);
> > gem_close(fd, handle);
> > prime_handle_to_fd_no_assert(handle, DRM_CLOEXEC, &dma_buf_fd);
> > @@ -391,7 +391,7 @@ test_errors(uint32_t region, int size)
> > errno = 0;
> >
> > /* close fd before mapping */
> > - handle = gem_create_in_memory_regions(fd, size, region);
> > + igt_assert(__gem_create_in_memory_regions(fd, &handle, &size, region) == 0);
> > fill_bo(handle, size);
> > dma_buf_fd = prime_handle_to_fd(fd, handle);
> > igt_assert(errno == 0);
> > @@ -402,7 +402,7 @@ test_errors(uint32_t region, int size)
> > gem_close(fd, handle);
> >
> > /* Map too big */
> > - handle = gem_create_in_memory_regions(fd, size, region);
> > + igt_assert(__gem_create_in_memory_regions(fd, &handle, &size, region) == 0);
> > fill_bo(handle, size);
> > dma_buf_fd = prime_handle_to_fd(fd, handle);
> > igt_assert(errno == 0);
> > @@ -413,7 +413,7 @@ test_errors(uint32_t region, int size)
> > gem_close(fd, handle);
> >
> > /* Overlapping the end of the buffer */
> > - handle = gem_create_in_memory_regions(fd, size, region);
> > + igt_assert(__gem_create_in_memory_regions(fd, &handle, &size, region) == 0);
> > dma_buf_fd = prime_handle_to_fd(fd, handle);
> > igt_assert(errno == 0);
> > ptr = mmap(NULL, size, PROT_READ, MAP_SHARED, dma_buf_fd, size / 2);
> > @@ -425,7 +425,7 @@ test_errors(uint32_t region, int size)
> >
> > /* Test for invalid flags on sync ioctl */
> > static void
> > -test_invalid_sync_flags(uint32_t region, int size)
> > +test_invalid_sync_flags(uint32_t region, uint64_t size)
> > {
> > int i, dma_buf_fd;
> > uint32_t handle;
> > @@ -435,7 +435,7 @@ test_invalid_sync_flags(uint32_t region, int size)
> > LOCAL_DMA_BUF_SYNC_RW + 1,
> > LOCAL_DMA_BUF_SYNC_VALID_FLAGS_MASK + 1};
> >
> > - handle = gem_create_in_memory_regions(fd, size, region);
> > + igt_assert(__gem_create_in_memory_regions(fd, &handle, &size, region) == 0);
> > dma_buf_fd = prime_handle_to_fd(fd, handle);
> > for (i = 0; i < sizeof(invalid_flags) / sizeof(invalid_flags[0]); i++) {
> > memset(&sync, 0, sizeof(sync));
> > @@ -448,7 +448,7 @@ test_invalid_sync_flags(uint32_t region, int size)
> > }
> >
> > static void
> > -test_aperture_limit(uint32_t region, int size)
> > +test_aperture_limit(uint32_t region, uint64_t size)
> > {
> > int dma_buf_fd1, dma_buf_fd2;
> > char *ptr1, *ptr2;
> > @@ -506,7 +506,7 @@ igt_main
> > struct drm_i915_query_memory_regions *query_info;
> > struct {
> > const char *name;
> > - void (*fn)(uint32_t, int);
> > + void (*fn)(uint32_t, uint64_t);
> > uint32_t skip;
> > } tests[] = {
> > { "test_correct", test_correct },
> > @@ -524,7 +524,6 @@ igt_main
> > };
> > uint32_t region;
> > char *ext;
> > - int size;
> > int i;
> >
> > igt_fixture {
> > @@ -545,13 +544,11 @@ igt_main
> > igt_subtest_with_dynamic(tests[i].name) {
> > for_each_combination(regions, 1, dma_buf_set) {
> > region = igt_collection_get_value(regions, 0);
> > - size = gem_get_batch_size(fd, MEMORY_TYPE_FROM_REGION(region));
> > - size = max(size, BO_SIZE);
> > if (check_skip(tests[i].skip, region))
> > continue;
> > ext = memregion_dynamic_subtest_name(regions);
> > igt_dynamic_f("%s-%s", tests[i].name, ext)
> > - tests[i].fn(region, size);
> > + tests[i].fn(region, BO_SIZE);
> > free(ext);
> > }
> > }
> > --
> > 2.34.1
> >
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [igt-dev] [PATCH i-g-t 1/3] tests/prime_mmap: Use batch sizes appropriate for regions
2022-09-27 9:17 ` [igt-dev] [PATCH i-g-t 1/3] tests/prime_mmap: Use batch sizes appropriate for regions Zbigniew Kempczyński
2022-09-27 15:11 ` Kamil Konieczny
@ 2022-09-27 16:57 ` Kamil Konieczny
1 sibling, 0 replies; 10+ messages in thread
From: Kamil Konieczny @ 2022-09-27 16:57 UTC (permalink / raw)
To: igt-dev
On 2022-09-27 at 11:17:25 +0200, Zbigniew Kempczyński wrote:
> Stop using gem_get_batch_size() as it returns hardcoded values which
> makes confusion regarding minimum object size in different regions.
>
> Use real object size instead which is more suitable.
>
> Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
> Cc: Kamil Konieczny <kamil.konieczny@linux.intel.com>
Reviewed-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>
> ---
> tests/prime_mmap.c | 59 ++++++++++++++++++++++------------------------
> 1 file changed, 28 insertions(+), 31 deletions(-)
>
> diff --git a/tests/prime_mmap.c b/tests/prime_mmap.c
> index d53185ff10..bc19f68c98 100644
> --- a/tests/prime_mmap.c
> +++ b/tests/prime_mmap.c
> @@ -81,13 +81,13 @@ fill_bo_cpu(char *ptr, size_t size)
> }
>
> static void
> -test_correct(uint32_t region, int size)
> +test_correct(uint32_t region, uint64_t size)
> {
> int dma_buf_fd;
> char *ptr1, *ptr2;
> uint32_t handle;
>
> - handle = gem_create_in_memory_regions(fd, size, region);
> + igt_assert(__gem_create_in_memory_regions(fd, &handle, &size, region) == 0);
> fill_bo(handle, size);
>
> dma_buf_fd = prime_handle_to_fd(fd, handle);
> @@ -110,13 +110,13 @@ test_correct(uint32_t region, int size)
> }
>
> static void
> -test_map_unmap(uint32_t region, int size)
> +test_map_unmap(uint32_t region, uint64_t size)
> {
> int dma_buf_fd;
> char *ptr;
> uint32_t handle;
>
> - handle = gem_create_in_memory_regions(fd, size, region);
> + igt_assert(__gem_create_in_memory_regions(fd, &handle, &size, region) == 0);
> fill_bo(handle, size);
>
> dma_buf_fd = prime_handle_to_fd(fd, handle);
> @@ -139,13 +139,13 @@ test_map_unmap(uint32_t region, int size)
>
> /* prime and then unprime and then prime again the same handle */
> static void
> -test_reprime(uint32_t region, int size)
> +test_reprime(uint32_t region, uint64_t size)
> {
> int dma_buf_fd;
> char *ptr;
> uint32_t handle;
>
> - handle = gem_create_in_memory_regions(fd, size, region);
> + igt_assert(__gem_create_in_memory_regions(fd, &handle, &size, region) == 0);
> fill_bo(handle, size);
>
> dma_buf_fd = prime_handle_to_fd(fd, handle);
> @@ -171,13 +171,13 @@ test_reprime(uint32_t region, int size)
>
> /* map from another process */
> static void
> -test_forked(uint32_t region, int size)
> +test_forked(uint32_t region, uint64_t size)
> {
> int dma_buf_fd;
> char *ptr;
> uint32_t handle;
>
> - handle = gem_create_in_memory_regions(fd, size, region);
> + igt_assert(__gem_create_in_memory_regions(fd, &handle, &size, region) == 0);
> fill_bo(handle, size);
>
> dma_buf_fd = prime_handle_to_fd(fd, handle);
> @@ -197,13 +197,13 @@ test_forked(uint32_t region, int size)
>
> /* test simple CPU write */
> static void
> -test_correct_cpu_write(uint32_t region, int size)
> +test_correct_cpu_write(uint32_t region, uint64_t size)
> {
> int dma_buf_fd;
> char *ptr;
> uint32_t handle;
>
> - handle = gem_create_in_memory_regions(fd, size, region);
> + igt_assert(__gem_create_in_memory_regions(fd, &handle, &size, region) == 0);
>
> dma_buf_fd = prime_handle_to_fd_for_mmap(fd, handle);
>
> @@ -227,13 +227,13 @@ test_correct_cpu_write(uint32_t region, int size)
>
> /* map from another process and then write using CPU */
> static void
> -test_forked_cpu_write(uint32_t region, int size)
> +test_forked_cpu_write(uint32_t region, uint64_t size)
> {
> int dma_buf_fd;
> char *ptr;
> uint32_t handle;
>
> - handle = gem_create_in_memory_regions(fd, size, region);
> + igt_assert(__gem_create_in_memory_regions(fd, &handle, &size, region) == 0);
>
> dma_buf_fd = prime_handle_to_fd_for_mmap(fd, handle);
>
> @@ -255,13 +255,13 @@ test_forked_cpu_write(uint32_t region, int size)
> }
>
> static void
> -test_refcounting(uint32_t region, int size)
> +test_refcounting(uint32_t region, uint64_t size)
> {
> int dma_buf_fd;
> char *ptr;
> uint32_t handle;
>
> - handle = gem_create_in_memory_regions(fd, size, region);
> + igt_assert(__gem_create_in_memory_regions(fd, &handle, &size, region) == 0);
> fill_bo(handle, size);
>
> dma_buf_fd = prime_handle_to_fd(fd, handle);
> @@ -278,13 +278,13 @@ test_refcounting(uint32_t region, int size)
>
> /* dup before mmap */
> static void
> -test_dup(uint32_t region, int size)
> +test_dup(uint32_t region, uint64_t size)
> {
> int dma_buf_fd;
> char *ptr;
> uint32_t handle;
>
> - handle = gem_create_in_memory_regions(fd, size, region);
> + igt_assert(__gem_create_in_memory_regions(fd, &handle, &size, region) == 0);
> fill_bo(handle, size);
>
> dma_buf_fd = dup(prime_handle_to_fd(fd, handle));
> @@ -331,7 +331,7 @@ static bool has_userptr(void)
>
> /* test for mmap(dma_buf_export(userptr)) */
> static void
> -test_userptr(uint32_t region, int size)
> +test_userptr(uint32_t region, uint64_t size)
> {
> int ret, dma_buf_fd;
> void *ptr;
> @@ -365,7 +365,7 @@ free_userptr:
> }
>
> static void
> -test_errors(uint32_t region, int size)
> +test_errors(uint32_t region, uint64_t size)
> {
> int i, dma_buf_fd;
> char *ptr;
> @@ -374,7 +374,7 @@ test_errors(uint32_t region, int size)
> DRM_RDWR - 1, DRM_RDWR + 1};
>
> /* Test for invalid flags */
> - handle = gem_create_in_memory_regions(fd, size, region);
> + igt_assert(__gem_create_in_memory_regions(fd, &handle, &size, region) == 0);
> for (i = 0; i < ARRAY_SIZE(invalid_flags); i++) {
> prime_handle_to_fd_no_assert(handle, invalid_flags[i], &dma_buf_fd);
> igt_assert_eq(errno, EINVAL);
> @@ -383,7 +383,7 @@ test_errors(uint32_t region, int size)
> gem_close(fd, handle);
>
> /* Close gem object before priming */
> - handle = gem_create_in_memory_regions(fd, size, region);
> + igt_assert(__gem_create_in_memory_regions(fd, &handle, &size, region) == 0);
> fill_bo(handle, size);
> gem_close(fd, handle);
> prime_handle_to_fd_no_assert(handle, DRM_CLOEXEC, &dma_buf_fd);
> @@ -391,7 +391,7 @@ test_errors(uint32_t region, int size)
> errno = 0;
>
> /* close fd before mapping */
> - handle = gem_create_in_memory_regions(fd, size, region);
> + igt_assert(__gem_create_in_memory_regions(fd, &handle, &size, region) == 0);
> fill_bo(handle, size);
> dma_buf_fd = prime_handle_to_fd(fd, handle);
> igt_assert(errno == 0);
> @@ -402,7 +402,7 @@ test_errors(uint32_t region, int size)
> gem_close(fd, handle);
>
> /* Map too big */
> - handle = gem_create_in_memory_regions(fd, size, region);
> + igt_assert(__gem_create_in_memory_regions(fd, &handle, &size, region) == 0);
> fill_bo(handle, size);
> dma_buf_fd = prime_handle_to_fd(fd, handle);
> igt_assert(errno == 0);
> @@ -413,7 +413,7 @@ test_errors(uint32_t region, int size)
> gem_close(fd, handle);
>
> /* Overlapping the end of the buffer */
> - handle = gem_create_in_memory_regions(fd, size, region);
> + igt_assert(__gem_create_in_memory_regions(fd, &handle, &size, region) == 0);
> dma_buf_fd = prime_handle_to_fd(fd, handle);
> igt_assert(errno == 0);
> ptr = mmap(NULL, size, PROT_READ, MAP_SHARED, dma_buf_fd, size / 2);
> @@ -425,7 +425,7 @@ test_errors(uint32_t region, int size)
>
> /* Test for invalid flags on sync ioctl */
> static void
> -test_invalid_sync_flags(uint32_t region, int size)
> +test_invalid_sync_flags(uint32_t region, uint64_t size)
> {
> int i, dma_buf_fd;
> uint32_t handle;
> @@ -435,7 +435,7 @@ test_invalid_sync_flags(uint32_t region, int size)
> LOCAL_DMA_BUF_SYNC_RW + 1,
> LOCAL_DMA_BUF_SYNC_VALID_FLAGS_MASK + 1};
>
> - handle = gem_create_in_memory_regions(fd, size, region);
> + igt_assert(__gem_create_in_memory_regions(fd, &handle, &size, region) == 0);
> dma_buf_fd = prime_handle_to_fd(fd, handle);
> for (i = 0; i < sizeof(invalid_flags) / sizeof(invalid_flags[0]); i++) {
> memset(&sync, 0, sizeof(sync));
> @@ -448,7 +448,7 @@ test_invalid_sync_flags(uint32_t region, int size)
> }
>
> static void
> -test_aperture_limit(uint32_t region, int size)
> +test_aperture_limit(uint32_t region, uint64_t size)
> {
> int dma_buf_fd1, dma_buf_fd2;
> char *ptr1, *ptr2;
> @@ -506,7 +506,7 @@ igt_main
> struct drm_i915_query_memory_regions *query_info;
> struct {
> const char *name;
> - void (*fn)(uint32_t, int);
> + void (*fn)(uint32_t, uint64_t);
> uint32_t skip;
> } tests[] = {
> { "test_correct", test_correct },
> @@ -524,7 +524,6 @@ igt_main
> };
> uint32_t region;
> char *ext;
> - int size;
> int i;
>
> igt_fixture {
> @@ -545,13 +544,11 @@ igt_main
> igt_subtest_with_dynamic(tests[i].name) {
> for_each_combination(regions, 1, dma_buf_set) {
> region = igt_collection_get_value(regions, 0);
> - size = gem_get_batch_size(fd, MEMORY_TYPE_FROM_REGION(region));
> - size = max(size, BO_SIZE);
> if (check_skip(tests[i].skip, region))
> continue;
> ext = memregion_dynamic_subtest_name(regions);
> igt_dynamic_f("%s-%s", tests[i].name, ext)
> - tests[i].fn(region, size);
> + tests[i].fn(region, BO_SIZE);
> free(ext);
> }
> }
> --
> 2.34.1
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [igt-dev] [PATCH i-g-t 2/3] tests/gem_exec_basic: Don't use hardcoded batch size
2022-09-27 9:17 ` [igt-dev] [PATCH i-g-t 2/3] tests/gem_exec_basic: Don't use hardcoded batch size Zbigniew Kempczyński
@ 2022-09-27 16:59 ` Kamil Konieczny
0 siblings, 0 replies; 10+ messages in thread
From: Kamil Konieczny @ 2022-09-27 16:59 UTC (permalink / raw)
To: igt-dev
On 2022-09-27 at 11:17:26 +0200, Zbigniew Kempczyński wrote:
> Instead of using hardcoded batch size use kernel altered object size.
> Change allows removing confusing gem_get_batch_size() function.
>
> Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
> Cc: Kamil Konieczny <kamil.konieczny@linux.intel.com>
Reviewed-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>
> ---
> tests/i915/gem_exec_basic.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/tests/i915/gem_exec_basic.c b/tests/i915/gem_exec_basic.c
> index ab4c159764..ca4fc7b961 100644
> --- a/tests/i915/gem_exec_basic.c
> +++ b/tests/i915/gem_exec_basic.c
> @@ -28,12 +28,12 @@
>
> IGT_TEST_DESCRIPTION("Basic sanity check of execbuf-ioctl rings.");
>
> -static uint32_t batch_create(int fd, uint32_t batch_size, uint32_t region)
> +static uint32_t batch_create(int fd, uint64_t *batch_size, uint32_t region)
> {
> const uint32_t bbe = MI_BATCH_BUFFER_END;
> uint32_t handle;
>
> - handle = gem_create_in_memory_regions(fd, batch_size, region);
> + igt_assert(__gem_create_in_memory_regions(fd, &handle, batch_size, region) == 0);
> gem_write(fd, handle, 0, &bbe, sizeof(bbe));
>
> return handle;
> @@ -44,7 +44,7 @@ igt_main
> const struct intel_execution_engine2 *e;
> struct drm_i915_query_memory_regions *query_info;
> struct igt_collection *regions, *set;
> - uint32_t batch_size;
> + uint64_t batch_size;
> const intel_ctx_t *ctx;
> int fd = -1;
>
> @@ -71,9 +71,9 @@ igt_main
> struct drm_i915_gem_exec_object2 exec;
> uint32_t region = igt_collection_get_value(regions, 0);
>
> - batch_size = gem_get_batch_size(fd, MEMORY_TYPE_FROM_REGION(region));
> + batch_size = 4096;
> memset(&exec, 0, sizeof(exec));
> - exec.handle = batch_create(fd, batch_size, region);
> + exec.handle = batch_create(fd, &batch_size, region);
>
> for_each_ctx_engine(fd, ctx, e) {
> igt_dynamic_f("%s-%s", e->name, sub_name) {
> --
> 2.34.1
>
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2022-09-27 16:59 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-27 9:17 [igt-dev] [PATCH i-g-t 0/3] Remove gem_get_batch_size() Zbigniew Kempczyński
2022-09-27 9:17 ` [igt-dev] [PATCH i-g-t 1/3] tests/prime_mmap: Use batch sizes appropriate for regions Zbigniew Kempczyński
2022-09-27 15:11 ` Kamil Konieczny
2022-09-27 16:12 ` Zbigniew Kempczyński
2022-09-27 16:57 ` Kamil Konieczny
2022-09-27 9:17 ` [igt-dev] [PATCH i-g-t 2/3] tests/gem_exec_basic: Don't use hardcoded batch size Zbigniew Kempczyński
2022-09-27 16:59 ` Kamil Konieczny
2022-09-27 9:17 ` [igt-dev] [PATCH i-g-t 3/3] lib/intel_memory_region: Remove function which returns batch size in regions Zbigniew Kempczyński
2022-09-27 14:44 ` Kamil Konieczny
2022-09-27 13:14 ` [igt-dev] ✗ Fi.CI.BAT: failure for Remove gem_get_batch_size() Patchwork
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.