* [igt-dev] [PATCH i-g-t] i915/gem_mmap_gtt: Markup a copy of GTT set-domains
@ 2019-04-13 13:27 Chris Wilson
2019-04-13 13:54 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Chris Wilson @ 2019-04-13 13:27 UTC (permalink / raw)
To: intel-gfx; +Cc: igt-dev
We have to control the cache domains, especially important before first
writing into the object.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
tests/i915/gem_mmap_gtt.c | 26 ++++++++++++++++----------
1 file changed, 16 insertions(+), 10 deletions(-)
diff --git a/tests/i915/gem_mmap_gtt.c b/tests/i915/gem_mmap_gtt.c
index 58922ee32..ab7d3f2d0 100644
--- a/tests/i915/gem_mmap_gtt.c
+++ b/tests/i915/gem_mmap_gtt.c
@@ -678,27 +678,26 @@ test_huge_copy(int fd, int huge, int tiling_a, int tiling_b, int ncpus)
igt_fork(child, ncpus) {
uint64_t valid_size = huge_object_size;
- uint32_t bo;
+ uint32_t bo[2];
char *a, *b;
- bo = gem_create(fd, huge_object_size);
+ bo[0] = gem_create(fd, huge_object_size);
if (tiling_a) {
- igt_require(__gem_set_tiling(fd, bo, abs(tiling_a), min_tile_width(devid, tiling_a)) == 0);
+ igt_require(__gem_set_tiling(fd, bo[0], abs(tiling_a), min_tile_width(devid, tiling_a)) == 0);
valid_size = rounddown(valid_size, tile_row_size(tiling_a, min_tile_width(devid, tiling_a)));
}
- a = __gem_mmap__gtt(fd, bo, huge_object_size, PROT_READ | PROT_WRITE);
+ a = __gem_mmap__gtt(fd, bo[0], huge_object_size, PROT_READ | PROT_WRITE);
igt_require(a);
- gem_close(fd, bo);
- bo = gem_create(fd, huge_object_size);
+ bo[1] = gem_create(fd, huge_object_size);
if (tiling_b) {
- igt_require(__gem_set_tiling(fd, bo, abs(tiling_b), max_tile_width(devid, tiling_b)) == 0);
+ igt_require(__gem_set_tiling(fd, bo[1], abs(tiling_b), max_tile_width(devid, tiling_b)) == 0);
valid_size = rounddown(valid_size, tile_row_size(tiling_b, max_tile_width(devid, tiling_b)));
}
- b = __gem_mmap__gtt(fd, bo, huge_object_size, PROT_READ | PROT_WRITE);
+ b = __gem_mmap__gtt(fd, bo[1], huge_object_size, PROT_READ | PROT_WRITE);
igt_require(b);
- gem_close(fd, bo);
+ gem_set_domain(fd, bo[0], I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT);
for (i = 0; i < valid_size / PAGE_SIZE; i++) {
uint32_t *ptr = (uint32_t *)(a + PAGE_SIZE*i);
for (int j = 0; j < PAGE_SIZE/4; j++)
@@ -706,7 +705,7 @@ test_huge_copy(int fd, int huge, int tiling_a, int tiling_b, int ncpus)
igt_progress("Writing a ", i, valid_size / PAGE_SIZE);
}
-
+ gem_set_domain(fd, bo[1], I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT);
for (i = 0; i < valid_size / PAGE_SIZE; i++) {
uint32_t *ptr = (uint32_t *)(b + PAGE_SIZE*i);
for (int j = 0; j < PAGE_SIZE/4; j++)
@@ -727,12 +726,19 @@ test_huge_copy(int fd, int huge, int tiling_a, int tiling_b, int ncpus)
A_tmp[j] = B_tmp[j];
else
B_tmp[j] = A_tmp[j];
+
+ gem_set_domain(fd, bo[0], I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT);
memcpy(A, A_tmp, PAGE_SIZE);
+
+ gem_set_domain(fd, bo[1], I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT);
memcpy(B, B_tmp, PAGE_SIZE);
igt_progress("Copying a<->b ", i, valid_size / PAGE_SIZE);
}
+ gem_close(fd, bo[0]);
+ gem_close(fd, bo[1]);
+
for (i = 0; i < valid_size / PAGE_SIZE; i++) {
uint32_t page[PAGE_SIZE/sizeof(uint32_t)];
copy_wc_page(page, a + PAGE_SIZE*i);
--
2.20.1
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [igt-dev] ✓ Fi.CI.BAT: success for i915/gem_mmap_gtt: Markup a copy of GTT set-domains
2019-04-13 13:27 [igt-dev] [PATCH i-g-t] i915/gem_mmap_gtt: Markup a copy of GTT set-domains Chris Wilson
@ 2019-04-13 13:54 ` Patchwork
2019-04-13 15:27 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2019-04-15 12:23 ` [igt-dev] [PATCH i-g-t] " Ville Syrjälä
2 siblings, 0 replies; 6+ messages in thread
From: Patchwork @ 2019-04-13 13:54 UTC (permalink / raw)
To: Chris Wilson; +Cc: igt-dev
== Series Details ==
Series: i915/gem_mmap_gtt: Markup a copy of GTT set-domains
URL : https://patchwork.freedesktop.org/series/59435/
State : success
== Summary ==
CI Bug Log - changes from CI_DRM_5927 -> IGTPW_2855
====================================================
Summary
-------
**SUCCESS**
No regressions found.
External URL: https://patchwork.freedesktop.org/api/1.0/series/59435/revisions/1/mbox/
Known issues
------------
Here are the changes found in IGTPW_2855 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@amdgpu/amd_basic@userptr:
- fi-kbl-8809g: PASS -> DMESG-WARN [fdo#108965]
* igt@i915_selftest@live_execlists:
- fi-apl-guc: PASS -> INCOMPLETE [fdo#103927] / [fdo#109720]
* igt@kms_pipe_crc_basic@read-crc-pipe-a:
- fi-byt-clapper: PASS -> FAIL [fdo#103191]
* igt@runner@aborted:
- fi-apl-guc: NOTRUN -> FAIL [fdo#108622] / [fdo#109720]
#### Possible fixes ####
* igt@i915_selftest@live_contexts:
- fi-bdw-gvtdvm: DMESG-FAIL [fdo#110235 ] -> PASS
* igt@i915_selftest@live_evict:
- fi-bsw-kefka: DMESG-WARN [fdo#107709] -> PASS
* igt@kms_busy@basic-flip-c:
- fi-skl-6770hq: SKIP [fdo#109271] / [fdo#109278] -> PASS +2
* igt@kms_flip@basic-flip-vs-dpms:
- fi-skl-6770hq: SKIP [fdo#109271] -> PASS +23
* igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a:
- fi-byt-clapper: FAIL [fdo#103191] -> PASS
[fdo#103191]: https://bugs.freedesktop.org/show_bug.cgi?id=103191
[fdo#103927]: https://bugs.freedesktop.org/show_bug.cgi?id=103927
[fdo#107709]: https://bugs.freedesktop.org/show_bug.cgi?id=107709
[fdo#108622]: https://bugs.freedesktop.org/show_bug.cgi?id=108622
[fdo#108965]: https://bugs.freedesktop.org/show_bug.cgi?id=108965
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109278]: https://bugs.freedesktop.org/show_bug.cgi?id=109278
[fdo#109720]: https://bugs.freedesktop.org/show_bug.cgi?id=109720
[fdo#110235 ]: https://bugs.freedesktop.org/show_bug.cgi?id=110235
Participating hosts (48 -> 40)
------------------------------
Missing (8): fi-kbl-soraka fi-byt-j1900 fi-byt-squawks fi-bsw-cyan fi-ctg-p8600 fi-icl-y fi-icl-dsi fi-bdw-samus
Build changes
-------------
* IGT: IGT_4945 -> IGTPW_2855
CI_DRM_5927: d4c5510b1c590155f09d6582266341dd3d82701f @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_2855: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2855/
IGT_4945: a52cc643cfe6733465cfc9ccb3d21cbdc4fd7506 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2855/
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply [flat|nested] 6+ messages in thread
* [igt-dev] ✓ Fi.CI.IGT: success for i915/gem_mmap_gtt: Markup a copy of GTT set-domains
2019-04-13 13:27 [igt-dev] [PATCH i-g-t] i915/gem_mmap_gtt: Markup a copy of GTT set-domains Chris Wilson
2019-04-13 13:54 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
@ 2019-04-13 15:27 ` Patchwork
2019-04-15 12:23 ` [igt-dev] [PATCH i-g-t] " Ville Syrjälä
2 siblings, 0 replies; 6+ messages in thread
From: Patchwork @ 2019-04-13 15:27 UTC (permalink / raw)
To: Chris Wilson; +Cc: igt-dev
== Series Details ==
Series: i915/gem_mmap_gtt: Markup a copy of GTT set-domains
URL : https://patchwork.freedesktop.org/series/59435/
State : success
== Summary ==
CI Bug Log - changes from CI_DRM_5927_full -> IGTPW_2855_full
====================================================
Summary
-------
**SUCCESS**
No regressions found.
External URL: https://patchwork.freedesktop.org/api/1.0/series/59435/revisions/1/mbox/
Known issues
------------
Here are the changes found in IGTPW_2855_full that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@gem_exec_schedule@deep-bsd:
- shard-snb: NOTRUN -> SKIP [fdo#109271] +78
* igt@gem_pipe_control_store_loop@fresh-buffer:
- shard-apl: PASS -> DMESG-WARN [fdo#110376] +1
* igt@gem_tiled_fence_blits@normal:
- shard-kbl: PASS -> DMESG-WARN [fdo#110376]
* igt@i915_pm_rpm@i2c:
- shard-iclb: PASS -> DMESG-WARN [fdo#109982]
* igt@i915_suspend@fence-restore-tiled2untiled:
- shard-apl: PASS -> DMESG-WARN [fdo#108566] +2
* igt@kms_busy@extended-pageflip-hang-newfb-render-a:
- shard-apl: PASS -> INCOMPLETE [fdo#103927] +1
* igt@kms_busy@extended-pageflip-hang-newfb-render-c:
- shard-snb: NOTRUN -> SKIP [fdo#109271] / [fdo#109278] +8
* igt@kms_color@pipe-b-ctm-max:
- shard-apl: PASS -> FAIL [fdo#108147]
- shard-kbl: PASS -> FAIL [fdo#108147]
* igt@kms_flip@2x-busy-flip:
- shard-kbl: NOTRUN -> SKIP [fdo#109271] +9
* igt@kms_flip@flip-vs-expired-vblank-interruptible:
- shard-glk: PASS -> FAIL [fdo#105363]
* igt@kms_frontbuffer_tracking@fbc-2p-primscrn-cur-indfb-draw-mmap-cpu:
- shard-glk: PASS -> FAIL [fdo#103167]
* igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-cur-indfb-draw-render:
- shard-iclb: PASS -> FAIL [fdo#109247] +19
* igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-pri-shrfb-draw-render:
- shard-iclb: PASS -> FAIL [fdo#103167] +3
* igt@kms_frontbuffer_tracking@psr-2p-primscrn-pri-indfb-draw-mmap-gtt:
- shard-apl: NOTRUN -> SKIP [fdo#109271] +10
* igt@kms_pipe_crc_basic@suspend-read-crc-pipe-f:
- shard-kbl: NOTRUN -> SKIP [fdo#109271] / [fdo#109278]
- shard-apl: NOTRUN -> SKIP [fdo#109271] / [fdo#109278]
* igt@kms_plane@pixel-format-pipe-b-planes-source-clamping:
- shard-glk: PASS -> SKIP [fdo#109271]
* igt@kms_plane_lowres@pipe-a-tiling-y:
- shard-iclb: PASS -> FAIL [fdo#103166]
* igt@kms_plane_scaling@pipe-a-scaler-with-clipping-clamping:
- shard-glk: PASS -> SKIP [fdo#109271] / [fdo#109278]
* igt@kms_psr2_su@frontbuffer:
- shard-iclb: PASS -> SKIP [fdo#109642]
* igt@kms_psr@cursor_mmap_gtt:
- shard-iclb: PASS -> FAIL [fdo#107383] / [fdo#110215] +2
* igt@kms_psr@psr2_sprite_plane_move:
- shard-iclb: PASS -> SKIP [fdo#109441] +2
#### Possible fixes ####
* igt@gem_tiled_swapping@non-threaded:
- shard-iclb: FAIL [fdo#108686] -> PASS
* igt@i915_suspend@debugfs-reader:
- shard-apl: DMESG-WARN [fdo#108566] -> PASS +6
* igt@kms_frontbuffer_tracking@fbc-1p-offscren-pri-indfb-draw-render:
- shard-iclb: FAIL [fdo#103167] -> PASS +5
* igt@kms_frontbuffer_tracking@fbc-1p-primscrn-cur-indfb-draw-mmap-cpu:
- shard-snb: SKIP [fdo#109271] -> PASS +2
* igt@kms_frontbuffer_tracking@fbc-stridechange:
- shard-glk: FAIL [fdo#103167] -> PASS
- shard-apl: FAIL [fdo#103167] -> PASS
- shard-kbl: FAIL [fdo#103167] -> PASS
* igt@kms_frontbuffer_tracking@fbc-suspend:
- shard-kbl: DMESG-WARN [fdo#108566] -> PASS +2
* igt@kms_frontbuffer_tracking@fbcpsr-1p-offscren-pri-indfb-draw-pwrite:
- shard-iclb: FAIL [fdo#109247] -> PASS +11
* igt@kms_plane@pixel-format-pipe-a-planes-source-clamping:
- shard-glk: SKIP [fdo#109271] -> PASS +1
* igt@kms_plane_scaling@pipe-c-scaler-with-rotation:
- shard-glk: SKIP [fdo#109271] / [fdo#109278] -> PASS
* igt@kms_psr2_su@page_flip:
- shard-iclb: SKIP [fdo#109642] -> PASS
* igt@kms_psr@primary_page_flip:
- shard-iclb: FAIL [fdo#107383] / [fdo#110215] -> PASS +1
* igt@kms_psr@psr2_cursor_mmap_cpu:
- shard-iclb: SKIP [fdo#109441] -> PASS +1
* igt@testdisplay:
- shard-kbl: INCOMPLETE [fdo#103665] -> PASS
[fdo#103166]: https://bugs.freedesktop.org/show_bug.cgi?id=103166
[fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
[fdo#103665]: https://bugs.freedesktop.org/show_bug.cgi?id=103665
[fdo#103927]: https://bugs.freedesktop.org/show_bug.cgi?id=103927
[fdo#105363]: https://bugs.freedesktop.org/show_bug.cgi?id=105363
[fdo#107383]: https://bugs.freedesktop.org/show_bug.cgi?id=107383
[fdo#108147]: https://bugs.freedesktop.org/show_bug.cgi?id=108147
[fdo#108566]: https://bugs.freedesktop.org/show_bug.cgi?id=108566
[fdo#108686]: https://bugs.freedesktop.org/show_bug.cgi?id=108686
[fdo#109247]: https://bugs.freedesktop.org/show_bug.cgi?id=109247
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109278]: https://bugs.freedesktop.org/show_bug.cgi?id=109278
[fdo#109441]: https://bugs.freedesktop.org/show_bug.cgi?id=109441
[fdo#109642]: https://bugs.freedesktop.org/show_bug.cgi?id=109642
[fdo#109982]: https://bugs.freedesktop.org/show_bug.cgi?id=109982
[fdo#110215]: https://bugs.freedesktop.org/show_bug.cgi?id=110215
[fdo#110376]: https://bugs.freedesktop.org/show_bug.cgi?id=110376
Participating hosts (10 -> 6)
------------------------------
Missing (4): pig-skl-6260u shard-skl pig-hsw-4770r pig-glk-j5005
Build changes
-------------
* IGT: IGT_4945 -> IGTPW_2855
* Piglit: piglit_4509 -> None
CI_DRM_5927: d4c5510b1c590155f09d6582266341dd3d82701f @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_2855: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2855/
IGT_4945: a52cc643cfe6733465cfc9ccb3d21cbdc4fd7506 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2855/
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [igt-dev] [PATCH i-g-t] i915/gem_mmap_gtt: Markup a copy of GTT set-domains
2019-04-13 13:27 [igt-dev] [PATCH i-g-t] i915/gem_mmap_gtt: Markup a copy of GTT set-domains Chris Wilson
2019-04-13 13:54 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2019-04-13 15:27 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
@ 2019-04-15 12:23 ` Ville Syrjälä
2019-04-15 13:18 ` Chris Wilson
2 siblings, 1 reply; 6+ messages in thread
From: Ville Syrjälä @ 2019-04-15 12:23 UTC (permalink / raw)
To: Chris Wilson; +Cc: igt-dev, intel-gfx
On Sat, Apr 13, 2019 at 02:27:57PM +0100, Chris Wilson wrote:
> We have to control the cache domains, especially important before first
> writing into the object.
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> ---
> tests/i915/gem_mmap_gtt.c | 26 ++++++++++++++++----------
> 1 file changed, 16 insertions(+), 10 deletions(-)
>
> diff --git a/tests/i915/gem_mmap_gtt.c b/tests/i915/gem_mmap_gtt.c
> index 58922ee32..ab7d3f2d0 100644
> --- a/tests/i915/gem_mmap_gtt.c
> +++ b/tests/i915/gem_mmap_gtt.c
> @@ -678,27 +678,26 @@ test_huge_copy(int fd, int huge, int tiling_a, int tiling_b, int ncpus)
>
> igt_fork(child, ncpus) {
> uint64_t valid_size = huge_object_size;
> - uint32_t bo;
> + uint32_t bo[2];
> char *a, *b;
>
> - bo = gem_create(fd, huge_object_size);
> + bo[0] = gem_create(fd, huge_object_size);
> if (tiling_a) {
> - igt_require(__gem_set_tiling(fd, bo, abs(tiling_a), min_tile_width(devid, tiling_a)) == 0);
> + igt_require(__gem_set_tiling(fd, bo[0], abs(tiling_a), min_tile_width(devid, tiling_a)) == 0);
> valid_size = rounddown(valid_size, tile_row_size(tiling_a, min_tile_width(devid, tiling_a)));
> }
> - a = __gem_mmap__gtt(fd, bo, huge_object_size, PROT_READ | PROT_WRITE);
> + a = __gem_mmap__gtt(fd, bo[0], huge_object_size, PROT_READ | PROT_WRITE);
> igt_require(a);
> - gem_close(fd, bo);
>
> - bo = gem_create(fd, huge_object_size);
> + bo[1] = gem_create(fd, huge_object_size);
> if (tiling_b) {
> - igt_require(__gem_set_tiling(fd, bo, abs(tiling_b), max_tile_width(devid, tiling_b)) == 0);
> + igt_require(__gem_set_tiling(fd, bo[1], abs(tiling_b), max_tile_width(devid, tiling_b)) == 0);
> valid_size = rounddown(valid_size, tile_row_size(tiling_b, max_tile_width(devid, tiling_b)));
> }
> - b = __gem_mmap__gtt(fd, bo, huge_object_size, PROT_READ | PROT_WRITE);
> + b = __gem_mmap__gtt(fd, bo[1], huge_object_size, PROT_READ | PROT_WRITE);
> igt_require(b);
> - gem_close(fd, bo);
>
> + gem_set_domain(fd, bo[0], I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT);
> for (i = 0; i < valid_size / PAGE_SIZE; i++) {
> uint32_t *ptr = (uint32_t *)(a + PAGE_SIZE*i);
> for (int j = 0; j < PAGE_SIZE/4; j++)
> @@ -706,7 +705,7 @@ test_huge_copy(int fd, int huge, int tiling_a, int tiling_b, int ncpus)
> igt_progress("Writing a ", i, valid_size / PAGE_SIZE);
> }
>
> -
> + gem_set_domain(fd, bo[1], I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT);
> for (i = 0; i < valid_size / PAGE_SIZE; i++) {
> uint32_t *ptr = (uint32_t *)(b + PAGE_SIZE*i);
> for (int j = 0; j < PAGE_SIZE/4; j++)
> @@ -727,12 +726,19 @@ test_huge_copy(int fd, int huge, int tiling_a, int tiling_b, int ncpus)
> A_tmp[j] = B_tmp[j];
> else
> B_tmp[j] = A_tmp[j];
> +
> + gem_set_domain(fd, bo[0], I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT);
why do we repeat this here? I can't see anything that would change the
domains after the first time we set it.
> memcpy(A, A_tmp, PAGE_SIZE);
> +
> + gem_set_domain(fd, bo[1], I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT);
> memcpy(B, B_tmp, PAGE_SIZE);
>
> igt_progress("Copying a<->b ", i, valid_size / PAGE_SIZE);
> }
>
> + gem_close(fd, bo[0]);
> + gem_close(fd, bo[1]);
> +
> for (i = 0; i < valid_size / PAGE_SIZE; i++) {
> uint32_t page[PAGE_SIZE/sizeof(uint32_t)];
> copy_wc_page(page, a + PAGE_SIZE*i);
> --
> 2.20.1
>
> _______________________________________________
> igt-dev mailing list
> igt-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev
--
Ville Syrjälä
Intel
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [igt-dev] [PATCH i-g-t] i915/gem_mmap_gtt: Markup a copy of GTT set-domains
2019-04-15 12:23 ` [igt-dev] [PATCH i-g-t] " Ville Syrjälä
@ 2019-04-15 13:18 ` Chris Wilson
2019-04-15 13:29 ` Ville Syrjälä
0 siblings, 1 reply; 6+ messages in thread
From: Chris Wilson @ 2019-04-15 13:18 UTC (permalink / raw)
To: Ville Syrjälä; +Cc: igt-dev, intel-gfx
Quoting Ville Syrjälä (2019-04-15 13:23:54)
> On Sat, Apr 13, 2019 at 02:27:57PM +0100, Chris Wilson wrote:
> > We have to control the cache domains, especially important before first
> > writing into the object.
> >
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > ---
> > tests/i915/gem_mmap_gtt.c | 26 ++++++++++++++++----------
> > 1 file changed, 16 insertions(+), 10 deletions(-)
> >
> > diff --git a/tests/i915/gem_mmap_gtt.c b/tests/i915/gem_mmap_gtt.c
> > index 58922ee32..ab7d3f2d0 100644
> > --- a/tests/i915/gem_mmap_gtt.c
> > +++ b/tests/i915/gem_mmap_gtt.c
> > @@ -678,27 +678,26 @@ test_huge_copy(int fd, int huge, int tiling_a, int tiling_b, int ncpus)
> >
> > igt_fork(child, ncpus) {
> > uint64_t valid_size = huge_object_size;
> > - uint32_t bo;
> > + uint32_t bo[2];
> > char *a, *b;
> >
> > - bo = gem_create(fd, huge_object_size);
> > + bo[0] = gem_create(fd, huge_object_size);
> > if (tiling_a) {
> > - igt_require(__gem_set_tiling(fd, bo, abs(tiling_a), min_tile_width(devid, tiling_a)) == 0);
> > + igt_require(__gem_set_tiling(fd, bo[0], abs(tiling_a), min_tile_width(devid, tiling_a)) == 0);
> > valid_size = rounddown(valid_size, tile_row_size(tiling_a, min_tile_width(devid, tiling_a)));
> > }
> > - a = __gem_mmap__gtt(fd, bo, huge_object_size, PROT_READ | PROT_WRITE);
> > + a = __gem_mmap__gtt(fd, bo[0], huge_object_size, PROT_READ | PROT_WRITE);
> > igt_require(a);
> > - gem_close(fd, bo);
> >
> > - bo = gem_create(fd, huge_object_size);
> > + bo[1] = gem_create(fd, huge_object_size);
> > if (tiling_b) {
> > - igt_require(__gem_set_tiling(fd, bo, abs(tiling_b), max_tile_width(devid, tiling_b)) == 0);
> > + igt_require(__gem_set_tiling(fd, bo[1], abs(tiling_b), max_tile_width(devid, tiling_b)) == 0);
> > valid_size = rounddown(valid_size, tile_row_size(tiling_b, max_tile_width(devid, tiling_b)));
> > }
> > - b = __gem_mmap__gtt(fd, bo, huge_object_size, PROT_READ | PROT_WRITE);
> > + b = __gem_mmap__gtt(fd, bo[1], huge_object_size, PROT_READ | PROT_WRITE);
> > igt_require(b);
> > - gem_close(fd, bo);
> >
> > + gem_set_domain(fd, bo[0], I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT);
> > for (i = 0; i < valid_size / PAGE_SIZE; i++) {
> > uint32_t *ptr = (uint32_t *)(a + PAGE_SIZE*i);
> > for (int j = 0; j < PAGE_SIZE/4; j++)
> > @@ -706,7 +705,7 @@ test_huge_copy(int fd, int huge, int tiling_a, int tiling_b, int ncpus)
> > igt_progress("Writing a ", i, valid_size / PAGE_SIZE);
> > }
> >
> > -
> > + gem_set_domain(fd, bo[1], I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT);
> > for (i = 0; i < valid_size / PAGE_SIZE; i++) {
> > uint32_t *ptr = (uint32_t *)(b + PAGE_SIZE*i);
> > for (int j = 0; j < PAGE_SIZE/4; j++)
> > @@ -727,12 +726,19 @@ test_huge_copy(int fd, int huge, int tiling_a, int tiling_b, int ncpus)
> > A_tmp[j] = B_tmp[j];
> > else
> > B_tmp[j] = A_tmp[j];
> > +
> > + gem_set_domain(fd, bo[0], I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT);
>
> why do we repeat this here? I can't see anything that would change the
> domains after the first time we set it.
Just nervous; the one aspect I thoroughly dislike about set-domain is
that it is one sided and does not define a critical section over which
its applies. As such, anything else may change the domain in the middle
of our operation, and that unnerves me.
Making it double-sided has the dilemma of how best to lie to userspace
when you steal control, or how to fixup userspace who forgot to release
their lock.
It's easy to say not to repeat this in future api; defining what else
should be done instead is trickier. At present, such sketches all imply
that userspace is entirely responsible for controlling coherency with
consumers and swapping remains an invisible cache flush.
-Chris
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [igt-dev] [PATCH i-g-t] i915/gem_mmap_gtt: Markup a copy of GTT set-domains
2019-04-15 13:18 ` Chris Wilson
@ 2019-04-15 13:29 ` Ville Syrjälä
0 siblings, 0 replies; 6+ messages in thread
From: Ville Syrjälä @ 2019-04-15 13:29 UTC (permalink / raw)
To: Chris Wilson; +Cc: igt-dev, intel-gfx
On Mon, Apr 15, 2019 at 02:18:28PM +0100, Chris Wilson wrote:
> Quoting Ville Syrjälä (2019-04-15 13:23:54)
> > On Sat, Apr 13, 2019 at 02:27:57PM +0100, Chris Wilson wrote:
> > > We have to control the cache domains, especially important before first
> > > writing into the object.
> > >
> > > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > > ---
> > > tests/i915/gem_mmap_gtt.c | 26 ++++++++++++++++----------
> > > 1 file changed, 16 insertions(+), 10 deletions(-)
> > >
> > > diff --git a/tests/i915/gem_mmap_gtt.c b/tests/i915/gem_mmap_gtt.c
> > > index 58922ee32..ab7d3f2d0 100644
> > > --- a/tests/i915/gem_mmap_gtt.c
> > > +++ b/tests/i915/gem_mmap_gtt.c
> > > @@ -678,27 +678,26 @@ test_huge_copy(int fd, int huge, int tiling_a, int tiling_b, int ncpus)
> > >
> > > igt_fork(child, ncpus) {
> > > uint64_t valid_size = huge_object_size;
> > > - uint32_t bo;
> > > + uint32_t bo[2];
> > > char *a, *b;
> > >
> > > - bo = gem_create(fd, huge_object_size);
> > > + bo[0] = gem_create(fd, huge_object_size);
> > > if (tiling_a) {
> > > - igt_require(__gem_set_tiling(fd, bo, abs(tiling_a), min_tile_width(devid, tiling_a)) == 0);
> > > + igt_require(__gem_set_tiling(fd, bo[0], abs(tiling_a), min_tile_width(devid, tiling_a)) == 0);
> > > valid_size = rounddown(valid_size, tile_row_size(tiling_a, min_tile_width(devid, tiling_a)));
> > > }
> > > - a = __gem_mmap__gtt(fd, bo, huge_object_size, PROT_READ | PROT_WRITE);
> > > + a = __gem_mmap__gtt(fd, bo[0], huge_object_size, PROT_READ | PROT_WRITE);
> > > igt_require(a);
> > > - gem_close(fd, bo);
> > >
> > > - bo = gem_create(fd, huge_object_size);
> > > + bo[1] = gem_create(fd, huge_object_size);
> > > if (tiling_b) {
> > > - igt_require(__gem_set_tiling(fd, bo, abs(tiling_b), max_tile_width(devid, tiling_b)) == 0);
> > > + igt_require(__gem_set_tiling(fd, bo[1], abs(tiling_b), max_tile_width(devid, tiling_b)) == 0);
> > > valid_size = rounddown(valid_size, tile_row_size(tiling_b, max_tile_width(devid, tiling_b)));
> > > }
> > > - b = __gem_mmap__gtt(fd, bo, huge_object_size, PROT_READ | PROT_WRITE);
> > > + b = __gem_mmap__gtt(fd, bo[1], huge_object_size, PROT_READ | PROT_WRITE);
> > > igt_require(b);
> > > - gem_close(fd, bo);
> > >
> > > + gem_set_domain(fd, bo[0], I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT);
> > > for (i = 0; i < valid_size / PAGE_SIZE; i++) {
> > > uint32_t *ptr = (uint32_t *)(a + PAGE_SIZE*i);
> > > for (int j = 0; j < PAGE_SIZE/4; j++)
> > > @@ -706,7 +705,7 @@ test_huge_copy(int fd, int huge, int tiling_a, int tiling_b, int ncpus)
> > > igt_progress("Writing a ", i, valid_size / PAGE_SIZE);
> > > }
> > >
> > > -
> > > + gem_set_domain(fd, bo[1], I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT);
> > > for (i = 0; i < valid_size / PAGE_SIZE; i++) {
> > > uint32_t *ptr = (uint32_t *)(b + PAGE_SIZE*i);
> > > for (int j = 0; j < PAGE_SIZE/4; j++)
> > > @@ -727,12 +726,19 @@ test_huge_copy(int fd, int huge, int tiling_a, int tiling_b, int ncpus)
> > > A_tmp[j] = B_tmp[j];
> > > else
> > > B_tmp[j] = A_tmp[j];
> > > +
> > > + gem_set_domain(fd, bo[0], I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT);
> >
> > why do we repeat this here? I can't see anything that would change the
> > domains after the first time we set it.
>
> Just nervous; the one aspect I thoroughly dislike about set-domain is
> that it is one sided and does not define a critical section over which
> its applies. As such, anything else may change the domain in the middle
> of our operation, and that unnerves me.
>
> Making it double-sided has the dilemma of how best to lie to userspace
> when you steal control, or how to fixup userspace who forgot to release
> their lock.
>
> It's easy to say not to repeat this in future api; defining what else
> should be done instead is trickier. At present, such sketches all imply
> that userspace is entirely responsible for controlling coherency with
> consumers and swapping remains an invisible cache flush.
Fair enough.
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
--
Ville Syrjälä
Intel
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2019-04-15 13:29 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-04-13 13:27 [igt-dev] [PATCH i-g-t] i915/gem_mmap_gtt: Markup a copy of GTT set-domains Chris Wilson
2019-04-13 13:54 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2019-04-13 15:27 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2019-04-15 12:23 ` [igt-dev] [PATCH i-g-t] " Ville Syrjälä
2019-04-15 13:18 ` Chris Wilson
2019-04-15 13:29 ` Ville Syrjälä
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox