All of lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] i915/gem_mocs_settings: Add mocs table for icelake
@ 2019-02-15 21:46 Prathap Kumar Valsan via igt-dev
  2019-02-15 22:48 ` [igt-dev] ✓ Fi.CI.BAT: success for i915/gem_mocs_settings: Add mocs table for icelake (rev3) Patchwork
                   ` (20 more replies)
  0 siblings, 21 replies; 44+ messages in thread
From: Prathap Kumar Valsan via igt-dev @ 2019-02-15 21:46 UTC (permalink / raw)
  To: igt-dev; +Cc: Kalamarz

From: "Kumar Valsan, Prathap" <prathap.kumar.valsan@intel.com>

This patch adds mocs table for icelake with expected L3 and eDRAM
control values.

Signed-off-by: Kumar Valsan, Prathap <prathap.kumar.valsan@intel.com>
---
 tests/i915/gem_mocs_settings.c | 145 +++++++++++++++++++++++++++------
 1 file changed, 122 insertions(+), 23 deletions(-)

diff --git a/tests/i915/gem_mocs_settings.c b/tests/i915/gem_mocs_settings.c
index 5b3b6bc1..b84273a0 100644
--- a/tests/i915/gem_mocs_settings.c
+++ b/tests/i915/gem_mocs_settings.c
@@ -33,6 +33,10 @@
 #include "igt_sysfs.h"
 
 #define MAX_NUMBER_MOCS_REGISTERS	(64)
+#define GEN9_NUM_MOCS_ENTRIES   62  /* 62 out of 64 - 63 & 64 are reserved. */
+#define GEN11_NUM_MOCS_ENTRIES  64  /* 63-64 are reserved, but configured. */
+#define MOCS_PTE_INDEX		(0x1)
+
 enum {
 	NONE,
 	RESET,
@@ -65,6 +69,7 @@ static const char * const test_modes[] = {
 struct mocs_entry {
 	uint32_t	control_value;
 	uint16_t	l3cc_value;
+	uint8_t		used;
 };
 
 struct mocs_table {
@@ -73,37 +78,113 @@ struct mocs_table {
 };
 
 /* The first entries in the MOCS tables are defined by uABI */
-static const struct mocs_entry skylake_mocs_table[] = {
-	{ 0x00000009, 0x0010 },
-	{ 0x00000038, 0x0030 },
-	{ 0x0000003b, 0x0030 },
+static struct mocs_entry icelake_mocs_table[GEN11_NUM_MOCS_ENTRIES] = {
+	[0]  = { 0x00000005, 0x0010, 0x1 },
+	[1]  = { 0x00000004, 0x0030, 0x1 },
+	[2]  = { 0x00000037, 0x0030, 0x1 },
+	[3]  = { 0x00000005, 0x0010, 0x1 },
+	[4]  = { 0x00000005, 0x0030, 0x1 },
+	[5]  = { 0x00000037, 0x0010, 0x1 },
+	[6]  = { 0x00000017, 0x0010, 0x1 },
+	[7]  = { 0x00000017, 0x0030, 0x1 },
+	[8]  = { 0x00000027, 0x0010, 0x1 },
+	[9]  = { 0x00000027, 0x0030, 0x1 },
+	[10] = { 0x00000077, 0x0010, 0x1 },
+	[11] = { 0x00000077, 0x0030, 0x1 },
+	[12] = { 0x00000057, 0x0010, 0x1 },
+	[13] = { 0x00000057, 0x0030, 0x1 },
+	[14] = { 0x00000067, 0x0010, 0x1 },
+	[15] = { 0x00000067, 0x0030, 0x1 },
+	[18] = { 0x00060037, 0x0030, 0x1 },
+	[19] = { 0x00000737, 0x0030, 0x1 },
+	[20] = { 0x00000337, 0x0030, 0x1 },
+	[21] = { 0x00000137, 0x0030, 0x1 },
+	[22] = { 0x000003b7, 0x0030, 0x1 },
+	[23] = { 0x000007b7, 0x0030, 0x1 },
+	[62] = { 0x00000037, 0x0010, 0x1 },
+	[63] = { 0x00000037, 0x0010, 0x1 },
+};
+
+static struct mocs_entry dirty_icelake_mocs_table[GEN11_NUM_MOCS_ENTRIES] = {
+	[0]  = { 0x0007FFFF, 0x003F },
+	[1]  = { 0x0007FFFF, 0x003F },
+	[2]  = { 0x0007FFFF, 0x003F },
+	[3]  = { 0x0007FFFF, 0x003F },
+	[4]  = { 0x0007FFFF, 0x003F },
+	[5]  = { 0x0007FFFF, 0x003F },
+	[6]  = { 0x0007FFFF, 0x003F },
+	[7]  = { 0x0007FFFF, 0x003F },
+	[8]  = { 0x0007FFFF, 0x003F },
+	[9]  = { 0x0007FFFF, 0x003F },
+	[10] = { 0x0007FFFF, 0x003F },
+	[11] = { 0x0007FFFF, 0x003F },
+	[12] = { 0x0007FFFF, 0x003F },
+	[13] = { 0x0007FFFF, 0x003F },
+	[14] = { 0x0007FFFF, 0x003F },
+	[15] = { 0x0007FFFF, 0x003F },
+	[18] = { 0x0007FFFF, 0x003F },
+	[19] = { 0x0007FFFF, 0x003F },
+	[21] = { 0x0007FFFF, 0x003F },
+	[22] = { 0x0007FFFF, 0x003F },
+	[23] = { 0x0007FFFF, 0x003F },
+	[62] = { 0x0007FFFF, 0x003F },
+	[63] = { 0x0007FFFF, 0x003F },
 };
 
-static const struct mocs_entry dirty_skylake_mocs_table[] = {
-	{ 0x00003FFF, 0x003F }, /* no snoop bit */
-	{ 0x00003FFF, 0x003F },
-	{ 0x00003FFF, 0x003F },
+static struct mocs_entry skylake_mocs_table[GEN9_NUM_MOCS_ENTRIES] = {
+	{ 0x00000009, 0x0010, 0x1 },
+	{ 0x00000038, 0x0030, 0x1 },
+	{ 0x0000003b, 0x0030, 0x1 },
 };
 
-static const struct mocs_entry broxton_mocs_table[] = {
-	{ 0x00000009, 0x0010 },
-	{ 0x00000038, 0x0030 },
-	{ 0x00000039, 0x0030 },
+static struct mocs_entry dirty_skylake_mocs_table[GEN9_NUM_MOCS_ENTRIES] = {
+	{ 0x00003FFF, 0x003F, 0x1 }, /* no snoop bit */
+	{ 0x00003FFF, 0x003F, 0x1 },
+	{ 0x00003FFF, 0x003F, 0x1 },
 };
 
-static const struct mocs_entry dirty_broxton_mocs_table[] = {
-	{ 0x00007FFF, 0x003F },
-	{ 0x00007FFF, 0x003F },
-	{ 0x00007FFF, 0x003F },
+static struct mocs_entry broxton_mocs_table[GEN9_NUM_MOCS_ENTRIES] = {
+	{ 0x00000009, 0x0010, 0x1 },
+	{ 0x00000038, 0x0030, 0x1 },
+	{ 0x00000039, 0x0030, 0x1 },
 };
 
-static const uint32_t write_values[] = {
-	0xFFFFFFFF,
-	0xFFFFFFFF,
-	0xFFFFFFFF,
-	0xFFFFFFFF
+static struct mocs_entry dirty_broxton_mocs_table[GEN9_NUM_MOCS_ENTRIES] = {
+	{ 0x00007FFF, 0x003F, 0x1 },
+	{ 0x00007FFF, 0x003F, 0x1 },
+	{ 0x00007FFF, 0x003F, 0x1 },
 };
 
+static uint32_t write_values[MAX_NUMBER_MOCS_REGISTERS];
+
+static void set_mocs_settings(void)
+{
+	uint8_t index;
+	/* Set un-used entries to PTE */
+	for (index = 0; index < MAX_NUMBER_MOCS_REGISTERS; index++) {
+		if (index < GEN9_NUM_MOCS_ENTRIES) {
+			if (!skylake_mocs_table[index].used) {
+				skylake_mocs_table[index] =  skylake_mocs_table[MOCS_PTE_INDEX];
+				dirty_skylake_mocs_table[index] =  dirty_skylake_mocs_table[MOCS_PTE_INDEX];
+			}
+			if (!broxton_mocs_table[index].used) {
+				broxton_mocs_table[index] =  broxton_mocs_table[MOCS_PTE_INDEX];
+				dirty_broxton_mocs_table[index] =  dirty_broxton_mocs_table[MOCS_PTE_INDEX];
+			}
+			if (!icelake_mocs_table[index].used) {
+				icelake_mocs_table[index] =  icelake_mocs_table[MOCS_PTE_INDEX];
+				dirty_icelake_mocs_table[index] =  dirty_icelake_mocs_table[MOCS_PTE_INDEX];
+			}
+		} else { /*icelake has 64 entries */
+			if (!icelake_mocs_table[index].used) {
+				icelake_mocs_table[index] =  icelake_mocs_table[MOCS_PTE_INDEX];
+				dirty_icelake_mocs_table[index] =  dirty_icelake_mocs_table[MOCS_PTE_INDEX];
+			}
+		}
+	}
+	memset((char *)write_values, 0xFF, MAX_NUMBER_MOCS_REGISTERS * sizeof(uint32_t));
+}
+
 static bool get_mocs_settings(int fd, struct mocs_table *table, bool dirty)
 {
 	uint32_t devid = intel_get_drm_devid(fd);
@@ -127,6 +208,15 @@ static bool get_mocs_settings(int fd, struct mocs_table *table, bool dirty)
 			table->table = broxton_mocs_table;
 		}
 		result = true;
+	} else if (IS_ICELAKE(devid)) {
+		if (dirty) {
+			table->size  = ARRAY_SIZE(dirty_icelake_mocs_table);
+			table->table = dirty_icelake_mocs_table;
+		} else {
+			table->size  = ARRAY_SIZE(icelake_mocs_table);
+			table->table = icelake_mocs_table;
+		}
+		result = true;
 	}
 
 	return result;
@@ -374,13 +464,21 @@ static void check_mocs_values(int fd, unsigned engine, uint32_t ctx_id, bool dir
 
 static void write_dirty_mocs(int fd, unsigned engine, uint32_t ctx_id)
 {
+	uint32_t devid = intel_get_drm_devid(fd);
+	int num_of_mocs_entries;
+
+	if (IS_ICELAKE(devid))
+		num_of_mocs_entries = GEN11_NUM_MOCS_ENTRIES;
+	else
+		num_of_mocs_entries = GEN9_NUM_MOCS_ENTRIES;
+
 	write_registers(fd, ctx_id, get_engine_base(engine),
-			write_values, ARRAY_SIZE(write_values),
+			write_values, num_of_mocs_entries,
 			engine);
 
 	if (engine == I915_EXEC_RENDER)
 		write_registers(fd, ctx_id, GEN9_LNCFCMOCS0,
-				write_values, ARRAY_SIZE(write_values),
+				write_values, num_of_mocs_entries/2,
 				engine);
 }
 
@@ -440,6 +538,7 @@ igt_main
 		fd = drm_open_driver_master(DRIVER_INTEL); /* for SECURE */
 		igt_require_gem(fd);
 		gem_require_mocs_registers(fd);
+		set_mocs_settings();
 		igt_require(get_mocs_settings(fd, &table, false));
 	}
 
-- 
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] 44+ messages in thread

* [igt-dev] ✓ Fi.CI.BAT: success for i915/gem_mocs_settings: Add mocs table for icelake (rev3)
  2019-02-15 21:46 [igt-dev] [PATCH i-g-t] i915/gem_mocs_settings: Add mocs table for icelake Prathap Kumar Valsan via igt-dev
@ 2019-02-15 22:48 ` Patchwork
  2019-02-16  6:07 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
                   ` (19 subsequent siblings)
  20 siblings, 0 replies; 44+ messages in thread
From: Patchwork @ 2019-02-15 22:48 UTC (permalink / raw)
  To: igt-dev

== Series Details ==

Series: i915/gem_mocs_settings: Add mocs table for icelake (rev3)
URL   : https://patchwork.freedesktop.org/series/56459/
State : success

== Summary ==

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

Summary
-------

  **SUCCESS**

  No regressions found.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/56459/revisions/3/mbox/

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

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

### IGT changes ###

#### Issues hit ####

  * igt@kms_chamelium@hdmi-hpd-fast:
    - fi-kbl-7500u:       PASS -> FAIL [fdo#109485]

  * igt@kms_frontbuffer_tracking@basic:
    - fi-byt-clapper:     PASS -> FAIL [fdo#103167]

  
#### 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#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
  [fdo#103191]: https://bugs.freedesktop.org/show_bug.cgi?id=103191
  [fdo#105998]: https://bugs.freedesktop.org/show_bug.cgi?id=105998
  [fdo#107362]: https://bugs.freedesktop.org/show_bug.cgi?id=107362
  [fdo#108511]: https://bugs.freedesktop.org/show_bug.cgi?id=108511
  [fdo#108569]: https://bugs.freedesktop.org/show_bug.cgi?id=108569
  [fdo#108840]: https://bugs.freedesktop.org/show_bug.cgi?id=108840
  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [fdo#109276]: https://bugs.freedesktop.org/show_bug.cgi?id=109276
  [fdo#109278]: https://bugs.freedesktop.org/show_bug.cgi?id=109278
  [fdo#109284]: https://bugs.freedesktop.org/show_bug.cgi?id=109284
  [fdo#109285]: https://bugs.freedesktop.org/show_bug.cgi?id=109285
  [fdo#109289]: https://bugs.freedesktop.org/show_bug.cgi?id=109289
  [fdo#109294]: https://bugs.freedesktop.org/show_bug.cgi?id=109294
  [fdo#109485]: https://bugs.freedesktop.org/show_bug.cgi?id=109485
  [fdo#109527]: https://bugs.freedesktop.org/show_bug.cgi?id=109527
  [fdo#109528]: https://bugs.freedesktop.org/show_bug.cgi?id=109528
  [fdo#109530]: https://bugs.freedesktop.org/show_bug.cgi?id=109530


Participating hosts (49 -> 41)
------------------------------

  Additional (1): fi-icl-y 
  Missing    (9): fi-kbl-soraka fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-ctg-p8600 fi-glk-j4005 fi-bxt-j4205 fi-bdw-samus 


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

    * IGT: IGT_4832 -> IGTPW_2430

  CI_DRM_5611: c09679e398a860df940ba35ad5102e396bf4acb5 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_2430: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2430/
  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_2430/
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] ✓ Fi.CI.IGT: success for i915/gem_mocs_settings: Add mocs table for icelake (rev3)
  2019-02-15 21:46 [igt-dev] [PATCH i-g-t] i915/gem_mocs_settings: Add mocs table for icelake Prathap Kumar Valsan via igt-dev
  2019-02-15 22:48 ` [igt-dev] ✓ Fi.CI.BAT: success for i915/gem_mocs_settings: Add mocs table for icelake (rev3) Patchwork
@ 2019-02-16  6:07 ` Patchwork
  2019-02-20  8:33 ` [igt-dev] [PATCH i-g-t] i915/gem_mocs_settings: Add mocs table for icelake Szwichtenberg, Radoslaw
                   ` (18 subsequent siblings)
  20 siblings, 0 replies; 44+ messages in thread
From: Patchwork @ 2019-02-16  6:07 UTC (permalink / raw)
  To: igt-dev

== Series Details ==

Series: i915/gem_mocs_settings: Add mocs table for icelake (rev3)
URL   : https://patchwork.freedesktop.org/series/56459/
State : success

== Summary ==

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

Summary
-------

  **SUCCESS**

  No regressions found.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/56459/revisions/3/mbox/

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

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

### IGT changes ###

#### Issues hit ####

  * igt@i915_suspend@fence-restore-untiled:
    - shard-apl:          PASS -> DMESG-WARN [fdo#108566]

  * igt@kms_color@pipe-a-gamma:
    - shard-kbl:          PASS -> FAIL [fdo#104782]
    - shard-apl:          PASS -> FAIL [fdo#104782] +1

  * igt@kms_color@pipe-c-ctm-max:
    - shard-apl:          PASS -> FAIL [fdo#108147]

  * igt@kms_cursor_crc@cursor-256x256-random:
    - shard-apl:          PASS -> FAIL [fdo#103232] +6

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

  * igt@kms_cursor_crc@cursor-64x21-onscreen:
    - shard-kbl:          PASS -> FAIL [fdo#103232] +1

  * igt@kms_cursor_legacy@2x-long-cursor-vs-flip-legacy:
    - shard-hsw:          PASS -> FAIL [fdo#105767]

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

  * igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-mmap-wc:
    - shard-kbl:          PASS -> FAIL [fdo#103167]

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

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

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

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

  * igt@kms_plane_multiple@atomic-pipe-c-tiling-yf:
    - shard-apl:          PASS -> FAIL [fdo#103166] +5

  * igt@kms_rotation_crc@multiplane-rotation:
    - shard-kbl:          PASS -> FAIL [fdo#109016]

  * igt@kms_rotation_crc@multiplane-rotation-cropping-bottom:
    - shard-kbl:          PASS -> DMESG-FAIL [fdo#105763]

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

  * igt@kms_vblank@pipe-b-ts-continuation-modeset-rpm:
    - shard-apl:          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-random:
    - shard-apl:          FAIL [fdo#103232] -> PASS +3

  * 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-wc:
    - shard-glk:          FAIL [fdo#103167] -> PASS +2

  * 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-glk:          FAIL [fdo#103166] -> PASS +1

  * igt@kms_plane_multiple@atomic-pipe-a-tiling-y:
    - shard-apl:          FAIL [fdo#103166] -> PASS +2
    - shard-kbl:          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#103166]: https://bugs.freedesktop.org/show_bug.cgi?id=103166
  [fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
  [fdo#103232]: https://bugs.freedesktop.org/show_bug.cgi?id=103232
  [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#105763]: https://bugs.freedesktop.org/show_bug.cgi?id=105763
  [fdo#105767]: https://bugs.freedesktop.org/show_bug.cgi?id=105767
  [fdo#107791]: https://bugs.freedesktop.org/show_bug.cgi?id=107791
  [fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
  [fdo#108147]: https://bugs.freedesktop.org/show_bug.cgi?id=108147
  [fdo#108566]: https://bugs.freedesktop.org/show_bug.cgi?id=108566
  [fdo#108948]: https://bugs.freedesktop.org/show_bug.cgi?id=108948
  [fdo#109016]: https://bugs.freedesktop.org/show_bug.cgi?id=109016
  [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_2430

  CI_DRM_5611: c09679e398a860df940ba35ad5102e396bf4acb5 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_2430: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2430/
  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_2430/
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* Re: [igt-dev] [PATCH i-g-t] i915/gem_mocs_settings: Add mocs table for icelake
  2019-02-15 21:46 [igt-dev] [PATCH i-g-t] i915/gem_mocs_settings: Add mocs table for icelake Prathap Kumar Valsan via igt-dev
  2019-02-15 22:48 ` [igt-dev] ✓ Fi.CI.BAT: success for i915/gem_mocs_settings: Add mocs table for icelake (rev3) Patchwork
  2019-02-16  6:07 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
@ 2019-02-20  8:33 ` Szwichtenberg, Radoslaw
  2019-02-21 22:48 ` Lucas De Marchi
                   ` (17 subsequent siblings)
  20 siblings, 0 replies; 44+ messages in thread
From: Szwichtenberg, Radoslaw @ 2019-02-20  8:33 UTC (permalink / raw)
  To: igt-dev, Kumar Valsan, Prathap

Fixing the CC.

Radek

On Fri, 2019-02-15 at 16:46 -0500, Prathap Kumar Valsan via igt-dev wrote:
> From: "Kumar Valsan, Prathap" <prathap.kumar.valsan@intel.com>
> 
> This patch adds mocs table for icelake with expected L3 and eDRAM
> control values.
> 
> Signed-off-by: Kumar Valsan, Prathap <prathap.kumar.valsan@intel.com>
> ---
>  tests/i915/gem_mocs_settings.c | 145 +++++++++++++++++++++++++++------
>  1 file changed, 122 insertions(+), 23 deletions(-)
> 
> diff --git a/tests/i915/gem_mocs_settings.c b/tests/i915/gem_mocs_settings.c
> index 5b3b6bc1..b84273a0 100644
> --- a/tests/i915/gem_mocs_settings.c
> +++ b/tests/i915/gem_mocs_settings.c
> @@ -33,6 +33,10 @@
>  #include "igt_sysfs.h"
>  
>  #define MAX_NUMBER_MOCS_REGISTERS	(64)
> +#define GEN9_NUM_MOCS_ENTRIES   62  /* 62 out of 64 - 63 & 64 are reserved.
> */
> +#define GEN11_NUM_MOCS_ENTRIES  64  /* 63-64 are reserved, but configured. */
> +#define MOCS_PTE_INDEX		(0x1)
> +
>  enum {
>  	NONE,
>  	RESET,
> @@ -65,6 +69,7 @@ static const char * const test_modes[] = {
>  struct mocs_entry {
>  	uint32_t	control_value;
>  	uint16_t	l3cc_value;
> +	uint8_t		used;
>  };
>  
>  struct mocs_table {
> @@ -73,37 +78,113 @@ struct mocs_table {
>  };
>  
>  /* The first entries in the MOCS tables are defined by uABI */
> -static const struct mocs_entry skylake_mocs_table[] = {
> -	{ 0x00000009, 0x0010 },
> -	{ 0x00000038, 0x0030 },
> -	{ 0x0000003b, 0x0030 },
> +static struct mocs_entry icelake_mocs_table[GEN11_NUM_MOCS_ENTRIES] = {
> +	[0]  = { 0x00000005, 0x0010, 0x1 },
> +	[1]  = { 0x00000004, 0x0030, 0x1 },
> +	[2]  = { 0x00000037, 0x0030, 0x1 },
> +	[3]  = { 0x00000005, 0x0010, 0x1 },
> +	[4]  = { 0x00000005, 0x0030, 0x1 },
> +	[5]  = { 0x00000037, 0x0010, 0x1 },
> +	[6]  = { 0x00000017, 0x0010, 0x1 },
> +	[7]  = { 0x00000017, 0x0030, 0x1 },
> +	[8]  = { 0x00000027, 0x0010, 0x1 },
> +	[9]  = { 0x00000027, 0x0030, 0x1 },
> +	[10] = { 0x00000077, 0x0010, 0x1 },
> +	[11] = { 0x00000077, 0x0030, 0x1 },
> +	[12] = { 0x00000057, 0x0010, 0x1 },
> +	[13] = { 0x00000057, 0x0030, 0x1 },
> +	[14] = { 0x00000067, 0x0010, 0x1 },
> +	[15] = { 0x00000067, 0x0030, 0x1 },
> +	[18] = { 0x00060037, 0x0030, 0x1 },
> +	[19] = { 0x00000737, 0x0030, 0x1 },
> +	[20] = { 0x00000337, 0x0030, 0x1 },
> +	[21] = { 0x00000137, 0x0030, 0x1 },
> +	[22] = { 0x000003b7, 0x0030, 0x1 },
> +	[23] = { 0x000007b7, 0x0030, 0x1 },
> +	[62] = { 0x00000037, 0x0010, 0x1 },
> +	[63] = { 0x00000037, 0x0010, 0x1 },
> +};
> +
> +static struct mocs_entry dirty_icelake_mocs_table[GEN11_NUM_MOCS_ENTRIES] = {
> +	[0]  = { 0x0007FFFF, 0x003F },
> +	[1]  = { 0x0007FFFF, 0x003F },
> +	[2]  = { 0x0007FFFF, 0x003F },
> +	[3]  = { 0x0007FFFF, 0x003F },
> +	[4]  = { 0x0007FFFF, 0x003F },
> +	[5]  = { 0x0007FFFF, 0x003F },
> +	[6]  = { 0x0007FFFF, 0x003F },
> +	[7]  = { 0x0007FFFF, 0x003F },
> +	[8]  = { 0x0007FFFF, 0x003F },
> +	[9]  = { 0x0007FFFF, 0x003F },
> +	[10] = { 0x0007FFFF, 0x003F },
> +	[11] = { 0x0007FFFF, 0x003F },
> +	[12] = { 0x0007FFFF, 0x003F },
> +	[13] = { 0x0007FFFF, 0x003F },
> +	[14] = { 0x0007FFFF, 0x003F },
> +	[15] = { 0x0007FFFF, 0x003F },
> +	[18] = { 0x0007FFFF, 0x003F },
> +	[19] = { 0x0007FFFF, 0x003F },
> +	[21] = { 0x0007FFFF, 0x003F },
> +	[22] = { 0x0007FFFF, 0x003F },
> +	[23] = { 0x0007FFFF, 0x003F },
> +	[62] = { 0x0007FFFF, 0x003F },
> +	[63] = { 0x0007FFFF, 0x003F },
>  };
>  
> -static const struct mocs_entry dirty_skylake_mocs_table[] = {
> -	{ 0x00003FFF, 0x003F }, /* no snoop bit */
> -	{ 0x00003FFF, 0x003F },
> -	{ 0x00003FFF, 0x003F },
> +static struct mocs_entry skylake_mocs_table[GEN9_NUM_MOCS_ENTRIES] = {
> +	{ 0x00000009, 0x0010, 0x1 },
> +	{ 0x00000038, 0x0030, 0x1 },
> +	{ 0x0000003b, 0x0030, 0x1 },
>  };
>  
> -static const struct mocs_entry broxton_mocs_table[] = {
> -	{ 0x00000009, 0x0010 },
> -	{ 0x00000038, 0x0030 },
> -	{ 0x00000039, 0x0030 },
> +static struct mocs_entry dirty_skylake_mocs_table[GEN9_NUM_MOCS_ENTRIES] = {
> +	{ 0x00003FFF, 0x003F, 0x1 }, /* no snoop bit */
> +	{ 0x00003FFF, 0x003F, 0x1 },
> +	{ 0x00003FFF, 0x003F, 0x1 },
>  };
>  
> -static const struct mocs_entry dirty_broxton_mocs_table[] = {
> -	{ 0x00007FFF, 0x003F },
> -	{ 0x00007FFF, 0x003F },
> -	{ 0x00007FFF, 0x003F },
> +static struct mocs_entry broxton_mocs_table[GEN9_NUM_MOCS_ENTRIES] = {
> +	{ 0x00000009, 0x0010, 0x1 },
> +	{ 0x00000038, 0x0030, 0x1 },
> +	{ 0x00000039, 0x0030, 0x1 },
>  };
>  
> -static const uint32_t write_values[] = {
> -	0xFFFFFFFF,
> -	0xFFFFFFFF,
> -	0xFFFFFFFF,
> -	0xFFFFFFFF
> +static struct mocs_entry dirty_broxton_mocs_table[GEN9_NUM_MOCS_ENTRIES] = {
> +	{ 0x00007FFF, 0x003F, 0x1 },
> +	{ 0x00007FFF, 0x003F, 0x1 },
> +	{ 0x00007FFF, 0x003F, 0x1 },
>  };
>  
> +static uint32_t write_values[MAX_NUMBER_MOCS_REGISTERS];
> +
> +static void set_mocs_settings(void)
> +{
> +	uint8_t index;
> +	/* Set un-used entries to PTE */
> +	for (index = 0; index < MAX_NUMBER_MOCS_REGISTERS; index++) {
> +		if (index < GEN9_NUM_MOCS_ENTRIES) {
> +			if (!skylake_mocs_table[index].used) {
> +				skylake_mocs_table[index]
> =  skylake_mocs_table[MOCS_PTE_INDEX];
> +				dirty_skylake_mocs_table[index]
> =  dirty_skylake_mocs_table[MOCS_PTE_INDEX];
> +			}
> +			if (!broxton_mocs_table[index].used) {
> +				broxton_mocs_table[index]
> =  broxton_mocs_table[MOCS_PTE_INDEX];
> +				dirty_broxton_mocs_table[index]
> =  dirty_broxton_mocs_table[MOCS_PTE_INDEX];
> +			}
> +			if (!icelake_mocs_table[index].used) {
> +				icelake_mocs_table[index]
> =  icelake_mocs_table[MOCS_PTE_INDEX];
> +				dirty_icelake_mocs_table[index]
> =  dirty_icelake_mocs_table[MOCS_PTE_INDEX];
> +			}
> +		} else { /*icelake has 64 entries */
> +			if (!icelake_mocs_table[index].used) {
> +				icelake_mocs_table[index]
> =  icelake_mocs_table[MOCS_PTE_INDEX];
> +				dirty_icelake_mocs_table[index]
> =  dirty_icelake_mocs_table[MOCS_PTE_INDEX];
> +			}
> +		}
> +	}
> +	memset((char *)write_values, 0xFF, MAX_NUMBER_MOCS_REGISTERS *
> sizeof(uint32_t));
> +}
> +
>  static bool get_mocs_settings(int fd, struct mocs_table *table, bool dirty)
>  {
>  	uint32_t devid = intel_get_drm_devid(fd);
> @@ -127,6 +208,15 @@ static bool get_mocs_settings(int fd, struct mocs_table
> *table, bool dirty)
>  			table->table = broxton_mocs_table;
>  		}
>  		result = true;
> +	} else if (IS_ICELAKE(devid)) {
> +		if (dirty) {
> +			table->size  = ARRAY_SIZE(dirty_icelake_mocs_table);
> +			table->table = dirty_icelake_mocs_table;
> +		} else {
> +			table->size  = ARRAY_SIZE(icelake_mocs_table);
> +			table->table = icelake_mocs_table;
> +		}
> +		result = true;
>  	}
>  
>  	return result;
> @@ -374,13 +464,21 @@ static void check_mocs_values(int fd, unsigned engine,
> uint32_t ctx_id, bool dir
>  
>  static void write_dirty_mocs(int fd, unsigned engine, uint32_t ctx_id)
>  {
> +	uint32_t devid = intel_get_drm_devid(fd);
> +	int num_of_mocs_entries;
> +
> +	if (IS_ICELAKE(devid))
> +		num_of_mocs_entries = GEN11_NUM_MOCS_ENTRIES;
> +	else
> +		num_of_mocs_entries = GEN9_NUM_MOCS_ENTRIES;
> +
>  	write_registers(fd, ctx_id, get_engine_base(engine),
> -			write_values, ARRAY_SIZE(write_values),
> +			write_values, num_of_mocs_entries,
>  			engine);
>  
>  	if (engine == I915_EXEC_RENDER)
>  		write_registers(fd, ctx_id, GEN9_LNCFCMOCS0,
> -				write_values, ARRAY_SIZE(write_values),
> +				write_values, num_of_mocs_entries/2,
>  				engine);
>  }
>  
> @@ -440,6 +538,7 @@ igt_main
>  		fd = drm_open_driver_master(DRIVER_INTEL); /* for SECURE */
>  		igt_require_gem(fd);
>  		gem_require_mocs_registers(fd);
> +		set_mocs_settings();
>  		igt_require(get_mocs_settings(fd, &table, false));
>  	}
>  
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* Re: [igt-dev] [PATCH i-g-t] i915/gem_mocs_settings: Add mocs table for icelake
  2019-02-15 21:46 [igt-dev] [PATCH i-g-t] i915/gem_mocs_settings: Add mocs table for icelake Prathap Kumar Valsan via igt-dev
                   ` (2 preceding siblings ...)
  2019-02-20  8:33 ` [igt-dev] [PATCH i-g-t] i915/gem_mocs_settings: Add mocs table for icelake Szwichtenberg, Radoslaw
@ 2019-02-21 22:48 ` Lucas De Marchi
  2019-02-21 23:42   ` Chris Wilson
  2019-02-22 14:05 ` [igt-dev] ✗ Fi.CI.BAT: failure for i915/gem_mocs_settings: Add mocs table for icelake (rev4) Patchwork
                   ` (16 subsequent siblings)
  20 siblings, 1 reply; 44+ messages in thread
From: Lucas De Marchi @ 2019-02-21 22:48 UTC (permalink / raw)
  To: Prathap Kumar Valsan; +Cc: Lucas De Marchi, igt-dev

On Fri, Feb 15, 2019 at 1:32 PM Prathap Kumar Valsan
<prathap.kumar.valsan@intel.com> wrote:
>
> From: "Kumar Valsan, Prathap" <prathap.kumar.valsan@intel.com>
>
> This patch adds mocs table for icelake with expected L3 and eDRAM
> control values.
>
> Signed-off-by: Kumar Valsan, Prathap <prathap.kumar.valsan@intel.com>
> ---
>  tests/i915/gem_mocs_settings.c | 145 +++++++++++++++++++++++++++------
>  1 file changed, 122 insertions(+), 23 deletions(-)
>
> diff --git a/tests/i915/gem_mocs_settings.c b/tests/i915/gem_mocs_settings.c
> index 5b3b6bc1..b84273a0 100644
> --- a/tests/i915/gem_mocs_settings.c
> +++ b/tests/i915/gem_mocs_settings.c
> @@ -33,6 +33,10 @@
>  #include "igt_sysfs.h"
>
>  #define MAX_NUMBER_MOCS_REGISTERS      (64)
> +#define GEN9_NUM_MOCS_ENTRIES   62  /* 62 out of 64 - 63 & 64 are reserved. */
> +#define GEN11_NUM_MOCS_ENTRIES  64  /* 63-64 are reserved, but configured. */
> +#define MOCS_PTE_INDEX         (0x1)
> +
>  enum {
>         NONE,
>         RESET,
> @@ -65,6 +69,7 @@ static const char * const test_modes[] = {
>  struct mocs_entry {
>         uint32_t        control_value;
>         uint16_t        l3cc_value;
> +       uint8_t         used;
>  };
>
>  struct mocs_table {
> @@ -73,37 +78,113 @@ struct mocs_table {
>  };
>
>  /* The first entries in the MOCS tables are defined by uABI */
> -static const struct mocs_entry skylake_mocs_table[] = {
> -       { 0x00000009, 0x0010 },
> -       { 0x00000038, 0x0030 },
> -       { 0x0000003b, 0x0030 },
> +static struct mocs_entry icelake_mocs_table[GEN11_NUM_MOCS_ENTRIES] = {
> +       [0]  = { 0x00000005, 0x0010, 0x1 },
> +       [1]  = { 0x00000004, 0x0030, 0x1 },
> +       [2]  = { 0x00000037, 0x0030, 0x1 },
> +       [3]  = { 0x00000005, 0x0010, 0x1 },
> +       [4]  = { 0x00000005, 0x0030, 0x1 },
> +       [5]  = { 0x00000037, 0x0010, 0x1 },
> +       [6]  = { 0x00000017, 0x0010, 0x1 },
> +       [7]  = { 0x00000017, 0x0030, 0x1 },
> +       [8]  = { 0x00000027, 0x0010, 0x1 },
> +       [9]  = { 0x00000027, 0x0030, 0x1 },
> +       [10] = { 0x00000077, 0x0010, 0x1 },
> +       [11] = { 0x00000077, 0x0030, 0x1 },
> +       [12] = { 0x00000057, 0x0010, 0x1 },
> +       [13] = { 0x00000057, 0x0030, 0x1 },
> +       [14] = { 0x00000067, 0x0010, 0x1 },
> +       [15] = { 0x00000067, 0x0030, 0x1 },
> +       [18] = { 0x00060037, 0x0030, 0x1 },
> +       [19] = { 0x00000737, 0x0030, 0x1 },
> +       [20] = { 0x00000337, 0x0030, 0x1 },
> +       [21] = { 0x00000137, 0x0030, 0x1 },
> +       [22] = { 0x000003b7, 0x0030, 0x1 },
> +       [23] = { 0x000007b7, 0x0030, 0x1 },
> +       [62] = { 0x00000037, 0x0010, 0x1 },
> +       [63] = { 0x00000037, 0x0010, 0x1 },
> +};
> +
> +static struct mocs_entry dirty_icelake_mocs_table[GEN11_NUM_MOCS_ENTRIES] = {
> +       [0]  = { 0x0007FFFF, 0x003F },
> +       [1]  = { 0x0007FFFF, 0x003F },
> +       [2]  = { 0x0007FFFF, 0x003F },
> +       [3]  = { 0x0007FFFF, 0x003F },
> +       [4]  = { 0x0007FFFF, 0x003F },
> +       [5]  = { 0x0007FFFF, 0x003F },
> +       [6]  = { 0x0007FFFF, 0x003F },
> +       [7]  = { 0x0007FFFF, 0x003F },
> +       [8]  = { 0x0007FFFF, 0x003F },
> +       [9]  = { 0x0007FFFF, 0x003F },
> +       [10] = { 0x0007FFFF, 0x003F },
> +       [11] = { 0x0007FFFF, 0x003F },
> +       [12] = { 0x0007FFFF, 0x003F },
> +       [13] = { 0x0007FFFF, 0x003F },
> +       [14] = { 0x0007FFFF, 0x003F },
> +       [15] = { 0x0007FFFF, 0x003F },
> +       [18] = { 0x0007FFFF, 0x003F },
> +       [19] = { 0x0007FFFF, 0x003F },
> +       [21] = { 0x0007FFFF, 0x003F },
> +       [22] = { 0x0007FFFF, 0x003F },
> +       [23] = { 0x0007FFFF, 0x003F },
> +       [62] = { 0x0007FFFF, 0x003F },
> +       [63] = { 0x0007FFFF, 0x003F },
>  };
>
> -static const struct mocs_entry dirty_skylake_mocs_table[] = {
> -       { 0x00003FFF, 0x003F }, /* no snoop bit */
> -       { 0x00003FFF, 0x003F },
> -       { 0x00003FFF, 0x003F },
> +static struct mocs_entry skylake_mocs_table[GEN9_NUM_MOCS_ENTRIES] = {
> +       { 0x00000009, 0x0010, 0x1 },
> +       { 0x00000038, 0x0030, 0x1 },
> +       { 0x0000003b, 0x0030, 0x1 },
>  };
>
> -static const struct mocs_entry broxton_mocs_table[] = {
> -       { 0x00000009, 0x0010 },
> -       { 0x00000038, 0x0030 },
> -       { 0x00000039, 0x0030 },
> +static struct mocs_entry dirty_skylake_mocs_table[GEN9_NUM_MOCS_ENTRIES] = {
> +       { 0x00003FFF, 0x003F, 0x1 }, /* no snoop bit */
> +       { 0x00003FFF, 0x003F, 0x1 },
> +       { 0x00003FFF, 0x003F, 0x1 },
>  };
>
> -static const struct mocs_entry dirty_broxton_mocs_table[] = {
> -       { 0x00007FFF, 0x003F },
> -       { 0x00007FFF, 0x003F },
> -       { 0x00007FFF, 0x003F },
> +static struct mocs_entry broxton_mocs_table[GEN9_NUM_MOCS_ENTRIES] = {
> +       { 0x00000009, 0x0010, 0x1 },
> +       { 0x00000038, 0x0030, 0x1 },
> +       { 0x00000039, 0x0030, 0x1 },
>  };
>
> -static const uint32_t write_values[] = {
> -       0xFFFFFFFF,
> -       0xFFFFFFFF,
> -       0xFFFFFFFF,
> -       0xFFFFFFFF
> +static struct mocs_entry dirty_broxton_mocs_table[GEN9_NUM_MOCS_ENTRIES] = {
> +       { 0x00007FFF, 0x003F, 0x1 },
> +       { 0x00007FFF, 0x003F, 0x1 },
> +       { 0x00007FFF, 0x003F, 0x1 },

These are all the same, why bother defining the array?

>  };
>
> +static uint32_t write_values[MAX_NUMBER_MOCS_REGISTERS];
> +
> +static void set_mocs_settings(void)
> +{
> +       uint8_t index;
> +       /* Set un-used entries to PTE */
> +       for (index = 0; index < MAX_NUMBER_MOCS_REGISTERS; index++) {

I think this is too verbose to fix the issue. IMO we should

a) continue with *const* tables
b) not have this function to modify the values

for that I think it's reasonable to have something like:

static const struct mocs_entry icelake_mocs_pte = { 0x00000004, 0x0030, 0x1 };
static struct mocs_entry icelake_mocs_table[GEN11_NUM_MOCS_ENTRIES] = {
       [0]  = { 0x00000005, 0x0010, 0x1 },
       [1]  = icelake_mocs_pte,
       [2]  = { 0x00000037, 0x0030, 0x1 },
...
       [20]  = icelake_mocs_pte,
...

So... you basically define all entries and don't need to overwrite the
values like you are doing.

Lucas De Marchi

> +               if (index < GEN9_NUM_MOCS_ENTRIES) {
> +                       if (!skylake_mocs_table[index].used) {
> +                               skylake_mocs_table[index] =  skylake_mocs_table[MOCS_PTE_INDEX];
> +                               dirty_skylake_mocs_table[index] =  dirty_skylake_mocs_table[MOCS_PTE_INDEX];
> +                       }
> +                       if (!broxton_mocs_table[index].used) {
> +                               broxton_mocs_table[index] =  broxton_mocs_table[MOCS_PTE_INDEX];
> +                               dirty_broxton_mocs_table[index] =  dirty_broxton_mocs_table[MOCS_PTE_INDEX];
> +                       }
> +                       if (!icelake_mocs_table[index].used) {
> +                               icelake_mocs_table[index] =  icelake_mocs_table[MOCS_PTE_INDEX];
> +                               dirty_icelake_mocs_table[index] =  dirty_icelake_mocs_table[MOCS_PTE_INDEX];
> +                       }
> +               } else { /*icelake has 64 entries */
> +                       if (!icelake_mocs_table[index].used) {
> +                               icelake_mocs_table[index] =  icelake_mocs_table[MOCS_PTE_INDEX];
> +                               dirty_icelake_mocs_table[index] =  dirty_icelake_mocs_table[MOCS_PTE_INDEX];
> +                       }
> +               }
> +       }
> +       memset((char *)write_values, 0xFF, MAX_NUMBER_MOCS_REGISTERS * sizeof(uint32_t));
> +}
> +
>  static bool get_mocs_settings(int fd, struct mocs_table *table, bool dirty)
>  {
>         uint32_t devid = intel_get_drm_devid(fd);
> @@ -127,6 +208,15 @@ static bool get_mocs_settings(int fd, struct mocs_table *table, bool dirty)
>                         table->table = broxton_mocs_table;
>                 }
>                 result = true;
> +       } else if (IS_ICELAKE(devid)) {
> +               if (dirty) {
> +                       table->size  = ARRAY_SIZE(dirty_icelake_mocs_table);
> +                       table->table = dirty_icelake_mocs_table;
> +               } else {
> +                       table->size  = ARRAY_SIZE(icelake_mocs_table);
> +                       table->table = icelake_mocs_table;
> +               }
> +               result = true;
>         }
>
>         return result;
> @@ -374,13 +464,21 @@ static void check_mocs_values(int fd, unsigned engine, uint32_t ctx_id, bool dir
>
>  static void write_dirty_mocs(int fd, unsigned engine, uint32_t ctx_id)
>  {
> +       uint32_t devid = intel_get_drm_devid(fd);
> +       int num_of_mocs_entries;
> +
> +       if (IS_ICELAKE(devid))
> +               num_of_mocs_entries = GEN11_NUM_MOCS_ENTRIES;
> +       else
> +               num_of_mocs_entries = GEN9_NUM_MOCS_ENTRIES;
> +
>         write_registers(fd, ctx_id, get_engine_base(engine),
> -                       write_values, ARRAY_SIZE(write_values),
> +                       write_values, num_of_mocs_entries,
>                         engine);
>
>         if (engine == I915_EXEC_RENDER)
>                 write_registers(fd, ctx_id, GEN9_LNCFCMOCS0,
> -                               write_values, ARRAY_SIZE(write_values),
> +                               write_values, num_of_mocs_entries/2,
>                                 engine);
>  }
>
> @@ -440,6 +538,7 @@ igt_main
>                 fd = drm_open_driver_master(DRIVER_INTEL); /* for SECURE */
>                 igt_require_gem(fd);
>                 gem_require_mocs_registers(fd);
> +               set_mocs_settings();
>                 igt_require(get_mocs_settings(fd, &table, false));
>         }
>
> --
> 2.20.1
>


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

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

* Re: [igt-dev] [PATCH i-g-t] i915/gem_mocs_settings: Add mocs table for icelake
  2019-02-21 22:48 ` Lucas De Marchi
@ 2019-02-21 23:42   ` Chris Wilson
  2019-02-22 17:49     ` Lucas De Marchi
  0 siblings, 1 reply; 44+ messages in thread
From: Chris Wilson @ 2019-02-21 23:42 UTC (permalink / raw)
  To: Lucas De Marchi, Prathap Kumar Valsan; +Cc: igt-dev, Lucas De Marchi

Quoting Lucas De Marchi (2019-02-21 22:48:45)
> static const struct mocs_entry icelake_mocs_pte = { 0x00000004, 0x0030, 0x1 };
> static struct mocs_entry icelake_mocs_table[GEN11_NUM_MOCS_ENTRIES] = {
>        [0]  = { 0x00000005, 0x0010, 0x1 },
>        [1]  = icelake_mocs_pte,
>        [2]  = { 0x00000037, 0x0030, 0x1 },
> ...
>        [20]  = icelake_mocs_pte,
> ...
> 
> So... you basically define all entries and don't need to overwrite the
> values like you are doing.

/* All unspecified entries default to following PTE */
[0 ... GEN11_NUM_MOCS_ENTRIES-1] = icelake_mocs_pte,

[0] = ...,
[2] = ...,

If I remember my syntax correctly,
-Chris
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] ✗ Fi.CI.BAT: failure for i915/gem_mocs_settings: Add mocs table for icelake (rev4)
  2019-02-15 21:46 [igt-dev] [PATCH i-g-t] i915/gem_mocs_settings: Add mocs table for icelake Prathap Kumar Valsan via igt-dev
                   ` (3 preceding siblings ...)
  2019-02-21 22:48 ` Lucas De Marchi
@ 2019-02-22 14:05 ` Patchwork
  2019-02-22 14:17 ` [igt-dev] [PATCH i-g-t v2] i915/gem_mocs_settings: Add mocs table for icelake Prathap Kumar Valsan
                   ` (15 subsequent siblings)
  20 siblings, 0 replies; 44+ messages in thread
From: Patchwork @ 2019-02-22 14:05 UTC (permalink / raw)
  To: igt-dev

== Series Details ==

Series: i915/gem_mocs_settings: Add mocs table for icelake (rev4)
URL   : https://patchwork.freedesktop.org/series/56459/
State : failure

== Summary ==

IGT patchset build failed on latest successful build
2b7dd10a4e2ea0cabff68421fd15e96c99be3cad i915/gem_eio: Not everyone actually has contexts!

../tests/i915/gem_mocs_settings.c:126:38: note: (near initialization for ‘broxton_mocs_table[37]’)
../tests/i915/gem_mocs_settings.c:126:38: error: initializer element is not constant
../tests/i915/gem_mocs_settings.c:126:38: note: (near initialization for ‘broxton_mocs_table[38]’)
../tests/i915/gem_mocs_settings.c:126:38: error: initializer element is not constant
../tests/i915/gem_mocs_settings.c:126:38: note: (near initialization for ‘broxton_mocs_table[39]’)
../tests/i915/gem_mocs_settings.c:126:38: error: initializer element is not constant
../tests/i915/gem_mocs_settings.c:126:38: note: (near initialization for ‘broxton_mocs_table[40]’)
../tests/i915/gem_mocs_settings.c:126:38: error: initializer element is not constant
../tests/i915/gem_mocs_settings.c:126:38: note: (near initialization for ‘broxton_mocs_table[41]’)
../tests/i915/gem_mocs_settings.c:126:38: error: initializer element is not constant
../tests/i915/gem_mocs_settings.c:126:38: note: (near initialization for ‘broxton_mocs_table[42]’)
../tests/i915/gem_mocs_settings.c:126:38: error: initializer element is not constant
../tests/i915/gem_mocs_settings.c:126:38: note: (near initialization for ‘broxton_mocs_table[43]’)
../tests/i915/gem_mocs_settings.c:126:38: error: initializer element is not constant
../tests/i915/gem_mocs_settings.c:126:38: note: (near initialization for ‘broxton_mocs_table[44]’)
../tests/i915/gem_mocs_settings.c:126:38: error: initializer element is not constant
../tests/i915/gem_mocs_settings.c:126:38: note: (near initialization for ‘broxton_mocs_table[45]’)
../tests/i915/gem_mocs_settings.c:126:38: error: initializer element is not constant
../tests/i915/gem_mocs_settings.c:126:38: note: (near initialization for ‘broxton_mocs_table[46]’)
../tests/i915/gem_mocs_settings.c:126:38: error: initializer element is not constant
../tests/i915/gem_mocs_settings.c:126:38: note: (near initialization for ‘broxton_mocs_table[47]’)
../tests/i915/gem_mocs_settings.c:126:38: error: initializer element is not constant
../tests/i915/gem_mocs_settings.c:126:38: note: (near initialization for ‘broxton_mocs_table[48]’)
../tests/i915/gem_mocs_settings.c:126:38: error: initializer element is not constant
../tests/i915/gem_mocs_settings.c:126:38: note: (near initialization for ‘broxton_mocs_table[49]’)
../tests/i915/gem_mocs_settings.c:126:38: error: initializer element is not constant
../tests/i915/gem_mocs_settings.c:126:38: note: (near initialization for ‘broxton_mocs_table[50]’)
../tests/i915/gem_mocs_settings.c:126:38: error: initializer element is not constant
../tests/i915/gem_mocs_settings.c:126:38: note: (near initialization for ‘broxton_mocs_table[51]’)
../tests/i915/gem_mocs_settings.c:126:38: error: initializer element is not constant
../tests/i915/gem_mocs_settings.c:126:38: note: (near initialization for ‘broxton_mocs_table[52]’)
../tests/i915/gem_mocs_settings.c:126:38: error: initializer element is not constant
../tests/i915/gem_mocs_settings.c:126:38: note: (near initialization for ‘broxton_mocs_table[53]’)
../tests/i915/gem_mocs_settings.c:126:38: error: initializer element is not constant
../tests/i915/gem_mocs_settings.c:126:38: note: (near initialization for ‘broxton_mocs_table[54]’)
../tests/i915/gem_mocs_settings.c:126:38: error: initializer element is not constant
../tests/i915/gem_mocs_settings.c:126:38: note: (near initialization for ‘broxton_mocs_table[55]’)
../tests/i915/gem_mocs_settings.c:126:38: error: initializer element is not constant
../tests/i915/gem_mocs_settings.c:126:38: note: (near initialization for ‘broxton_mocs_table[56]’)
../tests/i915/gem_mocs_settings.c:126:38: error: initializer element is not constant
../tests/i915/gem_mocs_settings.c:126:38: note: (near initialization for ‘broxton_mocs_table[57]’)
../tests/i915/gem_mocs_settings.c:126:38: error: initializer element is not constant
../tests/i915/gem_mocs_settings.c:126:38: note: (near initialization for ‘broxton_mocs_table[58]’)
../tests/i915/gem_mocs_settings.c:126:38: error: initializer element is not constant
../tests/i915/gem_mocs_settings.c:126:38: note: (near initialization for ‘broxton_mocs_table[59]’)
../tests/i915/gem_mocs_settings.c:126:38: error: initializer element is not constant
../tests/i915/gem_mocs_settings.c:126:38: note: (near initialization for ‘broxton_mocs_table[60]’)
../tests/i915/gem_mocs_settings.c:126:38: error: initializer element is not constant
../tests/i915/gem_mocs_settings.c:126:38: note: (near initialization for ‘broxton_mocs_table[61]’)
ninja: build stopped: subcommand failed.

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

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

* [igt-dev] [PATCH i-g-t v2] i915/gem_mocs_settings: Add mocs table for icelake
  2019-02-15 21:46 [igt-dev] [PATCH i-g-t] i915/gem_mocs_settings: Add mocs table for icelake Prathap Kumar Valsan via igt-dev
                   ` (4 preceding siblings ...)
  2019-02-22 14:05 ` [igt-dev] ✗ Fi.CI.BAT: failure for i915/gem_mocs_settings: Add mocs table for icelake (rev4) Patchwork
@ 2019-02-22 14:17 ` Prathap Kumar Valsan
  2019-02-22 15:17   ` Lis, Tomasz
  2019-02-22 21:16 ` [igt-dev] ✗ Fi.CI.BAT: failure for i915/gem_mocs_settings: Add mocs table for icelake (rev5) Patchwork
                   ` (14 subsequent siblings)
  20 siblings, 1 reply; 44+ messages in thread
From: Prathap Kumar Valsan @ 2019-02-22 14:17 UTC (permalink / raw)
  To: igt-dev; +Cc: Lucas De Marchi

From: "Kumar Valsan, Prathap" <prathap.kumar.valsan@intel.com>

This patch adds mocs table for icelake with expected L3 and eDRAM
control values.

Signed-off-by: Kumar Valsan, Prathap <prathap.kumar.valsan@intel.com>
---
Changes in v2:
- Cleaned up the code based on review comments from Lucas and Chris
 tests/i915/gem_mocs_settings.c | 96 ++++++++++++++++++++++++++--------
 1 file changed, 73 insertions(+), 23 deletions(-)

diff --git a/tests/i915/gem_mocs_settings.c b/tests/i915/gem_mocs_settings.c
index 5b3b6bc1..6d111076 100644
--- a/tests/i915/gem_mocs_settings.c
+++ b/tests/i915/gem_mocs_settings.c
@@ -33,6 +33,9 @@
 #include "igt_sysfs.h"
 
 #define MAX_NUMBER_MOCS_REGISTERS	(64)
+#define GEN9_NUM_MOCS_ENTRIES   62  /* 62 out of 64 - 63 & 64 are reserved. */
+#define GEN11_NUM_MOCS_ENTRIES  64  /* 63-64 are reserved, but configured. */
+
 enum {
 	NONE,
 	RESET,
@@ -72,36 +75,66 @@ struct mocs_table {
 	const struct mocs_entry	*table;
 };
 
+static const struct mocs_entry icelake_mocs_pte = {0x00000004, 0x0030};
+static const struct mocs_entry mocs_pte = {0x00000038, 0x0030};
+
 /* The first entries in the MOCS tables are defined by uABI */
-static const struct mocs_entry skylake_mocs_table[] = {
-	{ 0x00000009, 0x0010 },
-	{ 0x00000038, 0x0030 },
-	{ 0x0000003b, 0x0030 },
+static const struct mocs_entry icelake_mocs_table[GEN11_NUM_MOCS_ENTRIES] = {
+	[0 ... GEN11_NUM_MOCS_ENTRIES - 1] = icelake_mocs_pte,
+	[0]  = { 0x00000005, 0x0010},
+	[1]  = { 0x00000004, 0x0030},
+	[2]  = { 0x00000037, 0x0030},
+	[3]  = { 0x00000005, 0x0010},
+	[4]  = { 0x00000005, 0x0030},
+	[5]  = { 0x00000037, 0x0010},
+	[6]  = { 0x00000017, 0x0010},
+	[7]  = { 0x00000017, 0x0030},
+	[8]  = { 0x00000027, 0x0010},
+	[9]  = { 0x00000027, 0x0030},
+	[10] = { 0x00000077, 0x0010},
+	[11] = { 0x00000077, 0x0030},
+	[12] = { 0x00000057, 0x0010},
+	[13] = { 0x00000057, 0x0030},
+	[14] = { 0x00000067, 0x0010},
+	[15] = { 0x00000067, 0x0030},
+	[18] = { 0x00060037, 0x0030},
+	[19] = { 0x00000737, 0x0030},
+	[20] = { 0x00000337, 0x0030},
+	[21] = { 0x00000137, 0x0030},
+	[22] = { 0x000003b7, 0x0030},
+	[23] = { 0x000007b7, 0x0030},
+	[62] = { 0x00000037, 0x0010},
+	[63] = { 0x00000037, 0x0010},
+};
+
+static const struct mocs_entry dirty_icelake_mocs_table[GEN11_NUM_MOCS_ENTRIES] = {
+	[0 ... GEN11_NUM_MOCS_ENTRIES - 1] = { 0x0007FFFF, 0x003F },
 };
 
-static const struct mocs_entry dirty_skylake_mocs_table[] = {
-	{ 0x00003FFF, 0x003F }, /* no snoop bit */
-	{ 0x00003FFF, 0x003F },
-	{ 0x00003FFF, 0x003F },
+static const struct mocs_entry skylake_mocs_table[GEN9_NUM_MOCS_ENTRIES] = {
+	[0 ... GEN9_NUM_MOCS_ENTRIES - 1] = mocs_pte,
+	[0] = { 0x00000009, 0x0010},
+	[1] = { 0x00000038, 0x0030},
+	[2] = { 0x0000003b, 0x0030},
 };
 
-static const struct mocs_entry broxton_mocs_table[] = {
-	{ 0x00000009, 0x0010 },
-	{ 0x00000038, 0x0030 },
-	{ 0x00000039, 0x0030 },
+static const struct mocs_entry dirty_skylake_mocs_table[GEN9_NUM_MOCS_ENTRIES] = {
+	[0 ... GEN9_NUM_MOCS_ENTRIES - 1] = { 0x00003FFF, 0x003F },
 };
 
-static const struct mocs_entry dirty_broxton_mocs_table[] = {
-	{ 0x00007FFF, 0x003F },
-	{ 0x00007FFF, 0x003F },
-	{ 0x00007FFF, 0x003F },
+static const struct mocs_entry broxton_mocs_table[GEN9_NUM_MOCS_ENTRIES] = {
+	[0 ... GEN9_NUM_MOCS_ENTRIES - 1] = mocs_pte,
+	[0] = { 0x00000009, 0x0010},
+	[1] = { 0x00000038, 0x0030},
+	[2] = { 0x00000039, 0x0030},
 };
 
-static const uint32_t write_values[] = {
-	0xFFFFFFFF,
-	0xFFFFFFFF,
-	0xFFFFFFFF,
-	0xFFFFFFFF
+static const struct mocs_entry dirty_broxton_mocs_table[GEN9_NUM_MOCS_ENTRIES] = {
+	[0 ... GEN9_NUM_MOCS_ENTRIES - 1] = { 0x00007FFF, 0x003F },
+};
+
+static const uint32_t write_values[MAX_NUMBER_MOCS_REGISTERS] = {
+	[0 ... MAX_NUMBER_MOCS_REGISTERS - 1] = 0xFFFFFFFF,
 };
 
 static bool get_mocs_settings(int fd, struct mocs_table *table, bool dirty)
@@ -127,6 +160,15 @@ static bool get_mocs_settings(int fd, struct mocs_table *table, bool dirty)
 			table->table = broxton_mocs_table;
 		}
 		result = true;
+	} else if (IS_ICELAKE(devid)) {
+		if (dirty) {
+			table->size  = ARRAY_SIZE(dirty_icelake_mocs_table);
+			table->table = dirty_icelake_mocs_table;
+		} else {
+			table->size  = ARRAY_SIZE(icelake_mocs_table);
+			table->table = icelake_mocs_table;
+		}
+		result = true;
 	}
 
 	return result;
@@ -374,13 +416,21 @@ static void check_mocs_values(int fd, unsigned engine, uint32_t ctx_id, bool dir
 
 static void write_dirty_mocs(int fd, unsigned engine, uint32_t ctx_id)
 {
+	uint32_t devid = intel_get_drm_devid(fd);
+	int num_of_mocs_entries;
+
+	if (IS_ICELAKE(devid))
+		num_of_mocs_entries = GEN11_NUM_MOCS_ENTRIES;
+	else
+		num_of_mocs_entries = GEN9_NUM_MOCS_ENTRIES;
+
 	write_registers(fd, ctx_id, get_engine_base(engine),
-			write_values, ARRAY_SIZE(write_values),
+			write_values, num_of_mocs_entries,
 			engine);
 
 	if (engine == I915_EXEC_RENDER)
 		write_registers(fd, ctx_id, GEN9_LNCFCMOCS0,
-				write_values, ARRAY_SIZE(write_values),
+				write_values, num_of_mocs_entries/2,
 				engine);
 }
 
-- 
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] 44+ messages in thread

* Re: [igt-dev] [PATCH i-g-t v2] i915/gem_mocs_settings: Add mocs table for icelake
  2019-02-22 14:17 ` [igt-dev] [PATCH i-g-t v2] i915/gem_mocs_settings: Add mocs table for icelake Prathap Kumar Valsan
@ 2019-02-22 15:17   ` Lis, Tomasz
  2019-02-22 15:21     ` Chris Wilson
  2019-02-25  0:26     ` Kumar Valsan, Prathap
  0 siblings, 2 replies; 44+ messages in thread
From: Lis, Tomasz @ 2019-02-22 15:17 UTC (permalink / raw)
  To: Prathap Kumar Valsan, igt-dev; +Cc: Lucas De Marchi



On 2019-02-22 15:17, Prathap Kumar Valsan wrote:
> From: "Kumar Valsan, Prathap" <prathap.kumar.valsan@intel.com>
>
> This patch adds mocs table for icelake with expected L3 and eDRAM
> control values.
>
> Signed-off-by: Kumar Valsan, Prathap <prathap.kumar.valsan@intel.com>
> ---
> Changes in v2:
> - Cleaned up the code based on review comments from Lucas and Chris
>   tests/i915/gem_mocs_settings.c | 96 ++++++++++++++++++++++++++--------
>   1 file changed, 73 insertions(+), 23 deletions(-)
>
> diff --git a/tests/i915/gem_mocs_settings.c b/tests/i915/gem_mocs_settings.c
> index 5b3b6bc1..6d111076 100644
> --- a/tests/i915/gem_mocs_settings.c
> +++ b/tests/i915/gem_mocs_settings.c
> @@ -33,6 +33,9 @@
>   #include "igt_sysfs.h"
>   
>   #define MAX_NUMBER_MOCS_REGISTERS	(64)
> +#define GEN9_NUM_MOCS_ENTRIES   62  /* 62 out of 64 - 63 & 64 are reserved. */
> +#define GEN11_NUM_MOCS_ENTRIES  64  /* 63-64 are reserved, but configured. */
> +
>   enum {
>   	NONE,
>   	RESET,
> @@ -72,36 +75,66 @@ struct mocs_table {
>   	const struct mocs_entry	*table;
>   };
>   
> +static const struct mocs_entry icelake_mocs_pte = {0x00000004, 0x0030};
> +static const struct mocs_entry mocs_pte = {0x00000038, 0x0030};
> +
>   /* The first entries in the MOCS tables are defined by uABI */
> -static const struct mocs_entry skylake_mocs_table[] = {
> -	{ 0x00000009, 0x0010 },
> -	{ 0x00000038, 0x0030 },
> -	{ 0x0000003b, 0x0030 },
> +static const struct mocs_entry icelake_mocs_table[GEN11_NUM_MOCS_ENTRIES] = {
> +	[0 ... GEN11_NUM_MOCS_ENTRIES - 1] = icelake_mocs_pte,
> +	[0]  = { 0x00000005, 0x0010},
> +	[1]  = { 0x00000004, 0x0030},
> +	[2]  = { 0x00000037, 0x0030},
> +	[3]  = { 0x00000005, 0x0010},
> +	[4]  = { 0x00000005, 0x0030},
> +	[5]  = { 0x00000037, 0x0010},
> +	[6]  = { 0x00000017, 0x0010},
> +	[7]  = { 0x00000017, 0x0030},
> +	[8]  = { 0x00000027, 0x0010},
> +	[9]  = { 0x00000027, 0x0030},
> +	[10] = { 0x00000077, 0x0010},
> +	[11] = { 0x00000077, 0x0030},
> +	[12] = { 0x00000057, 0x0010},
> +	[13] = { 0x00000057, 0x0030},
> +	[14] = { 0x00000067, 0x0010},
> +	[15] = { 0x00000067, 0x0030},
> +	[18] = { 0x00060037, 0x0030},
> +	[19] = { 0x00000737, 0x0030},
> +	[20] = { 0x00000337, 0x0030},
> +	[21] = { 0x00000137, 0x0030},
> +	[22] = { 0x000003b7, 0x0030},
> +	[23] = { 0x000007b7, 0x0030},
> +	[62] = { 0x00000037, 0x0010},
> +	[63] = { 0x00000037, 0x0010},
> +};
> +
> +static const struct mocs_entry dirty_icelake_mocs_table[GEN11_NUM_MOCS_ENTRIES] = {
> +	[0 ... GEN11_NUM_MOCS_ENTRIES - 1] = { 0x0007FFFF, 0x003F },
>   };
>   
> -static const struct mocs_entry dirty_skylake_mocs_table[] = {
> -	{ 0x00003FFF, 0x003F }, /* no snoop bit */
> -	{ 0x00003FFF, 0x003F },
> -	{ 0x00003FFF, 0x003F },
> +static const struct mocs_entry skylake_mocs_table[GEN9_NUM_MOCS_ENTRIES] = {
> +	[0 ... GEN9_NUM_MOCS_ENTRIES - 1] = mocs_pte,
> +	[0] = { 0x00000009, 0x0010},
> +	[1] = { 0x00000038, 0x0030},
> +	[2] = { 0x0000003b, 0x0030},
>   };
>   
> -static const struct mocs_entry broxton_mocs_table[] = {
> -	{ 0x00000009, 0x0010 },
> -	{ 0x00000038, 0x0030 },
> -	{ 0x00000039, 0x0030 },
> +static const struct mocs_entry dirty_skylake_mocs_table[GEN9_NUM_MOCS_ENTRIES] = {
> +	[0 ... GEN9_NUM_MOCS_ENTRIES - 1] = { 0x00003FFF, 0x003F },
>   };
>   
> -static const struct mocs_entry dirty_broxton_mocs_table[] = {
> -	{ 0x00007FFF, 0x003F },
> -	{ 0x00007FFF, 0x003F },
> -	{ 0x00007FFF, 0x003F },
> +static const struct mocs_entry broxton_mocs_table[GEN9_NUM_MOCS_ENTRIES] = {
> +	[0 ... GEN9_NUM_MOCS_ENTRIES - 1] = mocs_pte,
> +	[0] = { 0x00000009, 0x0010},
> +	[1] = { 0x00000038, 0x0030},
> +	[2] = { 0x00000039, 0x0030},
>   };
>   
> -static const uint32_t write_values[] = {
> -	0xFFFFFFFF,
> -	0xFFFFFFFF,
> -	0xFFFFFFFF,
> -	0xFFFFFFFF
> +static const struct mocs_entry dirty_broxton_mocs_table[GEN9_NUM_MOCS_ENTRIES] = {
> +	[0 ... GEN9_NUM_MOCS_ENTRIES - 1] = { 0x00007FFF, 0x003F },
> +};
> +
> +static const uint32_t write_values[MAX_NUMBER_MOCS_REGISTERS] = {
> +	[0 ... MAX_NUMBER_MOCS_REGISTERS - 1] = 0xFFFFFFFF,
>   };
>   
>   static bool get_mocs_settings(int fd, struct mocs_table *table, bool dirty)
> @@ -127,6 +160,15 @@ static bool get_mocs_settings(int fd, struct mocs_table *table, bool dirty)
>   			table->table = broxton_mocs_table;
>   		}
>   		result = true;
> +	} else if (IS_ICELAKE(devid)) {
> +		if (dirty) {
> +			table->size  = ARRAY_SIZE(dirty_icelake_mocs_table);
> +			table->table = dirty_icelake_mocs_table;
> +		} else {
> +			table->size  = ARRAY_SIZE(icelake_mocs_table);
> +			table->table = icelake_mocs_table;
> +		}
> +		result = true;
>   	}
>   
>   	return result;
> @@ -374,13 +416,21 @@ static void check_mocs_values(int fd, unsigned engine, uint32_t ctx_id, bool dir
>   
>   static void write_dirty_mocs(int fd, unsigned engine, uint32_t ctx_id)
>   {
> +	uint32_t devid = intel_get_drm_devid(fd);
> +	int num_of_mocs_entries;
> +
> +	if (IS_ICELAKE(devid))
> +		num_of_mocs_entries = GEN11_NUM_MOCS_ENTRIES;
> +	else
> +		num_of_mocs_entries = GEN9_NUM_MOCS_ENTRIES;
> +
>   	write_registers(fd, ctx_id, get_engine_base(engine),
> -			write_values, ARRAY_SIZE(write_values),
> +			write_values, num_of_mocs_entries,
>   			engine);
>   
>   	if (engine == I915_EXEC_RENDER)
>   		write_registers(fd, ctx_id, GEN9_LNCFCMOCS0,
> -				write_values, ARRAY_SIZE(write_values),
> +				write_values, num_of_mocs_entries/2,
>   				engine);
>   }
>   
The "-dirty" subcase of the test doesn't seem suitable to current hardware..

The table is now global. So writing it from one context and checking if 
another context is unaffected is bound to fail.

Shouldn't the test for gen11+ be restricted to reading the values and 
checking whether they match pre-defined array?
(we may still do a test if everything is fine after reset/suspend, that 
won't hurt)
And if we are writing dirty values, shouldn't there be a restoration to 
original values afterwards?

-Tomasz

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

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

* Re: [igt-dev] [PATCH i-g-t v2] i915/gem_mocs_settings: Add mocs table for icelake
  2019-02-22 15:17   ` Lis, Tomasz
@ 2019-02-22 15:21     ` Chris Wilson
  2019-02-22 21:32       ` Kumar Valsan, Prathap
  2019-02-25  0:26     ` Kumar Valsan, Prathap
  1 sibling, 1 reply; 44+ messages in thread
From: Chris Wilson @ 2019-02-22 15:21 UTC (permalink / raw)
  To: Lis, Tomasz, Prathap Kumar Valsan, igt-dev; +Cc: Lucas De Marchi

Quoting Lis, Tomasz (2019-02-22 15:17:34)
> 
> 
> On 2019-02-22 15:17, Prathap Kumar Valsan wrote:
> > From: "Kumar Valsan, Prathap" <prathap.kumar.valsan@intel.com>
> >
> > This patch adds mocs table for icelake with expected L3 and eDRAM
> > control values.
> >
> > Signed-off-by: Kumar Valsan, Prathap <prathap.kumar.valsan@intel.com>
> > ---
> > Changes in v2:
> > - Cleaned up the code based on review comments from Lucas and Chris
> >   tests/i915/gem_mocs_settings.c | 96 ++++++++++++++++++++++++++--------
> >   1 file changed, 73 insertions(+), 23 deletions(-)
> >
> > diff --git a/tests/i915/gem_mocs_settings.c b/tests/i915/gem_mocs_settings.c
> > index 5b3b6bc1..6d111076 100644
> > --- a/tests/i915/gem_mocs_settings.c
> > +++ b/tests/i915/gem_mocs_settings.c
> > @@ -33,6 +33,9 @@
> >   #include "igt_sysfs.h"
> >   
> >   #define MAX_NUMBER_MOCS_REGISTERS   (64)
> > +#define GEN9_NUM_MOCS_ENTRIES   62  /* 62 out of 64 - 63 & 64 are reserved. */
> > +#define GEN11_NUM_MOCS_ENTRIES  64  /* 63-64 are reserved, but configured. */
> > +
> >   enum {
> >       NONE,
> >       RESET,
> > @@ -72,36 +75,66 @@ struct mocs_table {
> >       const struct mocs_entry *table;
> >   };
> >   
> > +static const struct mocs_entry icelake_mocs_pte = {0x00000004, 0x0030};
> > +static const struct mocs_entry mocs_pte = {0x00000038, 0x0030};
> > +
> >   /* The first entries in the MOCS tables are defined by uABI */
> > -static const struct mocs_entry skylake_mocs_table[] = {
> > -     { 0x00000009, 0x0010 },
> > -     { 0x00000038, 0x0030 },
> > -     { 0x0000003b, 0x0030 },
> > +static const struct mocs_entry icelake_mocs_table[GEN11_NUM_MOCS_ENTRIES] = {
> > +     [0 ... GEN11_NUM_MOCS_ENTRIES - 1] = icelake_mocs_pte,
> > +     [0]  = { 0x00000005, 0x0010},
> > +     [1]  = { 0x00000004, 0x0030},
> > +     [2]  = { 0x00000037, 0x0030},
> > +     [3]  = { 0x00000005, 0x0010},
> > +     [4]  = { 0x00000005, 0x0030},
> > +     [5]  = { 0x00000037, 0x0010},
> > +     [6]  = { 0x00000017, 0x0010},
> > +     [7]  = { 0x00000017, 0x0030},
> > +     [8]  = { 0x00000027, 0x0010},
> > +     [9]  = { 0x00000027, 0x0030},
> > +     [10] = { 0x00000077, 0x0010},
> > +     [11] = { 0x00000077, 0x0030},
> > +     [12] = { 0x00000057, 0x0010},
> > +     [13] = { 0x00000057, 0x0030},
> > +     [14] = { 0x00000067, 0x0010},
> > +     [15] = { 0x00000067, 0x0030},
> > +     [18] = { 0x00060037, 0x0030},
> > +     [19] = { 0x00000737, 0x0030},
> > +     [20] = { 0x00000337, 0x0030},
> > +     [21] = { 0x00000137, 0x0030},
> > +     [22] = { 0x000003b7, 0x0030},
> > +     [23] = { 0x000007b7, 0x0030},
> > +     [62] = { 0x00000037, 0x0010},
> > +     [63] = { 0x00000037, 0x0010},
> > +};
> > +
> > +static const struct mocs_entry dirty_icelake_mocs_table[GEN11_NUM_MOCS_ENTRIES] = {
> > +     [0 ... GEN11_NUM_MOCS_ENTRIES - 1] = { 0x0007FFFF, 0x003F },
> >   };
> >   
> > -static const struct mocs_entry dirty_skylake_mocs_table[] = {
> > -     { 0x00003FFF, 0x003F }, /* no snoop bit */
> > -     { 0x00003FFF, 0x003F },
> > -     { 0x00003FFF, 0x003F },
> > +static const struct mocs_entry skylake_mocs_table[GEN9_NUM_MOCS_ENTRIES] = {
> > +     [0 ... GEN9_NUM_MOCS_ENTRIES - 1] = mocs_pte,
> > +     [0] = { 0x00000009, 0x0010},
> > +     [1] = { 0x00000038, 0x0030},
> > +     [2] = { 0x0000003b, 0x0030},
> >   };
> >   
> > -static const struct mocs_entry broxton_mocs_table[] = {
> > -     { 0x00000009, 0x0010 },
> > -     { 0x00000038, 0x0030 },
> > -     { 0x00000039, 0x0030 },
> > +static const struct mocs_entry dirty_skylake_mocs_table[GEN9_NUM_MOCS_ENTRIES] = {
> > +     [0 ... GEN9_NUM_MOCS_ENTRIES - 1] = { 0x00003FFF, 0x003F },
> >   };
> >   
> > -static const struct mocs_entry dirty_broxton_mocs_table[] = {
> > -     { 0x00007FFF, 0x003F },
> > -     { 0x00007FFF, 0x003F },
> > -     { 0x00007FFF, 0x003F },
> > +static const struct mocs_entry broxton_mocs_table[GEN9_NUM_MOCS_ENTRIES] = {
> > +     [0 ... GEN9_NUM_MOCS_ENTRIES - 1] = mocs_pte,
> > +     [0] = { 0x00000009, 0x0010},
> > +     [1] = { 0x00000038, 0x0030},
> > +     [2] = { 0x00000039, 0x0030},
> >   };
> >   
> > -static const uint32_t write_values[] = {
> > -     0xFFFFFFFF,
> > -     0xFFFFFFFF,
> > -     0xFFFFFFFF,
> > -     0xFFFFFFFF
> > +static const struct mocs_entry dirty_broxton_mocs_table[GEN9_NUM_MOCS_ENTRIES] = {
> > +     [0 ... GEN9_NUM_MOCS_ENTRIES - 1] = { 0x00007FFF, 0x003F },
> > +};
> > +
> > +static const uint32_t write_values[MAX_NUMBER_MOCS_REGISTERS] = {
> > +     [0 ... MAX_NUMBER_MOCS_REGISTERS - 1] = 0xFFFFFFFF,
> >   };
> >   
> >   static bool get_mocs_settings(int fd, struct mocs_table *table, bool dirty)
> > @@ -127,6 +160,15 @@ static bool get_mocs_settings(int fd, struct mocs_table *table, bool dirty)
> >                       table->table = broxton_mocs_table;
> >               }
> >               result = true;
> > +     } else if (IS_ICELAKE(devid)) {
> > +             if (dirty) {
> > +                     table->size  = ARRAY_SIZE(dirty_icelake_mocs_table);
> > +                     table->table = dirty_icelake_mocs_table;
> > +             } else {
> > +                     table->size  = ARRAY_SIZE(icelake_mocs_table);
> > +                     table->table = icelake_mocs_table;
> > +             }
> > +             result = true;
> >       }
> >   
> >       return result;
> > @@ -374,13 +416,21 @@ static void check_mocs_values(int fd, unsigned engine, uint32_t ctx_id, bool dir
> >   
> >   static void write_dirty_mocs(int fd, unsigned engine, uint32_t ctx_id)
> >   {
> > +     uint32_t devid = intel_get_drm_devid(fd);
> > +     int num_of_mocs_entries;
> > +
> > +     if (IS_ICELAKE(devid))
> > +             num_of_mocs_entries = GEN11_NUM_MOCS_ENTRIES;
> > +     else
> > +             num_of_mocs_entries = GEN9_NUM_MOCS_ENTRIES;
> > +
> >       write_registers(fd, ctx_id, get_engine_base(engine),
> > -                     write_values, ARRAY_SIZE(write_values),
> > +                     write_values, num_of_mocs_entries,
> >                       engine);
> >   
> >       if (engine == I915_EXEC_RENDER)
> >               write_registers(fd, ctx_id, GEN9_LNCFCMOCS0,
> > -                             write_values, ARRAY_SIZE(write_values),
> > +                             write_values, num_of_mocs_entries/2,
> >                               engine);
> >   }
> >   
> The "-dirty" subcase of the test doesn't seem suitable to current hardware..
> 
> The table is now global. So writing it from one context and checking if 
> another context is unaffected is bound to fail.

We shouldn't be able to do nonpriv writes to it then. Hopefully those
writes are already being dropped?
-Chris
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* Re: [igt-dev] [PATCH i-g-t] i915/gem_mocs_settings: Add mocs table for icelake
  2019-02-21 23:42   ` Chris Wilson
@ 2019-02-22 17:49     ` Lucas De Marchi
  0 siblings, 0 replies; 44+ messages in thread
From: Lucas De Marchi @ 2019-02-22 17:49 UTC (permalink / raw)
  To: Chris Wilson; +Cc: igt-dev

On Thu, Feb 21, 2019 at 11:42:02PM +0000, Chris Wilson wrote:
>Quoting Lucas De Marchi (2019-02-21 22:48:45)
>> static const struct mocs_entry icelake_mocs_pte = { 0x00000004, 0x0030, 0x1 };
>> static struct mocs_entry icelake_mocs_table[GEN11_NUM_MOCS_ENTRIES] = {
>>        [0]  = { 0x00000005, 0x0010, 0x1 },
>>        [1]  = icelake_mocs_pte,
>>        [2]  = { 0x00000037, 0x0030, 0x1 },
>> ...
>>        [20]  = icelake_mocs_pte,
>> ...
>>
>> So... you basically define all entries and don't need to overwrite the
>> values like you are doing.
>
>/* All unspecified entries default to following PTE */
>[0 ... GEN11_NUM_MOCS_ENTRIES-1] = icelake_mocs_pte,
>
>[0] = ...,
>[2] = ...,
>
>If I remember my syntax correctly,

yep, but just remember there are holes of unspecified entries, so you
need to do this in the middle of the array by supplying the correct
index, not the number of entries.

Lucas De Marchi

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

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

* [igt-dev] ✗ Fi.CI.BAT: failure for i915/gem_mocs_settings: Add mocs table for icelake (rev5)
  2019-02-15 21:46 [igt-dev] [PATCH i-g-t] i915/gem_mocs_settings: Add mocs table for icelake Prathap Kumar Valsan via igt-dev
                   ` (5 preceding siblings ...)
  2019-02-22 14:17 ` [igt-dev] [PATCH i-g-t v2] i915/gem_mocs_settings: Add mocs table for icelake Prathap Kumar Valsan
@ 2019-02-22 21:16 ` Patchwork
  2019-02-22 21:20 ` [igt-dev] [PATCH i-g-t v3] i915/gem_mocs_settings: Add mocs table for icelake Prathap Kumar Valsan
                   ` (13 subsequent siblings)
  20 siblings, 0 replies; 44+ messages in thread
From: Patchwork @ 2019-02-22 21:16 UTC (permalink / raw)
  To: igt-dev

== Series Details ==

Series: i915/gem_mocs_settings: Add mocs table for icelake (rev5)
URL   : https://patchwork.freedesktop.org/series/56459/
State : failure

== Summary ==

IGT patchset build failed on latest successful build
8afdfd8fa9ce17043d9105dedca46ad4555fdcdb tests/prime_self_import: Swap gtt mapping for cpu

../tests/i915/gem_mocs_settings.c:131:38: note: (near initialization for ‘broxton_mocs_table[37]’)
../tests/i915/gem_mocs_settings.c:131:38: error: initializer element is not constant
../tests/i915/gem_mocs_settings.c:131:38: note: (near initialization for ‘broxton_mocs_table[38]’)
../tests/i915/gem_mocs_settings.c:131:38: error: initializer element is not constant
../tests/i915/gem_mocs_settings.c:131:38: note: (near initialization for ‘broxton_mocs_table[39]’)
../tests/i915/gem_mocs_settings.c:131:38: error: initializer element is not constant
../tests/i915/gem_mocs_settings.c:131:38: note: (near initialization for ‘broxton_mocs_table[40]’)
../tests/i915/gem_mocs_settings.c:131:38: error: initializer element is not constant
../tests/i915/gem_mocs_settings.c:131:38: note: (near initialization for ‘broxton_mocs_table[41]’)
../tests/i915/gem_mocs_settings.c:131:38: error: initializer element is not constant
../tests/i915/gem_mocs_settings.c:131:38: note: (near initialization for ‘broxton_mocs_table[42]’)
../tests/i915/gem_mocs_settings.c:131:38: error: initializer element is not constant
../tests/i915/gem_mocs_settings.c:131:38: note: (near initialization for ‘broxton_mocs_table[43]’)
../tests/i915/gem_mocs_settings.c:131:38: error: initializer element is not constant
../tests/i915/gem_mocs_settings.c:131:38: note: (near initialization for ‘broxton_mocs_table[44]’)
../tests/i915/gem_mocs_settings.c:131:38: error: initializer element is not constant
../tests/i915/gem_mocs_settings.c:131:38: note: (near initialization for ‘broxton_mocs_table[45]’)
../tests/i915/gem_mocs_settings.c:131:38: error: initializer element is not constant
../tests/i915/gem_mocs_settings.c:131:38: note: (near initialization for ‘broxton_mocs_table[46]’)
../tests/i915/gem_mocs_settings.c:131:38: error: initializer element is not constant
../tests/i915/gem_mocs_settings.c:131:38: note: (near initialization for ‘broxton_mocs_table[47]’)
../tests/i915/gem_mocs_settings.c:131:38: error: initializer element is not constant
../tests/i915/gem_mocs_settings.c:131:38: note: (near initialization for ‘broxton_mocs_table[48]’)
../tests/i915/gem_mocs_settings.c:131:38: error: initializer element is not constant
../tests/i915/gem_mocs_settings.c:131:38: note: (near initialization for ‘broxton_mocs_table[49]’)
../tests/i915/gem_mocs_settings.c:131:38: error: initializer element is not constant
../tests/i915/gem_mocs_settings.c:131:38: note: (near initialization for ‘broxton_mocs_table[50]’)
../tests/i915/gem_mocs_settings.c:131:38: error: initializer element is not constant
../tests/i915/gem_mocs_settings.c:131:38: note: (near initialization for ‘broxton_mocs_table[51]’)
../tests/i915/gem_mocs_settings.c:131:38: error: initializer element is not constant
../tests/i915/gem_mocs_settings.c:131:38: note: (near initialization for ‘broxton_mocs_table[52]’)
../tests/i915/gem_mocs_settings.c:131:38: error: initializer element is not constant
../tests/i915/gem_mocs_settings.c:131:38: note: (near initialization for ‘broxton_mocs_table[53]’)
../tests/i915/gem_mocs_settings.c:131:38: error: initializer element is not constant
../tests/i915/gem_mocs_settings.c:131:38: note: (near initialization for ‘broxton_mocs_table[54]’)
../tests/i915/gem_mocs_settings.c:131:38: error: initializer element is not constant
../tests/i915/gem_mocs_settings.c:131:38: note: (near initialization for ‘broxton_mocs_table[55]’)
../tests/i915/gem_mocs_settings.c:131:38: error: initializer element is not constant
../tests/i915/gem_mocs_settings.c:131:38: note: (near initialization for ‘broxton_mocs_table[56]’)
../tests/i915/gem_mocs_settings.c:131:38: error: initializer element is not constant
../tests/i915/gem_mocs_settings.c:131:38: note: (near initialization for ‘broxton_mocs_table[57]’)
../tests/i915/gem_mocs_settings.c:131:38: error: initializer element is not constant
../tests/i915/gem_mocs_settings.c:131:38: note: (near initialization for ‘broxton_mocs_table[58]’)
../tests/i915/gem_mocs_settings.c:131:38: error: initializer element is not constant
../tests/i915/gem_mocs_settings.c:131:38: note: (near initialization for ‘broxton_mocs_table[59]’)
../tests/i915/gem_mocs_settings.c:131:38: error: initializer element is not constant
../tests/i915/gem_mocs_settings.c:131:38: note: (near initialization for ‘broxton_mocs_table[60]’)
../tests/i915/gem_mocs_settings.c:131:38: error: initializer element is not constant
../tests/i915/gem_mocs_settings.c:131:38: note: (near initialization for ‘broxton_mocs_table[61]’)
ninja: build stopped: subcommand failed.

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

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

* [igt-dev] [PATCH i-g-t v3] i915/gem_mocs_settings: Add mocs table for icelake
  2019-02-15 21:46 [igt-dev] [PATCH i-g-t] i915/gem_mocs_settings: Add mocs table for icelake Prathap Kumar Valsan via igt-dev
                   ` (6 preceding siblings ...)
  2019-02-22 21:16 ` [igt-dev] ✗ Fi.CI.BAT: failure for i915/gem_mocs_settings: Add mocs table for icelake (rev5) Patchwork
@ 2019-02-22 21:20 ` Prathap Kumar Valsan
  2019-03-04 20:27 ` [igt-dev] [PATCH i-g-t v4] " Prathap Kumar Valsan
                   ` (12 subsequent siblings)
  20 siblings, 0 replies; 44+ messages in thread
From: Prathap Kumar Valsan @ 2019-02-22 21:20 UTC (permalink / raw)
  To: igt-dev; +Cc: Lucas De Marchi

From: "Kumar Valsan, Prathap" <prathap.kumar.valsan@intel.com>

This patch adds mocs table for icelake with expected L3 and eDRAM
control values.

Signed-off-by: Kumar Valsan, Prathap <prathap.kumar.valsan@intel.com>
---
Changes in v3:
- There are holes in the mocs table(Lucas Pointed out).
  In icelake index 16 and 17 are reserved.
  So test shouldn't be checking them.
Changes in v2:
- Cleaned up the code based on review
  comments from Lucas and Chris

 tests/i915/gem_mocs_settings.c | 115 +++++++++++++++++++++++++--------
 1 file changed, 87 insertions(+), 28 deletions(-)

diff --git a/tests/i915/gem_mocs_settings.c b/tests/i915/gem_mocs_settings.c
index 5b3b6bc1..22944014 100644
--- a/tests/i915/gem_mocs_settings.c
+++ b/tests/i915/gem_mocs_settings.c
@@ -33,6 +33,9 @@
 #include "igt_sysfs.h"
 
 #define MAX_NUMBER_MOCS_REGISTERS	(64)
+#define GEN9_NUM_MOCS_ENTRIES   62  /* 62 out of 64 - 63 & 64 are reserved. */
+#define GEN11_NUM_MOCS_ENTRIES  64  /* 63-64 are reserved, but configured. */
+
 enum {
 	NONE,
 	RESET,
@@ -65,6 +68,7 @@ static const char * const test_modes[] = {
 struct mocs_entry {
 	uint32_t	control_value;
 	uint16_t	l3cc_value;
+	uint8_t 	used;
 };
 
 struct mocs_table {
@@ -72,36 +76,67 @@ struct mocs_table {
 	const struct mocs_entry	*table;
 };
 
+static const struct mocs_entry icelake_mocs_pte = {0x00000004, 0x0030, 0x1};
+static const struct mocs_entry mocs_pte = {0x00000038, 0x0030, 0x1};
+
 /* The first entries in the MOCS tables are defined by uABI */
-static const struct mocs_entry skylake_mocs_table[] = {
-	{ 0x00000009, 0x0010 },
-	{ 0x00000038, 0x0030 },
-	{ 0x0000003b, 0x0030 },
+static const struct mocs_entry icelake_mocs_table[GEN11_NUM_MOCS_ENTRIES] = {
+	[0]  = { 0x00000005, 0x0010, 0x1},
+	[1]  = icelake_mocs_pte,
+	[2]  = { 0x00000037, 0x0030, 0x1},
+	[3]  = { 0x00000005, 0x0010, 0x1},
+	[4]  = { 0x00000005, 0x0030, 0x1},
+	[5]  = { 0x00000037, 0x0010, 0x1},
+	[6]  = { 0x00000017, 0x0010, 0x1},
+	[7]  = { 0x00000017, 0x0030, 0x1},
+	[8]  = { 0x00000027, 0x0010, 0x1},
+	[9]  = { 0x00000027, 0x0030, 0x1},
+	[10] = { 0x00000077, 0x0010, 0x1},
+	[11] = { 0x00000077, 0x0030, 0x1},
+	[12] = { 0x00000057, 0x0010, 0x1},
+	[13] = { 0x00000057, 0x0030, 0x1},
+	[14] = { 0x00000067, 0x0010, 0x1},
+	[15] = { 0x00000067, 0x0030, 0x1},
+	[18] = { 0x00060037, 0x0030, 0x1},
+	[19] = { 0x00000737, 0x0030, 0x1},
+	[20] = { 0x00000337, 0x0030, 0x1},
+	[21] = { 0x00000137, 0x0030, 0x1},
+	[22] = { 0x000003b7, 0x0030, 0x1},
+	[23] = { 0x000007b7, 0x0030, 0x1},
+	[24 ... 61] = icelake_mocs_pte,
+	[62] = { 0x00000037, 0x0010, 0x1},
+	[63] = { 0x00000037, 0x0010, 0x1},
+};
+
+static const struct mocs_entry dirty_icelake_mocs_table[GEN11_NUM_MOCS_ENTRIES] = {
+	[0 ... 15] = { 0x0007FFFF, 0x003F, 0x1 },
+	[18 ... GEN11_NUM_MOCS_ENTRIES - 1] = { 0x0007FFFF, 0x003F, 0x1 },
+};
+
+static const struct mocs_entry skylake_mocs_table[GEN9_NUM_MOCS_ENTRIES] = {
+	[0] = { 0x00000009, 0x0010, 0x1},
+	[1] = mocs_pte,
+	[2] = { 0x0000003b, 0x0030, 0x1},
+	[3 ... GEN9_NUM_MOCS_ENTRIES - 1] = mocs_pte,
 };
 
-static const struct mocs_entry dirty_skylake_mocs_table[] = {
-	{ 0x00003FFF, 0x003F }, /* no snoop bit */
-	{ 0x00003FFF, 0x003F },
-	{ 0x00003FFF, 0x003F },
+static const struct mocs_entry dirty_skylake_mocs_table[GEN9_NUM_MOCS_ENTRIES] = {
+	[0 ... GEN9_NUM_MOCS_ENTRIES - 1] = { 0x00003FFF, 0x003F, 0x1 },
 };
 
-static const struct mocs_entry broxton_mocs_table[] = {
-	{ 0x00000009, 0x0010 },
-	{ 0x00000038, 0x0030 },
-	{ 0x00000039, 0x0030 },
+static const struct mocs_entry broxton_mocs_table[GEN9_NUM_MOCS_ENTRIES] = {
+	[0] = { 0x00000009, 0x0010, 0x1},
+	[1] = mocs_pte,
+	[2] = { 0x00000039, 0x0030, 0x1},
+	[3 ... GEN9_NUM_MOCS_ENTRIES - 1] = mocs_pte,
 };
 
-static const struct mocs_entry dirty_broxton_mocs_table[] = {
-	{ 0x00007FFF, 0x003F },
-	{ 0x00007FFF, 0x003F },
-	{ 0x00007FFF, 0x003F },
+static const struct mocs_entry dirty_broxton_mocs_table[GEN9_NUM_MOCS_ENTRIES] = {
+	[0 ... GEN9_NUM_MOCS_ENTRIES - 1] = { 0x00007FFF, 0x003F, 0x1 },
 };
 
-static const uint32_t write_values[] = {
-	0xFFFFFFFF,
-	0xFFFFFFFF,
-	0xFFFFFFFF,
-	0xFFFFFFFF
+static const uint32_t write_values[MAX_NUMBER_MOCS_REGISTERS] = {
+	[0 ... MAX_NUMBER_MOCS_REGISTERS - 1] = 0xFFFFFFFF,
 };
 
 static bool get_mocs_settings(int fd, struct mocs_table *table, bool dirty)
@@ -127,6 +162,15 @@ static bool get_mocs_settings(int fd, struct mocs_table *table, bool dirty)
 			table->table = broxton_mocs_table;
 		}
 		result = true;
+	} else if (IS_ICELAKE(devid)) {
+		if (dirty) {
+			table->size  = ARRAY_SIZE(dirty_icelake_mocs_table);
+			table->table = dirty_icelake_mocs_table;
+		} else {
+			table->size  = ARRAY_SIZE(icelake_mocs_table);
+			table->table = icelake_mocs_table;
+		}
+		result = true;
 	}
 
 	return result;
@@ -283,9 +327,12 @@ static void check_control_registers(int fd,
 	read_regs = gem_mmap__cpu(fd, dst_handle, 0, 4096, PROT_READ);
 
 	gem_set_domain(fd, dst_handle, I915_GEM_DOMAIN_CPU, 0);
-	for (int index = 0; index < table.size; index++)
+	for (int index = 0; index < table.size; index++) {
+		if (!table.table[index].used)
+			continue;
 		igt_assert_eq_u32(read_regs[index],
 				  table.table[index].control_value);
+	}
 
 	munmap(read_regs, 4096);
 	gem_close(fd, dst_handle);
@@ -315,10 +362,14 @@ static void check_l3cc_registers(int fd,
 	gem_set_domain(fd, dst_handle, I915_GEM_DOMAIN_CPU, 0);
 
 	for (index = 0; index < table.size / 2; index++) {
-		igt_assert_eq_u32(read_regs[index] & 0xffff,
-				  table.table[index * 2].l3cc_value);
-		igt_assert_eq_u32(read_regs[index] >> 16,
-				  table.table[index * 2 + 1].l3cc_value);
+		if (table.table[index * 2].used) {
+			igt_assert_eq_u32(read_regs[index] & 0xffff,
+					  table.table[index * 2].l3cc_value);
+		}
+		if (table.table[index * 2 + 1].used) {
+			igt_assert_eq_u32(read_regs[index] >> 16,
+					  table.table[index * 2 + 1].l3cc_value);
+		}
 	}
 
 	if (table.size & 1)
@@ -374,13 +425,21 @@ static void check_mocs_values(int fd, unsigned engine, uint32_t ctx_id, bool dir
 
 static void write_dirty_mocs(int fd, unsigned engine, uint32_t ctx_id)
 {
+	uint32_t devid = intel_get_drm_devid(fd);
+	int num_of_mocs_entries;
+
+	if (IS_ICELAKE(devid))
+		num_of_mocs_entries = GEN11_NUM_MOCS_ENTRIES;
+	else
+		num_of_mocs_entries = GEN9_NUM_MOCS_ENTRIES;
+
 	write_registers(fd, ctx_id, get_engine_base(engine),
-			write_values, ARRAY_SIZE(write_values),
+			write_values, num_of_mocs_entries,
 			engine);
 
 	if (engine == I915_EXEC_RENDER)
 		write_registers(fd, ctx_id, GEN9_LNCFCMOCS0,
-				write_values, ARRAY_SIZE(write_values),
+				write_values, num_of_mocs_entries/2,
 				engine);
 }
 
-- 
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] 44+ messages in thread

* Re: [igt-dev] [PATCH i-g-t v2] i915/gem_mocs_settings: Add mocs table for icelake
  2019-02-22 15:21     ` Chris Wilson
@ 2019-02-22 21:32       ` Kumar Valsan, Prathap
  2019-02-22 21:48         ` Chris Wilson
  0 siblings, 1 reply; 44+ messages in thread
From: Kumar Valsan, Prathap @ 2019-02-22 21:32 UTC (permalink / raw)
  To: Chris Wilson; +Cc: igt-dev, Lucas De Marchi

On Fri, Feb 22, 2019 at 03:21:18PM +0000, Chris Wilson wrote:
> Quoting Lis, Tomasz (2019-02-22 15:17:34)
> > 
> > 
> > On 2019-02-22 15:17, Prathap Kumar Valsan wrote:
> > > From: "Kumar Valsan, Prathap" <prathap.kumar.valsan@intel.com>
> > >
> > > This patch adds mocs table for icelake with expected L3 and eDRAM
> > > control values.
> > >
> > > Signed-off-by: Kumar Valsan, Prathap <prathap.kumar.valsan@intel.com>
> > > ---
> > > Changes in v2:
> > > - Cleaned up the code based on review comments from Lucas and Chris
> > >   tests/i915/gem_mocs_settings.c | 96 ++++++++++++++++++++++++++--------
> > >   1 file changed, 73 insertions(+), 23 deletions(-)
> > >
> > > diff --git a/tests/i915/gem_mocs_settings.c b/tests/i915/gem_mocs_settings.c
> > > index 5b3b6bc1..6d111076 100644
> > > --- a/tests/i915/gem_mocs_settings.c
> > > +++ b/tests/i915/gem_mocs_settings.c
> > > @@ -33,6 +33,9 @@
> > >   #include "igt_sysfs.h"
> > >   
> > >   #define MAX_NUMBER_MOCS_REGISTERS   (64)
> > > +#define GEN9_NUM_MOCS_ENTRIES   62  /* 62 out of 64 - 63 & 64 are reserved. */
> > > +#define GEN11_NUM_MOCS_ENTRIES  64  /* 63-64 are reserved, but configured. */
> > > +
> > >   enum {
> > >       NONE,
> > >       RESET,
> > > @@ -72,36 +75,66 @@ struct mocs_table {
> > >       const struct mocs_entry *table;
> > >   };
> > >   
> > > +static const struct mocs_entry icelake_mocs_pte = {0x00000004, 0x0030};
> > > +static const struct mocs_entry mocs_pte = {0x00000038, 0x0030};
> > > +
> > >   /* The first entries in the MOCS tables are defined by uABI */
> > > -static const struct mocs_entry skylake_mocs_table[] = {
> > > -     { 0x00000009, 0x0010 },
> > > -     { 0x00000038, 0x0030 },
> > > -     { 0x0000003b, 0x0030 },
> > > +static const struct mocs_entry icelake_mocs_table[GEN11_NUM_MOCS_ENTRIES] = {
> > > +     [0 ... GEN11_NUM_MOCS_ENTRIES - 1] = icelake_mocs_pte,
> > > +     [0]  = { 0x00000005, 0x0010},
> > > +     [1]  = { 0x00000004, 0x0030},
> > > +     [2]  = { 0x00000037, 0x0030},
> > > +     [3]  = { 0x00000005, 0x0010},
> > > +     [4]  = { 0x00000005, 0x0030},
> > > +     [5]  = { 0x00000037, 0x0010},
> > > +     [6]  = { 0x00000017, 0x0010},
> > > +     [7]  = { 0x00000017, 0x0030},
> > > +     [8]  = { 0x00000027, 0x0010},
> > > +     [9]  = { 0x00000027, 0x0030},
> > > +     [10] = { 0x00000077, 0x0010},
> > > +     [11] = { 0x00000077, 0x0030},
> > > +     [12] = { 0x00000057, 0x0010},
> > > +     [13] = { 0x00000057, 0x0030},
> > > +     [14] = { 0x00000067, 0x0010},
> > > +     [15] = { 0x00000067, 0x0030},
> > > +     [18] = { 0x00060037, 0x0030},
> > > +     [19] = { 0x00000737, 0x0030},
> > > +     [20] = { 0x00000337, 0x0030},
> > > +     [21] = { 0x00000137, 0x0030},
> > > +     [22] = { 0x000003b7, 0x0030},
> > > +     [23] = { 0x000007b7, 0x0030},
> > > +     [62] = { 0x00000037, 0x0010},
> > > +     [63] = { 0x00000037, 0x0010},
> > > +};
> > > +
> > > +static const struct mocs_entry dirty_icelake_mocs_table[GEN11_NUM_MOCS_ENTRIES] = {
> > > +     [0 ... GEN11_NUM_MOCS_ENTRIES - 1] = { 0x0007FFFF, 0x003F },
> > >   };
> > >   
> > > -static const struct mocs_entry dirty_skylake_mocs_table[] = {
> > > -     { 0x00003FFF, 0x003F }, /* no snoop bit */
> > > -     { 0x00003FFF, 0x003F },
> > > -     { 0x00003FFF, 0x003F },
> > > +static const struct mocs_entry skylake_mocs_table[GEN9_NUM_MOCS_ENTRIES] = {
> > > +     [0 ... GEN9_NUM_MOCS_ENTRIES - 1] = mocs_pte,
> > > +     [0] = { 0x00000009, 0x0010},
> > > +     [1] = { 0x00000038, 0x0030},
> > > +     [2] = { 0x0000003b, 0x0030},
> > >   };
> > >   
> > > -static const struct mocs_entry broxton_mocs_table[] = {
> > > -     { 0x00000009, 0x0010 },
> > > -     { 0x00000038, 0x0030 },
> > > -     { 0x00000039, 0x0030 },
> > > +static const struct mocs_entry dirty_skylake_mocs_table[GEN9_NUM_MOCS_ENTRIES] = {
> > > +     [0 ... GEN9_NUM_MOCS_ENTRIES - 1] = { 0x00003FFF, 0x003F },
> > >   };
> > >   
> > > -static const struct mocs_entry dirty_broxton_mocs_table[] = {
> > > -     { 0x00007FFF, 0x003F },
> > > -     { 0x00007FFF, 0x003F },
> > > -     { 0x00007FFF, 0x003F },
> > > +static const struct mocs_entry broxton_mocs_table[GEN9_NUM_MOCS_ENTRIES] = {
> > > +     [0 ... GEN9_NUM_MOCS_ENTRIES - 1] = mocs_pte,
> > > +     [0] = { 0x00000009, 0x0010},
> > > +     [1] = { 0x00000038, 0x0030},
> > > +     [2] = { 0x00000039, 0x0030},
> > >   };
> > >   
> > > -static const uint32_t write_values[] = {
> > > -     0xFFFFFFFF,
> > > -     0xFFFFFFFF,
> > > -     0xFFFFFFFF,
> > > -     0xFFFFFFFF
> > > +static const struct mocs_entry dirty_broxton_mocs_table[GEN9_NUM_MOCS_ENTRIES] = {
> > > +     [0 ... GEN9_NUM_MOCS_ENTRIES - 1] = { 0x00007FFF, 0x003F },
> > > +};
> > > +
> > > +static const uint32_t write_values[MAX_NUMBER_MOCS_REGISTERS] = {
> > > +     [0 ... MAX_NUMBER_MOCS_REGISTERS - 1] = 0xFFFFFFFF,
> > >   };
> > >   
> > >   static bool get_mocs_settings(int fd, struct mocs_table *table, bool dirty)
> > > @@ -127,6 +160,15 @@ static bool get_mocs_settings(int fd, struct mocs_table *table, bool dirty)
> > >                       table->table = broxton_mocs_table;
> > >               }
> > >               result = true;
> > > +     } else if (IS_ICELAKE(devid)) {
> > > +             if (dirty) {
> > > +                     table->size  = ARRAY_SIZE(dirty_icelake_mocs_table);
> > > +                     table->table = dirty_icelake_mocs_table;
> > > +             } else {
> > > +                     table->size  = ARRAY_SIZE(icelake_mocs_table);
> > > +                     table->table = icelake_mocs_table;
> > > +             }
> > > +             result = true;
> > >       }
> > >   
> > >       return result;
> > > @@ -374,13 +416,21 @@ static void check_mocs_values(int fd, unsigned engine, uint32_t ctx_id, bool dir
> > >   
> > >   static void write_dirty_mocs(int fd, unsigned engine, uint32_t ctx_id)
> > >   {
> > > +     uint32_t devid = intel_get_drm_devid(fd);
> > > +     int num_of_mocs_entries;
> > > +
> > > +     if (IS_ICELAKE(devid))
> > > +             num_of_mocs_entries = GEN11_NUM_MOCS_ENTRIES;
> > > +     else
> > > +             num_of_mocs_entries = GEN9_NUM_MOCS_ENTRIES;
> > > +
> > >       write_registers(fd, ctx_id, get_engine_base(engine),
> > > -                     write_values, ARRAY_SIZE(write_values),
> > > +                     write_values, num_of_mocs_entries,
> > >                       engine);
> > >   
> > >       if (engine == I915_EXEC_RENDER)
> > >               write_registers(fd, ctx_id, GEN9_LNCFCMOCS0,
> > > -                             write_values, ARRAY_SIZE(write_values),
> > > +                             write_values, num_of_mocs_entries/2,
> > >                               engine);
> > >   }
> > >   
> > The "-dirty" subcase of the test doesn't seem suitable to current hardware..
> > 
> > The table is now global. So writing it from one context and checking if 
> > another context is unaffected is bound to fail.
As you pointed out On Gen11, "-dirty" subcases are failing.
Test is not able to write to registers.
> 
> We shouldn't be able to do nonpriv writes to it then. Hopefully those
> writes are already being dropped?
So probably on latest hardware, test should still try to write and call
it pass if the dirty values are not being written?
> -Chris
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* Re: [igt-dev] [PATCH i-g-t v2] i915/gem_mocs_settings: Add mocs table for icelake
  2019-02-22 21:32       ` Kumar Valsan, Prathap
@ 2019-02-22 21:48         ` Chris Wilson
  2019-02-25 13:17           ` Lis, Tomasz
  0 siblings, 1 reply; 44+ messages in thread
From: Chris Wilson @ 2019-02-22 21:48 UTC (permalink / raw)
  To: Kumar Valsan, Prathap; +Cc: igt-dev, Lucas De Marchi

Quoting Kumar Valsan, Prathap (2019-02-22 21:32:55)
> On Fri, Feb 22, 2019 at 03:21:18PM +0000, Chris Wilson wrote:
> > Quoting Lis, Tomasz (2019-02-22 15:17:34)
> > > 
> > > 
> > > On 2019-02-22 15:17, Prathap Kumar Valsan wrote:
> > > > From: "Kumar Valsan, Prathap" <prathap.kumar.valsan@intel.com>
> > > >
> > > > This patch adds mocs table for icelake with expected L3 and eDRAM
> > > > control values.
> > > >
> > > > Signed-off-by: Kumar Valsan, Prathap <prathap.kumar.valsan@intel.com>
> > > > ---
> > > > Changes in v2:
> > > > - Cleaned up the code based on review comments from Lucas and Chris
> > > >   tests/i915/gem_mocs_settings.c | 96 ++++++++++++++++++++++++++--------
> > > >   1 file changed, 73 insertions(+), 23 deletions(-)
> > > >
> > > > diff --git a/tests/i915/gem_mocs_settings.c b/tests/i915/gem_mocs_settings.c
> > > > index 5b3b6bc1..6d111076 100644
> > > > --- a/tests/i915/gem_mocs_settings.c
> > > > +++ b/tests/i915/gem_mocs_settings.c
> > > > @@ -33,6 +33,9 @@
> > > >   #include "igt_sysfs.h"
> > > >   
> > > >   #define MAX_NUMBER_MOCS_REGISTERS   (64)
> > > > +#define GEN9_NUM_MOCS_ENTRIES   62  /* 62 out of 64 - 63 & 64 are reserved. */
> > > > +#define GEN11_NUM_MOCS_ENTRIES  64  /* 63-64 are reserved, but configured. */
> > > > +
> > > >   enum {
> > > >       NONE,
> > > >       RESET,
> > > > @@ -72,36 +75,66 @@ struct mocs_table {
> > > >       const struct mocs_entry *table;
> > > >   };
> > > >   
> > > > +static const struct mocs_entry icelake_mocs_pte = {0x00000004, 0x0030};
> > > > +static const struct mocs_entry mocs_pte = {0x00000038, 0x0030};
> > > > +
> > > >   /* The first entries in the MOCS tables are defined by uABI */
> > > > -static const struct mocs_entry skylake_mocs_table[] = {
> > > > -     { 0x00000009, 0x0010 },
> > > > -     { 0x00000038, 0x0030 },
> > > > -     { 0x0000003b, 0x0030 },
> > > > +static const struct mocs_entry icelake_mocs_table[GEN11_NUM_MOCS_ENTRIES] = {
> > > > +     [0 ... GEN11_NUM_MOCS_ENTRIES - 1] = icelake_mocs_pte,
> > > > +     [0]  = { 0x00000005, 0x0010},
> > > > +     [1]  = { 0x00000004, 0x0030},
> > > > +     [2]  = { 0x00000037, 0x0030},
> > > > +     [3]  = { 0x00000005, 0x0010},
> > > > +     [4]  = { 0x00000005, 0x0030},
> > > > +     [5]  = { 0x00000037, 0x0010},
> > > > +     [6]  = { 0x00000017, 0x0010},
> > > > +     [7]  = { 0x00000017, 0x0030},
> > > > +     [8]  = { 0x00000027, 0x0010},
> > > > +     [9]  = { 0x00000027, 0x0030},
> > > > +     [10] = { 0x00000077, 0x0010},
> > > > +     [11] = { 0x00000077, 0x0030},
> > > > +     [12] = { 0x00000057, 0x0010},
> > > > +     [13] = { 0x00000057, 0x0030},
> > > > +     [14] = { 0x00000067, 0x0010},
> > > > +     [15] = { 0x00000067, 0x0030},
> > > > +     [18] = { 0x00060037, 0x0030},
> > > > +     [19] = { 0x00000737, 0x0030},
> > > > +     [20] = { 0x00000337, 0x0030},
> > > > +     [21] = { 0x00000137, 0x0030},
> > > > +     [22] = { 0x000003b7, 0x0030},
> > > > +     [23] = { 0x000007b7, 0x0030},
> > > > +     [62] = { 0x00000037, 0x0010},
> > > > +     [63] = { 0x00000037, 0x0010},
> > > > +};
> > > > +
> > > > +static const struct mocs_entry dirty_icelake_mocs_table[GEN11_NUM_MOCS_ENTRIES] = {
> > > > +     [0 ... GEN11_NUM_MOCS_ENTRIES - 1] = { 0x0007FFFF, 0x003F },
> > > >   };
> > > >   
> > > > -static const struct mocs_entry dirty_skylake_mocs_table[] = {
> > > > -     { 0x00003FFF, 0x003F }, /* no snoop bit */
> > > > -     { 0x00003FFF, 0x003F },
> > > > -     { 0x00003FFF, 0x003F },
> > > > +static const struct mocs_entry skylake_mocs_table[GEN9_NUM_MOCS_ENTRIES] = {
> > > > +     [0 ... GEN9_NUM_MOCS_ENTRIES - 1] = mocs_pte,
> > > > +     [0] = { 0x00000009, 0x0010},
> > > > +     [1] = { 0x00000038, 0x0030},
> > > > +     [2] = { 0x0000003b, 0x0030},
> > > >   };
> > > >   
> > > > -static const struct mocs_entry broxton_mocs_table[] = {
> > > > -     { 0x00000009, 0x0010 },
> > > > -     { 0x00000038, 0x0030 },
> > > > -     { 0x00000039, 0x0030 },
> > > > +static const struct mocs_entry dirty_skylake_mocs_table[GEN9_NUM_MOCS_ENTRIES] = {
> > > > +     [0 ... GEN9_NUM_MOCS_ENTRIES - 1] = { 0x00003FFF, 0x003F },
> > > >   };
> > > >   
> > > > -static const struct mocs_entry dirty_broxton_mocs_table[] = {
> > > > -     { 0x00007FFF, 0x003F },
> > > > -     { 0x00007FFF, 0x003F },
> > > > -     { 0x00007FFF, 0x003F },
> > > > +static const struct mocs_entry broxton_mocs_table[GEN9_NUM_MOCS_ENTRIES] = {
> > > > +     [0 ... GEN9_NUM_MOCS_ENTRIES - 1] = mocs_pte,
> > > > +     [0] = { 0x00000009, 0x0010},
> > > > +     [1] = { 0x00000038, 0x0030},
> > > > +     [2] = { 0x00000039, 0x0030},
> > > >   };
> > > >   
> > > > -static const uint32_t write_values[] = {
> > > > -     0xFFFFFFFF,
> > > > -     0xFFFFFFFF,
> > > > -     0xFFFFFFFF,
> > > > -     0xFFFFFFFF
> > > > +static const struct mocs_entry dirty_broxton_mocs_table[GEN9_NUM_MOCS_ENTRIES] = {
> > > > +     [0 ... GEN9_NUM_MOCS_ENTRIES - 1] = { 0x00007FFF, 0x003F },
> > > > +};
> > > > +
> > > > +static const uint32_t write_values[MAX_NUMBER_MOCS_REGISTERS] = {
> > > > +     [0 ... MAX_NUMBER_MOCS_REGISTERS - 1] = 0xFFFFFFFF,
> > > >   };
> > > >   
> > > >   static bool get_mocs_settings(int fd, struct mocs_table *table, bool dirty)
> > > > @@ -127,6 +160,15 @@ static bool get_mocs_settings(int fd, struct mocs_table *table, bool dirty)
> > > >                       table->table = broxton_mocs_table;
> > > >               }
> > > >               result = true;
> > > > +     } else if (IS_ICELAKE(devid)) {
> > > > +             if (dirty) {
> > > > +                     table->size  = ARRAY_SIZE(dirty_icelake_mocs_table);
> > > > +                     table->table = dirty_icelake_mocs_table;
> > > > +             } else {
> > > > +                     table->size  = ARRAY_SIZE(icelake_mocs_table);
> > > > +                     table->table = icelake_mocs_table;
> > > > +             }
> > > > +             result = true;
> > > >       }
> > > >   
> > > >       return result;
> > > > @@ -374,13 +416,21 @@ static void check_mocs_values(int fd, unsigned engine, uint32_t ctx_id, bool dir
> > > >   
> > > >   static void write_dirty_mocs(int fd, unsigned engine, uint32_t ctx_id)
> > > >   {
> > > > +     uint32_t devid = intel_get_drm_devid(fd);
> > > > +     int num_of_mocs_entries;
> > > > +
> > > > +     if (IS_ICELAKE(devid))
> > > > +             num_of_mocs_entries = GEN11_NUM_MOCS_ENTRIES;
> > > > +     else
> > > > +             num_of_mocs_entries = GEN9_NUM_MOCS_ENTRIES;
> > > > +
> > > >       write_registers(fd, ctx_id, get_engine_base(engine),
> > > > -                     write_values, ARRAY_SIZE(write_values),
> > > > +                     write_values, num_of_mocs_entries,
> > > >                       engine);
> > > >   
> > > >       if (engine == I915_EXEC_RENDER)
> > > >               write_registers(fd, ctx_id, GEN9_LNCFCMOCS0,
> > > > -                             write_values, ARRAY_SIZE(write_values),
> > > > +                             write_values, num_of_mocs_entries/2,
> > > >                               engine);
> > > >   }
> > > >   
> > > The "-dirty" subcase of the test doesn't seem suitable to current hardware..
> > > 
> > > The table is now global. So writing it from one context and checking if 
> > > another context is unaffected is bound to fail.
> As you pointed out On Gen11, "-dirty" subcases are failing.
> Test is not able to write to registers.
> > 
> > We shouldn't be able to do nonpriv writes to it then. Hopefully those
> > writes are already being dropped?
> So probably on latest hardware, test should still try to write and call
> it pass if the dirty values are not being written?

Yes, that would be useful confirmation that one context can't shoot
another in the back, and that our global MOCS table remain invariant.
-Chris
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* Re: [igt-dev] [PATCH i-g-t v2] i915/gem_mocs_settings: Add mocs table for icelake
  2019-02-22 15:17   ` Lis, Tomasz
  2019-02-22 15:21     ` Chris Wilson
@ 2019-02-25  0:26     ` Kumar Valsan, Prathap
  1 sibling, 0 replies; 44+ messages in thread
From: Kumar Valsan, Prathap @ 2019-02-25  0:26 UTC (permalink / raw)
  To: Lis, Tomasz, Chris Wilson; +Cc: igt-dev, Lucas De Marchi

On Fri, Feb 22, 2019 at 04:17:34PM +0100, Lis, Tomasz wrote:
> 
> 
> On 2019-02-22 15:17, Prathap Kumar Valsan wrote:
> > From: "Kumar Valsan, Prathap" <prathap.kumar.valsan@intel.com>
> > 
> > This patch adds mocs table for icelake with expected L3 and eDRAM
> > control values.
> > 
> > Signed-off-by: Kumar Valsan, Prathap <prathap.kumar.valsan@intel.com>
> > ---
> > Changes in v2:
> > - Cleaned up the code based on review comments from Lucas and Chris
> >   tests/i915/gem_mocs_settings.c | 96 ++++++++++++++++++++++++++--------
> >   1 file changed, 73 insertions(+), 23 deletions(-)
> > 
> > diff --git a/tests/i915/gem_mocs_settings.c b/tests/i915/gem_mocs_settings.c
> > index 5b3b6bc1..6d111076 100644
> > --- a/tests/i915/gem_mocs_settings.c
> > +++ b/tests/i915/gem_mocs_settings.c
> > @@ -33,6 +33,9 @@
> >   #include "igt_sysfs.h"
> >   #define MAX_NUMBER_MOCS_REGISTERS	(64)
> > +#define GEN9_NUM_MOCS_ENTRIES   62  /* 62 out of 64 - 63 & 64 are reserved. */
> > +#define GEN11_NUM_MOCS_ENTRIES  64  /* 63-64 are reserved, but configured. */
> > +
> >   enum {
> >   	NONE,
> >   	RESET,
> > @@ -72,36 +75,66 @@ struct mocs_table {
> >   	const struct mocs_entry	*table;
> >   };
> > +static const struct mocs_entry icelake_mocs_pte = {0x00000004, 0x0030};
> > +static const struct mocs_entry mocs_pte = {0x00000038, 0x0030};
> > +
> >   /* The first entries in the MOCS tables are defined by uABI */
> > -static const struct mocs_entry skylake_mocs_table[] = {
> > -	{ 0x00000009, 0x0010 },
> > -	{ 0x00000038, 0x0030 },
> > -	{ 0x0000003b, 0x0030 },
> > +static const struct mocs_entry icelake_mocs_table[GEN11_NUM_MOCS_ENTRIES] = {
> > +	[0 ... GEN11_NUM_MOCS_ENTRIES - 1] = icelake_mocs_pte,
> > +	[0]  = { 0x00000005, 0x0010},
> > +	[1]  = { 0x00000004, 0x0030},
> > +	[2]  = { 0x00000037, 0x0030},
> > +	[3]  = { 0x00000005, 0x0010},
> > +	[4]  = { 0x00000005, 0x0030},
> > +	[5]  = { 0x00000037, 0x0010},
> > +	[6]  = { 0x00000017, 0x0010},
> > +	[7]  = { 0x00000017, 0x0030},
> > +	[8]  = { 0x00000027, 0x0010},
> > +	[9]  = { 0x00000027, 0x0030},
> > +	[10] = { 0x00000077, 0x0010},
> > +	[11] = { 0x00000077, 0x0030},
> > +	[12] = { 0x00000057, 0x0010},
> > +	[13] = { 0x00000057, 0x0030},
> > +	[14] = { 0x00000067, 0x0010},
> > +	[15] = { 0x00000067, 0x0030},
> > +	[18] = { 0x00060037, 0x0030},
> > +	[19] = { 0x00000737, 0x0030},
> > +	[20] = { 0x00000337, 0x0030},
> > +	[21] = { 0x00000137, 0x0030},
> > +	[22] = { 0x000003b7, 0x0030},
> > +	[23] = { 0x000007b7, 0x0030},
> > +	[62] = { 0x00000037, 0x0010},
> > +	[63] = { 0x00000037, 0x0010},
> > +};
> > +
> > +static const struct mocs_entry dirty_icelake_mocs_table[GEN11_NUM_MOCS_ENTRIES] = {
> > +	[0 ... GEN11_NUM_MOCS_ENTRIES - 1] = { 0x0007FFFF, 0x003F },
> >   };
> > -static const struct mocs_entry dirty_skylake_mocs_table[] = {
> > -	{ 0x00003FFF, 0x003F }, /* no snoop bit */
> > -	{ 0x00003FFF, 0x003F },
> > -	{ 0x00003FFF, 0x003F },
> > +static const struct mocs_entry skylake_mocs_table[GEN9_NUM_MOCS_ENTRIES] = {
> > +	[0 ... GEN9_NUM_MOCS_ENTRIES - 1] = mocs_pte,
> > +	[0] = { 0x00000009, 0x0010},
> > +	[1] = { 0x00000038, 0x0030},
> > +	[2] = { 0x0000003b, 0x0030},
> >   };
> > -static const struct mocs_entry broxton_mocs_table[] = {
> > -	{ 0x00000009, 0x0010 },
> > -	{ 0x00000038, 0x0030 },
> > -	{ 0x00000039, 0x0030 },
> > +static const struct mocs_entry dirty_skylake_mocs_table[GEN9_NUM_MOCS_ENTRIES] = {
> > +	[0 ... GEN9_NUM_MOCS_ENTRIES - 1] = { 0x00003FFF, 0x003F },
> >   };
> > -static const struct mocs_entry dirty_broxton_mocs_table[] = {
> > -	{ 0x00007FFF, 0x003F },
> > -	{ 0x00007FFF, 0x003F },
> > -	{ 0x00007FFF, 0x003F },
> > +static const struct mocs_entry broxton_mocs_table[GEN9_NUM_MOCS_ENTRIES] = {
> > +	[0 ... GEN9_NUM_MOCS_ENTRIES - 1] = mocs_pte,
> > +	[0] = { 0x00000009, 0x0010},
> > +	[1] = { 0x00000038, 0x0030},
> > +	[2] = { 0x00000039, 0x0030},
> >   };
> > -static const uint32_t write_values[] = {
> > -	0xFFFFFFFF,
> > -	0xFFFFFFFF,
> > -	0xFFFFFFFF,
> > -	0xFFFFFFFF
> > +static const struct mocs_entry dirty_broxton_mocs_table[GEN9_NUM_MOCS_ENTRIES] = {
> > +	[0 ... GEN9_NUM_MOCS_ENTRIES - 1] = { 0x00007FFF, 0x003F },
> > +};
> > +
> > +static const uint32_t write_values[MAX_NUMBER_MOCS_REGISTERS] = {
> > +	[0 ... MAX_NUMBER_MOCS_REGISTERS - 1] = 0xFFFFFFFF,
> >   };
> >   static bool get_mocs_settings(int fd, struct mocs_table *table, bool dirty)
> > @@ -127,6 +160,15 @@ static bool get_mocs_settings(int fd, struct mocs_table *table, bool dirty)
> >   			table->table = broxton_mocs_table;
> >   		}
> >   		result = true;
> > +	} else if (IS_ICELAKE(devid)) {
> > +		if (dirty) {
> > +			table->size  = ARRAY_SIZE(dirty_icelake_mocs_table);
> > +			table->table = dirty_icelake_mocs_table;
> > +		} else {
> > +			table->size  = ARRAY_SIZE(icelake_mocs_table);
> > +			table->table = icelake_mocs_table;
> > +		}
> > +		result = true;
> >   	}
> >   	return result;
> > @@ -374,13 +416,21 @@ static void check_mocs_values(int fd, unsigned engine, uint32_t ctx_id, bool dir
> >   static void write_dirty_mocs(int fd, unsigned engine, uint32_t ctx_id)
> >   {
> > +	uint32_t devid = intel_get_drm_devid(fd);
> > +	int num_of_mocs_entries;
> > +
> > +	if (IS_ICELAKE(devid))
> > +		num_of_mocs_entries = GEN11_NUM_MOCS_ENTRIES;
> > +	else
> > +		num_of_mocs_entries = GEN9_NUM_MOCS_ENTRIES;
> > +
> >   	write_registers(fd, ctx_id, get_engine_base(engine),
> > -			write_values, ARRAY_SIZE(write_values),
> > +			write_values, num_of_mocs_entries,
> >   			engine);
> >   	if (engine == I915_EXEC_RENDER)
> >   		write_registers(fd, ctx_id, GEN9_LNCFCMOCS0,
> > -				write_values, ARRAY_SIZE(write_values),
> > +				write_values, num_of_mocs_entries/2,
> >   				engine);
> >   }
> The "-dirty" subcase of the test doesn't seem suitable to current hardware..
> 
> The table is now global. So writing it from one context and checking if
> another context is unaffected is bound to fail.
> 
> Shouldn't the test for gen11+ be restricted to reading the values and
> checking whether they match pre-defined array?
> (we may still do a test if everything is fine after reset/suspend, that
> won't hurt)
> And if we are writing dirty values, shouldn't there be a restoration to
> original values afterwards?
> 
> -Tomasz

I am observing following behaviour on Icelake platform

 "-dirty" subcase of the test fails in checking l3 control register.

  Tomasz mentioned that the table is now golbal. However, for control
  registers(LLC/eDRAM), the context is getting saved and restored
  between contexts like the Gen9. If the table was global this shouldn't
  be the expected behaviour. Also i don't see a reference in bspec which
  stated mocs table is global for GEN11+.

  Now for L3 control registers the behaviour is different. This is where
  test is failing in "-dirty" subcase. For L3 control registers, writing
  dirty values are somehow ignored by the hardware. So checking the L3
  Control registers after writing the dirty values fails.


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

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

* Re: [igt-dev] [PATCH i-g-t v2] i915/gem_mocs_settings: Add mocs table for icelake
  2019-02-22 21:48         ` Chris Wilson
@ 2019-02-25 13:17           ` Lis, Tomasz
  0 siblings, 0 replies; 44+ messages in thread
From: Lis, Tomasz @ 2019-02-25 13:17 UTC (permalink / raw)
  To: Chris Wilson, Kumar Valsan, Prathap; +Cc: igt-dev, Lucas De Marchi



On 2019-02-22 22:48, Chris Wilson wrote:
> Quoting Kumar Valsan, Prathap (2019-02-22 21:32:55)
>> On Fri, Feb 22, 2019 at 03:21:18PM +0000, Chris Wilson wrote:
>>> Quoting Lis, Tomasz (2019-02-22 15:17:34)
>>>>
>>>> On 2019-02-22 15:17, Prathap Kumar Valsan wrote:
>>>>> From: "Kumar Valsan, Prathap" <prathap.kumar.valsan@intel.com>
>>>>>
>>>>> This patch adds mocs table for icelake with expected L3 and eDRAM
>>>>> control values.
>>>>>
>>>>> Signed-off-by: Kumar Valsan, Prathap <prathap.kumar.valsan@intel.com>
>>>>> ---
>>>>> Changes in v2:
>>>>> - Cleaned up the code based on review comments from Lucas and Chris
>>>>>    tests/i915/gem_mocs_settings.c | 96 ++++++++++++++++++++++++++--------
>>>>>    1 file changed, 73 insertions(+), 23 deletions(-)
>>>>>
>>>>> diff --git a/tests/i915/gem_mocs_settings.c b/tests/i915/gem_mocs_settings.c
>>>>> index 5b3b6bc1..6d111076 100644
>>>>> --- a/tests/i915/gem_mocs_settings.c
>>>>> +++ b/tests/i915/gem_mocs_settings.c
>>>>> @@ -33,6 +33,9 @@
>>>>>    #include "igt_sysfs.h"
>>>>>    
>>>>>    #define MAX_NUMBER_MOCS_REGISTERS   (64)
>>>>> +#define GEN9_NUM_MOCS_ENTRIES   62  /* 62 out of 64 - 63 & 64 are reserved. */
>>>>> +#define GEN11_NUM_MOCS_ENTRIES  64  /* 63-64 are reserved, but configured. */
>>>>> +
>>>>>    enum {
>>>>>        NONE,
>>>>>        RESET,
>>>>> @@ -72,36 +75,66 @@ struct mocs_table {
>>>>>        const struct mocs_entry *table;
>>>>>    };
>>>>>    
>>>>> +static const struct mocs_entry icelake_mocs_pte = {0x00000004, 0x0030};
>>>>> +static const struct mocs_entry mocs_pte = {0x00000038, 0x0030};
>>>>> +
>>>>>    /* The first entries in the MOCS tables are defined by uABI */
>>>>> -static const struct mocs_entry skylake_mocs_table[] = {
>>>>> -     { 0x00000009, 0x0010 },
>>>>> -     { 0x00000038, 0x0030 },
>>>>> -     { 0x0000003b, 0x0030 },
>>>>> +static const struct mocs_entry icelake_mocs_table[GEN11_NUM_MOCS_ENTRIES] = {
>>>>> +     [0 ... GEN11_NUM_MOCS_ENTRIES - 1] = icelake_mocs_pte,
>>>>> +     [0]  = { 0x00000005, 0x0010},
>>>>> +     [1]  = { 0x00000004, 0x0030},
>>>>> +     [2]  = { 0x00000037, 0x0030},
>>>>> +     [3]  = { 0x00000005, 0x0010},
>>>>> +     [4]  = { 0x00000005, 0x0030},
>>>>> +     [5]  = { 0x00000037, 0x0010},
>>>>> +     [6]  = { 0x00000017, 0x0010},
>>>>> +     [7]  = { 0x00000017, 0x0030},
>>>>> +     [8]  = { 0x00000027, 0x0010},
>>>>> +     [9]  = { 0x00000027, 0x0030},
>>>>> +     [10] = { 0x00000077, 0x0010},
>>>>> +     [11] = { 0x00000077, 0x0030},
>>>>> +     [12] = { 0x00000057, 0x0010},
>>>>> +     [13] = { 0x00000057, 0x0030},
>>>>> +     [14] = { 0x00000067, 0x0010},
>>>>> +     [15] = { 0x00000067, 0x0030},
>>>>> +     [18] = { 0x00060037, 0x0030},
>>>>> +     [19] = { 0x00000737, 0x0030},
>>>>> +     [20] = { 0x00000337, 0x0030},
>>>>> +     [21] = { 0x00000137, 0x0030},
>>>>> +     [22] = { 0x000003b7, 0x0030},
>>>>> +     [23] = { 0x000007b7, 0x0030},
>>>>> +     [62] = { 0x00000037, 0x0010},
>>>>> +     [63] = { 0x00000037, 0x0010},
>>>>> +};
>>>>> +
>>>>> +static const struct mocs_entry dirty_icelake_mocs_table[GEN11_NUM_MOCS_ENTRIES] = {
>>>>> +     [0 ... GEN11_NUM_MOCS_ENTRIES - 1] = { 0x0007FFFF, 0x003F },
>>>>>    };
>>>>>    
>>>>> -static const struct mocs_entry dirty_skylake_mocs_table[] = {
>>>>> -     { 0x00003FFF, 0x003F }, /* no snoop bit */
>>>>> -     { 0x00003FFF, 0x003F },
>>>>> -     { 0x00003FFF, 0x003F },
>>>>> +static const struct mocs_entry skylake_mocs_table[GEN9_NUM_MOCS_ENTRIES] = {
>>>>> +     [0 ... GEN9_NUM_MOCS_ENTRIES - 1] = mocs_pte,
>>>>> +     [0] = { 0x00000009, 0x0010},
>>>>> +     [1] = { 0x00000038, 0x0030},
>>>>> +     [2] = { 0x0000003b, 0x0030},
>>>>>    };
>>>>>    
>>>>> -static const struct mocs_entry broxton_mocs_table[] = {
>>>>> -     { 0x00000009, 0x0010 },
>>>>> -     { 0x00000038, 0x0030 },
>>>>> -     { 0x00000039, 0x0030 },
>>>>> +static const struct mocs_entry dirty_skylake_mocs_table[GEN9_NUM_MOCS_ENTRIES] = {
>>>>> +     [0 ... GEN9_NUM_MOCS_ENTRIES - 1] = { 0x00003FFF, 0x003F },
>>>>>    };
>>>>>    
>>>>> -static const struct mocs_entry dirty_broxton_mocs_table[] = {
>>>>> -     { 0x00007FFF, 0x003F },
>>>>> -     { 0x00007FFF, 0x003F },
>>>>> -     { 0x00007FFF, 0x003F },
>>>>> +static const struct mocs_entry broxton_mocs_table[GEN9_NUM_MOCS_ENTRIES] = {
>>>>> +     [0 ... GEN9_NUM_MOCS_ENTRIES - 1] = mocs_pte,
>>>>> +     [0] = { 0x00000009, 0x0010},
>>>>> +     [1] = { 0x00000038, 0x0030},
>>>>> +     [2] = { 0x00000039, 0x0030},
>>>>>    };
>>>>>    
>>>>> -static const uint32_t write_values[] = {
>>>>> -     0xFFFFFFFF,
>>>>> -     0xFFFFFFFF,
>>>>> -     0xFFFFFFFF,
>>>>> -     0xFFFFFFFF
>>>>> +static const struct mocs_entry dirty_broxton_mocs_table[GEN9_NUM_MOCS_ENTRIES] = {
>>>>> +     [0 ... GEN9_NUM_MOCS_ENTRIES - 1] = { 0x00007FFF, 0x003F },
>>>>> +};
>>>>> +
>>>>> +static const uint32_t write_values[MAX_NUMBER_MOCS_REGISTERS] = {
>>>>> +     [0 ... MAX_NUMBER_MOCS_REGISTERS - 1] = 0xFFFFFFFF,
>>>>>    };
>>>>>    
>>>>>    static bool get_mocs_settings(int fd, struct mocs_table *table, bool dirty)
>>>>> @@ -127,6 +160,15 @@ static bool get_mocs_settings(int fd, struct mocs_table *table, bool dirty)
>>>>>                        table->table = broxton_mocs_table;
>>>>>                }
>>>>>                result = true;
>>>>> +     } else if (IS_ICELAKE(devid)) {
>>>>> +             if (dirty) {
>>>>> +                     table->size  = ARRAY_SIZE(dirty_icelake_mocs_table);
>>>>> +                     table->table = dirty_icelake_mocs_table;
>>>>> +             } else {
>>>>> +                     table->size  = ARRAY_SIZE(icelake_mocs_table);
>>>>> +                     table->table = icelake_mocs_table;
>>>>> +             }
>>>>> +             result = true;
>>>>>        }
>>>>>    
>>>>>        return result;
>>>>> @@ -374,13 +416,21 @@ static void check_mocs_values(int fd, unsigned engine, uint32_t ctx_id, bool dir
>>>>>    
>>>>>    static void write_dirty_mocs(int fd, unsigned engine, uint32_t ctx_id)
>>>>>    {
>>>>> +     uint32_t devid = intel_get_drm_devid(fd);
>>>>> +     int num_of_mocs_entries;
>>>>> +
>>>>> +     if (IS_ICELAKE(devid))
>>>>> +             num_of_mocs_entries = GEN11_NUM_MOCS_ENTRIES;
>>>>> +     else
>>>>> +             num_of_mocs_entries = GEN9_NUM_MOCS_ENTRIES;
>>>>> +
>>>>>        write_registers(fd, ctx_id, get_engine_base(engine),
>>>>> -                     write_values, ARRAY_SIZE(write_values),
>>>>> +                     write_values, num_of_mocs_entries,
>>>>>                        engine);
>>>>>    
>>>>>        if (engine == I915_EXEC_RENDER)
>>>>>                write_registers(fd, ctx_id, GEN9_LNCFCMOCS0,
>>>>> -                             write_values, ARRAY_SIZE(write_values),
>>>>> +                             write_values, num_of_mocs_entries/2,
>>>>>                                engine);
>>>>>    }
>>>>>    
>>>> The "-dirty" subcase of the test doesn't seem suitable to current hardware..
>>>>
>>>> The table is now global. So writing it from one context and checking if
>>>> another context is unaffected is bound to fail.
>> As you pointed out On Gen11, "-dirty" subcases are failing.
>> Test is not able to write to registers.
>>> We shouldn't be able to do nonpriv writes to it then. Hopefully those
>>> writes are already being dropped?
>> So probably on latest hardware, test should still try to write and call
>> it pass if the dirty values are not being written?
> Yes, that would be useful confirmation that one context can't shoot
> another in the back, and that our global MOCS table remain invariant.
> -Chris
Don't we have a separate test for privileged registers? I'm not very 
familiar with all the tests, but I remember someone told me that.

The scope of this test, as written at its beginning, is:
/** @file gem_mocs_settings.c
  *
  * Check that the MOCs cache settings are valid.
  */
If we already write to MOCS instead of only checking, the scope should 
be expanded.
If we're going to check privileged operations, this should also be 
included in the scope.
-Tomasz

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

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

* [igt-dev] [PATCH i-g-t v4] i915/gem_mocs_settings: Add mocs table for icelake
  2019-02-15 21:46 [igt-dev] [PATCH i-g-t] i915/gem_mocs_settings: Add mocs table for icelake Prathap Kumar Valsan via igt-dev
                   ` (7 preceding siblings ...)
  2019-02-22 21:20 ` [igt-dev] [PATCH i-g-t v3] i915/gem_mocs_settings: Add mocs table for icelake Prathap Kumar Valsan
@ 2019-03-04 20:27 ` Prathap Kumar Valsan
  2019-03-04 20:37   ` Kumar Valsan, Prathap
  2019-03-04 21:01 ` [igt-dev] ✓ Fi.CI.BAT: success for i915/gem_mocs_settings: Add mocs table for icelake (rev6) Patchwork
                   ` (11 subsequent siblings)
  20 siblings, 1 reply; 44+ messages in thread
From: Prathap Kumar Valsan @ 2019-03-04 20:27 UTC (permalink / raw)
  To: igt-dev; +Cc: Lucas De Marchi, Lis

From: "Kumar Valsan, Prathap" <prathap.kumar.valsan@intel.com>

This patch adds mocs table for icelake with expected L3 and eDRAM
control values.

Signed-off-by: Kumar Valsan, Prathap <prathap.kumar.valsan@intel.com>
---
Changes in v4:
- L3 control registers are global in icelake.
  Test validates that dirty writes from userspace
  to L3 control registers are being dropped. 
Changes in v3:
- There are holes in the mocs table(Lucas Pointed out).
  In icelake index 16 and 17 are reserved.
  So test shouldn't be checking them.
Changes in v2:
- Cleaned up the code based on review
  comments from Lucas and Chris

 tests/i915/gem_mocs_settings.c | 126 +++++++++++++++++++++++++--------
 1 file changed, 96 insertions(+), 30 deletions(-)

diff --git a/tests/i915/gem_mocs_settings.c b/tests/i915/gem_mocs_settings.c
index 5b3b6bc1..66615007 100644
--- a/tests/i915/gem_mocs_settings.c
+++ b/tests/i915/gem_mocs_settings.c
@@ -33,6 +33,9 @@
 #include "igt_sysfs.h"
 
 #define MAX_NUMBER_MOCS_REGISTERS	(64)
+#define GEN9_NUM_MOCS_ENTRIES   62  /* 62 out of 64 - 63 & 64 are reserved. */
+#define GEN11_NUM_MOCS_ENTRIES  64  /* 63-64 are reserved, but configured. */
+
 enum {
 	NONE,
 	RESET,
@@ -61,10 +64,13 @@ static const char * const test_modes[] = {
 #define GEN9_MFX1_MOCS_0	(0xcA00)	/* Media 1 MOCS base register*/
 #define GEN9_VEBOX_MOCS_0	(0xcB00)	/* Video MOCS base register*/
 #define GEN9_BLT_MOCS_0		(0xcc00)	/* Blitter MOCS base register*/
+#define ICELAKE_MOCS_PTE	{0x00000004, 0x0030, 0x1}
+#define MOCS_PTE		{0x00000038, 0x0030, 0x1}
 
 struct mocs_entry {
 	uint32_t	control_value;
 	uint16_t	l3cc_value;
+	uint8_t 	used;
 };
 
 struct mocs_table {
@@ -73,35 +79,63 @@ struct mocs_table {
 };
 
 /* The first entries in the MOCS tables are defined by uABI */
-static const struct mocs_entry skylake_mocs_table[] = {
-	{ 0x00000009, 0x0010 },
-	{ 0x00000038, 0x0030 },
-	{ 0x0000003b, 0x0030 },
+static const struct mocs_entry icelake_mocs_table[GEN11_NUM_MOCS_ENTRIES] = {
+	[0]  = { 0x00000005, 0x0010, 0x1},
+	[1]  = ICELAKE_MOCS_PTE,
+	[2]  = { 0x00000037, 0x0030, 0x1},
+	[3]  = { 0x00000005, 0x0010, 0x1},
+	[4]  = { 0x00000005, 0x0030, 0x1},
+	[5]  = { 0x00000037, 0x0010, 0x1},
+	[6]  = { 0x00000017, 0x0010, 0x1},
+	[7]  = { 0x00000017, 0x0030, 0x1},
+	[8]  = { 0x00000027, 0x0010, 0x1},
+	[9]  = { 0x00000027, 0x0030, 0x1},
+	[10] = { 0x00000077, 0x0010, 0x1},
+	[11] = { 0x00000077, 0x0030, 0x1},
+	[12] = { 0x00000057, 0x0010, 0x1},
+	[13] = { 0x00000057, 0x0030, 0x1},
+	[14] = { 0x00000067, 0x0010, 0x1},
+	[15] = { 0x00000067, 0x0030, 0x1},
+	[18] = { 0x00060037, 0x0030, 0x1},
+	[19] = { 0x00000737, 0x0030, 0x1},
+	[20] = { 0x00000337, 0x0030, 0x1},
+	[21] = { 0x00000137, 0x0030, 0x1},
+	[22] = { 0x000003b7, 0x0030, 0x1},
+	[23] = { 0x000007b7, 0x0030, 0x1},
+	[24 ... 61] = ICELAKE_MOCS_PTE,
+	[62] = { 0x00000037, 0x0010, 0x1},
+	[63] = { 0x00000037, 0x0010, 0x1},
+};
+
+static const struct mocs_entry dirty_icelake_mocs_table[GEN11_NUM_MOCS_ENTRIES] = {
+	[0 ... 15] = { 0x0007FFFF, 0x003F, 0x1 },
+	[18 ... GEN11_NUM_MOCS_ENTRIES - 1] = { 0x0007FFFF, 0x003F, 0x1 },
 };
 
-static const struct mocs_entry dirty_skylake_mocs_table[] = {
-	{ 0x00003FFF, 0x003F }, /* no snoop bit */
-	{ 0x00003FFF, 0x003F },
-	{ 0x00003FFF, 0x003F },
+static const struct mocs_entry skylake_mocs_table[GEN9_NUM_MOCS_ENTRIES] = {
+	[0] = { 0x00000009, 0x0010, 0x1},
+	[1] = MOCS_PTE,
+	[2] = { 0x0000003b, 0x0030, 0x1},
+	[3 ... GEN9_NUM_MOCS_ENTRIES - 1] = MOCS_PTE,
 };
 
-static const struct mocs_entry broxton_mocs_table[] = {
-	{ 0x00000009, 0x0010 },
-	{ 0x00000038, 0x0030 },
-	{ 0x00000039, 0x0030 },
+static const struct mocs_entry dirty_skylake_mocs_table[GEN9_NUM_MOCS_ENTRIES] = {
+	[0 ... GEN9_NUM_MOCS_ENTRIES - 1] = { 0x00003FFF, 0x003F, 0x1 },
 };
 
-static const struct mocs_entry dirty_broxton_mocs_table[] = {
-	{ 0x00007FFF, 0x003F },
-	{ 0x00007FFF, 0x003F },
-	{ 0x00007FFF, 0x003F },
+static const struct mocs_entry broxton_mocs_table[GEN9_NUM_MOCS_ENTRIES] = {
+	[0] = { 0x00000009, 0x0010, 0x1},
+	[1] = MOCS_PTE,
+	[2] = { 0x00000039, 0x0030, 0x1},
+	[3 ... GEN9_NUM_MOCS_ENTRIES - 1] = MOCS_PTE,
 };
 
-static const uint32_t write_values[] = {
-	0xFFFFFFFF,
-	0xFFFFFFFF,
-	0xFFFFFFFF,
-	0xFFFFFFFF
+static const struct mocs_entry dirty_broxton_mocs_table[GEN9_NUM_MOCS_ENTRIES] = {
+	[0 ... GEN9_NUM_MOCS_ENTRIES - 1] = { 0x00007FFF, 0x003F, 0x1 },
+};
+
+static const uint32_t write_values[MAX_NUMBER_MOCS_REGISTERS] = {
+	[0 ... MAX_NUMBER_MOCS_REGISTERS - 1] = 0xFFFFFFFF,
 };
 
 static bool get_mocs_settings(int fd, struct mocs_table *table, bool dirty)
@@ -127,6 +161,15 @@ static bool get_mocs_settings(int fd, struct mocs_table *table, bool dirty)
 			table->table = broxton_mocs_table;
 		}
 		result = true;
+	} else if (IS_ICELAKE(devid)) {
+		if (dirty) {
+			table->size  = ARRAY_SIZE(dirty_icelake_mocs_table);
+			table->table = dirty_icelake_mocs_table;
+		} else {
+			table->size  = ARRAY_SIZE(icelake_mocs_table);
+			table->table = icelake_mocs_table;
+		}
+		result = true;
 	}
 
 	return result;
@@ -283,9 +326,12 @@ static void check_control_registers(int fd,
 	read_regs = gem_mmap__cpu(fd, dst_handle, 0, 4096, PROT_READ);
 
 	gem_set_domain(fd, dst_handle, I915_GEM_DOMAIN_CPU, 0);
-	for (int index = 0; index < table.size; index++)
+	for (int index = 0; index < table.size; index++) {
+		if (!table.table[index].used)
+			continue;
 		igt_assert_eq_u32(read_regs[index],
 				  table.table[index].control_value);
+	}
 
 	munmap(read_regs, 4096);
 	gem_close(fd, dst_handle);
@@ -315,10 +361,14 @@ static void check_l3cc_registers(int fd,
 	gem_set_domain(fd, dst_handle, I915_GEM_DOMAIN_CPU, 0);
 
 	for (index = 0; index < table.size / 2; index++) {
-		igt_assert_eq_u32(read_regs[index] & 0xffff,
-				  table.table[index * 2].l3cc_value);
-		igt_assert_eq_u32(read_regs[index] >> 16,
-				  table.table[index * 2 + 1].l3cc_value);
+		if (table.table[index * 2].used) {
+			igt_assert_eq_u32(read_regs[index] & 0xffff,
+					  table.table[index * 2].l3cc_value);
+		}
+		if (table.table[index * 2 + 1].used) {
+			igt_assert_eq_u32(read_regs[index] >> 16,
+					  table.table[index * 2 + 1].l3cc_value);
+		}
 	}
 
 	if (table.size & 1)
@@ -368,19 +418,35 @@ static void check_mocs_values(int fd, unsigned engine, uint32_t ctx_id, bool dir
 {
 	check_control_registers(fd, engine, ctx_id, dirty);
 
-	if (engine == I915_EXEC_RENDER)
-		check_l3cc_registers(fd, engine, ctx_id, dirty);
+	if (engine == I915_EXEC_RENDER) {
+		uint32_t devid = intel_get_drm_devid(fd);
+		/* L3 control  registers are global in icl.
+		 * dirty write from userspace will be ignored/
+		 */
+		if (dirty && IS_ICELAKE(devid))
+			check_l3cc_registers(fd, engine, ctx_id, !dirty);
+		else
+			check_l3cc_registers(fd, engine, ctx_id, dirty);
+	}
 }
 
 static void write_dirty_mocs(int fd, unsigned engine, uint32_t ctx_id)
 {
+	uint32_t devid = intel_get_drm_devid(fd);
+	int num_of_mocs_entries;
+
+	if (IS_ICELAKE(devid))
+		num_of_mocs_entries = GEN11_NUM_MOCS_ENTRIES;
+	else
+		num_of_mocs_entries = GEN9_NUM_MOCS_ENTRIES;
+
 	write_registers(fd, ctx_id, get_engine_base(engine),
-			write_values, ARRAY_SIZE(write_values),
+			write_values, num_of_mocs_entries,
 			engine);
 
 	if (engine == I915_EXEC_RENDER)
 		write_registers(fd, ctx_id, GEN9_LNCFCMOCS0,
-				write_values, ARRAY_SIZE(write_values),
+				write_values, num_of_mocs_entries/2,
 				engine);
 }
 
-- 
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] 44+ messages in thread

* Re: [igt-dev] [PATCH i-g-t v4] i915/gem_mocs_settings: Add mocs table for icelake
  2019-03-04 20:27 ` [igt-dev] [PATCH i-g-t v4] " Prathap Kumar Valsan
@ 2019-03-04 20:37   ` Kumar Valsan, Prathap
  0 siblings, 0 replies; 44+ messages in thread
From: Kumar Valsan, Prathap @ 2019-03-04 20:37 UTC (permalink / raw)
  To: igt-dev; +Cc: Lucas De Marchi

On Mon, Mar 04, 2019 at 03:27:25PM -0500, Prathap Kumar Valsan wrote:
> From: "Kumar Valsan, Prathap" <prathap.kumar.valsan@intel.com>
> 
> This patch adds mocs table for icelake with expected L3 and eDRAM
> control values.
> 
> Signed-off-by: Kumar Valsan, Prathap <prathap.kumar.valsan@intel.com>
> ---
> Changes in v4:
> - L3 control registers are global in icelake.
>   Test validates that dirty writes from userspace
>   to L3 control registers are being dropped. 
> Changes in v3:
> - There are holes in the mocs table(Lucas Pointed out).
>   In icelake index 16 and 17 are reserved.
>   So test shouldn't be checking them.
> Changes in v2:
> - Cleaned up the code based on review
>   comments from Lucas and Chris
> 
>  tests/i915/gem_mocs_settings.c | 126 +++++++++++++++++++++++++--------
>  1 file changed, 96 insertions(+), 30 deletions(-)
> 
> diff --git a/tests/i915/gem_mocs_settings.c b/tests/i915/gem_mocs_settings.c
> index 5b3b6bc1..66615007 100644
> --- a/tests/i915/gem_mocs_settings.c
> +++ b/tests/i915/gem_mocs_settings.c
> @@ -33,6 +33,9 @@
>  #include "igt_sysfs.h"
>  
>  #define MAX_NUMBER_MOCS_REGISTERS	(64)
> +#define GEN9_NUM_MOCS_ENTRIES   62  /* 62 out of 64 - 63 & 64 are reserved. */
> +#define GEN11_NUM_MOCS_ENTRIES  64  /* 63-64 are reserved, but configured. */
> +
>  enum {
>  	NONE,
>  	RESET,
> @@ -61,10 +64,13 @@ static const char * const test_modes[] = {
>  #define GEN9_MFX1_MOCS_0	(0xcA00)	/* Media 1 MOCS base register*/
>  #define GEN9_VEBOX_MOCS_0	(0xcB00)	/* Video MOCS base register*/
>  #define GEN9_BLT_MOCS_0		(0xcc00)	/* Blitter MOCS base register*/
> +#define ICELAKE_MOCS_PTE	{0x00000004, 0x0030, 0x1}
> +#define MOCS_PTE		{0x00000038, 0x0030, 0x1}
>  
>  struct mocs_entry {
>  	uint32_t	control_value;
>  	uint16_t	l3cc_value;
> +	uint8_t 	used;
>  };
>  
>  struct mocs_table {
> @@ -73,35 +79,63 @@ struct mocs_table {
>  };
>  
>  /* The first entries in the MOCS tables are defined by uABI */
> -static const struct mocs_entry skylake_mocs_table[] = {
> -	{ 0x00000009, 0x0010 },
> -	{ 0x00000038, 0x0030 },
> -	{ 0x0000003b, 0x0030 },
> +static const struct mocs_entry icelake_mocs_table[GEN11_NUM_MOCS_ENTRIES] = {
> +	[0]  = { 0x00000005, 0x0010, 0x1},
> +	[1]  = ICELAKE_MOCS_PTE,
> +	[2]  = { 0x00000037, 0x0030, 0x1},
> +	[3]  = { 0x00000005, 0x0010, 0x1},
> +	[4]  = { 0x00000005, 0x0030, 0x1},
> +	[5]  = { 0x00000037, 0x0010, 0x1},
> +	[6]  = { 0x00000017, 0x0010, 0x1},
> +	[7]  = { 0x00000017, 0x0030, 0x1},
> +	[8]  = { 0x00000027, 0x0010, 0x1},
> +	[9]  = { 0x00000027, 0x0030, 0x1},
> +	[10] = { 0x00000077, 0x0010, 0x1},
> +	[11] = { 0x00000077, 0x0030, 0x1},
> +	[12] = { 0x00000057, 0x0010, 0x1},
> +	[13] = { 0x00000057, 0x0030, 0x1},
> +	[14] = { 0x00000067, 0x0010, 0x1},
> +	[15] = { 0x00000067, 0x0030, 0x1},
> +	[18] = { 0x00060037, 0x0030, 0x1},
> +	[19] = { 0x00000737, 0x0030, 0x1},
> +	[20] = { 0x00000337, 0x0030, 0x1},
> +	[21] = { 0x00000137, 0x0030, 0x1},
> +	[22] = { 0x000003b7, 0x0030, 0x1},
> +	[23] = { 0x000007b7, 0x0030, 0x1},
> +	[24 ... 61] = ICELAKE_MOCS_PTE,
> +	[62] = { 0x00000037, 0x0010, 0x1},
> +	[63] = { 0x00000037, 0x0010, 0x1},
> +};
> +
> +static const struct mocs_entry dirty_icelake_mocs_table[GEN11_NUM_MOCS_ENTRIES] = {
> +	[0 ... 15] = { 0x0007FFFF, 0x003F, 0x1 },
> +	[18 ... GEN11_NUM_MOCS_ENTRIES - 1] = { 0x0007FFFF, 0x003F, 0x1 },
>  };
>  
> -static const struct mocs_entry dirty_skylake_mocs_table[] = {
> -	{ 0x00003FFF, 0x003F }, /* no snoop bit */
> -	{ 0x00003FFF, 0x003F },
> -	{ 0x00003FFF, 0x003F },
> +static const struct mocs_entry skylake_mocs_table[GEN9_NUM_MOCS_ENTRIES] = {
> +	[0] = { 0x00000009, 0x0010, 0x1},
> +	[1] = MOCS_PTE,
> +	[2] = { 0x0000003b, 0x0030, 0x1},
> +	[3 ... GEN9_NUM_MOCS_ENTRIES - 1] = MOCS_PTE,
>  };
>  
> -static const struct mocs_entry broxton_mocs_table[] = {
> -	{ 0x00000009, 0x0010 },
> -	{ 0x00000038, 0x0030 },
> -	{ 0x00000039, 0x0030 },
> +static const struct mocs_entry dirty_skylake_mocs_table[GEN9_NUM_MOCS_ENTRIES] = {
> +	[0 ... GEN9_NUM_MOCS_ENTRIES - 1] = { 0x00003FFF, 0x003F, 0x1 },
>  };
>  
> -static const struct mocs_entry dirty_broxton_mocs_table[] = {
> -	{ 0x00007FFF, 0x003F },
> -	{ 0x00007FFF, 0x003F },
> -	{ 0x00007FFF, 0x003F },
> +static const struct mocs_entry broxton_mocs_table[GEN9_NUM_MOCS_ENTRIES] = {
> +	[0] = { 0x00000009, 0x0010, 0x1},
> +	[1] = MOCS_PTE,
> +	[2] = { 0x00000039, 0x0030, 0x1},
> +	[3 ... GEN9_NUM_MOCS_ENTRIES - 1] = MOCS_PTE,
>  };
>  
> -static const uint32_t write_values[] = {
> -	0xFFFFFFFF,
> -	0xFFFFFFFF,
> -	0xFFFFFFFF,
> -	0xFFFFFFFF
> +static const struct mocs_entry dirty_broxton_mocs_table[GEN9_NUM_MOCS_ENTRIES] = {
> +	[0 ... GEN9_NUM_MOCS_ENTRIES - 1] = { 0x00007FFF, 0x003F, 0x1 },
> +};
> +
> +static const uint32_t write_values[MAX_NUMBER_MOCS_REGISTERS] = {
> +	[0 ... MAX_NUMBER_MOCS_REGISTERS - 1] = 0xFFFFFFFF,
>  };
>  
>  static bool get_mocs_settings(int fd, struct mocs_table *table, bool dirty)
> @@ -127,6 +161,15 @@ static bool get_mocs_settings(int fd, struct mocs_table *table, bool dirty)
>  			table->table = broxton_mocs_table;
>  		}
>  		result = true;
> +	} else if (IS_ICELAKE(devid)) {
> +		if (dirty) {
> +			table->size  = ARRAY_SIZE(dirty_icelake_mocs_table);
> +			table->table = dirty_icelake_mocs_table;
> +		} else {
> +			table->size  = ARRAY_SIZE(icelake_mocs_table);
> +			table->table = icelake_mocs_table;
> +		}
> +		result = true;
>  	}
>  
>  	return result;
> @@ -283,9 +326,12 @@ static void check_control_registers(int fd,
>  	read_regs = gem_mmap__cpu(fd, dst_handle, 0, 4096, PROT_READ);
>  
>  	gem_set_domain(fd, dst_handle, I915_GEM_DOMAIN_CPU, 0);
> -	for (int index = 0; index < table.size; index++)
> +	for (int index = 0; index < table.size; index++) {
> +		if (!table.table[index].used)
> +			continue;
>  		igt_assert_eq_u32(read_regs[index],
>  				  table.table[index].control_value);
> +	}
>  
>  	munmap(read_regs, 4096);
>  	gem_close(fd, dst_handle);
> @@ -315,10 +361,14 @@ static void check_l3cc_registers(int fd,
>  	gem_set_domain(fd, dst_handle, I915_GEM_DOMAIN_CPU, 0);
>  
>  	for (index = 0; index < table.size / 2; index++) {
> -		igt_assert_eq_u32(read_regs[index] & 0xffff,
> -				  table.table[index * 2].l3cc_value);
> -		igt_assert_eq_u32(read_regs[index] >> 16,
> -				  table.table[index * 2 + 1].l3cc_value);
> +		if (table.table[index * 2].used) {
> +			igt_assert_eq_u32(read_regs[index] & 0xffff,
> +					  table.table[index * 2].l3cc_value);
> +		}
> +		if (table.table[index * 2 + 1].used) {
> +			igt_assert_eq_u32(read_regs[index] >> 16,
> +					  table.table[index * 2 + 1].l3cc_value);
> +		}
>  	}
>  
>  	if (table.size & 1)
> @@ -368,19 +418,35 @@ static void check_mocs_values(int fd, unsigned engine, uint32_t ctx_id, bool dir
>  {
>  	check_control_registers(fd, engine, ctx_id, dirty);
>  
> -	if (engine == I915_EXEC_RENDER)
> -		check_l3cc_registers(fd, engine, ctx_id, dirty);
> +	if (engine == I915_EXEC_RENDER) {
> +		uint32_t devid = intel_get_drm_devid(fd);
> +		/* L3 control  registers are global in icl.
> +		 * dirty write from userspace will be ignored/
> +		 */
> +		if (dirty && IS_ICELAKE(devid))
> +			check_l3cc_registers(fd, engine, ctx_id, !dirty);
> +		else
> +			check_l3cc_registers(fd, engine, ctx_id, dirty);
> +	}
>  }
After testing on icl platform, it is observed that LLC control registers
can be context saved and restored between contexts, however write to 
L3 control registers are being dropped even though the writes is through
a priviliged batch buffer(I915_EXEC_SECURE). Need to confirm if this is
the expected behaviour. 

With this patch test including "-dirty" subtests are passing on icl.

>  
>  static void write_dirty_mocs(int fd, unsigned engine, uint32_t ctx_id)
>  {
> +	uint32_t devid = intel_get_drm_devid(fd);
> +	int num_of_mocs_entries;
> +
> +	if (IS_ICELAKE(devid))
> +		num_of_mocs_entries = GEN11_NUM_MOCS_ENTRIES;
> +	else
> +		num_of_mocs_entries = GEN9_NUM_MOCS_ENTRIES;
> +
>  	write_registers(fd, ctx_id, get_engine_base(engine),
> -			write_values, ARRAY_SIZE(write_values),
> +			write_values, num_of_mocs_entries,
>  			engine);
>  
>  	if (engine == I915_EXEC_RENDER)
>  		write_registers(fd, ctx_id, GEN9_LNCFCMOCS0,
> -				write_values, ARRAY_SIZE(write_values),
> +				write_values, num_of_mocs_entries/2,
>  				engine);
>  }
>  
> -- 
> 2.20.1
> 
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] ✓ Fi.CI.BAT: success for i915/gem_mocs_settings: Add mocs table for icelake (rev6)
  2019-02-15 21:46 [igt-dev] [PATCH i-g-t] i915/gem_mocs_settings: Add mocs table for icelake Prathap Kumar Valsan via igt-dev
                   ` (8 preceding siblings ...)
  2019-03-04 20:27 ` [igt-dev] [PATCH i-g-t v4] " Prathap Kumar Valsan
@ 2019-03-04 21:01 ` Patchwork
  2019-03-05  2:11 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
                   ` (10 subsequent siblings)
  20 siblings, 0 replies; 44+ messages in thread
From: Patchwork @ 2019-03-04 21:01 UTC (permalink / raw)
  To: Kumar Valsan, Prathap; +Cc: igt-dev

== Series Details ==

Series: i915/gem_mocs_settings: Add mocs table for icelake (rev6)
URL   : https://patchwork.freedesktop.org/series/56459/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_5699 -> IGTPW_2551
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/56459/revisions/6/mbox/

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

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

### IGT changes ###

#### Issues hit ####

  * igt@amdgpu/amd_basic@cs-compute:
    - fi-kbl-8809g:       NOTRUN -> FAIL [fdo#108094]

  * igt@amdgpu/amd_basic@query-info:
    - fi-bsw-kefka:       NOTRUN -> SKIP [fdo#109271] +56

  * igt@gem_exec_basic@readonly-bsd2:
    - fi-pnv-d510:        NOTRUN -> SKIP [fdo#109271] +76

  * igt@i915_pm_rpm@basic-rte:
    - fi-bsw-kefka:       NOTRUN -> FAIL [fdo#108800]

  * igt@kms_busy@basic-flip-c:
    - fi-bsw-kefka:       NOTRUN -> SKIP [fdo#109271] / [fdo#109278]
    - fi-pnv-d510:        NOTRUN -> SKIP [fdo#109271] / [fdo#109278]

  
#### Possible fixes ####

  * igt@amdgpu/amd_basic@userptr:
    - fi-kbl-8809g:       DMESG-WARN [fdo#108965] -> PASS

  * igt@gem_exec_suspend@basic-s4-devices:
    - {fi-icl-y}:         DMESG-WARN [fdo#109638] -> PASS

  * igt@i915_selftest@live_execlists:
    - fi-apl-guc:         INCOMPLETE [fdo#103927] / [fdo#109720] -> PASS

  * igt@kms_busy@basic-flip-a:
    - fi-gdg-551:         FAIL [fdo#103182] -> PASS +1

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

  * igt@prime_vgem@basic-fence-flip:
    - fi-gdg-551:         DMESG-FAIL [fdo#103182] -> PASS

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

  [fdo#103182]: https://bugs.freedesktop.org/show_bug.cgi?id=103182
  [fdo#103191]: https://bugs.freedesktop.org/show_bug.cgi?id=103191
  [fdo#103927]: https://bugs.freedesktop.org/show_bug.cgi?id=103927
  [fdo#107362]: https://bugs.freedesktop.org/show_bug.cgi?id=107362
  [fdo#108094]: https://bugs.freedesktop.org/show_bug.cgi?id=108094
  [fdo#108800]: https://bugs.freedesktop.org/show_bug.cgi?id=108800
  [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#109638]: https://bugs.freedesktop.org/show_bug.cgi?id=109638
  [fdo#109720]: https://bugs.freedesktop.org/show_bug.cgi?id=109720


Participating hosts (43 -> 41)
------------------------------

  Additional (2): fi-bsw-kefka fi-pnv-d510 
  Missing    (4): fi-ilk-m540 fi-byt-squawks fi-bsw-cyan fi-bdw-samus 


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

    * IGT: IGT_4870 -> IGTPW_2551

  CI_DRM_5699: 19d7e6b4a6c43104823680ed766240300f5ef876 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_2551: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2551/
  IGT_4870: ed944b45563c694dc6373bc48dc83b8ba7edb19f @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Logs ==

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

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

* [igt-dev] ✓ Fi.CI.IGT: success for i915/gem_mocs_settings: Add mocs table for icelake (rev6)
  2019-02-15 21:46 [igt-dev] [PATCH i-g-t] i915/gem_mocs_settings: Add mocs table for icelake Prathap Kumar Valsan via igt-dev
                   ` (9 preceding siblings ...)
  2019-03-04 21:01 ` [igt-dev] ✓ Fi.CI.BAT: success for i915/gem_mocs_settings: Add mocs table for icelake (rev6) Patchwork
@ 2019-03-05  2:11 ` Patchwork
  2019-03-12 15:14 ` [igt-dev] [PATCH i-g-t v5] i915/gem_mocs_settings: Add mocs table for icelake Prathap Kumar Valsan
                   ` (9 subsequent siblings)
  20 siblings, 0 replies; 44+ messages in thread
From: Patchwork @ 2019-03-05  2:11 UTC (permalink / raw)
  To: Kumar Valsan, Prathap; +Cc: igt-dev

== Series Details ==

Series: i915/gem_mocs_settings: Add mocs table for icelake (rev6)
URL   : https://patchwork.freedesktop.org/series/56459/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_5699_full -> IGTPW_2551_full
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/56459/revisions/6/mbox/

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

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

### IGT changes ###

#### Issues hit ####

  * igt@i915_pm_rc6_residency@rc6-accuracy:
    - shard-kbl:          PASS -> SKIP [fdo#109271]

  * igt@i915_pm_rpm@gem-execbuf-stress-extra-wait:
    - shard-snb:          NOTRUN -> SKIP [fdo#109271] +69

  * igt@kms_atomic_transition@4x-modeset-transitions-nonblocking-fencing:
    - shard-snb:          NOTRUN -> SKIP [fdo#109271] / [fdo#109278] +6

  * igt@kms_atomic_transition@plane-all-modeset-transition-fencing:
    - shard-apl:          PASS -> INCOMPLETE [fdo#103927]
    - shard-kbl:          PASS -> INCOMPLETE [fdo#103665] +1

  * igt@kms_busy@extended-modeset-hang-newfb-with-reset-render-b:
    - shard-kbl:          PASS -> DMESG-WARN [fdo#107956]
    - shard-snb:          PASS -> DMESG-WARN [fdo#107956]
    - shard-hsw:          PASS -> DMESG-WARN [fdo#107956]

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

  * igt@kms_cursor_crc@cursor-128x128-dpms:
    - shard-kbl:          PASS -> FAIL [fdo#103232] +1
    - shard-apl:          PASS -> FAIL [fdo#103232]

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

  * igt@kms_flip@2x-flip-vs-expired-vblank:
    - shard-glk:          PASS -> FAIL [fdo#105363] +1

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

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

  * igt@kms_frontbuffer_tracking@psr-2p-primscrn-spr-indfb-draw-mmap-cpu:
    - shard-glk:          NOTRUN -> SKIP [fdo#109271] +23

  * igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a:
    - shard-kbl:          PASS -> DMESG-WARN [fdo#108566]

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

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

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

  * igt@kms_universal_plane@universal-plane-pipe-c-functional:
    - shard-kbl:          PASS -> FAIL [fdo#103166] +1

  
#### Possible fixes ####

  * igt@kms_atomic_transition@1x-modeset-transitions-nonblocking:
    - shard-apl:          FAIL [fdo#109660] -> PASS

  * igt@kms_busy@extended-modeset-hang-newfb-render-a:
    - shard-kbl:          DMESG-WARN [fdo#107956] -> PASS

  * igt@kms_busy@extended-modeset-hang-newfb-render-b:
    - shard-hsw:          DMESG-WARN [fdo#107956] -> PASS +2

  * igt@kms_busy@extended-modeset-hang-newfb-with-reset-render-a:
    - shard-snb:          DMESG-WARN [fdo#107956] -> PASS +2

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

  * igt@kms_color@pipe-a-legacy-gamma:
    - shard-apl:          FAIL [fdo#104782] / [fdo#108145] -> PASS +1

  * igt@kms_color@pipe-b-ctm-max:
    - shard-apl:          FAIL [fdo#108147] -> PASS +1

  * igt@kms_color@pipe-b-degamma:
    - shard-apl:          FAIL [fdo#104782] -> PASS

  * igt@kms_color@pipe-c-ctm-max:
    - shard-kbl:          FAIL [fdo#108147] -> PASS

  * igt@kms_cursor_crc@cursor-256x256-random:
    - shard-apl:          FAIL [fdo#103232] -> PASS +7

  * igt@kms_cursor_crc@cursor-256x256-suspend:
    - shard-kbl:          FAIL [fdo#103191] / [fdo#103232] -> PASS

  * igt@kms_cursor_crc@cursor-256x85-sliding:
    - shard-kbl:          FAIL [fdo#103232] -> PASS +1

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

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

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

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

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

  * igt@kms_rotation_crc@multiplane-rotation-cropping-top:
    - shard-kbl:          FAIL [fdo#109016] -> PASS

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

  * igt@kms_vblank@pipe-a-ts-continuation-suspend:
    - shard-kbl:          FAIL [fdo#104894] -> PASS
    - shard-apl:          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#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#103665]: https://bugs.freedesktop.org/show_bug.cgi?id=103665
  [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#107956]: https://bugs.freedesktop.org/show_bug.cgi?id=107956
  [fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
  [fdo#108147]: https://bugs.freedesktop.org/show_bug.cgi?id=108147
  [fdo#108566]: https://bugs.freedesktop.org/show_bug.cgi?id=108566
  [fdo#109016]: https://bugs.freedesktop.org/show_bug.cgi?id=109016
  [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#109660]: https://bugs.freedesktop.org/show_bug.cgi?id=109660
  [fdo#99912]: https://bugs.freedesktop.org/show_bug.cgi?id=99912


Participating hosts (6 -> 5)
------------------------------

  Missing    (1): shard-skl 


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

    * IGT: IGT_4870 -> IGTPW_2551
    * Piglit: piglit_4509 -> None

  CI_DRM_5699: 19d7e6b4a6c43104823680ed766240300f5ef876 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_2551: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2551/
  IGT_4870: ed944b45563c694dc6373bc48dc83b8ba7edb19f @ 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_2551/
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] [PATCH i-g-t v5] i915/gem_mocs_settings: Add mocs table for icelake
  2019-02-15 21:46 [igt-dev] [PATCH i-g-t] i915/gem_mocs_settings: Add mocs table for icelake Prathap Kumar Valsan via igt-dev
                   ` (10 preceding siblings ...)
  2019-03-05  2:11 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
@ 2019-03-12 15:14 ` Prathap Kumar Valsan
  2019-03-13 13:58   ` Kalamarz, Lukasz
  2019-03-13 12:12 ` [igt-dev] ✗ Fi.CI.BAT: failure for i915/gem_mocs_settings: Add mocs table for icelake (rev7) Patchwork
                   ` (8 subsequent siblings)
  20 siblings, 1 reply; 44+ messages in thread
From: Prathap Kumar Valsan @ 2019-03-12 15:14 UTC (permalink / raw)
  To: igt-dev; +Cc: Lucas De Marchi

From: "Kumar Valsan, Prathap" <prathap.kumar.valsan@intel.com>

This patch adds mocs table for icelake with expected L3 and eDRAM
control values.

Signed-off-by: Kumar Valsan, Prathap <prathap.kumar.valsan@intel.com>
---
Changes in v5:
- As mocs table is global, test need not write
  mocs table. Below jira has the discussion. 
  https://jira.devtools.intel.com/browse/VLK-1567
Changes in v4:
- L3 control registers are global in icelake.
  Test validates that dirty writes from userspace
  to L3 control registers are being dropped. 
Changes in v3:
- There are holes in the mocs table(Lucas Pointed out).
  In icelake index 16 and 17 are reserved.
  So test shouldn't be checking them.
Changes in v2:
- Cleaned up the code based on review
  comments from Lucas and Chris
 tests/i915/gem_mocs_settings.c | 103 ++++++++++++++++++++++++---------
 1 file changed, 75 insertions(+), 28 deletions(-)

diff --git a/tests/i915/gem_mocs_settings.c b/tests/i915/gem_mocs_settings.c
index 5b3b6bc1..901cef38 100644
--- a/tests/i915/gem_mocs_settings.c
+++ b/tests/i915/gem_mocs_settings.c
@@ -32,7 +32,9 @@
 #include "igt_perf.h"
 #include "igt_sysfs.h"
 
-#define MAX_NUMBER_MOCS_REGISTERS	(64)
+#define GEN9_NUM_MOCS_ENTRIES   62  /* 62 out of 64 - 63 & 64 are reserved. */
+#define GEN11_NUM_MOCS_ENTRIES  64  /* 63-64 are reserved, but configured. */
+
 enum {
 	NONE,
 	RESET,
@@ -61,10 +63,13 @@ static const char * const test_modes[] = {
 #define GEN9_MFX1_MOCS_0	(0xcA00)	/* Media 1 MOCS base register*/
 #define GEN9_VEBOX_MOCS_0	(0xcB00)	/* Video MOCS base register*/
 #define GEN9_BLT_MOCS_0		(0xcc00)	/* Blitter MOCS base register*/
+#define ICELAKE_MOCS_PTE	{0x00000004, 0x0030, 0x1}
+#define MOCS_PTE		{0x00000038, 0x0030, 0x1}
 
 struct mocs_entry {
 	uint32_t	control_value;
 	uint16_t	l3cc_value;
+	uint8_t 	used;
 };
 
 struct mocs_table {
@@ -73,35 +78,59 @@ struct mocs_table {
 };
 
 /* The first entries in the MOCS tables are defined by uABI */
-static const struct mocs_entry skylake_mocs_table[] = {
-	{ 0x00000009, 0x0010 },
-	{ 0x00000038, 0x0030 },
-	{ 0x0000003b, 0x0030 },
+static const struct mocs_entry icelake_mocs_table[GEN11_NUM_MOCS_ENTRIES] = {
+	[0]  = { 0x00000005, 0x0010, 0x1},
+	[1]  = ICELAKE_MOCS_PTE,
+	[2]  = { 0x00000037, 0x0030, 0x1},
+	[3]  = { 0x00000005, 0x0010, 0x1},
+	[4]  = { 0x00000005, 0x0030, 0x1},
+	[5]  = { 0x00000037, 0x0010, 0x1},
+	[6]  = { 0x00000017, 0x0010, 0x1},
+	[7]  = { 0x00000017, 0x0030, 0x1},
+	[8]  = { 0x00000027, 0x0010, 0x1},
+	[9]  = { 0x00000027, 0x0030, 0x1},
+	[10] = { 0x00000077, 0x0010, 0x1},
+	[11] = { 0x00000077, 0x0030, 0x1},
+	[12] = { 0x00000057, 0x0010, 0x1},
+	[13] = { 0x00000057, 0x0030, 0x1},
+	[14] = { 0x00000067, 0x0010, 0x1},
+	[15] = { 0x00000067, 0x0030, 0x1},
+	[18] = { 0x00060037, 0x0030, 0x1},
+	[19] = { 0x00000737, 0x0030, 0x1},
+	[20] = { 0x00000337, 0x0030, 0x1},
+	[21] = { 0x00000137, 0x0030, 0x1},
+	[22] = { 0x000003b7, 0x0030, 0x1},
+	[23] = { 0x000007b7, 0x0030, 0x1},
+	[24 ... 61] = ICELAKE_MOCS_PTE,
+	[62] = { 0x00000037, 0x0010, 0x1},
+	[63] = { 0x00000037, 0x0010, 0x1},
+};
+
+
+static const struct mocs_entry skylake_mocs_table[GEN9_NUM_MOCS_ENTRIES] = {
+	[0] = { 0x00000009, 0x0010, 0x1},
+	[1] = MOCS_PTE,
+	[2] = { 0x0000003b, 0x0030, 0x1},
+	[3 ... GEN9_NUM_MOCS_ENTRIES - 1] = MOCS_PTE,
 };
 
-static const struct mocs_entry dirty_skylake_mocs_table[] = {
-	{ 0x00003FFF, 0x003F }, /* no snoop bit */
-	{ 0x00003FFF, 0x003F },
-	{ 0x00003FFF, 0x003F },
+static const struct mocs_entry dirty_skylake_mocs_table[GEN9_NUM_MOCS_ENTRIES] = {
+	[0 ... GEN9_NUM_MOCS_ENTRIES - 1] = { 0x00003FFF, 0x003F, 0x1 },
 };
 
-static const struct mocs_entry broxton_mocs_table[] = {
-	{ 0x00000009, 0x0010 },
-	{ 0x00000038, 0x0030 },
-	{ 0x00000039, 0x0030 },
+static const struct mocs_entry broxton_mocs_table[GEN9_NUM_MOCS_ENTRIES] = {
+	[0] = { 0x00000009, 0x0010, 0x1},
+	[1] = MOCS_PTE,
+	[2] = { 0x00000039, 0x0030, 0x1},
+	[3 ... GEN9_NUM_MOCS_ENTRIES - 1] = MOCS_PTE,
 };
 
-static const struct mocs_entry dirty_broxton_mocs_table[] = {
-	{ 0x00007FFF, 0x003F },
-	{ 0x00007FFF, 0x003F },
-	{ 0x00007FFF, 0x003F },
+static const struct mocs_entry dirty_broxton_mocs_table[GEN9_NUM_MOCS_ENTRIES] = {
+	[0 ... GEN9_NUM_MOCS_ENTRIES - 1] = { 0x00007FFF, 0x003F, 0x1 },
 };
 
-static const uint32_t write_values[] = {
-	0xFFFFFFFF,
-	0xFFFFFFFF,
-	0xFFFFFFFF,
-	0xFFFFFFFF
+static const uint32_t write_values[GEN9_NUM_MOCS_ENTRIES] = {
+	[0 ... GEN9_NUM_MOCS_ENTRIES - 1] = 0xFFFFFFFF,
 };
 
 static bool get_mocs_settings(int fd, struct mocs_table *table, bool dirty)
@@ -127,6 +156,10 @@ static bool get_mocs_settings(int fd, struct mocs_table *table, bool dirty)
 			table->table = broxton_mocs_table;
 		}
 		result = true;
+	} else if (IS_ICELAKE(devid)) {
+		table->size  = ARRAY_SIZE(icelake_mocs_table);
+		table->table = icelake_mocs_table;
+		result = true;
 	}
 
 	return result;
@@ -283,9 +316,12 @@ static void check_control_registers(int fd,
 	read_regs = gem_mmap__cpu(fd, dst_handle, 0, 4096, PROT_READ);
 
 	gem_set_domain(fd, dst_handle, I915_GEM_DOMAIN_CPU, 0);
-	for (int index = 0; index < table.size; index++)
+	for (int index = 0; index < table.size; index++) {
+		if (!table.table[index].used)
+			continue;
 		igt_assert_eq_u32(read_regs[index],
 				  table.table[index].control_value);
+	}
 
 	munmap(read_regs, 4096);
 	gem_close(fd, dst_handle);
@@ -315,10 +351,14 @@ static void check_l3cc_registers(int fd,
 	gem_set_domain(fd, dst_handle, I915_GEM_DOMAIN_CPU, 0);
 
 	for (index = 0; index < table.size / 2; index++) {
-		igt_assert_eq_u32(read_regs[index] & 0xffff,
-				  table.table[index * 2].l3cc_value);
-		igt_assert_eq_u32(read_regs[index] >> 16,
-				  table.table[index * 2 + 1].l3cc_value);
+		if (table.table[index * 2].used) {
+			igt_assert_eq_u32(read_regs[index] & 0xffff,
+					  table.table[index * 2].l3cc_value);
+		}
+		if (table.table[index * 2 + 1].used) {
+			igt_assert_eq_u32(read_regs[index] >> 16,
+					  table.table[index * 2 + 1].l3cc_value);
+		}
 	}
 
 	if (table.size & 1)
@@ -380,7 +420,7 @@ static void write_dirty_mocs(int fd, unsigned engine, uint32_t ctx_id)
 
 	if (engine == I915_EXEC_RENDER)
 		write_registers(fd, ctx_id, GEN9_LNCFCMOCS0,
-				write_values, ARRAY_SIZE(write_values),
+				write_values, ARRAY_SIZE(write_values)/2,
 				engine);
 }
 
@@ -390,6 +430,13 @@ static void run_test(int fd, unsigned engine, unsigned flags, unsigned mode)
 	uint32_t ctx_clean_id;
 	uint32_t ctx_dirty_id;
 
+	/* As mocs is global for GEN11+, trying to dirtying the mocs
+	 * and testing context save and restore of mocs between contexts
+	 * is bound to fail.
+	 */
+	if (flags & MOCS_DIRTY_VALUES)
+		igt_skip_on(intel_gen(intel_get_drm_devid(fd)) >= 11);
+
 	gem_require_ring(fd, engine);
 
 	/* Skip if we don't know where the registers are for this engine */
-- 
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] 44+ messages in thread

* [igt-dev] ✗ Fi.CI.BAT: failure for i915/gem_mocs_settings: Add mocs table for icelake (rev7)
  2019-02-15 21:46 [igt-dev] [PATCH i-g-t] i915/gem_mocs_settings: Add mocs table for icelake Prathap Kumar Valsan via igt-dev
                   ` (11 preceding siblings ...)
  2019-03-12 15:14 ` [igt-dev] [PATCH i-g-t v5] i915/gem_mocs_settings: Add mocs table for icelake Prathap Kumar Valsan
@ 2019-03-13 12:12 ` Patchwork
  2019-03-14  0:12 ` [igt-dev] [PATCH i-g-t v5] i915/gem_mocs_settings: Add mocs table for icelake Prathap Kumar Valsan
                   ` (7 subsequent siblings)
  20 siblings, 0 replies; 44+ messages in thread
From: Patchwork @ 2019-03-13 12:12 UTC (permalink / raw)
  To: Prathap Kumar Valsan; +Cc: igt-dev

== Series Details ==

Series: i915/gem_mocs_settings: Add mocs table for icelake (rev7)
URL   : https://patchwork.freedesktop.org/series/56459/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_5737 -> IGTPW_2597
====================================================

Summary
-------

  **FAILURE**

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

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

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

### IGT changes ###

#### Possible regressions ####

  * igt@gem_ctx_exec@basic:
    - fi-icl-u3:          PASS -> INCOMPLETE

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

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

### IGT changes ###

#### Issues hit ####

  * igt@amdgpu/amd_cs_nop@fork-gfx0:
    - fi-icl-u2:          NOTRUN -> SKIP [fdo#109315] +17

  * igt@gem_ctx_create@basic-files:
    - fi-gdg-551:         NOTRUN -> SKIP [fdo#109271] +106

  * igt@gem_exec_basic@gtt-bsd2:
    - fi-byt-clapper:     NOTRUN -> SKIP [fdo#109271] +57

  * igt@gem_exec_basic@readonly-bsd1:
    - fi-snb-2520m:       NOTRUN -> SKIP [fdo#109271] +57
    - fi-icl-u2:          NOTRUN -> SKIP [fdo#109276] +7

  * igt@gem_exec_parse@basic-allowed:
    - fi-icl-u2:          NOTRUN -> SKIP [fdo#109289] +1

  * igt@i915_selftest@live_contexts:
    - fi-icl-u2:          NOTRUN -> DMESG-FAIL [fdo#108569]

  * igt@kms_addfb_basic@addfb25-y-tiled-small:
    - fi-byt-n2820:       NOTRUN -> SKIP [fdo#109271] +56

  * igt@kms_busy@basic-flip-c:
    - fi-blb-e6850:       NOTRUN -> SKIP [fdo#109271] / [fdo#109278]
    - fi-byt-clapper:     NOTRUN -> SKIP [fdo#109271] / [fdo#109278]
    - fi-gdg-551:         NOTRUN -> SKIP [fdo#109271] / [fdo#109278]
    - fi-snb-2520m:       NOTRUN -> SKIP [fdo#109271] / [fdo#109278]
    - fi-byt-n2820:       NOTRUN -> SKIP [fdo#109271] / [fdo#109278]

  * igt@kms_chamelium@dp-edid-read:
    - fi-icl-u2:          NOTRUN -> SKIP [fdo#109316] +2

  * igt@kms_chamelium@hdmi-edid-read:
    - fi-hsw-peppy:       NOTRUN -> SKIP [fdo#109271] +46

  * igt@kms_chamelium@vga-hpd-fast:
    - fi-icl-u2:          NOTRUN -> SKIP [fdo#109309] +1

  * igt@kms_force_connector_basic@prune-stale-modes:
    - fi-icl-u2:          NOTRUN -> SKIP [fdo#109285] +3

  * igt@kms_frontbuffer_tracking@basic:
    - fi-hsw-peppy:       NOTRUN -> DMESG-FAIL [fdo#102614] / [fdo#107814]
    - fi-icl-u2:          NOTRUN -> FAIL [fdo#103167]
    - fi-byt-clapper:     NOTRUN -> FAIL [fdo#103167]

  * igt@kms_pipe_crc_basic@hang-read-crc-pipe-c:
    - fi-blb-e6850:       NOTRUN -> SKIP [fdo#109271] +20

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

  * igt@kms_pipe_crc_basic@suspend-read-crc-pipe-b:
    - fi-blb-e6850:       NOTRUN -> INCOMPLETE [fdo#107718]

  
#### Possible fixes ####

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

  
  [fdo#102614]: https://bugs.freedesktop.org/show_bug.cgi?id=102614
  [fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
  [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#107814]: https://bugs.freedesktop.org/show_bug.cgi?id=107814
  [fdo#108569]: https://bugs.freedesktop.org/show_bug.cgi?id=108569
  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [fdo#109276]: https://bugs.freedesktop.org/show_bug.cgi?id=109276
  [fdo#109278]: https://bugs.freedesktop.org/show_bug.cgi?id=109278
  [fdo#109285]: https://bugs.freedesktop.org/show_bug.cgi?id=109285
  [fdo#109289]: https://bugs.freedesktop.org/show_bug.cgi?id=109289
  [fdo#109309]: https://bugs.freedesktop.org/show_bug.cgi?id=109309
  [fdo#109315]: https://bugs.freedesktop.org/show_bug.cgi?id=109315
  [fdo#109316]: https://bugs.freedesktop.org/show_bug.cgi?id=109316


Participating hosts (41 -> 42)
------------------------------

  Additional (6): fi-hsw-peppy fi-icl-u2 fi-snb-2520m fi-gdg-551 fi-byt-n2820 fi-byt-clapper 
  Missing    (5): fi-kbl-soraka fi-ilk-m540 fi-hsw-4200u fi-ctg-p8600 fi-bdw-samus 


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

    * IGT: IGT_4883 -> IGTPW_2597

  CI_DRM_5737: d5bb7d77aa77996702426496078a597f30bead58 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_2597: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2597/
  IGT_4883: b25e06d6ddf2e42044cd9c93b613cbc7339a8c33 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Logs ==

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

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

* Re: [igt-dev] [PATCH i-g-t v5] i915/gem_mocs_settings: Add mocs table for icelake
  2019-03-12 15:14 ` [igt-dev] [PATCH i-g-t v5] i915/gem_mocs_settings: Add mocs table for icelake Prathap Kumar Valsan
@ 2019-03-13 13:58   ` Kalamarz, Lukasz
  2019-03-14  9:18     ` Chris Wilson
  0 siblings, 1 reply; 44+ messages in thread
From: Kalamarz, Lukasz @ 2019-03-13 13:58 UTC (permalink / raw)
  To: igt-dev, Kumar Valsan, Prathap; +Cc: De Marchi, Lucas

On Tue, 2019-03-12 at 11:14 -0400, Prathap Kumar Valsan wrote:
> From: "Kumar Valsan, Prathap" <prathap.kumar.valsan@intel.com>
> 
> This patch adds mocs table for icelake with expected L3 and eDRAM
> control values.
> 
> Signed-off-by: Kumar Valsan, Prathap <prathap.kumar.valsan@intel.com>
> ---

Chris and Tomek suggested creating negative scenario, that will verify
setting dirty mocs values instead of skipping for gen11+. But if they
will agree that this is not a blocker, then 
Signed-off-by: Lukasz Kalamarz <lukasz.kalamarz@intel.com>

> Changes in v5:
> - As mocs table is global, test need not write
>   mocs table. Below jira has the discussion. 
>   https://jira.devtools.intel.com/browse/VLK-1567
> Changes in v4:
> - L3 control registers are global in icelake.
>   Test validates that dirty writes from userspace
>   to L3 control registers are being dropped. 
> Changes in v3:
> - There are holes in the mocs table(Lucas Pointed out).
>   In icelake index 16 and 17 are reserved.
>   So test shouldn't be checking them.
> Changes in v2:
> - Cleaned up the code based on review
>   comments from Lucas and Chris
>  tests/i915/gem_mocs_settings.c | 103 ++++++++++++++++++++++++-------
> --
>  1 file changed, 75 insertions(+), 28 deletions(-)
> 
> diff --git a/tests/i915/gem_mocs_settings.c
> b/tests/i915/gem_mocs_settings.c
> index 5b3b6bc1..901cef38 100644
> --- a/tests/i915/gem_mocs_settings.c
> +++ b/tests/i915/gem_mocs_settings.c
> @@ -32,7 +32,9 @@
>  #include "igt_perf.h"
>  #include "igt_sysfs.h"
>  
> -#define MAX_NUMBER_MOCS_REGISTERS	(64)
> +#define GEN9_NUM_MOCS_ENTRIES   62  /* 62 out of 64 - 63 & 64 are
> reserved. */
> +#define GEN11_NUM_MOCS_ENTRIES  64  /* 63-64 are reserved, but
> configured. */
> +
>  enum {
>  	NONE,
>  	RESET,
> @@ -61,10 +63,13 @@ static const char * const test_modes[] = {
>  #define GEN9_MFX1_MOCS_0	(0xcA00)	/* Media 1 MOCS base
> register*/
>  #define GEN9_VEBOX_MOCS_0	(0xcB00)	/* Video MOCS base register*/
>  #define GEN9_BLT_MOCS_0		(0xcc00)	/* Blitter MOCS base
> register*/
> +#define ICELAKE_MOCS_PTE	{0x00000004, 0x0030, 0x1}
> +#define MOCS_PTE		{0x00000038, 0x0030, 0x1}
>  
>  struct mocs_entry {
>  	uint32_t	control_value;
>  	uint16_t	l3cc_value;
> +	uint8_t 	used;
>  };
>  
>  struct mocs_table {
> @@ -73,35 +78,59 @@ struct mocs_table {
>  };
>  
>  /* The first entries in the MOCS tables are defined by uABI */
> -static const struct mocs_entry skylake_mocs_table[] = {
> -	{ 0x00000009, 0x0010 },
> -	{ 0x00000038, 0x0030 },
> -	{ 0x0000003b, 0x0030 },
> +static const struct mocs_entry
> icelake_mocs_table[GEN11_NUM_MOCS_ENTRIES] = {
> +	[0]  = { 0x00000005, 0x0010, 0x1},
> +	[1]  = ICELAKE_MOCS_PTE,
> +	[2]  = { 0x00000037, 0x0030, 0x1},
> +	[3]  = { 0x00000005, 0x0010, 0x1},
> +	[4]  = { 0x00000005, 0x0030, 0x1},
> +	[5]  = { 0x00000037, 0x0010, 0x1},
> +	[6]  = { 0x00000017, 0x0010, 0x1},
> +	[7]  = { 0x00000017, 0x0030, 0x1},
> +	[8]  = { 0x00000027, 0x0010, 0x1},
> +	[9]  = { 0x00000027, 0x0030, 0x1},
> +	[10] = { 0x00000077, 0x0010, 0x1},
> +	[11] = { 0x00000077, 0x0030, 0x1},
> +	[12] = { 0x00000057, 0x0010, 0x1},
> +	[13] = { 0x00000057, 0x0030, 0x1},
> +	[14] = { 0x00000067, 0x0010, 0x1},
> +	[15] = { 0x00000067, 0x0030, 0x1},
> +	[18] = { 0x00060037, 0x0030, 0x1},
> +	[19] = { 0x00000737, 0x0030, 0x1},
> +	[20] = { 0x00000337, 0x0030, 0x1},
> +	[21] = { 0x00000137, 0x0030, 0x1},
> +	[22] = { 0x000003b7, 0x0030, 0x1},
> +	[23] = { 0x000007b7, 0x0030, 0x1},
> +	[24 ... 61] = ICELAKE_MOCS_PTE,
> +	[62] = { 0x00000037, 0x0010, 0x1},
> +	[63] = { 0x00000037, 0x0010, 0x1},
> +};
> +
> +
> +static const struct mocs_entry
> skylake_mocs_table[GEN9_NUM_MOCS_ENTRIES] = {
> +	[0] = { 0x00000009, 0x0010, 0x1},
> +	[1] = MOCS_PTE,
> +	[2] = { 0x0000003b, 0x0030, 0x1},
> +	[3 ... GEN9_NUM_MOCS_ENTRIES - 1] = MOCS_PTE,
>  };
>  
> -static const struct mocs_entry dirty_skylake_mocs_table[] = {
> -	{ 0x00003FFF, 0x003F }, /* no snoop bit */
> -	{ 0x00003FFF, 0x003F },
> -	{ 0x00003FFF, 0x003F },
> +static const struct mocs_entry
> dirty_skylake_mocs_table[GEN9_NUM_MOCS_ENTRIES] = {
> +	[0 ... GEN9_NUM_MOCS_ENTRIES - 1] = { 0x00003FFF, 0x003F, 0x1
> },
>  };
>  
> -static const struct mocs_entry broxton_mocs_table[] = {
> -	{ 0x00000009, 0x0010 },
> -	{ 0x00000038, 0x0030 },
> -	{ 0x00000039, 0x0030 },
> +static const struct mocs_entry
> broxton_mocs_table[GEN9_NUM_MOCS_ENTRIES] = {
> +	[0] = { 0x00000009, 0x0010, 0x1},
> +	[1] = MOCS_PTE,
> +	[2] = { 0x00000039, 0x0030, 0x1},
> +	[3 ... GEN9_NUM_MOCS_ENTRIES - 1] = MOCS_PTE,
>  };
>  
> -static const struct mocs_entry dirty_broxton_mocs_table[] = {
> -	{ 0x00007FFF, 0x003F },
> -	{ 0x00007FFF, 0x003F },
> -	{ 0x00007FFF, 0x003F },
> +static const struct mocs_entry
> dirty_broxton_mocs_table[GEN9_NUM_MOCS_ENTRIES] = {
> +	[0 ... GEN9_NUM_MOCS_ENTRIES - 1] = { 0x00007FFF, 0x003F, 0x1
> },
>  };
>  
> -static const uint32_t write_values[] = {
> -	0xFFFFFFFF,
> -	0xFFFFFFFF,
> -	0xFFFFFFFF,
> -	0xFFFFFFFF
> +static const uint32_t write_values[GEN9_NUM_MOCS_ENTRIES] = {
> +	[0 ... GEN9_NUM_MOCS_ENTRIES - 1] = 0xFFFFFFFF,
>  };
>  
>  static bool get_mocs_settings(int fd, struct mocs_table *table, bool
> dirty)
> @@ -127,6 +156,10 @@ static bool get_mocs_settings(int fd, struct
> mocs_table *table, bool dirty)
>  			table->table = broxton_mocs_table;
>  		}
>  		result = true;
> +	} else if (IS_ICELAKE(devid)) {
> +		table->size  = ARRAY_SIZE(icelake_mocs_table);
> +		table->table = icelake_mocs_table;
> +		result = true;
>  	}
>  
>  	return result;
> @@ -283,9 +316,12 @@ static void check_control_registers(int fd,
>  	read_regs = gem_mmap__cpu(fd, dst_handle, 0, 4096, PROT_READ);
>  
>  	gem_set_domain(fd, dst_handle, I915_GEM_DOMAIN_CPU, 0);
> -	for (int index = 0; index < table.size; index++)
> +	for (int index = 0; index < table.size; index++) {
> +		if (!table.table[index].used)
> +			continue;
>  		igt_assert_eq_u32(read_regs[index],
>  				  table.table[index].control_value);
> +	}
>  
>  	munmap(read_regs, 4096);
>  	gem_close(fd, dst_handle);
> @@ -315,10 +351,14 @@ static void check_l3cc_registers(int fd,
>  	gem_set_domain(fd, dst_handle, I915_GEM_DOMAIN_CPU, 0);
>  
>  	for (index = 0; index < table.size / 2; index++) {
> -		igt_assert_eq_u32(read_regs[index] & 0xffff,
> -				  table.table[index * 2].l3cc_value);
> -		igt_assert_eq_u32(read_regs[index] >> 16,
> -				  table.table[index * 2 +
> 1].l3cc_value);
> +		if (table.table[index * 2].used) {
> +			igt_assert_eq_u32(read_regs[index] & 0xffff,
> +					  table.table[index *
> 2].l3cc_value);
> +		}
> +		if (table.table[index * 2 + 1].used) {
> +			igt_assert_eq_u32(read_regs[index] >> 16,
> +					  table.table[index * 2 +
> 1].l3cc_value);
> +		}
>  	}
>  
>  	if (table.size & 1)
> @@ -380,7 +420,7 @@ static void write_dirty_mocs(int fd, unsigned
> engine, uint32_t ctx_id)
>  
>  	if (engine == I915_EXEC_RENDER)
>  		write_registers(fd, ctx_id, GEN9_LNCFCMOCS0,
> -				write_values, ARRAY_SIZE(write_values),
> +				write_values,
> ARRAY_SIZE(write_values)/2,
>  				engine);
>  }
>  
> @@ -390,6 +430,13 @@ static void run_test(int fd, unsigned engine,
> unsigned flags, unsigned mode)
>  	uint32_t ctx_clean_id;
>  	uint32_t ctx_dirty_id;
>  
> +	/* As mocs is global for GEN11+, trying to dirtying the mocs
> +	 * and testing context save and restore of mocs between
> contexts
> +	 * is bound to fail.
> +	 */
> +	if (flags & MOCS_DIRTY_VALUES)
> +		igt_skip_on(intel_gen(intel_get_drm_devid(fd)) >= 11);
> +
>  	gem_require_ring(fd, engine);
>  
>  	/* Skip if we don't know where the registers are for this
> engine */
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] [PATCH i-g-t v5] i915/gem_mocs_settings: Add mocs table for icelake
  2019-02-15 21:46 [igt-dev] [PATCH i-g-t] i915/gem_mocs_settings: Add mocs table for icelake Prathap Kumar Valsan via igt-dev
                   ` (12 preceding siblings ...)
  2019-03-13 12:12 ` [igt-dev] ✗ Fi.CI.BAT: failure for i915/gem_mocs_settings: Add mocs table for icelake (rev7) Patchwork
@ 2019-03-14  0:12 ` Prathap Kumar Valsan
  2019-03-14  0:47 ` [igt-dev] ✗ Fi.CI.BAT: failure for i915/gem_mocs_settings: Add mocs table for icelake (rev8) Patchwork
                   ` (6 subsequent siblings)
  20 siblings, 0 replies; 44+ messages in thread
From: Prathap Kumar Valsan @ 2019-03-14  0:12 UTC (permalink / raw)
  To: igt-dev; +Cc: Lucas De Marchi

From: "Kumar Valsan, Prathap" <prathap.kumar.valsan@intel.com>

This patch adds mocs table for icelake with expected L3 and eDRAM
control values.

Signed-off-by: Kumar Valsan, Prathap <prathap.kumar.valsan@intel.com>
---
Changes in v5:
- As mocs table is global, test need not write
  mocs table. Below jira has the discussion. 
  https://jira.devtools.intel.com/browse/VLK-1567
Changes in v4:
- L3 control registers are global in icelake.
  Test validates that dirty writes from userspace
  to L3 control registers are being dropped. 
Changes in v3:
- There are holes in the mocs table(Lucas Pointed out).
  In icelake index 16 and 17 are reserved.
  So test shouldn't be checking them.
Changes in v2:
- Cleaned up the code based on review
  comments from Lucas and Chris
 tests/i915/gem_mocs_settings.c | 103 ++++++++++++++++++++++++---------
 1 file changed, 75 insertions(+), 28 deletions(-)

diff --git a/tests/i915/gem_mocs_settings.c b/tests/i915/gem_mocs_settings.c
index 5b3b6bc1..901cef38 100644
--- a/tests/i915/gem_mocs_settings.c
+++ b/tests/i915/gem_mocs_settings.c
@@ -32,7 +32,9 @@
 #include "igt_perf.h"
 #include "igt_sysfs.h"
 
-#define MAX_NUMBER_MOCS_REGISTERS	(64)
+#define GEN9_NUM_MOCS_ENTRIES   62  /* 62 out of 64 - 63 & 64 are reserved. */
+#define GEN11_NUM_MOCS_ENTRIES  64  /* 63-64 are reserved, but configured. */
+
 enum {
 	NONE,
 	RESET,
@@ -61,10 +63,13 @@ static const char * const test_modes[] = {
 #define GEN9_MFX1_MOCS_0	(0xcA00)	/* Media 1 MOCS base register*/
 #define GEN9_VEBOX_MOCS_0	(0xcB00)	/* Video MOCS base register*/
 #define GEN9_BLT_MOCS_0		(0xcc00)	/* Blitter MOCS base register*/
+#define ICELAKE_MOCS_PTE	{0x00000004, 0x0030, 0x1}
+#define MOCS_PTE		{0x00000038, 0x0030, 0x1}
 
 struct mocs_entry {
 	uint32_t	control_value;
 	uint16_t	l3cc_value;
+	uint8_t 	used;
 };
 
 struct mocs_table {
@@ -73,35 +78,59 @@ struct mocs_table {
 };
 
 /* The first entries in the MOCS tables are defined by uABI */
-static const struct mocs_entry skylake_mocs_table[] = {
-	{ 0x00000009, 0x0010 },
-	{ 0x00000038, 0x0030 },
-	{ 0x0000003b, 0x0030 },
+static const struct mocs_entry icelake_mocs_table[GEN11_NUM_MOCS_ENTRIES] = {
+	[0]  = { 0x00000005, 0x0010, 0x1},
+	[1]  = ICELAKE_MOCS_PTE,
+	[2]  = { 0x00000037, 0x0030, 0x1},
+	[3]  = { 0x00000005, 0x0010, 0x1},
+	[4]  = { 0x00000005, 0x0030, 0x1},
+	[5]  = { 0x00000037, 0x0010, 0x1},
+	[6]  = { 0x00000017, 0x0010, 0x1},
+	[7]  = { 0x00000017, 0x0030, 0x1},
+	[8]  = { 0x00000027, 0x0010, 0x1},
+	[9]  = { 0x00000027, 0x0030, 0x1},
+	[10] = { 0x00000077, 0x0010, 0x1},
+	[11] = { 0x00000077, 0x0030, 0x1},
+	[12] = { 0x00000057, 0x0010, 0x1},
+	[13] = { 0x00000057, 0x0030, 0x1},
+	[14] = { 0x00000067, 0x0010, 0x1},
+	[15] = { 0x00000067, 0x0030, 0x1},
+	[18] = { 0x00060037, 0x0030, 0x1},
+	[19] = { 0x00000737, 0x0030, 0x1},
+	[20] = { 0x00000337, 0x0030, 0x1},
+	[21] = { 0x00000137, 0x0030, 0x1},
+	[22] = { 0x000003b7, 0x0030, 0x1},
+	[23] = { 0x000007b7, 0x0030, 0x1},
+	[24 ... 61] = ICELAKE_MOCS_PTE,
+	[62] = { 0x00000037, 0x0010, 0x1},
+	[63] = { 0x00000037, 0x0010, 0x1},
+};
+
+
+static const struct mocs_entry skylake_mocs_table[GEN9_NUM_MOCS_ENTRIES] = {
+	[0] = { 0x00000009, 0x0010, 0x1},
+	[1] = MOCS_PTE,
+	[2] = { 0x0000003b, 0x0030, 0x1},
+	[3 ... GEN9_NUM_MOCS_ENTRIES - 1] = MOCS_PTE,
 };
 
-static const struct mocs_entry dirty_skylake_mocs_table[] = {
-	{ 0x00003FFF, 0x003F }, /* no snoop bit */
-	{ 0x00003FFF, 0x003F },
-	{ 0x00003FFF, 0x003F },
+static const struct mocs_entry dirty_skylake_mocs_table[GEN9_NUM_MOCS_ENTRIES] = {
+	[0 ... GEN9_NUM_MOCS_ENTRIES - 1] = { 0x00003FFF, 0x003F, 0x1 },
 };
 
-static const struct mocs_entry broxton_mocs_table[] = {
-	{ 0x00000009, 0x0010 },
-	{ 0x00000038, 0x0030 },
-	{ 0x00000039, 0x0030 },
+static const struct mocs_entry broxton_mocs_table[GEN9_NUM_MOCS_ENTRIES] = {
+	[0] = { 0x00000009, 0x0010, 0x1},
+	[1] = MOCS_PTE,
+	[2] = { 0x00000039, 0x0030, 0x1},
+	[3 ... GEN9_NUM_MOCS_ENTRIES - 1] = MOCS_PTE,
 };
 
-static const struct mocs_entry dirty_broxton_mocs_table[] = {
-	{ 0x00007FFF, 0x003F },
-	{ 0x00007FFF, 0x003F },
-	{ 0x00007FFF, 0x003F },
+static const struct mocs_entry dirty_broxton_mocs_table[GEN9_NUM_MOCS_ENTRIES] = {
+	[0 ... GEN9_NUM_MOCS_ENTRIES - 1] = { 0x00007FFF, 0x003F, 0x1 },
 };
 
-static const uint32_t write_values[] = {
-	0xFFFFFFFF,
-	0xFFFFFFFF,
-	0xFFFFFFFF,
-	0xFFFFFFFF
+static const uint32_t write_values[GEN9_NUM_MOCS_ENTRIES] = {
+	[0 ... GEN9_NUM_MOCS_ENTRIES - 1] = 0xFFFFFFFF,
 };
 
 static bool get_mocs_settings(int fd, struct mocs_table *table, bool dirty)
@@ -127,6 +156,10 @@ static bool get_mocs_settings(int fd, struct mocs_table *table, bool dirty)
 			table->table = broxton_mocs_table;
 		}
 		result = true;
+	} else if (IS_ICELAKE(devid)) {
+		table->size  = ARRAY_SIZE(icelake_mocs_table);
+		table->table = icelake_mocs_table;
+		result = true;
 	}
 
 	return result;
@@ -283,9 +316,12 @@ static void check_control_registers(int fd,
 	read_regs = gem_mmap__cpu(fd, dst_handle, 0, 4096, PROT_READ);
 
 	gem_set_domain(fd, dst_handle, I915_GEM_DOMAIN_CPU, 0);
-	for (int index = 0; index < table.size; index++)
+	for (int index = 0; index < table.size; index++) {
+		if (!table.table[index].used)
+			continue;
 		igt_assert_eq_u32(read_regs[index],
 				  table.table[index].control_value);
+	}
 
 	munmap(read_regs, 4096);
 	gem_close(fd, dst_handle);
@@ -315,10 +351,14 @@ static void check_l3cc_registers(int fd,
 	gem_set_domain(fd, dst_handle, I915_GEM_DOMAIN_CPU, 0);
 
 	for (index = 0; index < table.size / 2; index++) {
-		igt_assert_eq_u32(read_regs[index] & 0xffff,
-				  table.table[index * 2].l3cc_value);
-		igt_assert_eq_u32(read_regs[index] >> 16,
-				  table.table[index * 2 + 1].l3cc_value);
+		if (table.table[index * 2].used) {
+			igt_assert_eq_u32(read_regs[index] & 0xffff,
+					  table.table[index * 2].l3cc_value);
+		}
+		if (table.table[index * 2 + 1].used) {
+			igt_assert_eq_u32(read_regs[index] >> 16,
+					  table.table[index * 2 + 1].l3cc_value);
+		}
 	}
 
 	if (table.size & 1)
@@ -380,7 +420,7 @@ static void write_dirty_mocs(int fd, unsigned engine, uint32_t ctx_id)
 
 	if (engine == I915_EXEC_RENDER)
 		write_registers(fd, ctx_id, GEN9_LNCFCMOCS0,
-				write_values, ARRAY_SIZE(write_values),
+				write_values, ARRAY_SIZE(write_values)/2,
 				engine);
 }
 
@@ -390,6 +430,13 @@ static void run_test(int fd, unsigned engine, unsigned flags, unsigned mode)
 	uint32_t ctx_clean_id;
 	uint32_t ctx_dirty_id;
 
+	/* As mocs is global for GEN11+, trying to dirtying the mocs
+	 * and testing context save and restore of mocs between contexts
+	 * is bound to fail.
+	 */
+	if (flags & MOCS_DIRTY_VALUES)
+		igt_skip_on(intel_gen(intel_get_drm_devid(fd)) >= 11);
+
 	gem_require_ring(fd, engine);
 
 	/* Skip if we don't know where the registers are for this engine */
-- 
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] 44+ messages in thread

* [igt-dev] ✗ Fi.CI.BAT: failure for i915/gem_mocs_settings: Add mocs table for icelake (rev8)
  2019-02-15 21:46 [igt-dev] [PATCH i-g-t] i915/gem_mocs_settings: Add mocs table for icelake Prathap Kumar Valsan via igt-dev
                   ` (13 preceding siblings ...)
  2019-03-14  0:12 ` [igt-dev] [PATCH i-g-t v5] i915/gem_mocs_settings: Add mocs table for icelake Prathap Kumar Valsan
@ 2019-03-14  0:47 ` Patchwork
  2019-03-14 17:28 ` [igt-dev] [PATCH i-g-t v6] i915/gem_mocs_settings: Add mocs table for icelake Prathap Kumar Valsan
                   ` (5 subsequent siblings)
  20 siblings, 0 replies; 44+ messages in thread
From: Patchwork @ 2019-03-14  0:47 UTC (permalink / raw)
  To: Prathap Kumar Valsan; +Cc: igt-dev

== Series Details ==

Series: i915/gem_mocs_settings: Add mocs table for icelake (rev8)
URL   : https://patchwork.freedesktop.org/series/56459/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_5742 -> IGTPW_2613
====================================================

Summary
-------

  **FAILURE**

  Serious unknown changes coming with IGTPW_2613 absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in IGTPW_2613, 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/56459/revisions/8/mbox/

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

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

### IGT changes ###

#### Possible regressions ####

  * igt@i915_selftest@live_hangcheck:
    - fi-cfl-8109u:       PASS -> DMESG-FAIL

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

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

### IGT changes ###

#### Issues hit ####

  * igt@amdgpu/amd_basic@userptr:
    - fi-whl-u:           NOTRUN -> SKIP [fdo#109271] +41

  * igt@gem_ctx_create@basic-files:
    - fi-gdg-551:         NOTRUN -> SKIP [fdo#109271] +106

  * igt@gem_exec_basic@readonly-bsd1:
    - fi-snb-2520m:       NOTRUN -> SKIP [fdo#109271] +57

  * igt@i915_pm_rpm@basic-pci-d3-state:
    - fi-byt-j1900:       PASS -> SKIP [fdo#109271]
    - fi-bsw-kefka:       PASS -> SKIP [fdo#109271]

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

  * igt@kms_busy@basic-flip-a:
    - fi-gdg-551:         NOTRUN -> FAIL [fdo#103182] +1

  * igt@kms_busy@basic-flip-c:
    - fi-blb-e6850:       NOTRUN -> SKIP [fdo#109271] / [fdo#109278]
    - fi-gdg-551:         NOTRUN -> SKIP [fdo#109271] / [fdo#109278]
    - fi-snb-2520m:       NOTRUN -> SKIP [fdo#109271] / [fdo#109278]

  * igt@kms_chamelium@hdmi-edid-read:
    - fi-hsw-peppy:       NOTRUN -> SKIP [fdo#109271] +46

  * igt@kms_frontbuffer_tracking@basic:
    - fi-hsw-peppy:       NOTRUN -> DMESG-FAIL [fdo#102614] / [fdo#107814]

  * igt@kms_pipe_crc_basic@hang-read-crc-pipe-c:
    - fi-blb-e6850:       NOTRUN -> SKIP [fdo#109271] +48

  * igt@kms_pipe_crc_basic@suspend-read-crc-pipe-b:
    - fi-byt-clapper:     PASS -> FAIL [fdo#103191] / [fdo#107362] +1

  * igt@kms_psr@cursor_plane_move:
    - fi-whl-u:           NOTRUN -> FAIL [fdo#107383] +3

  * igt@prime_vgem@basic-fence-flip:
    - fi-gdg-551:         NOTRUN -> DMESG-FAIL [fdo#103182]

  * igt@runner@aborted:
    - fi-bxt-dsi:         NOTRUN -> FAIL [fdo#109516]

  
#### Possible fixes ####

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

  * igt@i915_selftest@live_evict:
    - fi-bsw-kefka:       DMESG-WARN [fdo#107709] -> PASS

  
  [fdo#102614]: https://bugs.freedesktop.org/show_bug.cgi?id=102614
  [fdo#103182]: https://bugs.freedesktop.org/show_bug.cgi?id=103182
  [fdo#103191]: https://bugs.freedesktop.org/show_bug.cgi?id=103191
  [fdo#107362]: https://bugs.freedesktop.org/show_bug.cgi?id=107362
  [fdo#107383]: https://bugs.freedesktop.org/show_bug.cgi?id=107383
  [fdo#107709]: https://bugs.freedesktop.org/show_bug.cgi?id=107709
  [fdo#107718]: https://bugs.freedesktop.org/show_bug.cgi?id=107718
  [fdo#107814]: https://bugs.freedesktop.org/show_bug.cgi?id=107814
  [fdo#108800]: https://bugs.freedesktop.org/show_bug.cgi?id=108800
  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [fdo#109278]: https://bugs.freedesktop.org/show_bug.cgi?id=109278
  [fdo#109516]: https://bugs.freedesktop.org/show_bug.cgi?id=109516


Participating hosts (42 -> 40)
------------------------------

  Additional (5): fi-bxt-dsi fi-hsw-peppy fi-snb-2520m fi-whl-u fi-gdg-551 
  Missing    (7): fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-icl-u3 fi-icl-y fi-bdw-samus 


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

    * IGT: IGT_4884 -> IGTPW_2613

  CI_DRM_5742: 519a3f67aadea184cb97720c838946c1ba81c875 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_2613: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2613/
  IGT_4884: c46051337b972f8b5a302afb6f603df06fea527d @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Logs ==

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

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

* Re: [igt-dev] [PATCH i-g-t v5] i915/gem_mocs_settings: Add mocs table for icelake
  2019-03-13 13:58   ` Kalamarz, Lukasz
@ 2019-03-14  9:18     ` Chris Wilson
  2019-03-14 11:03       ` Kalamarz, Lukasz
  0 siblings, 1 reply; 44+ messages in thread
From: Chris Wilson @ 2019-03-14  9:18 UTC (permalink / raw)
  To: Kalamarz, Lukasz, Kumar Valsan, Prathap, igt-dev; +Cc: De Marchi, Lucas

Quoting Kalamarz, Lukasz (2019-03-13 13:58:59)
> On Tue, 2019-03-12 at 11:14 -0400, Prathap Kumar Valsan wrote:
> > From: "Kumar Valsan, Prathap" <prathap.kumar.valsan@intel.com>
> > 
> > This patch adds mocs table for icelake with expected L3 and eDRAM
> > control values.
> > 
> > Signed-off-by: Kumar Valsan, Prathap <prathap.kumar.valsan@intel.com>
> > ---
> 
> Chris and Tomek suggested creating negative scenario, that will verify
> setting dirty mocs values instead of skipping for gen11+. But if they
> will agree that this is not a blocker, then 
> Signed-off-by: Lukasz Kalamarz <lukasz.kalamarz@intel.com>

It all depends on the level of confidence in follow through.

Lukasz, did you mean s-o-b or r-b? s-o-b just says you've handled the
patch in some official capacity; with an r-b you confirm that the patch
does what it says, and that it is doing the right thing (give or take we
are totally not robots), and so ready for inclusion.
-Chris
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* Re: [igt-dev] [PATCH i-g-t v5] i915/gem_mocs_settings: Add mocs table for icelake
  2019-03-14  9:18     ` Chris Wilson
@ 2019-03-14 11:03       ` Kalamarz, Lukasz
  0 siblings, 0 replies; 44+ messages in thread
From: Kalamarz, Lukasz @ 2019-03-14 11:03 UTC (permalink / raw)
  To: igt-dev, Kumar Valsan, Prathap, chris; +Cc: De Marchi, Lucas

On Thu, 2019-03-14 at 09:18 +0000, Chris Wilson wrote:
> Quoting Kalamarz, Lukasz (2019-03-13 13:58:59)
> > On Tue, 2019-03-12 at 11:14 -0400, Prathap Kumar Valsan wrote:
> > > From: "Kumar Valsan, Prathap" <prathap.kumar.valsan@intel.com>
> > > 
> > > This patch adds mocs table for icelake with expected L3 and eDRAM
> > > control values.
> > > 
> > > Signed-off-by: Kumar Valsan, Prathap <
> > > prathap.kumar.valsan@intel.com>
> > > ---
> > 
> > Chris and Tomek suggested creating negative scenario, that will
> > verify
> > setting dirty mocs values instead of skipping for gen11+. But if
> > they
> > will agree that this is not a blocker, then 
> > Signed-off-by: Lukasz Kalamarz <lukasz.kalamarz@intel.com>
> 
> It all depends on the level of confidence in follow through.
> 
> Lukasz, did you mean s-o-b or r-b? s-o-b just says you've handled the
> patch in some official capacity; with an r-b you confirm that the
> patch
> does what it says, and that it is doing the right thing (give or take
> we
> are totally not robots), and so ready for inclusion.

I meant rb ...
Revieved-by: Lukasz Kalamarz <lukasz.kalamarz@intel.com>
-----
Lukasz
> -Chris
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] [PATCH i-g-t v6] i915/gem_mocs_settings: Add mocs table for icelake
  2019-02-15 21:46 [igt-dev] [PATCH i-g-t] i915/gem_mocs_settings: Add mocs table for icelake Prathap Kumar Valsan via igt-dev
                   ` (14 preceding siblings ...)
  2019-03-14  0:47 ` [igt-dev] ✗ Fi.CI.BAT: failure for i915/gem_mocs_settings: Add mocs table for icelake (rev8) Patchwork
@ 2019-03-14 17:28 ` Prathap Kumar Valsan
  2019-03-15  8:46   ` Chris Wilson
  2019-03-14 18:07 ` [igt-dev] ✓ Fi.CI.BAT: success for i915/gem_mocs_settings: Add mocs table for icelake (rev9) Patchwork
                   ` (4 subsequent siblings)
  20 siblings, 1 reply; 44+ messages in thread
From: Prathap Kumar Valsan @ 2019-03-14 17:28 UTC (permalink / raw)
  To: igt-dev, Chris Wilson, Lis Tomasz; +Cc: De Marchi Lucas

From: "Kumar Valsan, Prathap" <prathap.kumar.valsan@intel.com>

This patch adds mocs table for icelake with expected L3 and eDRAM
control values.

Signed-off-by: Kumar Valsan, Prathap <prathap.kumar.valsan@intel.com>
---
Changes in v6:
- We need to test non-privileged write to MOCS
  is dropped by the hardware.(As suggested by Chris)
Changes in v5:
- As mocs table is global, test need not write
  mocs table. Below jira has the discussion. 
  https://jira.devtools.intel.com/browse/VLK-1567
Changes in v4:
- L3 control registers are global in icelake.
  Test validates that dirty writes from userspace
  to L3 control registers are being dropped. 
Changes in v3:
- There are holes in the mocs table(Lucas Pointed out).
  In icelake index 16 and 17 are reserved.
  So test shouldn't be checking them.
Changes in v2:
- Cleaned up the code based on review
  comments from Lucas and Chris

 tests/i915/gem_mocs_settings.c | 147 ++++++++++++++++++++++++---------
 1 file changed, 109 insertions(+), 38 deletions(-)

diff --git a/tests/i915/gem_mocs_settings.c b/tests/i915/gem_mocs_settings.c
index 5b3b6bc1..3acaa615 100644
--- a/tests/i915/gem_mocs_settings.c
+++ b/tests/i915/gem_mocs_settings.c
@@ -32,7 +32,9 @@
 #include "igt_perf.h"
 #include "igt_sysfs.h"
 
-#define MAX_NUMBER_MOCS_REGISTERS	(64)
+#define GEN9_NUM_MOCS_ENTRIES   62  /* 62 out of 64 - 63 & 64 are reserved. */
+#define GEN11_NUM_MOCS_ENTRIES  64  /* 63-64 are reserved, but configured. */
+
 enum {
 	NONE,
 	RESET,
@@ -52,8 +54,10 @@ static const char * const test_modes[] = {
 
 #define MOCS_NON_DEFAULT_CTX	(1<<0)
 #define MOCS_DIRTY_VALUES	(1<<1)
+#define MOCS_NONPRIVILEGED_DIRTY_VALUES	(1<<2)
 #define ALL_MOCS_FLAGS		(MOCS_NON_DEFAULT_CTX | \
-				 MOCS_DIRTY_VALUES)
+				 MOCS_DIRTY_VALUES | \
+				 MOCS_NONPRIVILEGED_DIRTY_VALUES)
 
 #define GEN9_LNCFCMOCS0		(0xB020)	/* L3 Cache Control base */
 #define GEN9_GFX_MOCS_0		(0xc800)	/* Graphics MOCS base register*/
@@ -61,10 +65,13 @@ static const char * const test_modes[] = {
 #define GEN9_MFX1_MOCS_0	(0xcA00)	/* Media 1 MOCS base register*/
 #define GEN9_VEBOX_MOCS_0	(0xcB00)	/* Video MOCS base register*/
 #define GEN9_BLT_MOCS_0		(0xcc00)	/* Blitter MOCS base register*/
+#define ICELAKE_MOCS_PTE	{0x00000004, 0x0030, 0x1}
+#define MOCS_PTE		{0x00000038, 0x0030, 0x1}
 
 struct mocs_entry {
 	uint32_t	control_value;
 	uint16_t	l3cc_value;
+	uint8_t 	used;
 };
 
 struct mocs_table {
@@ -73,35 +80,58 @@ struct mocs_table {
 };
 
 /* The first entries in the MOCS tables are defined by uABI */
-static const struct mocs_entry skylake_mocs_table[] = {
-	{ 0x00000009, 0x0010 },
-	{ 0x00000038, 0x0030 },
-	{ 0x0000003b, 0x0030 },
+static const struct mocs_entry icelake_mocs_table[GEN11_NUM_MOCS_ENTRIES] = {
+	[0]  = { 0x00000005, 0x0010, 0x1},
+	[1]  = ICELAKE_MOCS_PTE,
+	[2]  = { 0x00000037, 0x0030, 0x1},
+	[3]  = { 0x00000005, 0x0010, 0x1},
+	[4]  = { 0x00000005, 0x0030, 0x1},
+	[5]  = { 0x00000037, 0x0010, 0x1},
+	[6]  = { 0x00000017, 0x0010, 0x1},
+	[7]  = { 0x00000017, 0x0030, 0x1},
+	[8]  = { 0x00000027, 0x0010, 0x1},
+	[9]  = { 0x00000027, 0x0030, 0x1},
+	[10] = { 0x00000077, 0x0010, 0x1},
+	[11] = { 0x00000077, 0x0030, 0x1},
+	[12] = { 0x00000057, 0x0010, 0x1},
+	[13] = { 0x00000057, 0x0030, 0x1},
+	[14] = { 0x00000067, 0x0010, 0x1},
+	[15] = { 0x00000067, 0x0030, 0x1},
+	[18] = { 0x00060037, 0x0030, 0x1},
+	[19] = { 0x00000737, 0x0030, 0x1},
+	[20] = { 0x00000337, 0x0030, 0x1},
+	[21] = { 0x00000137, 0x0030, 0x1},
+	[22] = { 0x000003b7, 0x0030, 0x1},
+	[23] = { 0x000007b7, 0x0030, 0x1},
+	[24 ... 61] = ICELAKE_MOCS_PTE,
+	[62] = { 0x00000037, 0x0010, 0x1},
+	[63] = { 0x00000037, 0x0010, 0x1},
+};
+
+static const struct mocs_entry skylake_mocs_table[GEN9_NUM_MOCS_ENTRIES] = {
+	[0] = { 0x00000009, 0x0010, 0x1},
+	[1] = MOCS_PTE,
+	[2] = { 0x0000003b, 0x0030, 0x1},
+	[3 ... GEN9_NUM_MOCS_ENTRIES - 1] = MOCS_PTE,
 };
 
-static const struct mocs_entry dirty_skylake_mocs_table[] = {
-	{ 0x00003FFF, 0x003F }, /* no snoop bit */
-	{ 0x00003FFF, 0x003F },
-	{ 0x00003FFF, 0x003F },
+static const struct mocs_entry dirty_skylake_mocs_table[GEN9_NUM_MOCS_ENTRIES] = {
+	[0 ... GEN9_NUM_MOCS_ENTRIES - 1] = { 0x00003FFF, 0x003F, 0x1 },
 };
 
-static const struct mocs_entry broxton_mocs_table[] = {
-	{ 0x00000009, 0x0010 },
-	{ 0x00000038, 0x0030 },
-	{ 0x00000039, 0x0030 },
+static const struct mocs_entry broxton_mocs_table[GEN9_NUM_MOCS_ENTRIES] = {
+	[0] = { 0x00000009, 0x0010, 0x1},
+	[1] = MOCS_PTE,
+	[2] = { 0x00000039, 0x0030, 0x1},
+	[3 ... GEN9_NUM_MOCS_ENTRIES - 1] = MOCS_PTE,
 };
 
-static const struct mocs_entry dirty_broxton_mocs_table[] = {
-	{ 0x00007FFF, 0x003F },
-	{ 0x00007FFF, 0x003F },
-	{ 0x00007FFF, 0x003F },
+static const struct mocs_entry dirty_broxton_mocs_table[GEN9_NUM_MOCS_ENTRIES] = {
+	[0 ... GEN9_NUM_MOCS_ENTRIES - 1] = { 0x00007FFF, 0x003F, 0x1 },
 };
 
-static const uint32_t write_values[] = {
-	0xFFFFFFFF,
-	0xFFFFFFFF,
-	0xFFFFFFFF,
-	0xFFFFFFFF
+static const uint32_t write_values[GEN9_NUM_MOCS_ENTRIES] = {
+	[0 ... GEN9_NUM_MOCS_ENTRIES - 1] = 0xFFFFFFFF,
 };
 
 static bool get_mocs_settings(int fd, struct mocs_table *table, bool dirty)
@@ -127,6 +157,10 @@ static bool get_mocs_settings(int fd, struct mocs_table *table, bool dirty)
 			table->table = broxton_mocs_table;
 		}
 		result = true;
+	} else if (IS_ICELAKE(devid)) {
+		table->size  = ARRAY_SIZE(icelake_mocs_table);
+		table->table = icelake_mocs_table;
+		result = true;
 	}
 
 	return result;
@@ -238,7 +272,8 @@ static void write_registers(int fd,
 			    uint32_t reg_base,
 			    const uint32_t *values,
 			    uint32_t size,
-			    uint32_t engine_id)
+			    uint32_t engine_id,
+			    bool privileged)
 {
 	struct drm_i915_gem_exec_object2 obj;
 	struct drm_i915_gem_execbuffer2 execbuf;
@@ -254,7 +289,10 @@ static void write_registers(int fd,
 	execbuf.buffer_count = 1;
 	execbuf.batch_len = create_write_batch(batch, values, size, reg_base);
 	i915_execbuffer2_set_context_id(execbuf, ctx_id);
-	execbuf.flags = I915_EXEC_SECURE | engine_id;
+	if (privileged)
+		execbuf.flags = I915_EXEC_SECURE | engine_id;
+	else
+		execbuf.flags = engine_id;
 
 	gem_write(fd, handle, 0, batch, execbuf.batch_len);
 	gem_execbuf(fd, &execbuf);
@@ -283,9 +321,12 @@ static void check_control_registers(int fd,
 	read_regs = gem_mmap__cpu(fd, dst_handle, 0, 4096, PROT_READ);
 
 	gem_set_domain(fd, dst_handle, I915_GEM_DOMAIN_CPU, 0);
-	for (int index = 0; index < table.size; index++)
+	for (int index = 0; index < table.size; index++) {
+		if (!table.table[index].used)
+			continue;
 		igt_assert_eq_u32(read_regs[index],
 				  table.table[index].control_value);
+	}
 
 	munmap(read_regs, 4096);
 	gem_close(fd, dst_handle);
@@ -315,10 +356,14 @@ static void check_l3cc_registers(int fd,
 	gem_set_domain(fd, dst_handle, I915_GEM_DOMAIN_CPU, 0);
 
 	for (index = 0; index < table.size / 2; index++) {
-		igt_assert_eq_u32(read_regs[index] & 0xffff,
-				  table.table[index * 2].l3cc_value);
-		igt_assert_eq_u32(read_regs[index] >> 16,
-				  table.table[index * 2 + 1].l3cc_value);
+		if (table.table[index * 2].used) {
+			igt_assert_eq_u32(read_regs[index] & 0xffff,
+					  table.table[index * 2].l3cc_value);
+		}
+		if (table.table[index * 2 + 1].used) {
+			igt_assert_eq_u32(read_regs[index] >> 16,
+					  table.table[index * 2 + 1].l3cc_value);
+		}
 	}
 
 	if (table.size & 1)
@@ -372,16 +417,23 @@ static void check_mocs_values(int fd, unsigned engine, uint32_t ctx_id, bool dir
 		check_l3cc_registers(fd, engine, ctx_id, dirty);
 }
 
-static void write_dirty_mocs(int fd, unsigned engine, uint32_t ctx_id)
+static void write_dirty_mocs(int fd, unsigned engine, uint32_t ctx_id, bool privileged)
 {
+	int num_of_mocs_entries;
+
+	if (intel_gen(intel_get_drm_devid(fd)) >= 11)
+		num_of_mocs_entries = GEN11_NUM_MOCS_ENTRIES;
+	else
+		num_of_mocs_entries = GEN9_NUM_MOCS_ENTRIES;
+
 	write_registers(fd, ctx_id, get_engine_base(engine),
-			write_values, ARRAY_SIZE(write_values),
-			engine);
+			write_values, num_of_mocs_entries,
+			engine, privileged);
 
 	if (engine == I915_EXEC_RENDER)
 		write_registers(fd, ctx_id, GEN9_LNCFCMOCS0,
-				write_values, ARRAY_SIZE(write_values),
-				engine);
+				write_values, num_of_mocs_entries/2,
+				engine, privileged);
 }
 
 static void run_test(int fd, unsigned engine, unsigned flags, unsigned mode)
@@ -389,6 +441,14 @@ static void run_test(int fd, unsigned engine, unsigned flags, unsigned mode)
 	uint32_t ctx_id = 0;
 	uint32_t ctx_clean_id;
 	uint32_t ctx_dirty_id;
+	uint32_t ctx_nonprivileged_dirty_id;
+
+	/* As mocs is global for GEN11+, trying privileged write to dirty
+	 * the mocs and testing context save and restore of mocs between
+	 * contexts is bound to fail.
+	 */
+	if (flags & MOCS_DIRTY_VALUES)
+		igt_skip_on(intel_gen(intel_get_drm_devid(fd)) >= 11);
 
 	gem_require_ring(fd, engine);
 
@@ -400,10 +460,20 @@ static void run_test(int fd, unsigned engine, unsigned flags, unsigned mode)
 
 	if (flags & MOCS_DIRTY_VALUES) {
 		ctx_dirty_id = gem_context_create(fd);
-		write_dirty_mocs(fd, engine, ctx_dirty_id);
+		write_dirty_mocs(fd, engine, ctx_dirty_id, true);
 		check_mocs_values(fd, engine, ctx_dirty_id, true);
 	}
 
+	/* Non-privileged write to dirty the mocs
+	 * should be ignored by the hardware
+	 */
+	if (flags & MOCS_NONPRIVILEGED_DIRTY_VALUES) {
+		ctx_nonprivileged_dirty_id = gem_context_create(fd);
+		write_dirty_mocs(fd, engine, ctx_nonprivileged_dirty_id, false);
+		check_mocs_values(fd, engine, ctx_nonprivileged_dirty_id, false);
+	}
+
+
 	check_mocs_values(fd, engine, ctx_id, false);
 
 	switch (mode) {
@@ -472,12 +542,13 @@ igt_main
 					if (flags && e->exec_id != I915_EXEC_RENDER)
 						continue;
 
-					igt_subtest_f("mocs-%s%s%s-%s",
+					igt_subtest_f("mocs-%s%s%s%s-%s",
 						      test_modes[mode],
 						      flags & MOCS_NON_DEFAULT_CTX ? "-ctx": "",
 						      flags & MOCS_DIRTY_VALUES ? "-dirty" : "",
+						      flags & MOCS_NONPRIVILEGED_DIRTY_VALUES ? "-nonprivdirty" : "",
 						      e->name) {
-						if (flags & (MOCS_NON_DEFAULT_CTX | MOCS_DIRTY_VALUES))
+						if (flags & (MOCS_NON_DEFAULT_CTX | MOCS_DIRTY_VALUES | MOCS_NONPRIVILEGED_DIRTY_VALUES))
 							gem_require_contexts(fd);
 
 						run_test(fd, e->exec_id | e->flags, flags, mode);
-- 
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] 44+ messages in thread

* [igt-dev] ✓ Fi.CI.BAT: success for i915/gem_mocs_settings: Add mocs table for icelake (rev9)
  2019-02-15 21:46 [igt-dev] [PATCH i-g-t] i915/gem_mocs_settings: Add mocs table for icelake Prathap Kumar Valsan via igt-dev
                   ` (15 preceding siblings ...)
  2019-03-14 17:28 ` [igt-dev] [PATCH i-g-t v6] i915/gem_mocs_settings: Add mocs table for icelake Prathap Kumar Valsan
@ 2019-03-14 18:07 ` Patchwork
  2019-03-15  2:54 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
                   ` (3 subsequent siblings)
  20 siblings, 0 replies; 44+ messages in thread
From: Patchwork @ 2019-03-14 18:07 UTC (permalink / raw)
  To: Prathap Kumar Valsan; +Cc: igt-dev

== Series Details ==

Series: i915/gem_mocs_settings: Add mocs table for icelake (rev9)
URL   : https://patchwork.freedesktop.org/series/56459/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_5747 -> IGTPW_2624
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/56459/revisions/9/mbox/

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

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

### IGT changes ###

#### Issues hit ####

  * igt@amdgpu/amd_basic@cs-compute:
    - fi-kbl-8809g:       NOTRUN -> FAIL [fdo#108094]

  * igt@amdgpu/amd_basic@cs-sdma:
    - fi-kbl-7500u:       NOTRUN -> SKIP [fdo#109271] +28

  * igt@amdgpu/amd_basic@query-info:
    - fi-bsw-kefka:       NOTRUN -> SKIP [fdo#109271] +55

  * igt@amdgpu/amd_cs_nop@sync-compute0:
    - fi-bdw-gvtdvm:      NOTRUN -> SKIP [fdo#109271] +42

  * igt@gem_ctx_param@basic:
    - fi-gdg-551:         NOTRUN -> SKIP [fdo#109271] +106

  * igt@gem_exec_basic@gtt-bsd1:
    - fi-bxt-j4205:       NOTRUN -> SKIP [fdo#109271] +47

  * igt@gem_exec_basic@gtt-bsd2:
    - fi-byt-clapper:     NOTRUN -> SKIP [fdo#109271] +57

  * igt@gem_exec_store@basic-bsd2:
    - fi-hsw-4770:        NOTRUN -> SKIP [fdo#109271] +41

  * igt@gem_mmap_gtt@basic-write-cpu-read-gtt:
    - fi-apl-guc:         NOTRUN -> SKIP [fdo#109271] +50

  * igt@i915_pm_rpm@basic-rte:
    - fi-byt-n2820:       NOTRUN -> FAIL [fdo#108800]

  * igt@kms_busy@basic-flip-c:
    - fi-gdg-551:         NOTRUN -> SKIP [fdo#109271] / [fdo#109278]
    - fi-bsw-kefka:       NOTRUN -> SKIP [fdo#109271] / [fdo#109278]
    - fi-ilk-650:         NOTRUN -> SKIP [fdo#109271] / [fdo#109278]
    - fi-byt-n2820:       NOTRUN -> SKIP [fdo#109271] / [fdo#109278]
    - fi-byt-clapper:     NOTRUN -> SKIP [fdo#109271] / [fdo#109278]

  * igt@kms_chamelium@common-hpd-after-suspend:
    - fi-kbl-7500u:       NOTRUN -> DMESG-WARN [fdo#102505] / [fdo#103558] / [fdo#105079] / [fdo#105602]

  * igt@kms_chamelium@dp-edid-read:
    - fi-byt-n2820:       NOTRUN -> SKIP [fdo#109271] +57

  * igt@kms_chamelium@dp-hpd-fast:
    - fi-ilk-650:         NOTRUN -> SKIP [fdo#109271] +69

  * igt@kms_frontbuffer_tracking@basic:
    - fi-byt-clapper:     NOTRUN -> FAIL [fdo#103167]

  
#### Possible fixes ####

  * igt@amdgpu/amd_basic@userptr:
    - fi-kbl-8809g:       DMESG-WARN [fdo#108965] -> PASS

  * igt@kms_chamelium@dp-crc-fast:
    - fi-kbl-7500u:       DMESG-WARN [fdo#103841] -> PASS

  
  [fdo#102505]: https://bugs.freedesktop.org/show_bug.cgi?id=102505
  [fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
  [fdo#103558]: https://bugs.freedesktop.org/show_bug.cgi?id=103558
  [fdo#103841]: https://bugs.freedesktop.org/show_bug.cgi?id=103841
  [fdo#105079]: https://bugs.freedesktop.org/show_bug.cgi?id=105079
  [fdo#105602]: https://bugs.freedesktop.org/show_bug.cgi?id=105602
  [fdo#108094]: https://bugs.freedesktop.org/show_bug.cgi?id=108094
  [fdo#108800]: https://bugs.freedesktop.org/show_bug.cgi?id=108800
  [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


Participating hosts (32 -> 33)
------------------------------

  Additional (9): fi-bdw-gvtdvm fi-ilk-650 fi-apl-guc fi-hsw-4770 fi-bxt-j4205 fi-gdg-551 fi-bsw-kefka fi-byt-n2820 fi-byt-clapper 
  Missing    (8): fi-ilk-m540 fi-icl-u2 fi-skl-6260u fi-snb-2520m fi-bsw-cyan fi-kbl-x1275 fi-icl-y fi-bdw-samus 


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

    * IGT: IGT_4885 -> IGTPW_2624

  CI_DRM_5747: 5b9f7d954ed4502fddc9d4b0ee09e59a1ef92895 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_2624: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2624/
  IGT_4885: 1e057f43cd30ab6acfd40794673843942521c0c5 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools



== Testlist changes ==

+igt@gem_mocs_settings@mocs-hibernate-ctx-dirty-nonprivdirty-render
+igt@gem_mocs_settings@mocs-hibernate-ctx-nonprivdirty-render
+igt@gem_mocs_settings@mocs-hibernate-dirty-nonprivdirty-render
+igt@gem_mocs_settings@mocs-hibernate-nonprivdirty-render
+igt@gem_mocs_settings@mocs-rc6-ctx-dirty-nonprivdirty-render
+igt@gem_mocs_settings@mocs-rc6-ctx-nonprivdirty-render
+igt@gem_mocs_settings@mocs-rc6-dirty-nonprivdirty-render
+igt@gem_mocs_settings@mocs-rc6-nonprivdirty-render
+igt@gem_mocs_settings@mocs-reset-ctx-dirty-nonprivdirty-render
+igt@gem_mocs_settings@mocs-reset-ctx-nonprivdirty-render
+igt@gem_mocs_settings@mocs-reset-dirty-nonprivdirty-render
+igt@gem_mocs_settings@mocs-reset-nonprivdirty-render
+igt@gem_mocs_settings@mocs-settings-ctx-dirty-nonprivdirty-render
+igt@gem_mocs_settings@mocs-settings-ctx-nonprivdirty-render
+igt@gem_mocs_settings@mocs-settings-dirty-nonprivdirty-render
+igt@gem_mocs_settings@mocs-settings-nonprivdirty-render
+igt@gem_mocs_settings@mocs-suspend-ctx-dirty-nonprivdirty-render
+igt@gem_mocs_settings@mocs-suspend-ctx-nonprivdirty-render
+igt@gem_mocs_settings@mocs-suspend-dirty-nonprivdirty-render
+igt@gem_mocs_settings@mocs-suspend-nonprivdirty-render

== Logs ==

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

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

* [igt-dev] ✗ Fi.CI.IGT: failure for i915/gem_mocs_settings: Add mocs table for icelake (rev9)
  2019-02-15 21:46 [igt-dev] [PATCH i-g-t] i915/gem_mocs_settings: Add mocs table for icelake Prathap Kumar Valsan via igt-dev
                   ` (16 preceding siblings ...)
  2019-03-14 18:07 ` [igt-dev] ✓ Fi.CI.BAT: success for i915/gem_mocs_settings: Add mocs table for icelake (rev9) Patchwork
@ 2019-03-15  2:54 ` Patchwork
  2019-03-15 19:15 ` [igt-dev] [PATCH i-g-t v7] i915/gem_mocs_settings: Add mocs table for icelake Prathap Kumar Valsan
                   ` (2 subsequent siblings)
  20 siblings, 0 replies; 44+ messages in thread
From: Patchwork @ 2019-03-15  2:54 UTC (permalink / raw)
  To: Prathap Kumar Valsan; +Cc: igt-dev

== Series Details ==

Series: i915/gem_mocs_settings: Add mocs table for icelake (rev9)
URL   : https://patchwork.freedesktop.org/series/56459/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_5747_full -> IGTPW_2624_full
====================================================

Summary
-------

  **FAILURE**

  Serious unknown changes coming with IGTPW_2624_full absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in IGTPW_2624_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/56459/revisions/9/mbox/

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

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

### IGT changes ###

#### Possible regressions ####

  * igt@gem_eio@unwedge-stress:
    - shard-glk:          PASS -> FAIL

  
#### Suppressed ####

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

  * {igt@kms_plane@pixel-format-pipe-c-planes}:
    - shard-apl:          PASS -> FAIL
    - shard-kbl:          PASS -> FAIL

  
New tests
---------

  New tests have been introduced between CI_DRM_5747_full and IGTPW_2624_full:

### New IGT tests (12) ###

  * igt@gem_mocs_settings@mocs-rc6-ctx-dirty-nonprivdirty-render:
    - Statuses : 2 pass(s) 3 skip(s)
    - Exec time: [0.0, 0.36] s

  * igt@gem_mocs_settings@mocs-rc6-ctx-nonprivdirty-render:
    - Statuses : 2 pass(s) 3 skip(s)
    - Exec time: [0.0, 0.35] s

  * igt@gem_mocs_settings@mocs-rc6-dirty-nonprivdirty-render:
    - Statuses : 2 pass(s) 3 skip(s)
    - Exec time: [0.0, 0.36] s

  * igt@gem_mocs_settings@mocs-rc6-nonprivdirty-render:
    - Statuses : 2 pass(s) 3 skip(s)
    - Exec time: [0.0, 0.35] s

  * igt@gem_mocs_settings@mocs-reset-ctx-dirty-nonprivdirty-render:
    - Statuses : 2 pass(s) 3 skip(s)
    - Exec time: [0.0, 0.03] s

  * igt@gem_mocs_settings@mocs-reset-ctx-nonprivdirty-render:
    - Statuses : 2 pass(s) 3 skip(s)
    - Exec time: [0.0, 0.01] s

  * igt@gem_mocs_settings@mocs-reset-dirty-nonprivdirty-render:
    - Statuses : 2 pass(s) 3 skip(s)
    - Exec time: [0.0, 0.02] s

  * igt@gem_mocs_settings@mocs-reset-nonprivdirty-render:
    - Statuses : 2 pass(s) 3 skip(s)
    - Exec time: [0.0, 0.01] s

  * igt@gem_mocs_settings@mocs-settings-ctx-dirty-nonprivdirty-render:
    - Statuses : 1 pass(s) 3 skip(s)
    - Exec time: [0.0, 0.00] s

  * igt@gem_mocs_settings@mocs-settings-ctx-nonprivdirty-render:
    - Statuses : 2 pass(s) 3 skip(s)
    - Exec time: [0.0, 0.01] s

  * igt@gem_mocs_settings@mocs-settings-dirty-nonprivdirty-render:
    - Statuses : 2 pass(s) 3 skip(s)
    - Exec time: [0.0, 0.02] s

  * igt@gem_mocs_settings@mocs-settings-nonprivdirty-render:
    - Statuses : 2 pass(s) 3 skip(s)
    - Exec time: [0.0, 0.01] s

  

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

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

### IGT changes ###

#### Issues hit ####

  * igt@gem_exec_capture@capture-bsd2:
    - shard-snb:          NOTRUN -> SKIP [fdo#109271] +123

  * {igt@gem_mocs_settings@mocs-rc6-nonprivdirty-render} (NEW):
    - shard-hsw:          NOTRUN -> SKIP [fdo#109271] +11

  * igt@i915_pm_rpm@dpms-mode-unset-lpsp:
    - shard-glk:          NOTRUN -> SKIP [fdo#109271] +23

  * igt@kms_atomic_transition@1x-modeset-transitions-nonblocking-fencing:
    - shard-apl:          PASS -> FAIL [fdo#109660]
    - shard-kbl:          PASS -> FAIL [fdo#109660]

  * igt@kms_atomic_transition@2x-modeset-transitions-nonblocking:
    - shard-kbl:          NOTRUN -> SKIP [fdo#109271] +23

  * igt@kms_atomic_transition@3x-modeset-transitions-nonblocking:
    - shard-kbl:          NOTRUN -> SKIP [fdo#109271] / [fdo#109278] +2
    - shard-apl:          NOTRUN -> SKIP [fdo#109271] / [fdo#109278] +1

  * igt@kms_atomic_transition@4x-modeset-transitions:
    - shard-snb:          NOTRUN -> SKIP [fdo#109271] / [fdo#109278] +11

  * igt@kms_busy@extended-modeset-hang-newfb-render-a:
    - shard-snb:          NOTRUN -> DMESG-WARN [fdo#107956]

  * igt@kms_busy@extended-modeset-hang-newfb-render-b:
    - shard-hsw:          PASS -> DMESG-WARN [fdo#107956]

  * igt@kms_busy@extended-modeset-hang-newfb-render-c:
    - shard-glk:          PASS -> DMESG-WARN [fdo#107956]

  * igt@kms_busy@extended-modeset-hang-newfb-render-e:
    - shard-glk:          NOTRUN -> SKIP [fdo#109271] / [fdo#109278]

  * igt@kms_busy@extended-modeset-hang-newfb-with-reset-render-b:
    - shard-kbl:          PASS -> DMESG-WARN [fdo#107956] +1

  * igt@kms_color@pipe-c-degamma:
    - shard-apl:          PASS -> FAIL [fdo#104782]

  * igt@kms_color@pipe-c-legacy-gamma:
    - shard-apl:          NOTRUN -> FAIL [fdo#104782]

  * igt@kms_content_protection@atomic-dpms:
    - shard-kbl:          NOTRUN -> FAIL [fdo#108739]

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

  * igt@kms_cursor_crc@cursor-64x21-onscreen:
    - shard-kbl:          PASS -> FAIL [fdo#103232] +1

  * igt@kms_cursor_crc@cursor-64x64-onscreen:
    - shard-apl:          PASS -> FAIL [fdo#103232] +1

  * igt@kms_cursor_legacy@2x-long-cursor-vs-flip-atomic:
    - shard-hsw:          PASS -> FAIL [fdo#105767]

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

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

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

  * igt@kms_plane_alpha_blend@pipe-b-alpha-basic:
    - shard-kbl:          NOTRUN -> FAIL [fdo#108145] / [fdo#108590]

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

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

  * igt@prime_vgem@sync-bsd1:
    - shard-apl:          NOTRUN -> SKIP [fdo#109271] +19

  * igt@tools_test@tools_test:
    - shard-kbl:          PASS -> SKIP [fdo#109271]

  
#### Possible fixes ####

  * igt@i915_pm_rpm@system-suspend-execbuf:
    - shard-kbl:          INCOMPLETE [fdo#103665] / [fdo#107807] -> PASS

  * igt@kms_atomic_transition@plane-all-modeset-transition:
    - shard-apl:          INCOMPLETE [fdo#103927] -> PASS

  * igt@kms_busy@extended-modeset-hang-newfb-render-b:
    - shard-snb:          DMESG-WARN [fdo#107956] -> PASS

  * igt@kms_busy@extended-modeset-hang-newfb-render-c:
    - shard-kbl:          DMESG-WARN [fdo#107956] -> PASS +1

  * igt@kms_ccs@pipe-a-crc-sprite-planes-basic:
    - shard-kbl:          FAIL [fdo#107725] / [fdo#108145] -> PASS

  * igt@kms_color@pipe-a-ctm-max:
    - shard-apl:          FAIL [fdo#108147] -> PASS

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

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

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

  * igt@kms_cursor_crc@cursor-size-change:
    - shard-glk:          FAIL [fdo#103232] -> PASS

  * igt@kms_flip@2x-modeset-vs-vblank-race:
    - shard-glk:          FAIL [fdo#103060] -> PASS

  * igt@kms_flip@flip-vs-suspend:
    - shard-kbl:          DMESG-WARN [fdo#108566] -> PASS

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

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

  * {igt@kms_plane@pixel-format-pipe-b-planes}:
    - shard-kbl:          DMESG-FAIL [fdo#103558] / [fdo#105602] -> PASS
    - shard-apl:          FAIL -> PASS

  * {igt@kms_plane@pixel-format-pipe-c-planes-source-clamping}:
    - shard-glk:          SKIP [fdo#109271] -> PASS

  * {igt@kms_plane@plane-position-covered-pipe-a-planes}:
    - shard-apl:          FAIL [fdo#110038] -> PASS +1

  * {igt@kms_plane@plane-position-covered-pipe-c-planes}:
    - shard-glk:          FAIL [fdo#110038] -> PASS

  * igt@kms_plane_alpha_blend@pipe-b-constant-alpha-max:
    - shard-glk:          FAIL [fdo#108145] -> PASS
    - shard-apl:          FAIL [fdo#108145] -> PASS
    - shard-kbl:          FAIL [fdo#108145] -> PASS

  * {igt@kms_plane_multiple@atomic-pipe-a-tiling-x}:
    - shard-apl:          FAIL [fdo#110037] -> PASS +1
    - shard-kbl:          FAIL [fdo#110037] -> PASS

  * {igt@kms_plane_multiple@atomic-pipe-c-tiling-none}:
    - shard-glk:          FAIL [fdo#110037] -> PASS +2

  * igt@kms_rmfb@rmfb-ioctl:
    - shard-kbl:          DMESG-WARN [fdo#103558] / [fdo#105602] -> PASS +11

  * igt@testdisplay:
    - shard-kbl:          INCOMPLETE [fdo#103665] -> PASS +1

  
#### Warnings ####

  * igt@kms_content_protection@legacy:
    - shard-apl:          INCOMPLETE [fdo#103927] -> FAIL [fdo#108597] / [fdo#108739]

  * igt@kms_rotation_crc@multiplane-rotation:
    - shard-kbl:          INCOMPLETE [fdo#103665] -> FAIL [fdo#109016]

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

  [fdo#103060]: https://bugs.freedesktop.org/show_bug.cgi?id=103060
  [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#103558]: https://bugs.freedesktop.org/show_bug.cgi?id=103558
  [fdo#103665]: https://bugs.freedesktop.org/show_bug.cgi?id=103665
  [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#105602]: https://bugs.freedesktop.org/show_bug.cgi?id=105602
  [fdo#105767]: https://bugs.freedesktop.org/show_bug.cgi?id=105767
  [fdo#107725]: https://bugs.freedesktop.org/show_bug.cgi?id=107725
  [fdo#107807]: https://bugs.freedesktop.org/show_bug.cgi?id=107807
  [fdo#107956]: https://bugs.freedesktop.org/show_bug.cgi?id=107956
  [fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
  [fdo#108147]: https://bugs.freedesktop.org/show_bug.cgi?id=108147
  [fdo#108566]: https://bugs.freedesktop.org/show_bug.cgi?id=108566
  [fdo#108590]: https://bugs.freedesktop.org/show_bug.cgi?id=108590
  [fdo#108597]: https://bugs.freedesktop.org/show_bug.cgi?id=108597
  [fdo#108739]: https://bugs.freedesktop.org/show_bug.cgi?id=108739
  [fdo#109016]: https://bugs.freedesktop.org/show_bug.cgi?id=109016
  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [fdo#109278]: https://bugs.freedesktop.org/show_bug.cgi?id=109278
  [fdo#109660]: https://bugs.freedesktop.org/show_bug.cgi?id=109660
  [fdo#110037]: https://bugs.freedesktop.org/show_bug.cgi?id=110037
  [fdo#110038]: https://bugs.freedesktop.org/show_bug.cgi?id=110038
  [fdo#99912]: https://bugs.freedesktop.org/show_bug.cgi?id=99912


Participating hosts (10 -> 5)
------------------------------

  Missing    (5): shard-skl pig-hsw-4770r pig-glk-j5005 shard-iclb pig-skl-6260u 


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

    * IGT: IGT_4885 -> IGTPW_2624
    * Piglit: piglit_4509 -> None

  CI_DRM_5747: 5b9f7d954ed4502fddc9d4b0ee09e59a1ef92895 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_2624: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2624/
  IGT_4885: 1e057f43cd30ab6acfd40794673843942521c0c5 @ 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_2624/
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* Re: [igt-dev] [PATCH i-g-t v6] i915/gem_mocs_settings: Add mocs table for icelake
  2019-03-14 17:28 ` [igt-dev] [PATCH i-g-t v6] i915/gem_mocs_settings: Add mocs table for icelake Prathap Kumar Valsan
@ 2019-03-15  8:46   ` Chris Wilson
  2019-03-15 19:28     ` Kumar Valsan, Prathap
  0 siblings, 1 reply; 44+ messages in thread
From: Chris Wilson @ 2019-03-15  8:46 UTC (permalink / raw)
  To: Lis Tomasz, Prathap Kumar Valsan, igt-dev; +Cc: De Marchi Lucas

Quoting Prathap Kumar Valsan (2019-03-14 17:28:52)
> From: "Kumar Valsan, Prathap" <prathap.kumar.valsan@intel.com>
> 
> This patch adds mocs table for icelake with expected L3 and eDRAM
> control values.
> 
> Signed-off-by: Kumar Valsan, Prathap <prathap.kumar.valsan@intel.com>
> ---
> Changes in v6:
> - We need to test non-privileged write to MOCS
>   is dropped by the hardware.(As suggested by Chris)
> Changes in v5:
> - As mocs table is global, test need not write
>   mocs table. Below jira has the discussion. 
>   https://jira.devtools.intel.com/browse/VLK-1567
> Changes in v4:
> - L3 control registers are global in icelake.
>   Test validates that dirty writes from userspace
>   to L3 control registers are being dropped. 
> Changes in v3:
> - There are holes in the mocs table(Lucas Pointed out).
>   In icelake index 16 and 17 are reserved.
>   So test shouldn't be checking them.
> Changes in v2:
> - Cleaned up the code based on review
>   comments from Lucas and Chris
> 
>  tests/i915/gem_mocs_settings.c | 147 ++++++++++++++++++++++++---------
>  1 file changed, 109 insertions(+), 38 deletions(-)
> 
> diff --git a/tests/i915/gem_mocs_settings.c b/tests/i915/gem_mocs_settings.c
> index 5b3b6bc1..3acaa615 100644
> --- a/tests/i915/gem_mocs_settings.c
> +++ b/tests/i915/gem_mocs_settings.c
> @@ -32,7 +32,9 @@
>  #include "igt_perf.h"
>  #include "igt_sysfs.h"
>  
> -#define MAX_NUMBER_MOCS_REGISTERS      (64)
> +#define GEN9_NUM_MOCS_ENTRIES   62  /* 62 out of 64 - 63 & 64 are reserved. */
> +#define GEN11_NUM_MOCS_ENTRIES  64  /* 63-64 are reserved, but configured. */
> +
>  enum {
>         NONE,
>         RESET,
> @@ -52,8 +54,10 @@ static const char * const test_modes[] = {
>  
>  #define MOCS_NON_DEFAULT_CTX   (1<<0)
>  #define MOCS_DIRTY_VALUES      (1<<1)
> +#define MOCS_NONPRIVILEGED_DIRTY_VALUES        (1<<2)
>  #define ALL_MOCS_FLAGS         (MOCS_NON_DEFAULT_CTX | \
> -                                MOCS_DIRTY_VALUES)
> +                                MOCS_DIRTY_VALUES | \
> +                                MOCS_NONPRIVILEGED_DIRTY_VALUES)
>  
>  #define GEN9_LNCFCMOCS0                (0xB020)        /* L3 Cache Control base */
>  #define GEN9_GFX_MOCS_0                (0xc800)        /* Graphics MOCS base register*/
> @@ -61,10 +65,13 @@ static const char * const test_modes[] = {
>  #define GEN9_MFX1_MOCS_0       (0xcA00)        /* Media 1 MOCS base register*/
>  #define GEN9_VEBOX_MOCS_0      (0xcB00)        /* Video MOCS base register*/
>  #define GEN9_BLT_MOCS_0                (0xcc00)        /* Blitter MOCS base register*/
> +#define ICELAKE_MOCS_PTE       {0x00000004, 0x0030, 0x1}
> +#define MOCS_PTE               {0x00000038, 0x0030, 0x1}
>  
>  struct mocs_entry {
>         uint32_t        control_value;
>         uint16_t        l3cc_value;
> +       uint8_t         used;
>  };
>  
>  struct mocs_table {
> @@ -73,35 +80,58 @@ struct mocs_table {
>  };
>  
>  /* The first entries in the MOCS tables are defined by uABI */
> -static const struct mocs_entry skylake_mocs_table[] = {
> -       { 0x00000009, 0x0010 },
> -       { 0x00000038, 0x0030 },
> -       { 0x0000003b, 0x0030 },
> +static const struct mocs_entry icelake_mocs_table[GEN11_NUM_MOCS_ENTRIES] = {
> +       [0]  = { 0x00000005, 0x0010, 0x1},
> +       [1]  = ICELAKE_MOCS_PTE,
> +       [2]  = { 0x00000037, 0x0030, 0x1},
> +       [3]  = { 0x00000005, 0x0010, 0x1},
> +       [4]  = { 0x00000005, 0x0030, 0x1},
> +       [5]  = { 0x00000037, 0x0010, 0x1},
> +       [6]  = { 0x00000017, 0x0010, 0x1},
> +       [7]  = { 0x00000017, 0x0030, 0x1},
> +       [8]  = { 0x00000027, 0x0010, 0x1},
> +       [9]  = { 0x00000027, 0x0030, 0x1},
> +       [10] = { 0x00000077, 0x0010, 0x1},
> +       [11] = { 0x00000077, 0x0030, 0x1},
> +       [12] = { 0x00000057, 0x0010, 0x1},
> +       [13] = { 0x00000057, 0x0030, 0x1},
> +       [14] = { 0x00000067, 0x0010, 0x1},
> +       [15] = { 0x00000067, 0x0030, 0x1},
> +       [18] = { 0x00060037, 0x0030, 0x1},
> +       [19] = { 0x00000737, 0x0030, 0x1},
> +       [20] = { 0x00000337, 0x0030, 0x1},
> +       [21] = { 0x00000137, 0x0030, 0x1},
> +       [22] = { 0x000003b7, 0x0030, 0x1},
> +       [23] = { 0x000007b7, 0x0030, 0x1},
> +       [24 ... 61] = ICELAKE_MOCS_PTE,
> +       [62] = { 0x00000037, 0x0010, 0x1},
> +       [63] = { 0x00000037, 0x0010, 0x1},
> +};
> +
> +static const struct mocs_entry skylake_mocs_table[GEN9_NUM_MOCS_ENTRIES] = {
> +       [0] = { 0x00000009, 0x0010, 0x1},
> +       [1] = MOCS_PTE,
> +       [2] = { 0x0000003b, 0x0030, 0x1},
> +       [3 ... GEN9_NUM_MOCS_ENTRIES - 1] = MOCS_PTE,
>  };
>  
> -static const struct mocs_entry dirty_skylake_mocs_table[] = {
> -       { 0x00003FFF, 0x003F }, /* no snoop bit */
> -       { 0x00003FFF, 0x003F },
> -       { 0x00003FFF, 0x003F },
> +static const struct mocs_entry dirty_skylake_mocs_table[GEN9_NUM_MOCS_ENTRIES] = {
> +       [0 ... GEN9_NUM_MOCS_ENTRIES - 1] = { 0x00003FFF, 0x003F, 0x1 },
>  };
>  
> -static const struct mocs_entry broxton_mocs_table[] = {
> -       { 0x00000009, 0x0010 },
> -       { 0x00000038, 0x0030 },
> -       { 0x00000039, 0x0030 },
> +static const struct mocs_entry broxton_mocs_table[GEN9_NUM_MOCS_ENTRIES] = {
> +       [0] = { 0x00000009, 0x0010, 0x1},
> +       [1] = MOCS_PTE,
> +       [2] = { 0x00000039, 0x0030, 0x1},
> +       [3 ... GEN9_NUM_MOCS_ENTRIES - 1] = MOCS_PTE,
>  };
>  
> -static const struct mocs_entry dirty_broxton_mocs_table[] = {
> -       { 0x00007FFF, 0x003F },
> -       { 0x00007FFF, 0x003F },
> -       { 0x00007FFF, 0x003F },
> +static const struct mocs_entry dirty_broxton_mocs_table[GEN9_NUM_MOCS_ENTRIES] = {
> +       [0 ... GEN9_NUM_MOCS_ENTRIES - 1] = { 0x00007FFF, 0x003F, 0x1 },
>  };
>  
> -static const uint32_t write_values[] = {
> -       0xFFFFFFFF,
> -       0xFFFFFFFF,
> -       0xFFFFFFFF,
> -       0xFFFFFFFF
> +static const uint32_t write_values[GEN9_NUM_MOCS_ENTRIES] = {
> +       [0 ... GEN9_NUM_MOCS_ENTRIES - 1] = 0xFFFFFFFF,
>  };
>  
>  static bool get_mocs_settings(int fd, struct mocs_table *table, bool dirty)
> @@ -127,6 +157,10 @@ static bool get_mocs_settings(int fd, struct mocs_table *table, bool dirty)
>                         table->table = broxton_mocs_table;
>                 }
>                 result = true;
> +       } else if (IS_ICELAKE(devid)) {
> +               table->size  = ARRAY_SIZE(icelake_mocs_table);
> +               table->table = icelake_mocs_table;
> +               result = true;
>         }
>  
>         return result;
> @@ -238,7 +272,8 @@ static void write_registers(int fd,
>                             uint32_t reg_base,
>                             const uint32_t *values,
>                             uint32_t size,
> -                           uint32_t engine_id)
> +                           uint32_t engine_id,
> +                           bool privileged)
>  {
>         struct drm_i915_gem_exec_object2 obj;
>         struct drm_i915_gem_execbuffer2 execbuf;
> @@ -254,7 +289,10 @@ static void write_registers(int fd,
>         execbuf.buffer_count = 1;
>         execbuf.batch_len = create_write_batch(batch, values, size, reg_base);
>         i915_execbuffer2_set_context_id(execbuf, ctx_id);
> -       execbuf.flags = I915_EXEC_SECURE | engine_id;
> +       if (privileged)
> +               execbuf.flags = I915_EXEC_SECURE | engine_id;
> +       else
> +               execbuf.flags = engine_id;
>  
>         gem_write(fd, handle, 0, batch, execbuf.batch_len);
>         gem_execbuf(fd, &execbuf);
> @@ -283,9 +321,12 @@ static void check_control_registers(int fd,
>         read_regs = gem_mmap__cpu(fd, dst_handle, 0, 4096, PROT_READ);
>  
>         gem_set_domain(fd, dst_handle, I915_GEM_DOMAIN_CPU, 0);
> -       for (int index = 0; index < table.size; index++)
> +       for (int index = 0; index < table.size; index++) {
> +               if (!table.table[index].used)
> +                       continue;
>                 igt_assert_eq_u32(read_regs[index],
>                                   table.table[index].control_value);
> +       }
>  
>         munmap(read_regs, 4096);
>         gem_close(fd, dst_handle);
> @@ -315,10 +356,14 @@ static void check_l3cc_registers(int fd,
>         gem_set_domain(fd, dst_handle, I915_GEM_DOMAIN_CPU, 0);
>  
>         for (index = 0; index < table.size / 2; index++) {
> -               igt_assert_eq_u32(read_regs[index] & 0xffff,
> -                                 table.table[index * 2].l3cc_value);
> -               igt_assert_eq_u32(read_regs[index] >> 16,
> -                                 table.table[index * 2 + 1].l3cc_value);
> +               if (table.table[index * 2].used) {
> +                       igt_assert_eq_u32(read_regs[index] & 0xffff,
> +                                         table.table[index * 2].l3cc_value);
> +               }
> +               if (table.table[index * 2 + 1].used) {
> +                       igt_assert_eq_u32(read_regs[index] >> 16,
> +                                         table.table[index * 2 + 1].l3cc_value);
> +               }
>         }
>  
>         if (table.size & 1)
> @@ -372,16 +417,23 @@ static void check_mocs_values(int fd, unsigned engine, uint32_t ctx_id, bool dir
>                 check_l3cc_registers(fd, engine, ctx_id, dirty);
>  }
>  
> -static void write_dirty_mocs(int fd, unsigned engine, uint32_t ctx_id)
> +static void write_dirty_mocs(int fd, unsigned engine, uint32_t ctx_id, bool privileged)
>  {
> +       int num_of_mocs_entries;
> +
> +       if (intel_gen(intel_get_drm_devid(fd)) >= 11)
> +               num_of_mocs_entries = GEN11_NUM_MOCS_ENTRIES;
> +       else
> +               num_of_mocs_entries = GEN9_NUM_MOCS_ENTRIES;
> +
>         write_registers(fd, ctx_id, get_engine_base(engine),
> -                       write_values, ARRAY_SIZE(write_values),
> -                       engine);
> +                       write_values, num_of_mocs_entries,
> +                       engine, privileged);
>  
>         if (engine == I915_EXEC_RENDER)
>                 write_registers(fd, ctx_id, GEN9_LNCFCMOCS0,
> -                               write_values, ARRAY_SIZE(write_values),
> -                               engine);
> +                               write_values, num_of_mocs_entries/2,
> +                               engine, privileged);
>  }
>  
>  static void run_test(int fd, unsigned engine, unsigned flags, unsigned mode)
> @@ -389,6 +441,14 @@ static void run_test(int fd, unsigned engine, unsigned flags, unsigned mode)
>         uint32_t ctx_id = 0;
>         uint32_t ctx_clean_id;
>         uint32_t ctx_dirty_id;
> +       uint32_t ctx_nonprivileged_dirty_id;
> +
> +       /* As mocs is global for GEN11+, trying privileged write to dirty
> +        * the mocs and testing context save and restore of mocs between
> +        * contexts is bound to fail.
> +        */
> +       if (flags & MOCS_DIRTY_VALUES)
> +               igt_skip_on(intel_gen(intel_get_drm_devid(fd)) >= 11);
>  
>         gem_require_ring(fd, engine);
>  
> @@ -400,10 +460,20 @@ static void run_test(int fd, unsigned engine, unsigned flags, unsigned mode)
>  
>         if (flags & MOCS_DIRTY_VALUES) {
>                 ctx_dirty_id = gem_context_create(fd);
> -               write_dirty_mocs(fd, engine, ctx_dirty_id);
> +               write_dirty_mocs(fd, engine, ctx_dirty_id, true);
>                 check_mocs_values(fd, engine, ctx_dirty_id, true);
>         }
>  
> +       /* Non-privileged write to dirty the mocs
> +        * should be ignored by the hardware
> +        */
> +       if (flags & MOCS_NONPRIVILEGED_DIRTY_VALUES) {
> +               ctx_nonprivileged_dirty_id = gem_context_create(fd);
> +               write_dirty_mocs(fd, engine, ctx_nonprivileged_dirty_id, false);
> +               check_mocs_values(fd, engine, ctx_nonprivileged_dirty_id, false);

Are we just creating a bunch of ctx and leaving them hanging? I hope we
are least closing the fd between runs.

I would rename this test to focus on isolation:
	MOCS_ISOLATION, "-isolation"

if (flags & MOCS_ISOLATION) {
	uint32_t ctx[2] = { gem_context_create(fd), gem_context_create(fd) }

	/* Any writes by one normal client should not affect a second client */
	write_dirty_mocs(fd, engine, ctx[0], false);
	check_mocs_values(fd, engine, ctx[1], false);

	for (int i = 0; i < ARRAY_SIZE(ctx); i++)
		gem_context_destroy(fd, ctx[i]);
}

This is just a standalone test that only needs to be checked per-engine;
I would advise against stuffing it inside run_test().

But other than that, I think the test is sound and exercises the uABI
correctly (i.e. clients depend on the MOCS values being static). Bonus
points for proving an invalid MOCS value without reading a register :)
-Chris
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] [PATCH i-g-t v7] i915/gem_mocs_settings: Add mocs table for icelake
  2019-02-15 21:46 [igt-dev] [PATCH i-g-t] i915/gem_mocs_settings: Add mocs table for icelake Prathap Kumar Valsan via igt-dev
                   ` (17 preceding siblings ...)
  2019-03-15  2:54 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
@ 2019-03-15 19:15 ` Prathap Kumar Valsan
  2019-03-18 13:10   ` Kumar Valsan, Prathap
  2019-03-18 13:27   ` Chris Wilson
  2019-03-18 10:21 ` [igt-dev] ✓ Fi.CI.BAT: success for i915/gem_mocs_settings: Add mocs table for icelake (rev11) Patchwork
  2019-03-18 12:37 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
  20 siblings, 2 replies; 44+ messages in thread
From: Prathap Kumar Valsan @ 2019-03-15 19:15 UTC (permalink / raw)
  To: igt-dev, Chris Wilson, Lis Tomasz; +Cc: De Marchi Lucas

From: "Kumar Valsan, Prathap" <prathap.kumar.valsan@intel.com>

This patch adds mocs table for icelake with expected L3 and eDRAM
control values.

Signed-off-by: Kumar Valsan, Prathap <prathap.kumar.valsan@intel.com>
---
Changes in v7:
- Testing non-privileged write to MOCS is dropped
  by h/w and clients are isolated has moved to a 
  new subtest. This subtest will be invoked per
  engine(suggested by Chris Wilson)
Changes in v6:
- We need to test non-privileged write to MOCS
  is dropped by the hardware.(suggested by Chris Wilson)
Changes in v5:
- As mocs table is global, test need not write
  mocs table. Below jira has the discussion. 
  https://jira.devtools.intel.com/browse/VLK-1567
Changes in v4:
- L3 control registers are global in icelake.
  Test validates that dirty writes from userspace
  to L3 control registers are being dropped. 
Changes in v3:
- There are holes in the mocs table(Lucas Pointed out).
  In icelake index 16 and 17 are reserved.
  So test shouldn't be checking them.
Changes in v2:
- Cleaned up the code based on review
  comments from Lucas and Chris

 tests/i915/gem_mocs_settings.c | 147 +++++++++++++++++++++++++--------
 1 file changed, 112 insertions(+), 35 deletions(-)

diff --git a/tests/i915/gem_mocs_settings.c b/tests/i915/gem_mocs_settings.c
index 5b3b6bc1..c205a726 100644
--- a/tests/i915/gem_mocs_settings.c
+++ b/tests/i915/gem_mocs_settings.c
@@ -32,7 +32,9 @@
 #include "igt_perf.h"
 #include "igt_sysfs.h"
 
-#define MAX_NUMBER_MOCS_REGISTERS	(64)
+#define GEN9_NUM_MOCS_ENTRIES   62  /* 62 out of 64 - 63 & 64 are reserved. */
+#define GEN11_NUM_MOCS_ENTRIES  64  /* 63-64 are reserved, but configured. */
+
 enum {
 	NONE,
 	RESET,
@@ -61,10 +63,13 @@ static const char * const test_modes[] = {
 #define GEN9_MFX1_MOCS_0	(0xcA00)	/* Media 1 MOCS base register*/
 #define GEN9_VEBOX_MOCS_0	(0xcB00)	/* Video MOCS base register*/
 #define GEN9_BLT_MOCS_0		(0xcc00)	/* Blitter MOCS base register*/
+#define ICELAKE_MOCS_PTE	{0x00000004, 0x0030, 0x1}
+#define MOCS_PTE		{0x00000038, 0x0030, 0x1}
 
 struct mocs_entry {
 	uint32_t	control_value;
 	uint16_t	l3cc_value;
+	uint8_t 	used;
 };
 
 struct mocs_table {
@@ -73,35 +78,58 @@ struct mocs_table {
 };
 
 /* The first entries in the MOCS tables are defined by uABI */
-static const struct mocs_entry skylake_mocs_table[] = {
-	{ 0x00000009, 0x0010 },
-	{ 0x00000038, 0x0030 },
-	{ 0x0000003b, 0x0030 },
+static const struct mocs_entry icelake_mocs_table[GEN11_NUM_MOCS_ENTRIES] = {
+	[0]  = { 0x00000005, 0x0010, 0x1},
+	[1]  = ICELAKE_MOCS_PTE,
+	[2]  = { 0x00000037, 0x0030, 0x1},
+	[3]  = { 0x00000005, 0x0010, 0x1},
+	[4]  = { 0x00000005, 0x0030, 0x1},
+	[5]  = { 0x00000037, 0x0010, 0x1},
+	[6]  = { 0x00000017, 0x0010, 0x1},
+	[7]  = { 0x00000017, 0x0030, 0x1},
+	[8]  = { 0x00000027, 0x0010, 0x1},
+	[9]  = { 0x00000027, 0x0030, 0x1},
+	[10] = { 0x00000077, 0x0010, 0x1},
+	[11] = { 0x00000077, 0x0030, 0x1},
+	[12] = { 0x00000057, 0x0010, 0x1},
+	[13] = { 0x00000057, 0x0030, 0x1},
+	[14] = { 0x00000067, 0x0010, 0x1},
+	[15] = { 0x00000067, 0x0030, 0x1},
+	[18] = { 0x00060037, 0x0030, 0x1},
+	[19] = { 0x00000737, 0x0030, 0x1},
+	[20] = { 0x00000337, 0x0030, 0x1},
+	[21] = { 0x00000137, 0x0030, 0x1},
+	[22] = { 0x000003b7, 0x0030, 0x1},
+	[23] = { 0x000007b7, 0x0030, 0x1},
+	[24 ... 61] = ICELAKE_MOCS_PTE,
+	[62] = { 0x00000037, 0x0010, 0x1},
+	[63] = { 0x00000037, 0x0010, 0x1},
+};
+
+static const struct mocs_entry skylake_mocs_table[GEN9_NUM_MOCS_ENTRIES] = {
+	[0] = { 0x00000009, 0x0010, 0x1},
+	[1] = MOCS_PTE,
+	[2] = { 0x0000003b, 0x0030, 0x1},
+	[3 ... GEN9_NUM_MOCS_ENTRIES - 1] = MOCS_PTE,
 };
 
-static const struct mocs_entry dirty_skylake_mocs_table[] = {
-	{ 0x00003FFF, 0x003F }, /* no snoop bit */
-	{ 0x00003FFF, 0x003F },
-	{ 0x00003FFF, 0x003F },
+static const struct mocs_entry dirty_skylake_mocs_table[GEN9_NUM_MOCS_ENTRIES] = {
+	[0 ... GEN9_NUM_MOCS_ENTRIES - 1] = { 0x00003FFF, 0x003F, 0x1 },
 };
 
-static const struct mocs_entry broxton_mocs_table[] = {
-	{ 0x00000009, 0x0010 },
-	{ 0x00000038, 0x0030 },
-	{ 0x00000039, 0x0030 },
+static const struct mocs_entry broxton_mocs_table[GEN9_NUM_MOCS_ENTRIES] = {
+	[0] = { 0x00000009, 0x0010, 0x1},
+	[1] = MOCS_PTE,
+	[2] = { 0x00000039, 0x0030, 0x1},
+	[3 ... GEN9_NUM_MOCS_ENTRIES - 1] = MOCS_PTE,
 };
 
-static const struct mocs_entry dirty_broxton_mocs_table[] = {
-	{ 0x00007FFF, 0x003F },
-	{ 0x00007FFF, 0x003F },
-	{ 0x00007FFF, 0x003F },
+static const struct mocs_entry dirty_broxton_mocs_table[GEN9_NUM_MOCS_ENTRIES] = {
+	[0 ... GEN9_NUM_MOCS_ENTRIES - 1] = { 0x00007FFF, 0x003F, 0x1 },
 };
 
-static const uint32_t write_values[] = {
-	0xFFFFFFFF,
-	0xFFFFFFFF,
-	0xFFFFFFFF,
-	0xFFFFFFFF
+static const uint32_t write_values[GEN9_NUM_MOCS_ENTRIES] = {
+	[0 ... GEN9_NUM_MOCS_ENTRIES - 1] = 0xFFFFFFFF,
 };
 
 static bool get_mocs_settings(int fd, struct mocs_table *table, bool dirty)
@@ -127,6 +155,10 @@ static bool get_mocs_settings(int fd, struct mocs_table *table, bool dirty)
 			table->table = broxton_mocs_table;
 		}
 		result = true;
+	} else if (IS_ICELAKE(devid)) {
+		table->size  = ARRAY_SIZE(icelake_mocs_table);
+		table->table = icelake_mocs_table;
+		result = true;
 	}
 
 	return result;
@@ -238,7 +270,8 @@ static void write_registers(int fd,
 			    uint32_t reg_base,
 			    const uint32_t *values,
 			    uint32_t size,
-			    uint32_t engine_id)
+			    uint32_t engine_id,
+			    bool privileged)
 {
 	struct drm_i915_gem_exec_object2 obj;
 	struct drm_i915_gem_execbuffer2 execbuf;
@@ -254,7 +287,10 @@ static void write_registers(int fd,
 	execbuf.buffer_count = 1;
 	execbuf.batch_len = create_write_batch(batch, values, size, reg_base);
 	i915_execbuffer2_set_context_id(execbuf, ctx_id);
-	execbuf.flags = I915_EXEC_SECURE | engine_id;
+	if (privileged)
+		execbuf.flags = I915_EXEC_SECURE | engine_id;
+	else
+		execbuf.flags = engine_id;
 
 	gem_write(fd, handle, 0, batch, execbuf.batch_len);
 	gem_execbuf(fd, &execbuf);
@@ -283,9 +319,12 @@ static void check_control_registers(int fd,
 	read_regs = gem_mmap__cpu(fd, dst_handle, 0, 4096, PROT_READ);
 
 	gem_set_domain(fd, dst_handle, I915_GEM_DOMAIN_CPU, 0);
-	for (int index = 0; index < table.size; index++)
+	for (int index = 0; index < table.size; index++) {
+		if (!table.table[index].used)
+			continue;
 		igt_assert_eq_u32(read_regs[index],
 				  table.table[index].control_value);
+	}
 
 	munmap(read_regs, 4096);
 	gem_close(fd, dst_handle);
@@ -315,10 +354,14 @@ static void check_l3cc_registers(int fd,
 	gem_set_domain(fd, dst_handle, I915_GEM_DOMAIN_CPU, 0);
 
 	for (index = 0; index < table.size / 2; index++) {
-		igt_assert_eq_u32(read_regs[index] & 0xffff,
-				  table.table[index * 2].l3cc_value);
-		igt_assert_eq_u32(read_regs[index] >> 16,
-				  table.table[index * 2 + 1].l3cc_value);
+		if (table.table[index * 2].used) {
+			igt_assert_eq_u32(read_regs[index] & 0xffff,
+					  table.table[index * 2].l3cc_value);
+		}
+		if (table.table[index * 2 + 1].used) {
+			igt_assert_eq_u32(read_regs[index] >> 16,
+					  table.table[index * 2 + 1].l3cc_value);
+		}
 	}
 
 	if (table.size & 1)
@@ -372,16 +415,23 @@ static void check_mocs_values(int fd, unsigned engine, uint32_t ctx_id, bool dir
 		check_l3cc_registers(fd, engine, ctx_id, dirty);
 }
 
-static void write_dirty_mocs(int fd, unsigned engine, uint32_t ctx_id)
+static void write_dirty_mocs(int fd, unsigned engine, uint32_t ctx_id, bool privileged)
 {
+	int num_of_mocs_entries;
+
+	if (intel_gen(intel_get_drm_devid(fd)) >= 11)
+		num_of_mocs_entries = GEN11_NUM_MOCS_ENTRIES;
+	else
+		num_of_mocs_entries = GEN9_NUM_MOCS_ENTRIES;
+
 	write_registers(fd, ctx_id, get_engine_base(engine),
-			write_values, ARRAY_SIZE(write_values),
-			engine);
+			write_values, num_of_mocs_entries,
+			engine, privileged);
 
 	if (engine == I915_EXEC_RENDER)
 		write_registers(fd, ctx_id, GEN9_LNCFCMOCS0,
-				write_values, ARRAY_SIZE(write_values),
-				engine);
+				write_values, num_of_mocs_entries/2,
+				engine, privileged);
 }
 
 static void run_test(int fd, unsigned engine, unsigned flags, unsigned mode)
@@ -390,6 +440,13 @@ static void run_test(int fd, unsigned engine, unsigned flags, unsigned mode)
 	uint32_t ctx_clean_id;
 	uint32_t ctx_dirty_id;
 
+	/* As mocs is global for GEN11+, trying privileged write to dirty
+	 * the mocs and testing context save and restore of mocs between
+	 * contexts is bound to fail.
+	 */
+	if (flags & MOCS_DIRTY_VALUES)
+		igt_skip_on(intel_gen(intel_get_drm_devid(fd)) >= 11);
+
 	gem_require_ring(fd, engine);
 
 	/* Skip if we don't know where the registers are for this engine */
@@ -400,7 +457,7 @@ static void run_test(int fd, unsigned engine, unsigned flags, unsigned mode)
 
 	if (flags & MOCS_DIRTY_VALUES) {
 		ctx_dirty_id = gem_context_create(fd);
-		write_dirty_mocs(fd, engine, ctx_dirty_id);
+		write_dirty_mocs(fd, engine, ctx_dirty_id, true);
 		check_mocs_values(fd, engine, ctx_dirty_id, true);
 	}
 
@@ -430,6 +487,18 @@ static void run_test(int fd, unsigned engine, unsigned flags, unsigned mode)
 		gem_context_destroy(fd, ctx_id);
 }
 
+static void isolation_test(int fd, unsigned engine)
+{
+	uint32_t ctx[2] = { gem_context_create(fd), gem_context_create(fd) };
+
+	/* Any writes by one normal client should not affect a second client */
+	write_dirty_mocs(fd, engine, ctx[0], false);
+	check_mocs_values(fd, engine, ctx[1], false);
+
+	for (int i = 0; i < ARRAY_SIZE(ctx); i++)
+		gem_context_destroy(fd, ctx[i]);
+}
+
 igt_main
 {
 	const struct intel_execution_engine *e;
@@ -490,6 +559,14 @@ igt_main
 				}
 			}
 		}
+
+		igt_subtest_f("mocs-isolation-%s",
+				e->name) {
+			gem_require_contexts(fd);
+
+			isolation_test(fd, e->exec_id | e->flags);
+		}
+
 	}
 
 	igt_fixture
-- 
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] 44+ messages in thread

* Re: [igt-dev] [PATCH i-g-t v6] i915/gem_mocs_settings: Add mocs table for icelake
  2019-03-15  8:46   ` Chris Wilson
@ 2019-03-15 19:28     ` Kumar Valsan, Prathap
  2019-03-15 21:11       ` Chris Wilson
  0 siblings, 1 reply; 44+ messages in thread
From: Kumar Valsan, Prathap @ 2019-03-15 19:28 UTC (permalink / raw)
  To: Chris Wilson; +Cc: igt-dev, De Marchi Lucas

On Fri, Mar 15, 2019 at 08:46:31AM +0000, Chris Wilson wrote:
> Quoting Prathap Kumar Valsan (2019-03-14 17:28:52)
> > From: "Kumar Valsan, Prathap" <prathap.kumar.valsan@intel.com>
> > 
> > This patch adds mocs table for icelake with expected L3 and eDRAM
> > control values.
> > 
> > Signed-off-by: Kumar Valsan, Prathap <prathap.kumar.valsan@intel.com>
> > ---
> > Changes in v6:
> > - We need to test non-privileged write to MOCS
> >   is dropped by the hardware.(As suggested by Chris)
> > Changes in v5:
> > - As mocs table is global, test need not write
> >   mocs table. Below jira has the discussion. 
> >   https://jira.devtools.intel.com/browse/VLK-1567
> > Changes in v4:
> > - L3 control registers are global in icelake.
> >   Test validates that dirty writes from userspace
> >   to L3 control registers are being dropped. 
> > Changes in v3:
> > - There are holes in the mocs table(Lucas Pointed out).
> >   In icelake index 16 and 17 are reserved.
> >   So test shouldn't be checking them.
> > Changes in v2:
> > - Cleaned up the code based on review
> >   comments from Lucas and Chris
> > 
> >  tests/i915/gem_mocs_settings.c | 147 ++++++++++++++++++++++++---------
> >  1 file changed, 109 insertions(+), 38 deletions(-)
> > 
> > diff --git a/tests/i915/gem_mocs_settings.c b/tests/i915/gem_mocs_settings.c
> > index 5b3b6bc1..3acaa615 100644
> > --- a/tests/i915/gem_mocs_settings.c
> > +++ b/tests/i915/gem_mocs_settings.c
> > @@ -32,7 +32,9 @@
> >  #include "igt_perf.h"
> >  #include "igt_sysfs.h"
> >  
> > -#define MAX_NUMBER_MOCS_REGISTERS      (64)
> > +#define GEN9_NUM_MOCS_ENTRIES   62  /* 62 out of 64 - 63 & 64 are reserved. */
> > +#define GEN11_NUM_MOCS_ENTRIES  64  /* 63-64 are reserved, but configured. */
> > +
> >  enum {
> >         NONE,
> >         RESET,
> > @@ -52,8 +54,10 @@ static const char * const test_modes[] = {
> >  
> >  #define MOCS_NON_DEFAULT_CTX   (1<<0)
> >  #define MOCS_DIRTY_VALUES      (1<<1)
> > +#define MOCS_NONPRIVILEGED_DIRTY_VALUES        (1<<2)
> >  #define ALL_MOCS_FLAGS         (MOCS_NON_DEFAULT_CTX | \
> > -                                MOCS_DIRTY_VALUES)
> > +                                MOCS_DIRTY_VALUES | \
> > +                                MOCS_NONPRIVILEGED_DIRTY_VALUES)
> >  
> >  #define GEN9_LNCFCMOCS0                (0xB020)        /* L3 Cache Control base */
> >  #define GEN9_GFX_MOCS_0                (0xc800)        /* Graphics MOCS base register*/
> > @@ -61,10 +65,13 @@ static const char * const test_modes[] = {
> >  #define GEN9_MFX1_MOCS_0       (0xcA00)        /* Media 1 MOCS base register*/
> >  #define GEN9_VEBOX_MOCS_0      (0xcB00)        /* Video MOCS base register*/
> >  #define GEN9_BLT_MOCS_0                (0xcc00)        /* Blitter MOCS base register*/
> > +#define ICELAKE_MOCS_PTE       {0x00000004, 0x0030, 0x1}
> > +#define MOCS_PTE               {0x00000038, 0x0030, 0x1}
> >  
> >  struct mocs_entry {
> >         uint32_t        control_value;
> >         uint16_t        l3cc_value;
> > +       uint8_t         used;
> >  };
> >  
> >  struct mocs_table {
> > @@ -73,35 +80,58 @@ struct mocs_table {
> >  };
> >  
> >  /* The first entries in the MOCS tables are defined by uABI */
> > -static const struct mocs_entry skylake_mocs_table[] = {
> > -       { 0x00000009, 0x0010 },
> > -       { 0x00000038, 0x0030 },
> > -       { 0x0000003b, 0x0030 },
> > +static const struct mocs_entry icelake_mocs_table[GEN11_NUM_MOCS_ENTRIES] = {
> > +       [0]  = { 0x00000005, 0x0010, 0x1},
> > +       [1]  = ICELAKE_MOCS_PTE,
> > +       [2]  = { 0x00000037, 0x0030, 0x1},
> > +       [3]  = { 0x00000005, 0x0010, 0x1},
> > +       [4]  = { 0x00000005, 0x0030, 0x1},
> > +       [5]  = { 0x00000037, 0x0010, 0x1},
> > +       [6]  = { 0x00000017, 0x0010, 0x1},
> > +       [7]  = { 0x00000017, 0x0030, 0x1},
> > +       [8]  = { 0x00000027, 0x0010, 0x1},
> > +       [9]  = { 0x00000027, 0x0030, 0x1},
> > +       [10] = { 0x00000077, 0x0010, 0x1},
> > +       [11] = { 0x00000077, 0x0030, 0x1},
> > +       [12] = { 0x00000057, 0x0010, 0x1},
> > +       [13] = { 0x00000057, 0x0030, 0x1},
> > +       [14] = { 0x00000067, 0x0010, 0x1},
> > +       [15] = { 0x00000067, 0x0030, 0x1},
> > +       [18] = { 0x00060037, 0x0030, 0x1},
> > +       [19] = { 0x00000737, 0x0030, 0x1},
> > +       [20] = { 0x00000337, 0x0030, 0x1},
> > +       [21] = { 0x00000137, 0x0030, 0x1},
> > +       [22] = { 0x000003b7, 0x0030, 0x1},
> > +       [23] = { 0x000007b7, 0x0030, 0x1},
> > +       [24 ... 61] = ICELAKE_MOCS_PTE,
> > +       [62] = { 0x00000037, 0x0010, 0x1},
> > +       [63] = { 0x00000037, 0x0010, 0x1},
> > +};
> > +
> > +static const struct mocs_entry skylake_mocs_table[GEN9_NUM_MOCS_ENTRIES] = {
> > +       [0] = { 0x00000009, 0x0010, 0x1},
> > +       [1] = MOCS_PTE,
> > +       [2] = { 0x0000003b, 0x0030, 0x1},
> > +       [3 ... GEN9_NUM_MOCS_ENTRIES - 1] = MOCS_PTE,
> >  };
> >  
> > -static const struct mocs_entry dirty_skylake_mocs_table[] = {
> > -       { 0x00003FFF, 0x003F }, /* no snoop bit */
> > -       { 0x00003FFF, 0x003F },
> > -       { 0x00003FFF, 0x003F },
> > +static const struct mocs_entry dirty_skylake_mocs_table[GEN9_NUM_MOCS_ENTRIES] = {
> > +       [0 ... GEN9_NUM_MOCS_ENTRIES - 1] = { 0x00003FFF, 0x003F, 0x1 },
> >  };
> >  
> > -static const struct mocs_entry broxton_mocs_table[] = {
> > -       { 0x00000009, 0x0010 },
> > -       { 0x00000038, 0x0030 },
> > -       { 0x00000039, 0x0030 },
> > +static const struct mocs_entry broxton_mocs_table[GEN9_NUM_MOCS_ENTRIES] = {
> > +       [0] = { 0x00000009, 0x0010, 0x1},
> > +       [1] = MOCS_PTE,
> > +       [2] = { 0x00000039, 0x0030, 0x1},
> > +       [3 ... GEN9_NUM_MOCS_ENTRIES - 1] = MOCS_PTE,
> >  };
> >  
> > -static const struct mocs_entry dirty_broxton_mocs_table[] = {
> > -       { 0x00007FFF, 0x003F },
> > -       { 0x00007FFF, 0x003F },
> > -       { 0x00007FFF, 0x003F },
> > +static const struct mocs_entry dirty_broxton_mocs_table[GEN9_NUM_MOCS_ENTRIES] = {
> > +       [0 ... GEN9_NUM_MOCS_ENTRIES - 1] = { 0x00007FFF, 0x003F, 0x1 },
> >  };
> >  
> > -static const uint32_t write_values[] = {
> > -       0xFFFFFFFF,
> > -       0xFFFFFFFF,
> > -       0xFFFFFFFF,
> > -       0xFFFFFFFF
> > +static const uint32_t write_values[GEN9_NUM_MOCS_ENTRIES] = {
> > +       [0 ... GEN9_NUM_MOCS_ENTRIES - 1] = 0xFFFFFFFF,
> >  };
> >  
> >  static bool get_mocs_settings(int fd, struct mocs_table *table, bool dirty)
> > @@ -127,6 +157,10 @@ static bool get_mocs_settings(int fd, struct mocs_table *table, bool dirty)
> >                         table->table = broxton_mocs_table;
> >                 }
> >                 result = true;
> > +       } else if (IS_ICELAKE(devid)) {
> > +               table->size  = ARRAY_SIZE(icelake_mocs_table);
> > +               table->table = icelake_mocs_table;
> > +               result = true;
> >         }
> >  
> >         return result;
> > @@ -238,7 +272,8 @@ static void write_registers(int fd,
> >                             uint32_t reg_base,
> >                             const uint32_t *values,
> >                             uint32_t size,
> > -                           uint32_t engine_id)
> > +                           uint32_t engine_id,
> > +                           bool privileged)
> >  {
> >         struct drm_i915_gem_exec_object2 obj;
> >         struct drm_i915_gem_execbuffer2 execbuf;
> > @@ -254,7 +289,10 @@ static void write_registers(int fd,
> >         execbuf.buffer_count = 1;
> >         execbuf.batch_len = create_write_batch(batch, values, size, reg_base);
> >         i915_execbuffer2_set_context_id(execbuf, ctx_id);
> > -       execbuf.flags = I915_EXEC_SECURE | engine_id;
> > +       if (privileged)
> > +               execbuf.flags = I915_EXEC_SECURE | engine_id;
> > +       else
> > +               execbuf.flags = engine_id;
> >  
> >         gem_write(fd, handle, 0, batch, execbuf.batch_len);
> >         gem_execbuf(fd, &execbuf);
> > @@ -283,9 +321,12 @@ static void check_control_registers(int fd,
> >         read_regs = gem_mmap__cpu(fd, dst_handle, 0, 4096, PROT_READ);
> >  
> >         gem_set_domain(fd, dst_handle, I915_GEM_DOMAIN_CPU, 0);
> > -       for (int index = 0; index < table.size; index++)
> > +       for (int index = 0; index < table.size; index++) {
> > +               if (!table.table[index].used)
> > +                       continue;
> >                 igt_assert_eq_u32(read_regs[index],
> >                                   table.table[index].control_value);
> > +       }
> >  
> >         munmap(read_regs, 4096);
> >         gem_close(fd, dst_handle);
> > @@ -315,10 +356,14 @@ static void check_l3cc_registers(int fd,
> >         gem_set_domain(fd, dst_handle, I915_GEM_DOMAIN_CPU, 0);
> >  
> >         for (index = 0; index < table.size / 2; index++) {
> > -               igt_assert_eq_u32(read_regs[index] & 0xffff,
> > -                                 table.table[index * 2].l3cc_value);
> > -               igt_assert_eq_u32(read_regs[index] >> 16,
> > -                                 table.table[index * 2 + 1].l3cc_value);
> > +               if (table.table[index * 2].used) {
> > +                       igt_assert_eq_u32(read_regs[index] & 0xffff,
> > +                                         table.table[index * 2].l3cc_value);
> > +               }
> > +               if (table.table[index * 2 + 1].used) {
> > +                       igt_assert_eq_u32(read_regs[index] >> 16,
> > +                                         table.table[index * 2 + 1].l3cc_value);
> > +               }
> >         }
> >  
> >         if (table.size & 1)
> > @@ -372,16 +417,23 @@ static void check_mocs_values(int fd, unsigned engine, uint32_t ctx_id, bool dir
> >                 check_l3cc_registers(fd, engine, ctx_id, dirty);
> >  }
> >  
> > -static void write_dirty_mocs(int fd, unsigned engine, uint32_t ctx_id)
> > +static void write_dirty_mocs(int fd, unsigned engine, uint32_t ctx_id, bool privileged)
> >  {
> > +       int num_of_mocs_entries;
> > +
> > +       if (intel_gen(intel_get_drm_devid(fd)) >= 11)
> > +               num_of_mocs_entries = GEN11_NUM_MOCS_ENTRIES;
> > +       else
> > +               num_of_mocs_entries = GEN9_NUM_MOCS_ENTRIES;
> > +
> >         write_registers(fd, ctx_id, get_engine_base(engine),
> > -                       write_values, ARRAY_SIZE(write_values),
> > -                       engine);
> > +                       write_values, num_of_mocs_entries,
> > +                       engine, privileged);
> >  
> >         if (engine == I915_EXEC_RENDER)
> >                 write_registers(fd, ctx_id, GEN9_LNCFCMOCS0,
> > -                               write_values, ARRAY_SIZE(write_values),
> > -                               engine);
> > +                               write_values, num_of_mocs_entries/2,
> > +                               engine, privileged);
> >  }
> >  
> >  static void run_test(int fd, unsigned engine, unsigned flags, unsigned mode)
> > @@ -389,6 +441,14 @@ static void run_test(int fd, unsigned engine, unsigned flags, unsigned mode)
> >         uint32_t ctx_id = 0;
> >         uint32_t ctx_clean_id;
> >         uint32_t ctx_dirty_id;
> > +       uint32_t ctx_nonprivileged_dirty_id;
> > +
> > +       /* As mocs is global for GEN11+, trying privileged write to dirty
> > +        * the mocs and testing context save and restore of mocs between
> > +        * contexts is bound to fail.
> > +        */
> > +       if (flags & MOCS_DIRTY_VALUES)
> > +               igt_skip_on(intel_gen(intel_get_drm_devid(fd)) >= 11);
> >  
> >         gem_require_ring(fd, engine);
> >  
> > @@ -400,10 +460,20 @@ static void run_test(int fd, unsigned engine, unsigned flags, unsigned mode)
> >  
> >         if (flags & MOCS_DIRTY_VALUES) {
> >                 ctx_dirty_id = gem_context_create(fd);
> > -               write_dirty_mocs(fd, engine, ctx_dirty_id);
> > +               write_dirty_mocs(fd, engine, ctx_dirty_id, true);
> >                 check_mocs_values(fd, engine, ctx_dirty_id, true);
> >         }
> >  
> > +       /* Non-privileged write to dirty the mocs
> > +        * should be ignored by the hardware
> > +        */
> > +       if (flags & MOCS_NONPRIVILEGED_DIRTY_VALUES) {
> > +               ctx_nonprivileged_dirty_id = gem_context_create(fd);
> > +               write_dirty_mocs(fd, engine, ctx_nonprivileged_dirty_id, false);
> > +               check_mocs_values(fd, engine, ctx_nonprivileged_dirty_id, false);
> 
> Are we just creating a bunch of ctx and leaving them hanging? I hope we
> are least closing the fd between runs.
> 
> I would rename this test to focus on isolation:
> 	MOCS_ISOLATION, "-isolation"
> 
> if (flags & MOCS_ISOLATION) {
> 	uint32_t ctx[2] = { gem_context_create(fd), gem_context_create(fd) }
> 
> 	/* Any writes by one normal client should not affect a second client */
> 	write_dirty_mocs(fd, engine, ctx[0], false);
> 	check_mocs_values(fd, engine, ctx[1], false);
> 
> 	for (int i = 0; i < ARRAY_SIZE(ctx); i++)
> 		gem_context_destroy(fd, ctx[i]);
> }
> 
> This is just a standalone test that only needs to be checked per-engine;
> I would advise against stuffing it inside run_test().
> 
Moved to a standalone subtest.
> But other than that, I think the test is sound and exercises the uABI
> correctly (i.e. clients depend on the MOCS values being static). Bonus
> points for proving an invalid MOCS value without reading a register :)
Proving an invalid MOCS value without reading a register  wasn't
successful. One thing i tried is using I915_PARAM_HAS_CONTEXT_ISOLATION:
created a second context after writing to mocs using first context. Then
check the value returned by I915_PARAM_HAS_CONTEXT_ISOLATION. If the
second context inherited the mocs from the first context, then this
ioctl should return false for the respective engine? Not very sure i am
heading at the right direction. Will have to experiment further as TODO.
:)
- Prathap
> -Chris
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* Re: [igt-dev] [PATCH i-g-t v6] i915/gem_mocs_settings: Add mocs table for icelake
  2019-03-15 19:28     ` Kumar Valsan, Prathap
@ 2019-03-15 21:11       ` Chris Wilson
  0 siblings, 0 replies; 44+ messages in thread
From: Chris Wilson @ 2019-03-15 21:11 UTC (permalink / raw)
  To: Kumar Valsan, Prathap; +Cc: igt-dev, De Marchi Lucas

Quoting Kumar Valsan, Prathap (2019-03-15 19:28:29)
> On Fri, Mar 15, 2019 at 08:46:31AM +0000, Chris Wilson wrote:
> > But other than that, I think the test is sound and exercises the uABI
> > correctly (i.e. clients depend on the MOCS values being static). Bonus
> > points for proving an invalid MOCS value without reading a register :)
> Proving an invalid MOCS value without reading a register  wasn't
> successful. One thing i tried is using I915_PARAM_HAS_CONTEXT_ISOLATION:
> created a second context after writing to mocs using first context. Then
> check the value returned by I915_PARAM_HAS_CONTEXT_ISOLATION. If the
> second context inherited the mocs from the first context, then this
> ioctl should return false for the respective engine? Not very sure i am
> heading at the right direction. Will have to experiment further as TODO.
> :)

No, that param concerns a separate uABI bug whereby the initial state of
context saved registers were not scrubbed before new contexts. Global
mocs state does not fall under the umbrella of context regs, so the
HAS_CONTEXT_ISOLATION param doesn't apply universally.

But still, it is a uABI bug for one context to see the altered mocs
state of another context; irrespective of that param. :)

For proving mocs actually does something, we need to look towards the
coherency issues between different mocs settings; and detecting those
quickly and reliably is hard.
-Chris
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] ✓ Fi.CI.BAT: success for i915/gem_mocs_settings: Add mocs table for icelake (rev11)
  2019-02-15 21:46 [igt-dev] [PATCH i-g-t] i915/gem_mocs_settings: Add mocs table for icelake Prathap Kumar Valsan via igt-dev
                   ` (18 preceding siblings ...)
  2019-03-15 19:15 ` [igt-dev] [PATCH i-g-t v7] i915/gem_mocs_settings: Add mocs table for icelake Prathap Kumar Valsan
@ 2019-03-18 10:21 ` Patchwork
  2019-03-18 12:37 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
  20 siblings, 0 replies; 44+ messages in thread
From: Patchwork @ 2019-03-18 10:21 UTC (permalink / raw)
  To: Kumar Valsan, Prathap; +Cc: igt-dev

== Series Details ==

Series: i915/gem_mocs_settings: Add mocs table for icelake (rev11)
URL   : https://patchwork.freedesktop.org/series/56459/
State : success

== Summary ==

CI Bug Log - changes from IGT_4888 -> IGTPW_2644
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/56459/revisions/11/mbox/

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

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

### IGT changes ###

#### Issues hit ####

  * igt@amdgpu/amd_cs_nop@sync-gfx0:
    - fi-kbl-7567u:       NOTRUN -> SKIP [fdo#109271] +17

  * igt@i915_module_load@reload:
    - fi-kbl-7567u:       PASS -> DMESG-WARN [fdo#105602] / [fdo#108529]

  * igt@i915_pm_rpm@basic-pci-d3-state:
    - fi-byt-j1900:       PASS -> SKIP [fdo#109271]

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

  * igt@i915_pm_rpm@module-reload:
    - fi-kbl-7567u:       NOTRUN -> DMESG-WARN [fdo#108529]

  * igt@kms_chamelium@common-hpd-after-suspend:
    - fi-kbl-7567u:       PASS -> DMESG-WARN [fdo#103558] / [fdo#105079] / [fdo#105602]

  * igt@kms_chamelium@dp-edid-read:
    - fi-skl-iommu:       NOTRUN -> SKIP [fdo#109271] +45

  * igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a:
    - fi-whl-u:           PASS -> FAIL [fdo#103375] +3
    - fi-byt-clapper:     PASS -> FAIL [fdo#103191] / [fdo#107362] +1
    - fi-kbl-7567u:       PASS -> DMESG-FAIL [fdo#105079]

  * igt@prime_vgem@basic-fence-flip:
    - fi-kbl-7567u:       PASS -> SKIP [fdo#109271] +4

  
#### Possible fixes ####

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

  * igt@kms_pipe_crc_basic@suspend-read-crc-pipe-b:
    - fi-byt-clapper:     FAIL [fdo#103191] / [fdo#107362] -> PASS +2

  * igt@prime_vgem@basic-fence-flip:
    - fi-ilk-650:         FAIL [fdo#104008] -> PASS

  
  [fdo#103191]: https://bugs.freedesktop.org/show_bug.cgi?id=103191
  [fdo#103375]: https://bugs.freedesktop.org/show_bug.cgi?id=103375
  [fdo#103558]: https://bugs.freedesktop.org/show_bug.cgi?id=103558
  [fdo#104008]: https://bugs.freedesktop.org/show_bug.cgi?id=104008
  [fdo#105079]: https://bugs.freedesktop.org/show_bug.cgi?id=105079
  [fdo#105602]: https://bugs.freedesktop.org/show_bug.cgi?id=105602
  [fdo#107362]: https://bugs.freedesktop.org/show_bug.cgi?id=107362
  [fdo#108529]: https://bugs.freedesktop.org/show_bug.cgi?id=108529
  [fdo#108800]: https://bugs.freedesktop.org/show_bug.cgi?id=108800
  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271


Participating hosts (46 -> 39)
------------------------------

  Additional (1): fi-skl-iommu 
  Missing    (8): fi-kbl-soraka fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-icl-u2 fi-bsw-cyan fi-icl-y fi-bdw-samus 


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

    * IGT: IGT_4888 -> IGTPW_2644
    * Linux: CI_DRM_5756 -> CI_DRM_5763

  CI_DRM_5756: 0a2a982693ac3f3ecabf8e6c12cb18aa993ae3b0 @ git://anongit.freedesktop.org/gfx-ci/linux
  CI_DRM_5763: de2772b353b83e6347687973dfff6f7f5257e364 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_2644: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2644/
  IGT_4888: 71ad19eb8fe4f0eecae3bf063e107293b90b9abc @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools



== Testlist changes ==

+igt@gem_mocs_settings@mocs-isolation-blt
+igt@gem_mocs_settings@mocs-isolation-bsd1
+igt@gem_mocs_settings@mocs-isolation-bsd2
+igt@gem_mocs_settings@mocs-isolation-render
+igt@gem_mocs_settings@mocs-isolation-vebox

== Logs ==

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

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

* [igt-dev] ✓ Fi.CI.IGT: success for i915/gem_mocs_settings: Add mocs table for icelake (rev11)
  2019-02-15 21:46 [igt-dev] [PATCH i-g-t] i915/gem_mocs_settings: Add mocs table for icelake Prathap Kumar Valsan via igt-dev
                   ` (19 preceding siblings ...)
  2019-03-18 10:21 ` [igt-dev] ✓ Fi.CI.BAT: success for i915/gem_mocs_settings: Add mocs table for icelake (rev11) Patchwork
@ 2019-03-18 12:37 ` Patchwork
  20 siblings, 0 replies; 44+ messages in thread
From: Patchwork @ 2019-03-18 12:37 UTC (permalink / raw)
  To: Kumar Valsan, Prathap; +Cc: igt-dev

== Series Details ==

Series: i915/gem_mocs_settings: Add mocs table for icelake (rev11)
URL   : https://patchwork.freedesktop.org/series/56459/
State : success

== Summary ==

CI Bug Log - changes from IGT_4888_full -> IGTPW_2644_full
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/56459/revisions/11/mbox/

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

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

### IGT changes ###

#### Possible regressions ####

  * {igt@gem_mocs_settings@mocs-isolation-bsd2} (NEW):
    - shard-apl:          NOTRUN -> FAIL

  
New tests
---------

  New tests have been introduced between IGT_4888_full and IGTPW_2644_full:

### New IGT tests (5) ###

  * igt@gem_mocs_settings@mocs-isolation-blt:
    - Statuses : 2 pass(s) 3 skip(s)
    - Exec time: [0.0, 0.00] s

  * igt@gem_mocs_settings@mocs-isolation-bsd1:
    - Statuses : 2 pass(s) 3 skip(s)
    - Exec time: [0.0, 0.00] s

  * igt@gem_mocs_settings@mocs-isolation-bsd2:
    - Statuses : 1 fail(s) 1 pass(s) 3 skip(s)
    - Exec time: [0.0, 0.09] s

  * igt@gem_mocs_settings@mocs-isolation-render:
    - Statuses : 2 pass(s) 3 skip(s)
    - Exec time: [0.0, 0.01] s

  * igt@gem_mocs_settings@mocs-isolation-vebox:
    - Statuses : 2 pass(s) 3 skip(s)
    - Exec time: [0.0, 0.00] s

  

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

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

### IGT changes ###

#### Issues hit ####

  * {igt@gem_mocs_settings@mocs-isolation-bsd2} (NEW):
    - shard-hsw:          NOTRUN -> SKIP [fdo#109271] +4

  * igt@gem_wait@wait-bsd:
    - shard-apl:          PASS -> INCOMPLETE [fdo#103927]

  * igt@kms_atomic_transition@3x-modeset-transitions-nonblocking:
    - shard-snb:          NOTRUN -> SKIP [fdo#109271] / [fdo#109278] +10

  * igt@kms_atomic_transition@4x-modeset-transitions-nonblocking-fencing:
    - shard-glk:          NOTRUN -> SKIP [fdo#109271] / [fdo#109278]

  * igt@kms_busy@extended-modeset-hang-newfb-with-reset-render-b:
    - shard-snb:          NOTRUN -> DMESG-WARN [fdo#107956]

  * igt@kms_busy@extended-modeset-hang-newfb-with-reset-render-c:
    - shard-hsw:          PASS -> DMESG-WARN [fdo#107956] +1
    - shard-kbl:          PASS -> DMESG-WARN [fdo#107956]

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

  * igt@kms_color@pipe-b-degamma:
    - shard-kbl:          PASS -> FAIL [fdo#104782]
    - shard-apl:          PASS -> FAIL [fdo#104782] +1

  * igt@kms_cursor_crc@cursor-128x128-random:
    - shard-apl:          PASS -> FAIL [fdo#103232] +7
    - shard-kbl:          PASS -> FAIL [fdo#103232] +1

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

  * igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-mmap-wc:
    - shard-kbl:          PASS -> FAIL [fdo#103167]

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

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

  * igt@kms_frontbuffer_tracking@fbc-2p-rte:
    - shard-glk:          PASS -> FAIL [fdo#103167] / [fdo#105682]

  * igt@kms_frontbuffer_tracking@fbcpsr-rgb565-draw-mmap-gtt:
    - shard-kbl:          NOTRUN -> SKIP [fdo#109271] +4

  * igt@kms_frontbuffer_tracking@psr-1p-primscrn-cur-indfb-onoff:
    - shard-snb:          NOTRUN -> SKIP [fdo#109271] +111

  * igt@kms_psr@sprite_plane_onoff:
    - shard-glk:          NOTRUN -> SKIP [fdo#109271] +16

  * igt@kms_rotation_crc@multiplane-rotation-cropping-bottom:
    - shard-kbl:          PASS -> DMESG-FAIL [fdo#105763]

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

  * igt@perf_pmu@busy-idle-check-all-vecs0:
    - shard-hsw:          PASS -> INCOMPLETE [fdo#103540]

  * igt@perf_pmu@rc6:
    - shard-kbl:          PASS -> SKIP [fdo#109271]

  * igt@prime_nv_api@i915_nv_reimport_twice_check_flink_name:
    - shard-apl:          NOTRUN -> SKIP [fdo#109271] +6

  * igt@sw_sync@sync_busy_fork_unixsocket:
    - shard-snb:          NOTRUN -> FAIL [fdo#110150 ]

  * igt@testdisplay:
    - shard-kbl:          PASS -> INCOMPLETE [fdo#103665] +2

  
#### Possible fixes ####

  * igt@gem_eio@reset-stress:
    - shard-snb:          FAIL [fdo#109661] -> PASS

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

  * igt@kms_cursor_legacy@2x-long-cursor-vs-flip-legacy:
    - shard-hsw:          FAIL [fdo#105767] -> PASS

  * igt@kms_flip@modeset-vs-vblank-race-interruptible:
    - shard-glk:          FAIL [fdo#103060] -> 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-onoff:
    - shard-glk:          FAIL [fdo#103167] -> PASS +2

  * igt@kms_pipe_crc_basic@suspend-read-crc-pipe-c:
    - shard-kbl:          INCOMPLETE [fdo#103665] -> PASS

  * {igt@kms_plane@pixel-format-pipe-a-planes-source-clamping}:
    - shard-glk:          SKIP [fdo#109271] -> PASS
    - shard-apl:          FAIL [fdo#110033] -> PASS +1
    - shard-kbl:          FAIL -> PASS

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

  * {igt@kms_plane_multiple@atomic-pipe-b-tiling-y}:
    - shard-apl:          FAIL [fdo#110037] -> PASS +2

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

  
#### Warnings ####

  * igt@kms_plane_scaling@pipe-a-scaler-with-pixel-format:
    - shard-glk:          SKIP [fdo#109271] / [fdo#109278] -> FAIL [fdo#110098] +2

  * igt@kms_plane_scaling@pipe-a-scaler-with-rotation:
    - shard-glk:          FAIL [fdo#110098] -> SKIP [fdo#109271] / [fdo#109278] +1

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

  [fdo#103060]: https://bugs.freedesktop.org/show_bug.cgi?id=103060
  [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#103665]: https://bugs.freedesktop.org/show_bug.cgi?id=103665
  [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#105682]: https://bugs.freedesktop.org/show_bug.cgi?id=105682
  [fdo#105763]: https://bugs.freedesktop.org/show_bug.cgi?id=105763
  [fdo#105767]: https://bugs.freedesktop.org/show_bug.cgi?id=105767
  [fdo#107956]: https://bugs.freedesktop.org/show_bug.cgi?id=107956
  [fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [fdo#109278]: https://bugs.freedesktop.org/show_bug.cgi?id=109278
  [fdo#109661]: https://bugs.freedesktop.org/show_bug.cgi?id=109661
  [fdo#110033]: https://bugs.freedesktop.org/show_bug.cgi?id=110033
  [fdo#110037]: https://bugs.freedesktop.org/show_bug.cgi?id=110037
  [fdo#110038]: https://bugs.freedesktop.org/show_bug.cgi?id=110038
  [fdo#110098]: https://bugs.freedesktop.org/show_bug.cgi?id=110098
  [fdo#110150 ]: https://bugs.freedesktop.org/show_bug.cgi?id=110150 
  [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_4888 -> IGTPW_2644
    * Linux: CI_DRM_5756 -> CI_DRM_5763

  CI_DRM_5756: 0a2a982693ac3f3ecabf8e6c12cb18aa993ae3b0 @ git://anongit.freedesktop.org/gfx-ci/linux
  CI_DRM_5763: de2772b353b83e6347687973dfff6f7f5257e364 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_2644: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2644/
  IGT_4888: 71ad19eb8fe4f0eecae3bf063e107293b90b9abc @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Logs ==

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

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

* Re: [igt-dev] [PATCH i-g-t v7] i915/gem_mocs_settings: Add mocs table for icelake
  2019-03-18 13:10   ` Kumar Valsan, Prathap
@ 2019-03-18 13:06     ` Chris Wilson
  2019-03-18 13:31       ` Kumar Valsan, Prathap
  0 siblings, 1 reply; 44+ messages in thread
From: Chris Wilson @ 2019-03-18 13:06 UTC (permalink / raw)
  To: Kumar Valsan, Prathap, Lis Tomasz, igt-dev

Quoting Kumar Valsan, Prathap (2019-03-18 13:10:43)
> On Fri, Mar 15, 2019 at 03:15:55PM -0400, Prathap Kumar Valsan wrote:
> > +static void isolation_test(int fd, unsigned engine)
> > +{
> > +     uint32_t ctx[2] = { gem_context_create(fd), gem_context_create(fd) };
> > +
> > +     /* Any writes by one normal client should not affect a second client */
> > +     write_dirty_mocs(fd, engine, ctx[0], false);
> > +     check_mocs_values(fd, engine, ctx[1], false);
> > +
> > +     for (int i = 0; i < ARRAY_SIZE(ctx); i++)
> > +             gem_context_destroy(fd, ctx[i]);
> > +}
> > +
> >  igt_main
> >  {
> >       const struct intel_execution_engine *e;
> > @@ -490,6 +559,14 @@ igt_main
> >                               }
> >                       }
> >               }
> > +
> > +             igt_subtest_f("mocs-isolation-%s",
> > +                             e->name) {
> > +                     gem_require_contexts(fd);
> > +
> > +                     isolation_test(fd, e->exec_id | e->flags);
> > +             }
> > +
> >       }
> Chris,
> Added isolation_test as a subtest. Can i get a r-b if this looks good to
> you.

Yup, that looks like what I expect we need to verify the ABI that mocs
values are independent without overburdening ourselves with actual HW
implementation.

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* Re: [igt-dev] [PATCH i-g-t v7] i915/gem_mocs_settings: Add mocs table for icelake
  2019-03-15 19:15 ` [igt-dev] [PATCH i-g-t v7] i915/gem_mocs_settings: Add mocs table for icelake Prathap Kumar Valsan
@ 2019-03-18 13:10   ` Kumar Valsan, Prathap
  2019-03-18 13:06     ` Chris Wilson
  2019-03-18 13:27   ` Chris Wilson
  1 sibling, 1 reply; 44+ messages in thread
From: Kumar Valsan, Prathap @ 2019-03-18 13:10 UTC (permalink / raw)
  To: igt-dev, Chris Wilson, Lis Tomasz

On Fri, Mar 15, 2019 at 03:15:55PM -0400, Prathap Kumar Valsan wrote:
> From: "Kumar Valsan, Prathap" <prathap.kumar.valsan@intel.com>
> 
> This patch adds mocs table for icelake with expected L3 and eDRAM
> control values.
> 
> Signed-off-by: Kumar Valsan, Prathap <prathap.kumar.valsan@intel.com>
> ---
> Changes in v7:
> - Testing non-privileged write to MOCS is dropped
>   by h/w and clients are isolated has moved to a 
>   new subtest. This subtest will be invoked per
>   engine(suggested by Chris Wilson)
> Changes in v6:
> - We need to test non-privileged write to MOCS
>   is dropped by the hardware.(suggested by Chris Wilson)
> Changes in v5:
> - As mocs table is global, test need not write
>   mocs table. Below jira has the discussion. 
>   https://jira.devtools.intel.com/browse/VLK-1567
> Changes in v4:
> - L3 control registers are global in icelake.
>   Test validates that dirty writes from userspace
>   to L3 control registers are being dropped. 
> Changes in v3:
> - There are holes in the mocs table(Lucas Pointed out).
>   In icelake index 16 and 17 are reserved.
>   So test shouldn't be checking them.
> Changes in v2:
> - Cleaned up the code based on review
>   comments from Lucas and Chris
> 
>  tests/i915/gem_mocs_settings.c | 147 +++++++++++++++++++++++++--------
>  1 file changed, 112 insertions(+), 35 deletions(-)
> 
> diff --git a/tests/i915/gem_mocs_settings.c b/tests/i915/gem_mocs_settings.c
> index 5b3b6bc1..c205a726 100644
> --- a/tests/i915/gem_mocs_settings.c
> +++ b/tests/i915/gem_mocs_settings.c
> @@ -32,7 +32,9 @@
>  #include "igt_perf.h"
>  #include "igt_sysfs.h"
>  
> -#define MAX_NUMBER_MOCS_REGISTERS	(64)
> +#define GEN9_NUM_MOCS_ENTRIES   62  /* 62 out of 64 - 63 & 64 are reserved. */
> +#define GEN11_NUM_MOCS_ENTRIES  64  /* 63-64 are reserved, but configured. */
> +
>  enum {
>  	NONE,
>  	RESET,
> @@ -61,10 +63,13 @@ static const char * const test_modes[] = {
>  #define GEN9_MFX1_MOCS_0	(0xcA00)	/* Media 1 MOCS base register*/
>  #define GEN9_VEBOX_MOCS_0	(0xcB00)	/* Video MOCS base register*/
>  #define GEN9_BLT_MOCS_0		(0xcc00)	/* Blitter MOCS base register*/
> +#define ICELAKE_MOCS_PTE	{0x00000004, 0x0030, 0x1}
> +#define MOCS_PTE		{0x00000038, 0x0030, 0x1}
>  
>  struct mocs_entry {
>  	uint32_t	control_value;
>  	uint16_t	l3cc_value;
> +	uint8_t 	used;
>  };
>  
>  struct mocs_table {
> @@ -73,35 +78,58 @@ struct mocs_table {
>  };
>  
>  /* The first entries in the MOCS tables are defined by uABI */
> -static const struct mocs_entry skylake_mocs_table[] = {
> -	{ 0x00000009, 0x0010 },
> -	{ 0x00000038, 0x0030 },
> -	{ 0x0000003b, 0x0030 },
> +static const struct mocs_entry icelake_mocs_table[GEN11_NUM_MOCS_ENTRIES] = {
> +	[0]  = { 0x00000005, 0x0010, 0x1},
> +	[1]  = ICELAKE_MOCS_PTE,
> +	[2]  = { 0x00000037, 0x0030, 0x1},
> +	[3]  = { 0x00000005, 0x0010, 0x1},
> +	[4]  = { 0x00000005, 0x0030, 0x1},
> +	[5]  = { 0x00000037, 0x0010, 0x1},
> +	[6]  = { 0x00000017, 0x0010, 0x1},
> +	[7]  = { 0x00000017, 0x0030, 0x1},
> +	[8]  = { 0x00000027, 0x0010, 0x1},
> +	[9]  = { 0x00000027, 0x0030, 0x1},
> +	[10] = { 0x00000077, 0x0010, 0x1},
> +	[11] = { 0x00000077, 0x0030, 0x1},
> +	[12] = { 0x00000057, 0x0010, 0x1},
> +	[13] = { 0x00000057, 0x0030, 0x1},
> +	[14] = { 0x00000067, 0x0010, 0x1},
> +	[15] = { 0x00000067, 0x0030, 0x1},
> +	[18] = { 0x00060037, 0x0030, 0x1},
> +	[19] = { 0x00000737, 0x0030, 0x1},
> +	[20] = { 0x00000337, 0x0030, 0x1},
> +	[21] = { 0x00000137, 0x0030, 0x1},
> +	[22] = { 0x000003b7, 0x0030, 0x1},
> +	[23] = { 0x000007b7, 0x0030, 0x1},
> +	[24 ... 61] = ICELAKE_MOCS_PTE,
> +	[62] = { 0x00000037, 0x0010, 0x1},
> +	[63] = { 0x00000037, 0x0010, 0x1},
> +};
> +
> +static const struct mocs_entry skylake_mocs_table[GEN9_NUM_MOCS_ENTRIES] = {
> +	[0] = { 0x00000009, 0x0010, 0x1},
> +	[1] = MOCS_PTE,
> +	[2] = { 0x0000003b, 0x0030, 0x1},
> +	[3 ... GEN9_NUM_MOCS_ENTRIES - 1] = MOCS_PTE,
>  };
>  
> -static const struct mocs_entry dirty_skylake_mocs_table[] = {
> -	{ 0x00003FFF, 0x003F }, /* no snoop bit */
> -	{ 0x00003FFF, 0x003F },
> -	{ 0x00003FFF, 0x003F },
> +static const struct mocs_entry dirty_skylake_mocs_table[GEN9_NUM_MOCS_ENTRIES] = {
> +	[0 ... GEN9_NUM_MOCS_ENTRIES - 1] = { 0x00003FFF, 0x003F, 0x1 },
>  };
>  
> -static const struct mocs_entry broxton_mocs_table[] = {
> -	{ 0x00000009, 0x0010 },
> -	{ 0x00000038, 0x0030 },
> -	{ 0x00000039, 0x0030 },
> +static const struct mocs_entry broxton_mocs_table[GEN9_NUM_MOCS_ENTRIES] = {
> +	[0] = { 0x00000009, 0x0010, 0x1},
> +	[1] = MOCS_PTE,
> +	[2] = { 0x00000039, 0x0030, 0x1},
> +	[3 ... GEN9_NUM_MOCS_ENTRIES - 1] = MOCS_PTE,
>  };
>  
> -static const struct mocs_entry dirty_broxton_mocs_table[] = {
> -	{ 0x00007FFF, 0x003F },
> -	{ 0x00007FFF, 0x003F },
> -	{ 0x00007FFF, 0x003F },
> +static const struct mocs_entry dirty_broxton_mocs_table[GEN9_NUM_MOCS_ENTRIES] = {
> +	[0 ... GEN9_NUM_MOCS_ENTRIES - 1] = { 0x00007FFF, 0x003F, 0x1 },
>  };
>  
> -static const uint32_t write_values[] = {
> -	0xFFFFFFFF,
> -	0xFFFFFFFF,
> -	0xFFFFFFFF,
> -	0xFFFFFFFF
> +static const uint32_t write_values[GEN9_NUM_MOCS_ENTRIES] = {
> +	[0 ... GEN9_NUM_MOCS_ENTRIES - 1] = 0xFFFFFFFF,
>  };
>  
>  static bool get_mocs_settings(int fd, struct mocs_table *table, bool dirty)
> @@ -127,6 +155,10 @@ static bool get_mocs_settings(int fd, struct mocs_table *table, bool dirty)
>  			table->table = broxton_mocs_table;
>  		}
>  		result = true;
> +	} else if (IS_ICELAKE(devid)) {
> +		table->size  = ARRAY_SIZE(icelake_mocs_table);
> +		table->table = icelake_mocs_table;
> +		result = true;
>  	}
>  
>  	return result;
> @@ -238,7 +270,8 @@ static void write_registers(int fd,
>  			    uint32_t reg_base,
>  			    const uint32_t *values,
>  			    uint32_t size,
> -			    uint32_t engine_id)
> +			    uint32_t engine_id,
> +			    bool privileged)
>  {
>  	struct drm_i915_gem_exec_object2 obj;
>  	struct drm_i915_gem_execbuffer2 execbuf;
> @@ -254,7 +287,10 @@ static void write_registers(int fd,
>  	execbuf.buffer_count = 1;
>  	execbuf.batch_len = create_write_batch(batch, values, size, reg_base);
>  	i915_execbuffer2_set_context_id(execbuf, ctx_id);
> -	execbuf.flags = I915_EXEC_SECURE | engine_id;
> +	if (privileged)
> +		execbuf.flags = I915_EXEC_SECURE | engine_id;
> +	else
> +		execbuf.flags = engine_id;
>  
>  	gem_write(fd, handle, 0, batch, execbuf.batch_len);
>  	gem_execbuf(fd, &execbuf);
> @@ -283,9 +319,12 @@ static void check_control_registers(int fd,
>  	read_regs = gem_mmap__cpu(fd, dst_handle, 0, 4096, PROT_READ);
>  
>  	gem_set_domain(fd, dst_handle, I915_GEM_DOMAIN_CPU, 0);
> -	for (int index = 0; index < table.size; index++)
> +	for (int index = 0; index < table.size; index++) {
> +		if (!table.table[index].used)
> +			continue;
>  		igt_assert_eq_u32(read_regs[index],
>  				  table.table[index].control_value);
> +	}
>  
>  	munmap(read_regs, 4096);
>  	gem_close(fd, dst_handle);
> @@ -315,10 +354,14 @@ static void check_l3cc_registers(int fd,
>  	gem_set_domain(fd, dst_handle, I915_GEM_DOMAIN_CPU, 0);
>  
>  	for (index = 0; index < table.size / 2; index++) {
> -		igt_assert_eq_u32(read_regs[index] & 0xffff,
> -				  table.table[index * 2].l3cc_value);
> -		igt_assert_eq_u32(read_regs[index] >> 16,
> -				  table.table[index * 2 + 1].l3cc_value);
> +		if (table.table[index * 2].used) {
> +			igt_assert_eq_u32(read_regs[index] & 0xffff,
> +					  table.table[index * 2].l3cc_value);
> +		}
> +		if (table.table[index * 2 + 1].used) {
> +			igt_assert_eq_u32(read_regs[index] >> 16,
> +					  table.table[index * 2 + 1].l3cc_value);
> +		}
>  	}
>  
>  	if (table.size & 1)
> @@ -372,16 +415,23 @@ static void check_mocs_values(int fd, unsigned engine, uint32_t ctx_id, bool dir
>  		check_l3cc_registers(fd, engine, ctx_id, dirty);
>  }
>  
> -static void write_dirty_mocs(int fd, unsigned engine, uint32_t ctx_id)
> +static void write_dirty_mocs(int fd, unsigned engine, uint32_t ctx_id, bool privileged)
>  {
> +	int num_of_mocs_entries;
> +
> +	if (intel_gen(intel_get_drm_devid(fd)) >= 11)
> +		num_of_mocs_entries = GEN11_NUM_MOCS_ENTRIES;
> +	else
> +		num_of_mocs_entries = GEN9_NUM_MOCS_ENTRIES;
> +
>  	write_registers(fd, ctx_id, get_engine_base(engine),
> -			write_values, ARRAY_SIZE(write_values),
> -			engine);
> +			write_values, num_of_mocs_entries,
> +			engine, privileged);
>  
>  	if (engine == I915_EXEC_RENDER)
>  		write_registers(fd, ctx_id, GEN9_LNCFCMOCS0,
> -				write_values, ARRAY_SIZE(write_values),
> -				engine);
> +				write_values, num_of_mocs_entries/2,
> +				engine, privileged);
>  }
>  
>  static void run_test(int fd, unsigned engine, unsigned flags, unsigned mode)
> @@ -390,6 +440,13 @@ static void run_test(int fd, unsigned engine, unsigned flags, unsigned mode)
>  	uint32_t ctx_clean_id;
>  	uint32_t ctx_dirty_id;
>  
> +	/* As mocs is global for GEN11+, trying privileged write to dirty
> +	 * the mocs and testing context save and restore of mocs between
> +	 * contexts is bound to fail.
> +	 */
> +	if (flags & MOCS_DIRTY_VALUES)
> +		igt_skip_on(intel_gen(intel_get_drm_devid(fd)) >= 11);
> +
>  	gem_require_ring(fd, engine);
>  
>  	/* Skip if we don't know where the registers are for this engine */
> @@ -400,7 +457,7 @@ static void run_test(int fd, unsigned engine, unsigned flags, unsigned mode)
>  
>  	if (flags & MOCS_DIRTY_VALUES) {
>  		ctx_dirty_id = gem_context_create(fd);
> -		write_dirty_mocs(fd, engine, ctx_dirty_id);
> +		write_dirty_mocs(fd, engine, ctx_dirty_id, true);
>  		check_mocs_values(fd, engine, ctx_dirty_id, true);
>  	}
>  
> @@ -430,6 +487,18 @@ static void run_test(int fd, unsigned engine, unsigned flags, unsigned mode)
>  		gem_context_destroy(fd, ctx_id);
>  }
>  
> +static void isolation_test(int fd, unsigned engine)
> +{
> +	uint32_t ctx[2] = { gem_context_create(fd), gem_context_create(fd) };
> +
> +	/* Any writes by one normal client should not affect a second client */
> +	write_dirty_mocs(fd, engine, ctx[0], false);
> +	check_mocs_values(fd, engine, ctx[1], false);
> +
> +	for (int i = 0; i < ARRAY_SIZE(ctx); i++)
> +		gem_context_destroy(fd, ctx[i]);
> +}
> +
>  igt_main
>  {
>  	const struct intel_execution_engine *e;
> @@ -490,6 +559,14 @@ igt_main
>  				}
>  			}
>  		}
> +
> +		igt_subtest_f("mocs-isolation-%s",
> +				e->name) {
> +			gem_require_contexts(fd);
> +
> +			isolation_test(fd, e->exec_id | e->flags);
> +		}
> +
>  	}
Chris,
Added isolation_test as a subtest. Can i get a r-b if this looks good to
you.

Thanks,
Prathap
>  
>  	igt_fixture
> -- 
> 2.20.1
> 
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* Re: [igt-dev] [PATCH i-g-t v7] i915/gem_mocs_settings: Add mocs table for icelake
  2019-03-15 19:15 ` [igt-dev] [PATCH i-g-t v7] i915/gem_mocs_settings: Add mocs table for icelake Prathap Kumar Valsan
  2019-03-18 13:10   ` Kumar Valsan, Prathap
@ 2019-03-18 13:27   ` Chris Wilson
  1 sibling, 0 replies; 44+ messages in thread
From: Chris Wilson @ 2019-03-18 13:27 UTC (permalink / raw)
  To: Lis Tomasz, Prathap Kumar Valsan, igt-dev; +Cc: De Marchi Lucas

Quoting Prathap Kumar Valsan (2019-03-15 19:15:55)
> From: "Kumar Valsan, Prathap" <prathap.kumar.valsan@intel.com>
> 
> This patch adds mocs table for icelake with expected L3 and eDRAM
> control values.
> 
> Signed-off-by: Kumar Valsan, Prathap <prathap.kumar.valsan@intel.com>

I've picked this patch up for pushing just as soon as gitlab is happy
again. Thanks for the patch and reviews,
-Chris
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* Re: [igt-dev] [PATCH i-g-t v7] i915/gem_mocs_settings: Add mocs table for icelake
  2019-03-18 13:06     ` Chris Wilson
@ 2019-03-18 13:31       ` Kumar Valsan, Prathap
  0 siblings, 0 replies; 44+ messages in thread
From: Kumar Valsan, Prathap @ 2019-03-18 13:31 UTC (permalink / raw)
  To: Chris Wilson; +Cc: igt-dev

On Mon, Mar 18, 2019 at 01:06:13PM +0000, Chris Wilson wrote:
> Quoting Kumar Valsan, Prathap (2019-03-18 13:10:43)
> > On Fri, Mar 15, 2019 at 03:15:55PM -0400, Prathap Kumar Valsan wrote:
> > > +static void isolation_test(int fd, unsigned engine)
> > > +{
> > > +     uint32_t ctx[2] = { gem_context_create(fd), gem_context_create(fd) };
> > > +
> > > +     /* Any writes by one normal client should not affect a second client */
> > > +     write_dirty_mocs(fd, engine, ctx[0], false);
> > > +     check_mocs_values(fd, engine, ctx[1], false);
> > > +
> > > +     for (int i = 0; i < ARRAY_SIZE(ctx); i++)
> > > +             gem_context_destroy(fd, ctx[i]);
> > > +}
> > > +
> > >  igt_main
> > >  {
> > >       const struct intel_execution_engine *e;
> > > @@ -490,6 +559,14 @@ igt_main
> > >                               }
> > >                       }
> > >               }
> > > +
> > > +             igt_subtest_f("mocs-isolation-%s",
> > > +                             e->name) {
> > > +                     gem_require_contexts(fd);
> > > +
> > > +                     isolation_test(fd, e->exec_id | e->flags);
> > > +             }
> > > +
> > >       }
> > Chris,
> > Added isolation_test as a subtest. Can i get a r-b if this looks good to
> > you.
> 
> Yup, that looks like what I expect we need to verify the ABI that mocs
> values are independent without overburdening ourselves with actual HW
> implementation.
> 
> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
> -Chris

Thanks for the reviews.

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

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

* Re: [igt-dev] [PATCH i-g-t] i915/gem_mocs_settings: Add mocs table for icelake
  2019-02-09 19:50 Prathap Kumar Valsan
@ 2019-02-11 18:39 ` Lucas De Marchi
  0 siblings, 0 replies; 44+ messages in thread
From: Lucas De Marchi @ 2019-02-11 18:39 UTC (permalink / raw)
  To: Prathap Kumar Valsan; +Cc: igt-dev

On Sat, Feb 9, 2019 at 11:37 AM Prathap Kumar Valsan
<prathap.kumar.valsan@intel.com> wrote:
>
> From: "Kumar Valsan, Prathap" <prathap.kumar.valsan@intel.com>
>
> This patch adds mocs table for icelake with expected L3 and eDRAM
> control values.
>
> Signed-off-by: Kumar Valsan, Prathap <prathap.kumar.valsan@intel.com>
> ---
>  tests/i915/gem_mocs_settings.c | 21 +++++++++++++++++++++
>  1 file changed, 21 insertions(+)
>
> diff --git a/tests/i915/gem_mocs_settings.c b/tests/i915/gem_mocs_settings.c
> index 5b3b6bc1..bae245ef 100644
> --- a/tests/i915/gem_mocs_settings.c
> +++ b/tests/i915/gem_mocs_settings.c
> @@ -73,6 +73,18 @@ struct mocs_table {
>  };
>
>  /* The first entries in the MOCS tables are defined by uABI */
> +static const struct mocs_entry icelake_mocs_table[] = {
> +       { 0x00000005, 0x0010 },
> +       { 0x00000004, 0x0030 },
> +       { 0x00000037, 0x0030 },


the table contains 62 entries that we should be checking. What about
the other ones?

We  will need to update the other tables as well, as it was changed
from Uncached to PTE. Could you take care of that as well?

thanks
Lucas De Marchi

> +};
> +
> +static const struct mocs_entry dirty_icelake_mocs_table[] = {
> +       { 0x0007FFFF, 0x003F },
> +       { 0x0007FFFF, 0x003F },
> +       { 0x0007FFFF, 0x003F },
> +};
> +
>  static const struct mocs_entry skylake_mocs_table[] = {
>         { 0x00000009, 0x0010 },
>         { 0x00000038, 0x0030 },
> @@ -127,6 +139,15 @@ static bool get_mocs_settings(int fd, struct mocs_table *table, bool dirty)
>                         table->table = broxton_mocs_table;
>                 }
>                 result = true;
> +       } else if (IS_ICELAKE(devid)) {
> +               if (dirty) {
> +                       table->size  = ARRAY_SIZE(dirty_icelake_mocs_table);
> +                       table->table = dirty_icelake_mocs_table;
> +               } else {
> +                       table->size  = ARRAY_SIZE(icelake_mocs_table);
> +                       table->table = icelake_mocs_table;
> +               }
> +               result = true;
>         }
>
>         return result;
> --
> 2.20.1
>
> _______________________________________________
> igt-dev mailing list
> igt-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev



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

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

* [igt-dev] [PATCH i-g-t] i915/gem_mocs_settings: Add mocs table for icelake
@ 2019-02-09 19:54 Prathap Kumar Valsan
  0 siblings, 0 replies; 44+ messages in thread
From: Prathap Kumar Valsan @ 2019-02-09 19:54 UTC (permalink / raw)
  To: igt-dev

From: "Kumar Valsan, Prathap" <prathap.kumar.valsan@intel.com>

This patch adds mocs table for icelake with expected L3 and eDRAM
control values.

Signed-off-by: Kumar Valsan, Prathap <prathap.kumar.valsan@intel.com>
---
 tests/i915/gem_mocs_settings.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/tests/i915/gem_mocs_settings.c b/tests/i915/gem_mocs_settings.c
index 5b3b6bc1..bae245ef 100644
--- a/tests/i915/gem_mocs_settings.c
+++ b/tests/i915/gem_mocs_settings.c
@@ -73,6 +73,18 @@ struct mocs_table {
 };
 
 /* The first entries in the MOCS tables are defined by uABI */
+static const struct mocs_entry icelake_mocs_table[] = {
+	{ 0x00000005, 0x0010 },
+	{ 0x00000004, 0x0030 },
+	{ 0x00000037, 0x0030 },
+};
+
+static const struct mocs_entry dirty_icelake_mocs_table[] = {
+	{ 0x0007FFFF, 0x003F },
+	{ 0x0007FFFF, 0x003F },
+	{ 0x0007FFFF, 0x003F },
+};
+
 static const struct mocs_entry skylake_mocs_table[] = {
 	{ 0x00000009, 0x0010 },
 	{ 0x00000038, 0x0030 },
@@ -127,6 +139,15 @@ static bool get_mocs_settings(int fd, struct mocs_table *table, bool dirty)
 			table->table = broxton_mocs_table;
 		}
 		result = true;
+	} else if (IS_ICELAKE(devid)) {
+		if (dirty) {
+			table->size  = ARRAY_SIZE(dirty_icelake_mocs_table);
+			table->table = dirty_icelake_mocs_table;
+		} else {
+			table->size  = ARRAY_SIZE(icelake_mocs_table);
+			table->table = icelake_mocs_table;
+		}
+		result = true;
 	}
 
 	return result;
-- 
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] 44+ messages in thread

* [igt-dev] [PATCH i-g-t] i915/gem_mocs_settings: Add mocs table for icelake
@ 2019-02-09 19:50 Prathap Kumar Valsan
  2019-02-11 18:39 ` Lucas De Marchi
  0 siblings, 1 reply; 44+ messages in thread
From: Prathap Kumar Valsan @ 2019-02-09 19:50 UTC (permalink / raw)
  To: igt-dev

From: "Kumar Valsan, Prathap" <prathap.kumar.valsan@intel.com>

This patch adds mocs table for icelake with expected L3 and eDRAM
control values.

Signed-off-by: Kumar Valsan, Prathap <prathap.kumar.valsan@intel.com>
---
 tests/i915/gem_mocs_settings.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/tests/i915/gem_mocs_settings.c b/tests/i915/gem_mocs_settings.c
index 5b3b6bc1..bae245ef 100644
--- a/tests/i915/gem_mocs_settings.c
+++ b/tests/i915/gem_mocs_settings.c
@@ -73,6 +73,18 @@ struct mocs_table {
 };
 
 /* The first entries in the MOCS tables are defined by uABI */
+static const struct mocs_entry icelake_mocs_table[] = {
+	{ 0x00000005, 0x0010 },
+	{ 0x00000004, 0x0030 },
+	{ 0x00000037, 0x0030 },
+};
+
+static const struct mocs_entry dirty_icelake_mocs_table[] = {
+	{ 0x0007FFFF, 0x003F },
+	{ 0x0007FFFF, 0x003F },
+	{ 0x0007FFFF, 0x003F },
+};
+
 static const struct mocs_entry skylake_mocs_table[] = {
 	{ 0x00000009, 0x0010 },
 	{ 0x00000038, 0x0030 },
@@ -127,6 +139,15 @@ static bool get_mocs_settings(int fd, struct mocs_table *table, bool dirty)
 			table->table = broxton_mocs_table;
 		}
 		result = true;
+	} else if (IS_ICELAKE(devid)) {
+		if (dirty) {
+			table->size  = ARRAY_SIZE(dirty_icelake_mocs_table);
+			table->table = dirty_icelake_mocs_table;
+		} else {
+			table->size  = ARRAY_SIZE(icelake_mocs_table);
+			table->table = icelake_mocs_table;
+		}
+		result = true;
 	}
 
 	return result;
-- 
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] 44+ messages in thread

end of thread, other threads:[~2019-03-18 13:28 UTC | newest]

Thread overview: 44+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-15 21:46 [igt-dev] [PATCH i-g-t] i915/gem_mocs_settings: Add mocs table for icelake Prathap Kumar Valsan via igt-dev
2019-02-15 22:48 ` [igt-dev] ✓ Fi.CI.BAT: success for i915/gem_mocs_settings: Add mocs table for icelake (rev3) Patchwork
2019-02-16  6:07 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2019-02-20  8:33 ` [igt-dev] [PATCH i-g-t] i915/gem_mocs_settings: Add mocs table for icelake Szwichtenberg, Radoslaw
2019-02-21 22:48 ` Lucas De Marchi
2019-02-21 23:42   ` Chris Wilson
2019-02-22 17:49     ` Lucas De Marchi
2019-02-22 14:05 ` [igt-dev] ✗ Fi.CI.BAT: failure for i915/gem_mocs_settings: Add mocs table for icelake (rev4) Patchwork
2019-02-22 14:17 ` [igt-dev] [PATCH i-g-t v2] i915/gem_mocs_settings: Add mocs table for icelake Prathap Kumar Valsan
2019-02-22 15:17   ` Lis, Tomasz
2019-02-22 15:21     ` Chris Wilson
2019-02-22 21:32       ` Kumar Valsan, Prathap
2019-02-22 21:48         ` Chris Wilson
2019-02-25 13:17           ` Lis, Tomasz
2019-02-25  0:26     ` Kumar Valsan, Prathap
2019-02-22 21:16 ` [igt-dev] ✗ Fi.CI.BAT: failure for i915/gem_mocs_settings: Add mocs table for icelake (rev5) Patchwork
2019-02-22 21:20 ` [igt-dev] [PATCH i-g-t v3] i915/gem_mocs_settings: Add mocs table for icelake Prathap Kumar Valsan
2019-03-04 20:27 ` [igt-dev] [PATCH i-g-t v4] " Prathap Kumar Valsan
2019-03-04 20:37   ` Kumar Valsan, Prathap
2019-03-04 21:01 ` [igt-dev] ✓ Fi.CI.BAT: success for i915/gem_mocs_settings: Add mocs table for icelake (rev6) Patchwork
2019-03-05  2:11 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2019-03-12 15:14 ` [igt-dev] [PATCH i-g-t v5] i915/gem_mocs_settings: Add mocs table for icelake Prathap Kumar Valsan
2019-03-13 13:58   ` Kalamarz, Lukasz
2019-03-14  9:18     ` Chris Wilson
2019-03-14 11:03       ` Kalamarz, Lukasz
2019-03-13 12:12 ` [igt-dev] ✗ Fi.CI.BAT: failure for i915/gem_mocs_settings: Add mocs table for icelake (rev7) Patchwork
2019-03-14  0:12 ` [igt-dev] [PATCH i-g-t v5] i915/gem_mocs_settings: Add mocs table for icelake Prathap Kumar Valsan
2019-03-14  0:47 ` [igt-dev] ✗ Fi.CI.BAT: failure for i915/gem_mocs_settings: Add mocs table for icelake (rev8) Patchwork
2019-03-14 17:28 ` [igt-dev] [PATCH i-g-t v6] i915/gem_mocs_settings: Add mocs table for icelake Prathap Kumar Valsan
2019-03-15  8:46   ` Chris Wilson
2019-03-15 19:28     ` Kumar Valsan, Prathap
2019-03-15 21:11       ` Chris Wilson
2019-03-14 18:07 ` [igt-dev] ✓ Fi.CI.BAT: success for i915/gem_mocs_settings: Add mocs table for icelake (rev9) Patchwork
2019-03-15  2:54 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2019-03-15 19:15 ` [igt-dev] [PATCH i-g-t v7] i915/gem_mocs_settings: Add mocs table for icelake Prathap Kumar Valsan
2019-03-18 13:10   ` Kumar Valsan, Prathap
2019-03-18 13:06     ` Chris Wilson
2019-03-18 13:31       ` Kumar Valsan, Prathap
2019-03-18 13:27   ` Chris Wilson
2019-03-18 10:21 ` [igt-dev] ✓ Fi.CI.BAT: success for i915/gem_mocs_settings: Add mocs table for icelake (rev11) Patchwork
2019-03-18 12:37 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2019-02-09 19:54 [igt-dev] [PATCH i-g-t] i915/gem_mocs_settings: Add mocs table for icelake Prathap Kumar Valsan
2019-02-09 19:50 Prathap Kumar Valsan
2019-02-11 18:39 ` Lucas De Marchi

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.