Skip to contentSkip to conversation

lib/ioctl_wrappers: Handle PREAD/PWRITE ioctls not supported in gem_read/write

igt-dev Ashutosh Dixit 2 participants 2 messages Aug 29, 2020 Library code

lore
Share & tools
lore
#0 lore raw

Trial patch to replace PREAD/PWRITE ioctls with mmap + memcpy in gem_read/write. For CI only. Please don't review.

---
 lib/ioctl_wrappers.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
lib/ioctl_wrappers.c +11 -2
index 3781286d8..77752e8db 100644
@@ -55,6 +55,7 @@
 #include "igt_debugfs.h"
 #include "igt_sysfs.h"
 #include "config.h"
+#include "i915/gem_mman.h"
 
 #ifdef HAVE_VALGRIND
 #include <valgrind/valgrind.h>
@@ -353,7 +354,11 @@ int __gem_write(int fd, uint32_t handle, uint64_t offset, const void *buf, uint6
  */
 void gem_write(int fd, uint32_t handle, uint64_t offset, const void *buf, uint64_t length)
 {
-	igt_assert_eq(__gem_write(fd, handle, offset, buf, length), 0);
+	/* offset arg of gem_mmap__device_coherent must be 0 */
+	void *ptr = gem_mmap__device_coherent(fd, handle, 0, offset + length, PROT_WRITE);
+
+	memcpy(ptr + offset, buf, length);
+	munmap(ptr, offset + length);
 }
 
 int __gem_read(int fd, uint32_t handle, uint64_t offset, void *buf, uint64_t length)
@@ -385,7 +390,11 @@ int __gem_read(int fd, uint32_t handle, uint64_t offset, void *buf, uint64_t len
  */
 void gem_read(int fd, uint32_t handle, uint64_t offset, void *buf, uint64_t length)
 {
-	igt_assert_eq(__gem_read(fd, handle, offset, buf, length), 0);
+	/* offset arg of gem_mmap__device_coherent must be 0 */
+	void *ptr = gem_mmap__device_coherent(fd, handle, 0, offset + length, PROT_READ);
+
+	memcpy(buf, ptr + offset, length);
+	munmap(ptr, offset + length);
 }
 
 int __gem_set_domain(int fd, uint32_t handle, uint32_t read, uint32_t write)
Signature · 6 lines
2.26.2.108.g048abe1751

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
#1 lore raw

[igt-dev] ✗ Fi.CI.BAT: failure for lib/ioctl_wrappers: Handle PREAD/PWRITE ioctls not supported in gem_read/write (rev3)

== Series Details ==

== Series Details ==

Series: lib/ioctl_wrappers: Handle PREAD/PWRITE ioctls not supported in gem_read/write (rev3)
URL : https://patchwork.freedesktop.org/series/81152/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_8939 -> IGTPW_4921
====================================================

Summary
-------

**FAILURE**

Serious unknown changes coming with IGTPW_4921 absolutely need to be verified manually.

If you think the reported changes have nothing to do with the changes introduced in IGTPW_4921, 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_4921/index.html

Possible new issues
-------------------

Here are the unknown changes that may have been introduced in IGTPW_4921:

### IGT changes ###

#### Possible regressions ####

* igt@gem_exec_store@basic:
- fi-tgl-u2: [PASS][1] -> [FAIL][2] +2 similar issues
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8939/fi-tgl-u2/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4921/fi-tgl-u2/igt@[email protected]

* igt@gem_huc_copy@huc-copy:
- fi-kbl-guc: [PASS][3] -> [FAIL][4] +1 similar issue
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8939/fi-kbl-guc/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4921/fi-kbl-guc/igt@[email protected]
- fi-skl-guc: [PASS][5] -> [FAIL][6] +1 similar issue
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8939/fi-skl-guc/igt@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4921/fi-skl-guc/igt@[email protected]

* igt@gem_linear_blits@basic:
- fi-skl-6700k2: NOTRUN -> [FAIL][7]
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4921/fi-skl-6700k2/igt@[email protected]
- fi-elk-e7500: [PASS][8] -> [FAIL][9]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8939/fi-elk-e7500/igt@[email protected]
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4921/fi-elk-e7500/igt@[email protected]
- fi-ilk-650: [PASS][10] -> [FAIL][11]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8939/fi-ilk-650/igt@[email protected]
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4921/fi-ilk-650/igt@[email protected]
- fi-snb-2520m: [PASS][12] -> [FAIL][13]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8939/fi-snb-2520m/igt@[email protected]
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4921/fi-snb-2520m/igt@[email protected]
- fi-byt-j1900: [PASS][14] -> [FAIL][15]
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8939/fi-byt-j1900/igt@[email protected]
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4921/fi-byt-j1900/igt@[email protected]
- fi-icl-u2: [PASS][16] -> [FAIL][17] +1 similar issue
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8939/fi-icl-u2/igt@[email protected]
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4921/fi-icl-u2/igt@[email protected]
- fi-blb-e6850: [PASS][18] -> [FAIL][19]
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8939/fi-blb-e6850/igt@[email protected]
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4921/fi-blb-e6850/igt@[email protected]
- fi-icl-y: [PASS][20] -> [FAIL][21] +1 similar issue
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8939/fi-icl-y/igt@[email protected]
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4921/fi-icl-y/igt@[email protected]
- fi-cfl-8109u: [PASS][22] -> [FAIL][23] +1 similar issue
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8939/fi-cfl-8109u/igt@[email protected]
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4921/fi-cfl-8109u/igt@[email protected]
- fi-bwr-2160: [PASS][24] -> [FAIL][25]
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8939/fi-bwr-2160/igt@[email protected]
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4921/fi-bwr-2160/igt@[email protected]
- fi-snb-2600: [PASS][26] -> [FAIL][27]
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8939/fi-snb-2600/igt@[email protected]
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4921/fi-snb-2600/igt@[email protected]
- fi-kbl-x1275: [PASS][28] -> [FAIL][29]
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8939/fi-kbl-x1275/igt@[email protected]
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4921/fi-kbl-x1275/igt@[email protected]

* igt@i915_module_load@reload:
- fi-cml-u2: [PASS][30] -> [FAIL][31] +1 similar issue
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8939/fi-cml-u2/igt@[email protected]
[31]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4921/fi-cml-u2/igt@[email protected]
- fi-cfl-8700k: [PASS][32] -> [FAIL][33] +1 similar issue
[32]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8939/fi-cfl-8700k/igt@[email protected]
[33]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4921/fi-cfl-8700k/igt@[email protected]
- fi-kbl-r: [PASS][34] -> [FAIL][35] +1 similar issue
[34]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8939/fi-kbl-r/igt@[email protected]
[35]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4921/fi-kbl-r/igt@[email protected]
- fi-hsw-4770: [PASS][36] -> [FAIL][37]
[36]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8939/fi-hsw-4770/igt@[email protected]
[37]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4921/fi-hsw-4770/igt@[email protected]
- fi-cml-s: [PASS][38] -> [FAIL][39] +1 similar issue
[38]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8939/fi-cml-s/igt@[email protected]
[39]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4921/fi-cml-s/igt@[email protected]
- fi-skl-6600u: [PASS][40] -> [FAIL][41]
[40]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8939/fi-skl-6600u/igt@[email protected]
[41]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4921/fi-skl-6600u/igt@[email protected]
- fi-skl-lmem: [PASS][42] -> [FAIL][43]
[42]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8939/fi-skl-lmem/igt@[email protected]
[43]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4921/fi-skl-lmem/igt@[email protected]
- fi-bsw-kefka: [PASS][44] -> [FAIL][45]
[44]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8939/fi-bsw-kefka/igt@[email protected]
[45]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4921/fi-bsw-kefka/igt@[email protected]

#### Suppressed ####

The following results come from untrusted machines, tests, or statuses. They do not affect the overall result.

* igt@gem_linear_blits@basic:
- {fi-ehl-1}: [PASS][46] -> [FAIL][47]
[46]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8939/fi-ehl-1/igt@[email protected]
[47]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4921/fi-ehl-1/igt@[email protected]
- {fi-kbl-7560u}: [PASS][48] -> [FAIL][49] +1 similar issue
[48]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8939/fi-kbl-7560u/igt@[email protected]
[49]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4921/fi-kbl-7560u/igt@[email protected]

Known issues
------------

Here are the changes found in IGTPW_4921 that come from known issues:

### IGT changes ###

#### Issues hit ####

* igt@gem_exec_parallel@engines@contexts:
- fi-icl-y: [PASS][50] -> [INCOMPLETE][51] ([i915#2398])
[50]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8939/fi-icl-y/igt@gem_exec_parallel@[email protected]
[51]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4921/fi-icl-y/igt@gem_exec_parallel@[email protected]

* igt@gem_linear_blits@basic:
- fi-apl-guc: [PASS][52] -> [FAIL][53] ([i915#1635]) +1 similar issue
[52]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8939/fi-apl-guc/igt@[email protected]
[53]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4921/fi-apl-guc/igt@[email protected]

* igt@i915_module_load@reload:
- fi-bxt-dsi: [PASS][54] -> [FAIL][55] ([i915#1635])
[54]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8939/fi-bxt-dsi/igt@[email protected]
[55]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4921/fi-bxt-dsi/igt@[email protected]

* igt@i915_pm_rpm@module-reload:
- fi-bsw-n3050: [PASS][56] -> [DMESG-WARN][57] ([i915#1982])
[56]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8939/fi-bsw-n3050/igt@[email protected]
[57]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4921/fi-bsw-n3050/igt@[email protected]

* igt@kms_flip@basic-flip-vs-wf_vblank@c-edp1:
- fi-icl-u2: [PASS][58] -> [DMESG-WARN][59] ([i915#1982]) +1 similar issue
[58]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8939/fi-icl-u2/igt@kms_flip@[email protected]
[59]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4921/fi-icl-u2/igt@kms_flip@[email protected]

#### Possible fixes ####

* igt@gem_exec_parallel@engines@basic:
- fi-skl-6700k2: [INCOMPLETE][60] ([i915#2398]) -> [PASS][61]
[60]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8939/fi-skl-6700k2/igt@gem_exec_parallel@[email protected]
[61]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4921/fi-skl-6700k2/igt@gem_exec_parallel@[email protected]

* igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic:
- {fi-kbl-7560u}: [DMESG-WARN][62] ([i915#1982]) -> [PASS][63]
[62]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8939/fi-kbl-7560u/igt@[email protected]
[63]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4921/fi-kbl-7560u/igt@[email protected]

#### Warnings ####

* igt@gem_exec_suspend@basic-s0:
- fi-kbl-x1275: [DMESG-WARN][64] ([i915#62] / [i915#92]) -> [DMESG-WARN][65] ([i915#1982] / [i915#62] / [i915#92] / [i915#95])
[64]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8939/fi-kbl-x1275/igt@[email protected]
[65]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4921/fi-kbl-x1275/igt@[email protected]

* igt@i915_module_load@reload:
- fi-icl-u2: [DMESG-WARN][66] ([i915#289]) -> [DMESG-FAIL][67] ([i915#289])
[66]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8939/fi-icl-u2/igt@[email protected]
[67]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4921/fi-icl-u2/igt@[email protected]
- fi-kbl-x1275: [DMESG-WARN][68] ([i915#62] / [i915#92]) -> [DMESG-FAIL][69] ([i915#62])
[68]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8939/fi-kbl-x1275/igt@[email protected]
[69]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4921/fi-kbl-x1275/igt@[email protected]
- fi-skl-guc: [DMESG-WARN][70] ([i915#2203]) -> [DMESG-FAIL][71] ([i915#2203])
[70]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8939/fi-skl-guc/igt@[email protected]
[71]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4921/fi-skl-guc/igt@[email protected]
- fi-kbl-guc: [DMESG-WARN][72] ([i915#2203]) -> [DMESG-FAIL][73] ([i915#2203])
[72]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8939/fi-kbl-guc/igt@[email protected]
[73]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4921/fi-kbl-guc/igt@[email protected]

* igt@kms_flip@basic-flip-vs-dpms@a-dp1:
- fi-kbl-x1275: [DMESG-WARN][74] ([i915#62] / [i915#92] / [i915#95]) -> [DMESG-WARN][75] ([i915#62] / [i915#92])
[74]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8939/fi-kbl-x1275/igt@kms_flip@[email protected]
[75]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4921/fi-kbl-x1275/igt@kms_flip@[email protected]

* igt@kms_force_connector_basic@prune-stale-modes:
- fi-kbl-x1275: [DMESG-WARN][76] ([i915#62] / [i915#92]) -> [DMESG-WARN][77] ([i915#62] / [i915#92] / [i915#95]) +1 similar issue
[76]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8939/fi-kbl-x1275/igt@[email protected]
[77]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4921/fi-kbl-x1275/igt@[email protected]

{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).

[i915#1635]: https://gitlab.freedesktop.org/drm/intel/issues/1635
[i915#1982]: https://gitlab.freedesktop.org/drm/intel/issues/1982
[i915#2203]: https://gitlab.freedesktop.org/drm/intel/issues/2203
[i915#2398]: https://gitlab.freedesktop.org/drm/intel/issues/2398
[i915#289]: https://gitlab.freedesktop.org/drm/intel/issues/289
[i915#62]: https://gitlab.freedesktop.org/drm/intel/issues/62
[i915#92]: https://gitlab.freedesktop.org/drm/intel/issues/92
[i915#95]: https://gitlab.freedesktop.org/drm/intel/issues/95

Participating hosts (39 -> 34)
------------------------------

Missing (5): fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-byt-clapper

Build changes
-------------

* CI: CI-20190529 -> None
* IGT: IGT_5774 -> IGTPW_4921

CI-20190529: 20190529
CI_DRM_8939: bee93e0c4c7026eeef73e7777b100ae5aca6dfa0 @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_4921: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4921/index.html
IGT_5774: 2a5db9f60241383272aeec176e1b97b3f487209f @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4921/index.html

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev