All of lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] tests/gem_mmap_offset: add coherency check
@ 2020-08-04 11:27 Zbigniew Kempczyński
  2020-08-04 12:03 ` Chris Wilson
  2020-08-04 12:05 ` [igt-dev] ✗ Fi.CI.BAT: failure for " Patchwork
  0 siblings, 2 replies; 3+ messages in thread
From: Zbigniew Kempczyński @ 2020-08-04 11:27 UTC (permalink / raw)
  To: igt-dev; +Cc: Chris Wilson

Likely on !llc we have problem with too late flush. Verify we have
buffer coherent before execbuf.

Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
---
 tests/i915/gem_mmap_offset.c | 76 ++++++++++++++++++++++++++++++++++++
 1 file changed, 76 insertions(+)

diff --git a/tests/i915/gem_mmap_offset.c b/tests/i915/gem_mmap_offset.c
index 23d26075..f45174ab 100644
--- a/tests/i915/gem_mmap_offset.c
+++ b/tests/i915/gem_mmap_offset.c
@@ -574,6 +574,79 @@ static void always_clear(int i915, int timeout)
 	igt_info("Checked %'lu page allocations\n", checked);
 }
 
+static struct intel_buf *create_bo(struct buf_ops *bops, uint32_t value,
+				   uint32_t width, uint32_t height)
+{
+	int i915 = buf_ops_get_fd(bops);
+	struct intel_buf *buf;
+	uint32_t *v, size;
+
+	buf = intel_buf_create(bops, width, height, 32, 0, I915_TILING_NONE, 0);
+	size = buf->surface[0].size;
+	v = gem_mmap__cpu_coherent(i915, buf->handle, 0, size, PROT_WRITE);
+
+	gem_set_domain(i915, buf->handle,
+		       I915_GEM_DOMAIN_CPU, I915_GEM_DOMAIN_CPU);
+
+	for (int i = 0; i < 64 / sizeof(*v); i++)
+		v[i] = value;
+
+	munmap(buf, size);
+
+	return buf;
+}
+
+static void coherency_check(int i915)
+{
+	struct buf_ops *bops;
+	struct intel_buf *src, *dst;
+	struct intel_bb *ibb;
+	uint32_t width = 512;
+	uint32_t height = 512;
+	uint32_t *psrc, *pdst, size;
+	bool compare_ok;
+	int i;
+
+	bops = buf_ops_create(i915);
+	ibb = intel_bb_create(i915, 4096);
+
+	src = create_bo(bops, 2, width, height);
+	dst = create_bo(bops, 1, width, height);
+	size = src->surface[0].size;
+
+	intel_bb_add_object(ibb, src->handle, src->addr.offset, false);
+	intel_bb_add_object(ibb, dst->handle, dst->addr.offset, true);
+
+	intel_bb_blt_copy(ibb,
+			  src, 0, 0, src->surface[0].stride,
+			  dst, 0, 0, dst->surface[0].stride,
+			  intel_buf_width(dst),
+			  intel_buf_height(dst), dst->bpp);
+	intel_bb_sync(ibb);
+
+	psrc = gem_mmap__cpu_coherent(i915, src->handle, 0, size, PROT_READ);
+	gem_set_domain(i915, src->handle, I915_GEM_DOMAIN_CPU, 0);
+
+	pdst = gem_mmap__cpu_coherent(i915, dst->handle, 0, size, PROT_READ);
+	gem_set_domain(i915, dst->handle, I915_GEM_DOMAIN_CPU, 0);
+
+	for (i = 0; i < 16; i++)
+		igt_debug("[%2d] %08x <> %08x\n", i, psrc[i], pdst[i]);
+
+	compare_ok = psrc[0] == pdst[0];
+
+	munmap(psrc, size);
+	munmap(pdst, size);
+
+	intel_buf_destroy(src);
+	intel_buf_destroy(dst);
+
+	intel_bb_destroy(ibb);
+	buf_ops_destroy(bops);
+
+	igt_assert_f(compare_ok, "Problem with coherency, flush is too late\n");
+}
+
 static int mmap_gtt_version(int i915)
 {
 	int gtt_version = -1;
@@ -630,6 +703,9 @@ igt_main
 	igt_subtest_f("clear")
 		always_clear(i915, 20);
 
+	igt_subtest_f("coherency-check")
+		coherency_check(i915);
+
 	igt_fixture {
 		close(i915);
 	}
-- 
2.26.0

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [igt-dev] [PATCH i-g-t] tests/gem_mmap_offset: add coherency check
  2020-08-04 11:27 [igt-dev] [PATCH i-g-t] tests/gem_mmap_offset: add coherency check Zbigniew Kempczyński
@ 2020-08-04 12:03 ` Chris Wilson
  2020-08-04 12:05 ` [igt-dev] ✗ Fi.CI.BAT: failure for " Patchwork
  1 sibling, 0 replies; 3+ messages in thread
From: Chris Wilson @ 2020-08-04 12:03 UTC (permalink / raw)
  To: zbigniew.kempczynski, igt-dev

Quoting Zbigniew Kempczyński (2020-08-04 12:27:28)
> Likely on !llc we have problem with too late flush. Verify we have
> buffer coherent before execbuf.
> 
> Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> ---
>  tests/i915/gem_mmap_offset.c | 76 ++++++++++++++++++++++++++++++++++++
>  1 file changed, 76 insertions(+)
> 
> diff --git a/tests/i915/gem_mmap_offset.c b/tests/i915/gem_mmap_offset.c
> index 23d26075..f45174ab 100644
> --- a/tests/i915/gem_mmap_offset.c
> +++ b/tests/i915/gem_mmap_offset.c
> @@ -574,6 +574,79 @@ static void always_clear(int i915, int timeout)
>         igt_info("Checked %'lu page allocations\n", checked);
>  }
>  
> +static struct intel_buf *create_bo(struct buf_ops *bops, uint32_t value,
> +                                  uint32_t width, uint32_t height)
> +{
> +       int i915 = buf_ops_get_fd(bops);
> +       struct intel_buf *buf;
> +       uint32_t *v, size;
> +
> +       buf = intel_buf_create(bops, width, height, 32, 0, I915_TILING_NONE, 0);
> +       size = buf->surface[0].size;
> +       v = gem_mmap__cpu_coherent(i915, buf->handle, 0, size, PROT_WRITE);
> +
> +       gem_set_domain(i915, buf->handle,
> +                      I915_GEM_DOMAIN_CPU, I915_GEM_DOMAIN_CPU);
> +
> +       for (int i = 0; i < 64 / sizeof(*v); i++)
> +               v[i] = value;
> +
> +       munmap(buf, size);
> +
> +       return buf;
> +}
> +
> +static void coherency_check(int i915)
> +{
> +       struct buf_ops *bops;
> +       struct intel_buf *src, *dst;
> +       struct intel_bb *ibb;
> +       uint32_t width = 512;
> +       uint32_t height = 512;
> +       uint32_t *psrc, *pdst, size;
> +       bool compare_ok;
> +       int i;
> +
> +       bops = buf_ops_create(i915);
> +       ibb = intel_bb_create(i915, 4096);
> +
> +       src = create_bo(bops, 2, width, height);
> +       dst = create_bo(bops, 1, width, height);
> +       size = src->surface[0].size;
> +
> +       intel_bb_add_object(ibb, src->handle, src->addr.offset, false);
> +       intel_bb_add_object(ibb, dst->handle, dst->addr.offset, true);
> +
> +       intel_bb_blt_copy(ibb,
> +                         src, 0, 0, src->surface[0].stride,
> +                         dst, 0, 0, dst->surface[0].stride,
> +                         intel_buf_width(dst),
> +                         intel_buf_height(dst), dst->bpp);
> +       intel_bb_sync(ibb);

Drop the sync? Don't it make it too easy for the kernel.

> +
> +       psrc = gem_mmap__cpu_coherent(i915, src->handle, 0, size, PROT_READ);
> +       gem_set_domain(i915, src->handle, I915_GEM_DOMAIN_CPU, 0);
> +
> +       pdst = gem_mmap__cpu_coherent(i915, dst->handle, 0, size, PROT_READ);
> +       gem_set_domain(i915, dst->handle, I915_GEM_DOMAIN_CPU, 0);

Similarly something we haven't really checked is the order of
gem_set_domain in situations like this, a second pass with waiting for
dst before src might be helpful.

> +
> +       for (i = 0; i < 16; i++)
> +               igt_debug("[%2d] %08x <> %08x\n", i, psrc[i], pdst[i]);
> +
> +       compare_ok = psrc[0] == pdst[0];

Both are mapped as WB, so memcmp(psrc, pdst, 64) should not be expensive,
or just compare_ok &= psrc[i] == pdst[i] as they are printed.

> +
> +       munmap(psrc, size);
> +       munmap(pdst, size);
> +
> +       intel_buf_destroy(src);
> +       intel_buf_destroy(dst);
> +
> +       intel_bb_destroy(ibb);
> +       buf_ops_destroy(bops);
> +
> +       igt_assert_f(compare_ok, "Problem with coherency, flush is too late\n");
> +}
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [igt-dev] ✗ Fi.CI.BAT: failure for tests/gem_mmap_offset: add coherency check
  2020-08-04 11:27 [igt-dev] [PATCH i-g-t] tests/gem_mmap_offset: add coherency check Zbigniew Kempczyński
  2020-08-04 12:03 ` Chris Wilson
@ 2020-08-04 12:05 ` Patchwork
  1 sibling, 0 replies; 3+ messages in thread
From: Patchwork @ 2020-08-04 12:05 UTC (permalink / raw)
  To: Zbigniew Kempczyński; +Cc: igt-dev


[-- Attachment #1.1: Type: text/plain, Size: 6872 bytes --]

== Series Details ==

Series: tests/gem_mmap_offset: add coherency check
URL   : https://patchwork.freedesktop.org/series/80247/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_8839 -> IGTPW_4850
====================================================

Summary
-------

  **FAILURE**

  Serious unknown changes coming with IGTPW_4850 absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in IGTPW_4850, 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_4850/index.html

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

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

### IGT changes ###

#### Possible regressions ####

  * igt@i915_selftest@live@execlists:
    - fi-icl-y:           [PASS][1] -> [INCOMPLETE][2]
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8839/fi-icl-y/igt@i915_selftest@live@execlists.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4850/fi-icl-y/igt@i915_selftest@live@execlists.html

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

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

### IGT changes ###

#### Issues hit ####

  * igt@gem_exec_suspend@basic-s0:
    - fi-tgl-u2:          [PASS][3] -> [FAIL][4] ([i915#1888])
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8839/fi-tgl-u2/igt@gem_exec_suspend@basic-s0.html
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4850/fi-tgl-u2/igt@gem_exec_suspend@basic-s0.html

  * igt@i915_selftest@live@execlists:
    - fi-apl-guc:         [PASS][5] -> [INCOMPLETE][6] ([i915#1635])
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8839/fi-apl-guc/igt@i915_selftest@live@execlists.html
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4850/fi-apl-guc/igt@i915_selftest@live@execlists.html

  * igt@kms_busy@basic@flip:
    - fi-kbl-x1275:       [PASS][7] -> [DMESG-WARN][8] ([i915#62] / [i915#92] / [i915#95])
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8839/fi-kbl-x1275/igt@kms_busy@basic@flip.html
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4850/fi-kbl-x1275/igt@kms_busy@basic@flip.html

  * igt@kms_flip@basic-flip-vs-wf_vblank@c-edp1:
    - fi-icl-u2:          [PASS][9] -> [DMESG-WARN][10] ([i915#1982])
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8839/fi-icl-u2/igt@kms_flip@basic-flip-vs-wf_vblank@c-edp1.html
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4850/fi-icl-u2/igt@kms_flip@basic-flip-vs-wf_vblank@c-edp1.html

  * igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a:
    - fi-cml-s:           [PASS][11] -> [DMESG-WARN][12] ([i915#1982]) +1 similar issue
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8839/fi-cml-s/igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a.html
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4850/fi-cml-s/igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a.html

  * igt@vgem_basic@setversion:
    - fi-tgl-y:           [PASS][13] -> [DMESG-WARN][14] ([i915#402]) +1 similar issue
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8839/fi-tgl-y/igt@vgem_basic@setversion.html
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4850/fi-tgl-y/igt@vgem_basic@setversion.html

  
#### Possible fixes ####

  * igt@gem_flink_basic@flink-lifetime:
    - fi-tgl-y:           [DMESG-WARN][15] ([i915#402]) -> [PASS][16] +1 similar issue
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8839/fi-tgl-y/igt@gem_flink_basic@flink-lifetime.html
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4850/fi-tgl-y/igt@gem_flink_basic@flink-lifetime.html

  * igt@kms_chamelium@common-hpd-after-suspend:
    - fi-kbl-7500u:       [DMESG-WARN][17] ([i915#2203]) -> [PASS][18]
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8839/fi-kbl-7500u/igt@kms_chamelium@common-hpd-after-suspend.html
   [18]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4850/fi-kbl-7500u/igt@kms_chamelium@common-hpd-after-suspend.html

  * igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic:
    - fi-bsw-kefka:       [DMESG-WARN][19] ([i915#1982]) -> [PASS][20]
   [19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8839/fi-bsw-kefka/igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic.html
   [20]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4850/fi-bsw-kefka/igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic.html

  
#### Warnings ####

  * igt@kms_cursor_legacy@basic-flip-before-cursor-varying-size:
    - fi-kbl-x1275:       [DMESG-WARN][21] ([i915#62] / [i915#92] / [i915#95]) -> [DMESG-WARN][22] ([i915#62] / [i915#92]) +4 similar issues
   [21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8839/fi-kbl-x1275/igt@kms_cursor_legacy@basic-flip-before-cursor-varying-size.html
   [22]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4850/fi-kbl-x1275/igt@kms_cursor_legacy@basic-flip-before-cursor-varying-size.html

  * igt@kms_force_connector_basic@force-edid:
    - fi-kbl-x1275:       [DMESG-WARN][23] ([i915#62] / [i915#92]) -> [DMESG-WARN][24] ([i915#62] / [i915#92] / [i915#95]) +3 similar issues
   [23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8839/fi-kbl-x1275/igt@kms_force_connector_basic@force-edid.html
   [24]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4850/fi-kbl-x1275/igt@kms_force_connector_basic@force-edid.html

  
  {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#1888]: https://gitlab.freedesktop.org/drm/intel/issues/1888
  [i915#1982]: https://gitlab.freedesktop.org/drm/intel/issues/1982
  [i915#2203]: https://gitlab.freedesktop.org/drm/intel/issues/2203
  [i915#402]: https://gitlab.freedesktop.org/drm/intel/issues/402
  [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 (45 -> 38)
------------------------------

  Missing    (7): fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-ctg-p8600 fi-byt-clapper fi-bdw-samus 


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

  * CI: CI-20190529 -> None
  * IGT: IGT_5757 -> IGTPW_4850

  CI-20190529: 20190529
  CI_DRM_8839: 06f63a338431705e657d6788908d7ca2fdb9e13e @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_4850: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4850/index.html
  IGT_5757: d78c7fd293cb228fe03ccff730202b033e25ff18 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools



== Testlist changes ==

+igt@gem_mmap_offset@coherency-check

== Logs ==

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

[-- Attachment #1.2: Type: text/html, Size: 8638 bytes --]

[-- Attachment #2: Type: text/plain, Size: 154 bytes --]

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-08-04 12:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-04 11:27 [igt-dev] [PATCH i-g-t] tests/gem_mmap_offset: add coherency check Zbigniew Kempczyński
2020-08-04 12:03 ` Chris Wilson
2020-08-04 12:05 ` [igt-dev] ✗ Fi.CI.BAT: failure for " 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.