All of lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t v1 1/1] gem_ctx_isolation.c - Gen11 enabling for context isolation test
@ 2019-02-15 21:31 Dale B Stimson via igt-dev
  2019-02-15 22:08 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,v1,1/1] " Patchwork
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Dale B Stimson via igt-dev @ 2019-02-15 21:31 UTC (permalink / raw)
  To: igt-dev

This patch is a change to igt file tests/i915/gem_ctx_isolation.c to add
Gen11 support.

This patch enables Gen11 support.

This patch accounts for whitelisted registers appropriately for the
different Gen levels.

This patch accounts for the changed MMIO offsets of Gen11.

This patch redefines MAX_REG from 0x40000 to 0x200000 due to the
larger total register space for Gen11 mmio offsets.  The resulting
big sparse array allocations present a good candidate for future
optimization of memory usage.

The current Gen11 SKU has two video engines (with indexes 0 and 2,
for VCS0 and VCS2), with VCS1 not being used.

Current kernel and igt limitations only allow for VCS0 and VCS1.
Those limitations are in the process of being removed.  See for
example the RFC/PATCH series on igt-dev from Andy Shyti:
    [igt-dev] [RFC PATCH v9 0/5] new engine discovery interface
which depends on in-process kernel "media scalability" patches.

Lacking the above infrastructure at the moment:

The array of registers to be tested includes VCS2 and VCS3 registers.
They are present as a provision for the future, but they will
not actually be tested as those engines are not yet known to the
underlying infrastructure.

When run on Gen11 this patch skips the sub-tests for the non-existent VCS1
with these warnings:
  Test requirement not met in function gem_require_engine, file ../lib/igt_gt.h:114:
  Test requirement: gem_has_engine(gem_fd, class, instance)

Anticipated for the future:

Take advantage of the new infrastructure to dynamically determine which
engines are present and test the same register(s) in each of them.

Add support for CCS.

Reduce memory requirements by avoiding sparse register-space arrays.

Signed-off-by: Dale B Stimson <dale.b.stimson@intel.com>
---
 tests/i915/gem_ctx_isolation.c | 57 +++++++++++++++++++++++++++-------
 1 file changed, 45 insertions(+), 12 deletions(-)

diff --git a/tests/i915/gem_ctx_isolation.c b/tests/i915/gem_ctx_isolation.c
index 839d49ad..4628e499 100644
--- a/tests/i915/gem_ctx_isolation.c
+++ b/tests/i915/gem_ctx_isolation.c
@@ -24,7 +24,7 @@
 #include "igt.h"
 #include "igt_dummyload.h"
 
-#define MAX_REG 0x40000
+#define MAX_REG 0x200000
 #define NUM_REGS (MAX_REG / sizeof(uint32_t))
 
 #define PAGE_ALIGN(x) ALIGN(x, 4096)
@@ -41,6 +41,8 @@ enum {
 	BCS0 = ENGINE(I915_ENGINE_CLASS_COPY, 0),
 	VCS0 = ENGINE(I915_ENGINE_CLASS_VIDEO, 0),
 	VCS1 = ENGINE(I915_ENGINE_CLASS_VIDEO, 1),
+	VCS2 = ENGINE(I915_ENGINE_CLASS_VIDEO, 2),
+	VCS3 = ENGINE(I915_ENGINE_CLASS_VIDEO, 3),
 	VECS0 = ENGINE(I915_ENGINE_CLASS_VIDEO_ENHANCE, 0),
 };
 
@@ -52,10 +54,12 @@ enum {
 #define GEN7 (ALL << 7)
 #define GEN8 (ALL << 8)
 #define GEN9 (ALL << 9)
+#define GEN10 (ALL << 10)
+#define GEN11 (ALL << 11)
 
 #define NOCTX 0
 
-#define LAST_KNOWN_GEN 10
+#define LAST_KNOWN_GEN 11
 
 static const struct named_register {
 	const char *name;
@@ -125,30 +129,59 @@ static const struct named_register {
 	{ "PERF_CNT_1", NOCTX, RCS0, 0x91b8, 2 },
 	{ "PERF_CNT_2", NOCTX, RCS0, 0x91c0, 2 },
 
+	/* Begin - registers privileged at one time or another */
+
 	/* Privileged (enabled by w/a + FORCE_TO_NONPRIV) */
 	{ "CTX_PREEMPT", NOCTX /* GEN_RANGE(9, 10) */, RCS0, 0x2248 },
-	{ "CS_CHICKEN1", GEN_RANGE(9, 10), RCS0, 0x2580 },
-	{ "HDC_CHICKEN1", GEN_RANGE(9, 10), RCS0, 0x7304 },
-	{ "L3SQREG1", GEN8, RCS0, 0xb010 },
+
+	/* FORCE_TO_NONPRIV for gen 9-10, present non-priv thereafter. */
+	{ "CS_CHICKEN1", GEN9, RCS0, 0x2580 },
+
+	/* FORCE_TO_NONPRIV for gen 9, present non-priv Gen 10-11. */
+	{ "HDC_CHICKEN1", GEN_RANGE(9, 11), RCS0, 0x7304 },
+
+	/* Removed in Gen11 */
+	{ "L3SQREG1", GEN_RANGE(8, 10), RCS0, 0xb010 },
+
+	/* NOPRIV for Gen11 */
+	{ "HALF_SLICE_CHICKEN7", GEN_RANGE(11, 11), RCS0, 0xe194 },
+
+	/* NOPRIV for Gen11 */
+	{ "SAMPLER_MODE", GEN_RANGE(11, 11), RCS0, 0xE18C },
+
+	/* End - registers privileged at one time or another */
 
 	{ "BCS_GPR", GEN9, BCS0, 0x22600, 32 },
 	{ "BCS_SWCTRL", GEN8, BCS0, 0x22200 },
 
-	{ "VCS0_GPR", GEN9, VCS0, 0x12600, 32 },
 	{ "MFC_VDBOX1", NOCTX, VCS0, 0x12800, 64 },
-
-	{ "VCS1_GPR", GEN9, VCS1, 0x1c600, 32 },
 	{ "MFC_VDBOX2", NOCTX, VCS1, 0x1c800, 64 },
 
-	{ "VECS_GPR", GEN9, VECS0, 0x1a600, 32 },
+	{ "VCS0_GPR", GEN_RANGE(9, 10), VCS0, 0x12600, 32 },
+	{ "VCS1_GPR", GEN_RANGE(9, 10), VCS1, 0x1c600, 32 },
+	{ "VECS_GPR", GEN_RANGE(9, 10), VECS0, 0x1a600, 32 },
+
+	{ "VCS0_GPR", GEN11, VCS0, 0x1c0600, 32 },
+	{ "VCS1_GPR", GEN11, VCS1, 0x1c4600, 32 },
+	{ "VCS2_GPR", GEN11, VCS2, 0x1d0600, 32 },
+	{ "VCS3_GPR", GEN11, VCS3, 0x1d4600, 32 },
+	{ "VECS_GPR", GEN11, VECS0, 0x1c8600, 32 },
 
 	{}
 }, ignore_registers[] = {
 	{ "RCS timestamp", GEN6, ~0u, 0x2358 },
-	{ "VCS0 timestamp", GEN7, ~0u, 0x12358 },
-	{ "VCS1 timestamp", GEN7, ~0u, 0x1c358 },
 	{ "BCS timestamp", GEN7, ~0u, 0x22358 },
-	{ "VECS timestamp", GEN8, ~0u, 0x1a358 },
+
+	{ "VCS0 timestamp", GEN_RANGE(7, 10), ~0u, 0x12358 },
+	{ "VCS1 timestamp", GEN_RANGE(7, 10), ~0u, 0x1c358 },
+	{ "VECS timestamp", GEN_RANGE(8, 10), ~0u, 0x1a358 },
+
+	{ "VCS0 timestamp", GEN11, ~0u, 0x1c0358 },
+	{ "VCS1 timestamp", GEN11, ~0u, 0x1c4358 },
+	{ "VCS2 timestamp", GEN11, ~0u, 0x1d0358 },
+	{ "VCS3 timestamp", GEN11, ~0u, 0x1d4358 },
+	{ "VECS timestamp", GEN11, ~0u, 0x1c8358 },
+
 	{}
 };
 
-- 
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] 5+ messages in thread

* [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,v1,1/1] gem_ctx_isolation.c - Gen11 enabling for context isolation test
  2019-02-15 21:31 [igt-dev] [PATCH i-g-t v1 1/1] gem_ctx_isolation.c - Gen11 enabling for context isolation test Dale B Stimson via igt-dev
@ 2019-02-15 22:08 ` Patchwork
  2019-02-16  5:36 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
  2019-02-18 13:36 ` [igt-dev] [PATCH i-g-t v1 1/1] " Chris Wilson
  2 siblings, 0 replies; 5+ messages in thread
From: Patchwork @ 2019-02-15 22:08 UTC (permalink / raw)
  To: igt-dev

== Series Details ==

Series: series starting with [i-g-t,v1,1/1] gem_ctx_isolation.c - Gen11 enabling for context isolation test
URL   : https://patchwork.freedesktop.org/series/56759/
State : success

== Summary ==

CI Bug Log - changes from IGT_4832 -> IGTPW_2429
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/56759/revisions/1/mbox/

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

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

### IGT changes ###

#### Issues hit ####

  * igt@gem_exec_suspend@basic-s3:
    - fi-blb-e6850:       PASS -> INCOMPLETE [fdo#107718]

  * igt@kms_pipe_crc_basic@nonblocking-crc-pipe-a:
    - fi-byt-clapper:     PASS -> FAIL [fdo#107362]

  * igt@kms_pipe_crc_basic@nonblocking-crc-pipe-b-frame-sequence:
    - fi-byt-clapper:     PASS -> FAIL [fdo#103191] / [fdo#107362]

  * igt@pm_rpm@basic-rte:
    - fi-byt-j1900:       PASS -> FAIL [fdo#108800]
    - fi-bsw-kefka:       PASS -> FAIL [fdo#108800]

  
#### Possible fixes ####

  * igt@kms_pipe_crc_basic@nonblocking-crc-pipe-a-frame-sequence:
    - fi-byt-clapper:     FAIL [fdo#103191] / [fdo#107362] -> PASS

  * igt@pm_rpm@basic-rte:
    - fi-hsw-4770:        {SKIP} [fdo#109271] -> PASS +1

  * igt@pm_rpm@module-reload:
    - fi-skl-6770hq:      FAIL [fdo#108511] -> PASS

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

  [fdo#103191]: https://bugs.freedesktop.org/show_bug.cgi?id=103191
  [fdo#107362]: https://bugs.freedesktop.org/show_bug.cgi?id=107362
  [fdo#107718]: https://bugs.freedesktop.org/show_bug.cgi?id=107718
  [fdo#108511]: https://bugs.freedesktop.org/show_bug.cgi?id=108511
  [fdo#108800]: https://bugs.freedesktop.org/show_bug.cgi?id=108800
  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271


Participating hosts (49 -> 42)
------------------------------

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


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

    * IGT: IGT_4832 -> IGTPW_2429

  CI_DRM_5611: c09679e398a860df940ba35ad5102e396bf4acb5 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_2429: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2429/
  IGT_4832: 324ab48e67065f0cf67525b3ab9c44fd3dcaef0a @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2429/
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] ✗ Fi.CI.IGT: failure for series starting with [i-g-t,v1,1/1] gem_ctx_isolation.c - Gen11 enabling for context isolation test
  2019-02-15 21:31 [igt-dev] [PATCH i-g-t v1 1/1] gem_ctx_isolation.c - Gen11 enabling for context isolation test Dale B Stimson via igt-dev
  2019-02-15 22:08 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,v1,1/1] " Patchwork
@ 2019-02-16  5:36 ` Patchwork
  2019-02-18 13:36 ` [igt-dev] [PATCH i-g-t v1 1/1] " Chris Wilson
  2 siblings, 0 replies; 5+ messages in thread
From: Patchwork @ 2019-02-16  5:36 UTC (permalink / raw)
  To: igt-dev

== Series Details ==

Series: series starting with [i-g-t,v1,1/1] gem_ctx_isolation.c - Gen11 enabling for context isolation test
URL   : https://patchwork.freedesktop.org/series/56759/
State : failure

== Summary ==

CI Bug Log - changes from IGT_4832_full -> IGTPW_2429_full
====================================================

Summary
-------

  **FAILURE**

  Serious unknown changes coming with IGTPW_2429_full absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in IGTPW_2429_full, please notify your bug team to allow them
  to document this new failure mode, which will reduce false positives in CI.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/56759/revisions/1/mbox/

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

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

### IGT changes ###

#### Possible regressions ####

  * igt@kms_atomic_transition@1x-modeset-transitions-nonblocking:
    - shard-apl:          PASS -> FAIL
    - shard-kbl:          PASS -> FAIL

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

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

### IGT changes ###

#### Issues hit ####

  * igt@kms_atomic_transition@plane-toggle-modeset-transition:
    - shard-hsw:          PASS -> INCOMPLETE [fdo#103540]

  * igt@kms_ccs@pipe-b-crc-sprite-planes-basic:
    - shard-glk:          PASS -> FAIL [fdo#108145]

  * igt@kms_cursor_crc@cursor-128x42-sliding:
    - shard-apl:          PASS -> FAIL [fdo#103232] +7

  * igt@kms_cursor_crc@cursor-256x256-suspend:
    - shard-glk:          NOTRUN -> FAIL [fdo#103232]

  * igt@kms_cursor_crc@cursor-64x64-sliding:
    - shard-kbl:          PASS -> FAIL [fdo#103232]

  * igt@kms_cursor_crc@cursor-64x64-suspend:
    - shard-apl:          PASS -> FAIL [fdo#103191] / [fdo#103232]

  * igt@kms_flip@flip-vs-expired-vblank:
    - shard-glk:          PASS -> FAIL [fdo#102887] / [fdo#105363]

  * igt@kms_frontbuffer_tracking@fbc-1p-primscrn-cur-indfb-draw-render:
    - shard-apl:          PASS -> FAIL [fdo#103167] +2
    - shard-kbl:          PASS -> FAIL [fdo#103167]

  * igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-move:
    - shard-glk:          PASS -> FAIL [fdo#103167] +6

  * igt@kms_plane_alpha_blend@pipe-a-alpha-opaque-fb:
    - shard-glk:          NOTRUN -> FAIL [fdo#108145]

  * igt@kms_plane_multiple@atomic-pipe-a-tiling-x:
    - shard-apl:          PASS -> FAIL [fdo#103166] +2

  * igt@kms_plane_multiple@atomic-pipe-c-tiling-y:
    - shard-glk:          PASS -> FAIL [fdo#103166] +2

  * igt@kms_setmode@basic:
    - shard-hsw:          PASS -> FAIL [fdo#99912]

  * igt@kms_vblank@pipe-b-ts-continuation-modeset-rpm:
    - shard-apl:          PASS -> FAIL [fdo#104894] +6

  * igt@kms_vblank@pipe-c-ts-continuation-modeset-hang:
    - shard-kbl:          PASS -> FAIL [fdo#104894]

  
#### Possible fixes ####

  * igt@kms_color@pipe-a-degamma:
    - shard-kbl:          FAIL [fdo#104782] / [fdo#108145] -> PASS

  * igt@kms_cursor_crc@cursor-64x21-sliding:
    - shard-apl:          FAIL [fdo#103232] -> PASS

  * igt@kms_cursor_crc@cursor-alpha-opaque:
    - shard-glk:          FAIL [fdo#109350] -> PASS

  * igt@kms_draw_crc@draw-method-xrgb8888-pwrite-xtiled:
    - shard-glk:          FAIL [fdo#107791] -> PASS

  * {igt@kms_flip@flip-vs-suspend}:
    - shard-snb:          DMESG-WARN [fdo#102365] -> PASS

  * igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-fullscreen:
    - shard-apl:          FAIL [fdo#103167] -> PASS +1
    - shard-kbl:          FAIL [fdo#103167] -> PASS +1

  * igt@kms_frontbuffer_tracking@fbc-2p-primscrn-spr-indfb-draw-mmap-cpu:
    - shard-glk:          FAIL [fdo#103167] -> PASS +3

  * igt@kms_plane@pixel-format-pipe-b-planes-source-clamping:
    - shard-apl:          FAIL [fdo#108948] -> PASS

  * igt@kms_plane@plane-position-covered-pipe-c-planes:
    - shard-apl:          FAIL [fdo#103166] -> PASS +3

  * igt@kms_plane_multiple@atomic-pipe-a-tiling-y:
    - shard-kbl:          FAIL [fdo#103166] -> PASS +2

  * igt@kms_plane_multiple@atomic-pipe-b-tiling-none:
    - shard-glk:          FAIL [fdo#103166] -> PASS +2

  * igt@kms_vblank@pipe-c-ts-continuation-dpms-suspend:
    - shard-apl:          FAIL [fdo#104894] -> PASS
    - shard-kbl:          FAIL [fdo#104894] -> PASS

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

  [fdo#102365]: https://bugs.freedesktop.org/show_bug.cgi?id=102365
  [fdo#102887]: https://bugs.freedesktop.org/show_bug.cgi?id=102887
  [fdo#103166]: https://bugs.freedesktop.org/show_bug.cgi?id=103166
  [fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
  [fdo#103191]: https://bugs.freedesktop.org/show_bug.cgi?id=103191
  [fdo#103232]: https://bugs.freedesktop.org/show_bug.cgi?id=103232
  [fdo#103540]: https://bugs.freedesktop.org/show_bug.cgi?id=103540
  [fdo#103927]: https://bugs.freedesktop.org/show_bug.cgi?id=103927
  [fdo#104782]: https://bugs.freedesktop.org/show_bug.cgi?id=104782
  [fdo#104894]: https://bugs.freedesktop.org/show_bug.cgi?id=104894
  [fdo#105363]: https://bugs.freedesktop.org/show_bug.cgi?id=105363
  [fdo#107791]: https://bugs.freedesktop.org/show_bug.cgi?id=107791
  [fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
  [fdo#108948]: https://bugs.freedesktop.org/show_bug.cgi?id=108948
  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [fdo#109278]: https://bugs.freedesktop.org/show_bug.cgi?id=109278
  [fdo#109350]: https://bugs.freedesktop.org/show_bug.cgi?id=109350
  [fdo#99912]: https://bugs.freedesktop.org/show_bug.cgi?id=99912


Participating hosts (7 -> 5)
------------------------------

  Missing    (2): shard-skl shard-iclb 


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

    * IGT: IGT_4832 -> IGTPW_2429

  CI_DRM_5611: c09679e398a860df940ba35ad5102e396bf4acb5 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_2429: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2429/
  IGT_4832: 324ab48e67065f0cf67525b3ab9c44fd3dcaef0a @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2429/
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* Re: [igt-dev] [PATCH i-g-t v1 1/1] gem_ctx_isolation.c - Gen11 enabling for context isolation test
  2019-02-15 21:31 [igt-dev] [PATCH i-g-t v1 1/1] gem_ctx_isolation.c - Gen11 enabling for context isolation test Dale B Stimson via igt-dev
  2019-02-15 22:08 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,v1,1/1] " Patchwork
  2019-02-16  5:36 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
@ 2019-02-18 13:36 ` Chris Wilson
  2019-02-20  0:38   ` Dale B Stimson
  2 siblings, 1 reply; 5+ messages in thread
From: Chris Wilson @ 2019-02-18 13:36 UTC (permalink / raw)
  To: Dale B Stimson, igt-dev

Quoting Dale B Stimson via igt-dev (2019-02-15 21:31:53)
> This patch is a change to igt file tests/i915/gem_ctx_isolation.c to add
> Gen11 support.
> 
> This patch enables Gen11 support.
> 
> This patch accounts for whitelisted registers appropriately for the
> different Gen levels.
> 
> This patch accounts for the changed MMIO offsets of Gen11.
> 
> This patch redefines MAX_REG from 0x40000 to 0x200000 due to the
> larger total register space for Gen11 mmio offsets.  The resulting
> big sparse array allocations present a good candidate for future
> optimization of memory usage.
> 
> The current Gen11 SKU has two video engines (with indexes 0 and 2,
> for VCS0 and VCS2), with VCS1 not being used.
> 
> Current kernel and igt limitations only allow for VCS0 and VCS1.
> Those limitations are in the process of being removed.  See for
> example the RFC/PATCH series on igt-dev from Andy Shyti:
>     [igt-dev] [RFC PATCH v9 0/5] new engine discovery interface
> which depends on in-process kernel "media scalability" patches.
> 
> Lacking the above infrastructure at the moment:
> 
> The array of registers to be tested includes VCS2 and VCS3 registers.
> They are present as a provision for the future, but they will
> not actually be tested as those engines are not yet known to the
> underlying infrastructure.
> 
> When run on Gen11 this patch skips the sub-tests for the non-existent VCS1
> with these warnings:
>   Test requirement not met in function gem_require_engine, file ../lib/igt_gt.h:114:
>   Test requirement: gem_has_engine(gem_fd, class, instance)
> 
> Anticipated for the future:
> 
> Take advantage of the new infrastructure to dynamically determine which
> engines are present and test the same register(s) in each of them.

> Add support for CCS.
> 
> Reduce memory requirements by avoiding sparse register-space arrays.

Is that a real issue? Would you even care for doing anything other than
finding the range of interest in each engine-set? Or even just
subtracting off the engine->mmio_base.
 
> Signed-off-by: Dale B Stimson <dale.b.stimson@intel.com>
> ---
>  tests/i915/gem_ctx_isolation.c | 57 +++++++++++++++++++++++++++-------
>  1 file changed, 45 insertions(+), 12 deletions(-)
> 
> diff --git a/tests/i915/gem_ctx_isolation.c b/tests/i915/gem_ctx_isolation.c
> index 839d49ad..4628e499 100644
> --- a/tests/i915/gem_ctx_isolation.c
> +++ b/tests/i915/gem_ctx_isolation.c
> @@ -24,7 +24,7 @@
>  #include "igt.h"
>  #include "igt_dummyload.h"
>  
> -#define MAX_REG 0x40000
> +#define MAX_REG 0x200000
>  #define NUM_REGS (MAX_REG / sizeof(uint32_t))
>  
>  #define PAGE_ALIGN(x) ALIGN(x, 4096)
> @@ -41,6 +41,8 @@ enum {
>         BCS0 = ENGINE(I915_ENGINE_CLASS_COPY, 0),
>         VCS0 = ENGINE(I915_ENGINE_CLASS_VIDEO, 0),
>         VCS1 = ENGINE(I915_ENGINE_CLASS_VIDEO, 1),
> +       VCS2 = ENGINE(I915_ENGINE_CLASS_VIDEO, 2),
> +       VCS3 = ENGINE(I915_ENGINE_CLASS_VIDEO, 3),
>         VECS0 = ENGINE(I915_ENGINE_CLASS_VIDEO_ENHANCE, 0),
>  };
>  
> @@ -52,10 +54,12 @@ enum {
>  #define GEN7 (ALL << 7)
>  #define GEN8 (ALL << 8)
>  #define GEN9 (ALL << 9)
> +#define GEN10 (ALL << 10)
> +#define GEN11 (ALL << 11)
>  
>  #define NOCTX 0
>  
> -#define LAST_KNOWN_GEN 10
> +#define LAST_KNOWN_GEN 11
>  
>  static const struct named_register {
>         const char *name;
> @@ -125,30 +129,59 @@ static const struct named_register {
>         { "PERF_CNT_1", NOCTX, RCS0, 0x91b8, 2 },
>         { "PERF_CNT_2", NOCTX, RCS0, 0x91c0, 2 },
>  
> +       /* Begin - registers privileged at one time or another */
> +
>         /* Privileged (enabled by w/a + FORCE_TO_NONPRIV) */
>         { "CTX_PREEMPT", NOCTX /* GEN_RANGE(9, 10) */, RCS0, 0x2248 },
> -       { "CS_CHICKEN1", GEN_RANGE(9, 10), RCS0, 0x2580 },
> -       { "HDC_CHICKEN1", GEN_RANGE(9, 10), RCS0, 0x7304 },
> -       { "L3SQREG1", GEN8, RCS0, 0xb010 },
> +
> +       /* FORCE_TO_NONPRIV for gen 9-10, present non-priv thereafter. */
> +       { "CS_CHICKEN1", GEN9, RCS0, 0x2580 },
> +
> +       /* FORCE_TO_NONPRIV for gen 9, present non-priv Gen 10-11. */
> +       { "HDC_CHICKEN1", GEN_RANGE(9, 11), RCS0, 0x7304 },

Or we could just list the registers twice in the force-to-nonpriv and
actually-nonpriv.

I'd rather do that, so that it's much easy to read the list of whitelist
registers against the kernel.

> +
> +       /* Removed in Gen11 */
> +       { "L3SQREG1", GEN_RANGE(8, 10), RCS0, 0xb010 },

Comment is identical to code, doesn't contain a why so superfuous.

> +       /* NOPRIV for Gen11 */
> +       { "HALF_SLICE_CHICKEN7", GEN_RANGE(11, 11), RCS0, 0xe194 },
> +
> +       /* NOPRIV for Gen11 */
> +       { "SAMPLER_MODE", GEN_RANGE(11, 11), RCS0, 0xE18C },

So no need to be part of the privileged section at all; if it is doesn't
exist as part of the test before gen11, we don't need to mention it. (As
not being part of earlier gen is explicit in the gen_range.)

> +       /* End - registers privileged at one time or another */

And pretty much redundant after the changes as it can be reduced to a
single visual block again.

>  
>         { "BCS_GPR", GEN9, BCS0, 0x22600, 32 },
>         { "BCS_SWCTRL", GEN8, BCS0, 0x22200 },
>  
> -       { "VCS0_GPR", GEN9, VCS0, 0x12600, 32 },
>         { "MFC_VDBOX1", NOCTX, VCS0, 0x12800, 64 },
> -
> -       { "VCS1_GPR", GEN9, VCS1, 0x1c600, 32 },
>         { "MFC_VDBOX2", NOCTX, VCS1, 0x1c800, 64 },
>  
> -       { "VECS_GPR", GEN9, VECS0, 0x1a600, 32 },
> +       { "VCS0_GPR", GEN_RANGE(9, 10), VCS0, 0x12600, 32 },
> +       { "VCS1_GPR", GEN_RANGE(9, 10), VCS1, 0x1c600, 32 },
> +       { "VECS_GPR", GEN_RANGE(9, 10), VECS0, 0x1a600, 32 },
> +
> +       { "VCS0_GPR", GEN11, VCS0, 0x1c0600, 32 },
> +       { "VCS1_GPR", GEN11, VCS1, 0x1c4600, 32 },
> +       { "VCS2_GPR", GEN11, VCS2, 0x1d0600, 32 },
> +       { "VCS3_GPR", GEN11, VCS3, 0x1d4600, 32 },
> +       { "VECS_GPR", GEN11, VECS0, 0x1c8600, 32 },

Would we not want to keep this as part of per-engine sets? That makes
more sense to me.

>         {}
>  }, ignore_registers[] = {
>         { "RCS timestamp", GEN6, ~0u, 0x2358 },
> -       { "VCS0 timestamp", GEN7, ~0u, 0x12358 },
> -       { "VCS1 timestamp", GEN7, ~0u, 0x1c358 },
>         { "BCS timestamp", GEN7, ~0u, 0x22358 },
> -       { "VECS timestamp", GEN8, ~0u, 0x1a358 },
> +
> +       { "VCS0 timestamp", GEN_RANGE(7, 10), ~0u, 0x12358 },
> +       { "VCS1 timestamp", GEN_RANGE(7, 10), ~0u, 0x1c358 },
> +       { "VECS timestamp", GEN_RANGE(8, 10), ~0u, 0x1a358 },
> +
> +       { "VCS0 timestamp", GEN11, ~0u, 0x1c0358 },
> +       { "VCS1 timestamp", GEN11, ~0u, 0x1c4358 },
> +       { "VCS2 timestamp", GEN11, ~0u, 0x1d0358 },
> +       { "VCS3 timestamp", GEN11, ~0u, 0x1d4358 },
> +       { "VECS timestamp", GEN11, ~0u, 0x1c8358 },

Part of me wants to add GEN11_xCSy_MMIO etc (and the other part wants
that from the query iface).

Otherwise looks ok, and I just want someone else with an actual icl to
confirm it does what it says on the tin.

I still think we should add a readback inside the test to confirm that
writes to these registers are actually sticking before confirming that
they are reset between ctx. That should have caught the issue with the
previous patch, so a useful piece of sanitychecking.
-Chris
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* Re: [igt-dev] [PATCH i-g-t v1 1/1] gem_ctx_isolation.c - Gen11 enabling for context isolation test
  2019-02-18 13:36 ` [igt-dev] [PATCH i-g-t v1 1/1] " Chris Wilson
@ 2019-02-20  0:38   ` Dale B Stimson
  0 siblings, 0 replies; 5+ messages in thread
From: Dale B Stimson @ 2019-02-20  0:38 UTC (permalink / raw)
  To: Chris Wilson; +Cc: igt-dev

On Mon, Feb 18, 2019 at 01:36:26PM +0000, Chris Wilson wrote:
> Quoting Dale B Stimson via igt-dev (2019-02-15 21:31:53)
> > Anticipated for the future:
> > ...
> > Reduce memory requirements by avoiding sparse register-space arrays.
>
> Is that a real issue? Would you even care for doing anything other than
> finding the range of interest in each engine-set? Or even just
> subtracting off the engine->mmio_base.

Is it a real issue?  Maybe not.  I ask for your opinion on this.

Consider allocations done in function read_regs.
As far as I can see without drilling down too far into the gem object creation
process, the expanded address space (for the new mmio offsets and up to four
VCS engines) would change the allocation from around:
    user allocation   -- about 2MB
    kernel allocation -- about 3MB
to:
    user allocation   -- about 16MB
    kernel allocation -- about 24MB

Is it worthwhile doing anything about that?

    For reference, a code fragment from read_regs:
        reloc = calloc(NUM_REGS, sizeof(*reloc));
        igt_assert(reloc);

        regs_size = NUM_REGS * sizeof(uint32_t);
        regs_size = PAGE_ALIGN(regs_size);

        batch_size = NUM_REGS * 4 * sizeof(uint32_t) + 4;
        batch_size = PAGE_ALIGN(batch_size);

        memset(obj, 0, sizeof(obj));
        obj[0].handle = gem_create(fd, regs_size);
        obj[1].handle = gem_create(fd, batch_size);

...

You had several comments about the nonpriv_registers table, which I have
addressed and which will be shown in the next reroll.

> > +       { "VCS0_GPR", GEN11, VCS0, 0x1c0600, 32 },
> > +       { "VCS1_GPR", GEN11, VCS1, 0x1c4600, 32 },
> > +       { "VCS2_GPR", GEN11, VCS2, 0x1d0600, 32 },
> > +       { "VCS3_GPR", GEN11, VCS3, 0x1d4600, 32 },
> > +       { "VECS_GPR", GEN11, VECS0, 0x1c8600, 32 },
>
> Would we not want to keep this as part of per-engine sets? That makes
> more sense to me.

I agree, which is why I wrote in the commit message:

    Anticipated for the future:
    Take advantage of the new infrastructure to dynamically determine which
    engines are present and test the same register(s) in each of them.

Granted that something could be done about this without waiting for the new
query infrastructure.

I would prefer to do this as a separate patch to avoid complications and
further delays in getting this patch merged.

Are you aware of any plans to have any centralized data describing the MMIO
offsets for each engine?  If not, I would expect that I would propose doing
that in support of the per-engine handling.

Do you object to doing this part later?

> Part of me wants to add GEN11_xCSy_MMIO etc (and the other part wants
> that from the query iface).

I would like to see it from the query interface.  Single point of truth.
>
> Otherwise looks ok, and I just want someone else with an actual icl to
> confirm it does what it says on the tin.

My test output from an actual icl is appended below.  I will re-test with
the revised patch.

> I still think we should add a readback inside the test to confirm that
> writes to these registers are actually sticking before confirming that
> they are reset between ctx. That should have caught the issue with the
> previous patch, so a useful piece of sanitychecking.

I agree.  I'll do this and submit a separate patch.

I have prepared a revised version of this patch and am submitting it to
the list.

-Dale

================
Test output of 2019-02-13:

$ build/tests/gem_ctx_isolation
IGT-Version: 1.23-g4b08ac86 (x86_64) (Linux: 5.0.0-rc6-ci-ci-dii-1765+ x86_64)
Starting subtest: rcs0-clean
Subtest rcs0-clean: SUCCESS (0.034s)
Starting subtest: rcs0-dirty-create
Subtest rcs0-dirty-create: SUCCESS (0.274s)
Starting subtest: rcs0-dirty-switch
Subtest rcs0-dirty-switch: SUCCESS (0.311s)
Starting subtest: rcs0-none
Subtest rcs0-none: SUCCESS (0.207s)
Starting subtest: rcs0-reset
Subtest rcs0-reset: SUCCESS (0.209s)
Starting subtest: bcs0-clean
Subtest bcs0-clean: SUCCESS (0.064s)
Starting subtest: bcs0-dirty-create
Subtest bcs0-dirty-create: SUCCESS (0.265s)
Starting subtest: bcs0-dirty-switch
Subtest bcs0-dirty-switch: SUCCESS (0.287s)
Starting subtest: bcs0-none
Subtest bcs0-none: SUCCESS (0.238s)
Starting subtest: bcs0-reset
Subtest bcs0-reset: SUCCESS (0.210s)
Starting subtest: vcs0-clean
Subtest vcs0-clean: SUCCESS (0.061s)
Starting subtest: vcs0-dirty-create
Subtest vcs0-dirty-create: SUCCESS (0.277s)
Starting subtest: vcs0-dirty-switch
Subtest vcs0-dirty-switch: SUCCESS (0.292s)
Starting subtest: vcs0-none
Subtest vcs0-none: SUCCESS (0.227s)
Starting subtest: vcs0-reset
Subtest vcs0-reset: SUCCESS (0.190s)
Test requirement not met in function gem_require_engine, file ../lib/igt_gt.h:114:
Test requirement: gem_has_engine(gem_fd, class, instance)
Subtest vcs1-clean: SKIP
Subtest vcs1-dirty-create: SKIP
Subtest vcs1-dirty-switch: SKIP
Subtest vcs1-none: SKIP
Subtest vcs1-reset: SKIP
Starting subtest: vecs0-clean
Subtest vecs0-clean: SUCCESS (0.073s)
Starting subtest: vecs0-dirty-create
Subtest vecs0-dirty-create: SUCCESS (0.270s)
Starting subtest: vecs0-dirty-switch
Subtest vecs0-dirty-switch: SUCCESS (0.333s)
Starting subtest: vecs0-none
Subtest vecs0-none: SUCCESS (0.212s)
Starting subtest: vecs0-reset
Subtest vecs0-reset: SUCCESS (0.197s)
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

end of thread, other threads:[~2019-02-20  0:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-15 21:31 [igt-dev] [PATCH i-g-t v1 1/1] gem_ctx_isolation.c - Gen11 enabling for context isolation test Dale B Stimson via igt-dev
2019-02-15 22:08 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,v1,1/1] " Patchwork
2019-02-16  5:36 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2019-02-18 13:36 ` [igt-dev] [PATCH i-g-t v1 1/1] " Chris Wilson
2019-02-20  0:38   ` Dale B Stimson

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.