Skip to contentSkip to conversation

drm/i915: Transform whitelisting WAs into a simple reg write

PATCH In review Oscar Mateo 6 participants 11 messages Sep 28, 2017 – Oct 4, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/i915: Transform whitelisting WAs into a simple reg write

RING_FORCE_TO_NONPRIV registers do not live in the logical context. They are simply global privileged MMIO registers that happen to be powercontext saved and restored (meaning only they can survive RC6). Therefore, there is absolutely no need to save them so that they can be restored everytime we create a new logical context.

---
 drivers/gpu/drm/i915/intel_engine_cs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_engine_cs.c +2 -2
index a28e2a8..a75f5e8 100644
@@ -845,8 +845,8 @@ static int wa_ring_whitelist_reg(struct intel_engine_cs *engine,
 	if (WARN_ON(index >= RING_MAX_NONPRIV_SLOTS))
 		return -EINVAL;
 
-	WA_WRITE(RING_FORCE_TO_NONPRIV(engine->mmio_base, index),
-		 i915_mmio_reg_offset(reg));
+	I915_WRITE(RING_FORCE_TO_NONPRIV(engine->mmio_base, index),
+		   i915_mmio_reg_offset(reg));
 	wa->hw_whitelist_count[engine->id]++;
 
 	return 0;
Signature · 6 lines
1.9.1

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

✓ Fi.CI.BAT: success for drm/i915: Transform whitelisting WAs into a simple reg write

== Series Details ==

== Series Details ==

Series: drm/i915: Transform whitelisting WAs into a simple reg write
URL : https://patchwork.freedesktop.org/series/31099/
State : success

== Summary ==

Series 31099v1 drm/i915: Transform whitelisting WAs into a simple reg write
https://patchwork.freedesktop.org/api/1.0/series/31099/revisions/1/mbox/

Test chamelium:

        Subgroup dp-crc-fast:
                fail       -> PASS       (fi-kbl-7500u) fdo#102514
Test drv_module_reload:
        Subgroup basic-no-display:
                dmesg-warn -> PASS       (fi-glk-1) fdo#102777

fdo#102514 https://bugs.freedesktop.org/show_bug.cgi?id=102514
fdo#102777 https://bugs.freedesktop.org/show_bug.cgi?id=102777

fi-bdw-5557u     total:289  pass:268  dwarn:0   dfail:0   fail:0   skip:21  time:441s
fi-bdw-gvtdvm    total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  time:475s
fi-blb-e6850     total:289  pass:224  dwarn:1   dfail:0   fail:0   skip:64  time:416s
fi-bsw-n3050     total:289  pass:243  dwarn:0   dfail:0   fail:0   skip:46  time:508s
fi-bwr-2160      total:289  pass:184  dwarn:0   dfail:0   fail:0   skip:105 time:278s
fi-bxt-dsi       total:289  pass:259  dwarn:0   dfail:0   fail:0   skip:30  time:495s
fi-bxt-j4205     total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:509s
fi-byt-j1900     total:289  pass:254  dwarn:1   dfail:0   fail:0   skip:34  time:495s
fi-byt-n2820     total:289  pass:250  dwarn:1   dfail:0   fail:0   skip:38  time:487s
fi-cfl-s         total:289  pass:256  dwarn:1   dfail:0   fail:0   skip:32  time:547s
fi-cnl-y         total:289  pass:260  dwarn:1   dfail:0   fail:1   skip:27  time:633s
fi-elk-e7500     total:289  pass:230  dwarn:0   dfail:0   fail:0   skip:59  time:419s
fi-glk-1         total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:565s
fi-hsw-4770      total:289  pass:263  dwarn:0   dfail:0   fail:0   skip:26  time:429s
fi-hsw-4770r     total:289  pass:263  dwarn:0   dfail:0   fail:0   skip:26  time:404s
fi-ilk-650       total:289  pass:229  dwarn:0   dfail:0   fail:0   skip:60  time:429s
fi-ivb-3520m     total:289  pass:261  dwarn:0   dfail:0   fail:0   skip:28  time:488s
fi-ivb-3770      total:289  pass:261  dwarn:0   dfail:0   fail:0   skip:28  time:467s
fi-kbl-7500u     total:289  pass:264  dwarn:1   dfail:0   fail:0   skip:24  time:474s
fi-kbl-7560u     total:289  pass:270  dwarn:0   dfail:0   fail:0   skip:19  time:577s
fi-kbl-r         total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:588s
fi-pnv-d510      total:289  pass:223  dwarn:1   dfail:0   fail:0   skip:65  time:545s
fi-skl-6260u     total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:451s
fi-skl-6700k     total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  time:761s
fi-skl-6770hq    total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:488s
fi-skl-gvtdvm    total:289  pass:266  dwarn:0   dfail:0   fail:0   skip:23  time:477s
fi-snb-2520m     total:289  pass:251  dwarn:0   dfail:0   fail:0   skip:38  time:564s
fi-snb-2600      total:289  pass:250  dwarn:0   dfail:0   fail:0   skip:39  time:415s

0369ecdbb55495dd4671ad33d375f37d0707b629 drm-tip: 2017y-09m-28d-20h-01m-55s UTC integration manifest 34540f12b1bc drm/i915: Transform whitelisting WAs into a simple reg write

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_5854/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Acked-by on v1 1/1
#2 lore raw
In reply to Oscar Mateo
Quoted 28 lines · Oscar Mateo

RING_FORCE_TO_NONPRIV registers do not live in the logical context. They are simply global privileged MMIO registers that happen to be powercontext saved and restored (meaning only they can survive RC6). Therefore, there is absolutely no need to save them so that they can be restored everytime we create a new logical context.

---
  drivers/gpu/drm/i915/intel_engine_cs.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_engine_cs.c +2 -3
index a28e2a8..a75f5e8 100644
@@ -845,8 +845,8 @@ static int wa_ring_whitelist_reg(struct intel_engine_cs *engine,
         if (WARN_ON(index >= RING_MAX_NONPRIV_SLOTS))
                 return -EINVAL;
 
-       WA_WRITE(RING_FORCE_TO_NONPRIV(engine->mmio_base, index),
-                i915_mmio_reg_offset(reg));
+       I915_WRITE(RING_FORCE_TO_NONPRIV(engine->mmio_base, index),
+                  i915_mmio_reg_offset(reg));
         wa->hw_whitelist_count[engine->id]++;
 
         return 0;
--
Quoted 2 lines

1.9.1

I see RCS_FORCE_TO_NONPRIV in "Render Engine *Power* Context" and not in the "Register State Context", so

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

maintainer
#3 lore raw
Quoted 35 lines · Michel Thierry
Quoted 28 lines · Oscar Mateo

RING_FORCE_TO_NONPRIV registers do not live in the logical context. They are simply global privileged MMIO registers that happen to be powercontext saved and restored (meaning only they can survive RC6). Therefore, there is absolutely no need to save them so that they can be restored everytime we create a new logical context.

---
  drivers/gpu/drm/i915/intel_engine_cs.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_engine_cs.c +2 -3
index a28e2a8..a75f5e8 100644
@@ -845,8 +845,8 @@ static int wa_ring_whitelist_reg(struct intel_engine_cs *engine,
         if (WARN_ON(index >= RING_MAX_NONPRIV_SLOTS))
                 return -EINVAL;
 
-       WA_WRITE(RING_FORCE_TO_NONPRIV(engine->mmio_base, index),
-                i915_mmio_reg_offset(reg));
+       I915_WRITE(RING_FORCE_TO_NONPRIV(engine->mmio_base, index),
+                  i915_mmio_reg_offset(reg));
         wa->hw_whitelist_count[engine->id]++;
 
         return 0;
--
Quoted 2 lines

1.9.1

I see RCS_FORCE_TO_NONPRIV in "Render Engine *Power* Context" and not in the "Register State Context", so

Quoted 1 line

You reviewed the spec and the code, so should be Reviewed-by :)

Then this could be merged, too.

Regards, Joonas

Signature · 7 lines
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by
#4 lore raw
Quoted 36 lines · Joonas Lahtinen
Quoted 35 lines · Michel Thierry
Quoted 28 lines · Oscar Mateo

RING_FORCE_TO_NONPRIV registers do not live in the logical context. They are simply global privileged MMIO registers that happen to be powercontext saved and restored (meaning only they can survive RC6). Therefore, there is absolutely no need to save them so that they can be restored everytime we create a new logical context.

---
   drivers/gpu/drm/i915/intel_engine_cs.c | 4 ++--
   1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_engine_cs.c +2 -3
index a28e2a8..a75f5e8 100644
@@ -845,8 +845,8 @@ static int wa_ring_whitelist_reg(struct intel_engine_cs *engine,
          if (WARN_ON(index >= RING_MAX_NONPRIV_SLOTS))
                  return -EINVAL;
 
-       WA_WRITE(RING_FORCE_TO_NONPRIV(engine->mmio_base, index),
-                i915_mmio_reg_offset(reg));
+       I915_WRITE(RING_FORCE_TO_NONPRIV(engine->mmio_base, index),
+                  i915_mmio_reg_offset(reg));
          wa->hw_whitelist_count[engine->id]++;
 
          return 0;
--
Quoted 2 lines

1.9.1

I see RCS_FORCE_TO_NONPRIV in "Render Engine *Power* Context" and not in the "Register State Context", so

Quoted 8 lines
Quoted 1 line

You reviewed the spec and the code, so should be Reviewed-by :)

Then this could be merged, too.

Regards, Joonas

I thought Chris would be adding his. Swap my acked-by to,

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#5 lore raw

✓ Fi.CI.IGT: success for drm/i915: Transform whitelisting WAs into a simple reg write

In reply to Oscar Mateo
== Series Details ==

== Series Details ==

Series: drm/i915: Transform whitelisting WAs into a simple reg write
URL : https://patchwork.freedesktop.org/series/31099/
State : success

== Summary ==

Test kms_setmode:

        Subgroup basic:
                pass       -> FAIL       (shard-hsw) fdo#99912

fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912

shard-hsw total:2429 pass:1330 dwarn:5 dfail:0 fail:11 skip:1083 time:9966s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_5854/shards.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Tested-by on v1 1/1
#6 lore raw
In reply to Oscar Mateo

Quoting Oscar Mateo (2017-09-28 23:40:39)

Quoted 8 lines

RING_FORCE_TO_NONPRIV registers do not live in the logical context. They are simply global privileged MMIO registers that happen to be powercontext saved and restored (meaning only they can survive RC6). Therefore, there is absolutely no need to save them so that they can be restored everytime we create a new logical context.

Now we just need Mika for the full set of tags! :) -Chris
_______________________________________________
Intel-gfx mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

maintainer
#7 lore raw
Quoted 6 lines · Chris Wilson

Quoting Oscar Mateo (2017-09-28 23:40:39)

Quoted 5 lines

RING_FORCE_TO_NONPRIV registers do not live in the logical context. They are simply global privileged MMIO registers that happen to be powercontext saved and restored (meaning only they can survive RC6). Therefore, there is absolutely no need to save them so that they can be restored everytime we create a new logical context.

Quoted 7 lines
Quoted 3 lines

Now we just need Mika for the full set of tags! :)

Mika, ping?

Regards, Joonas

Signature · 7 lines
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on v1 1/1
#8 lore raw
In reply to Oscar Mateo
Quoted 17 lines · Oscar Mateo

RING_FORCE_TO_NONPRIV registers do not live in the logical context. They are simply global privileged MMIO registers that happen to be powercontext saved and restored (meaning only they can survive RC6). Therefore, there is absolutely no need to save them so that they can be restored everytime we create a new logical context.

---
 drivers/gpu/drm/i915/intel_engine_cs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_engine_cs.c +0 -0
index a28e2a8..a75f5e8 100644

drivers/gpu/drm/i915/intel_engine_cs.c static int wa_ring_whitelist_reg(struct intel_engine_cs *engine, · line 849

Quoted 7 lines
drivers/gpu/drm/i915/intel_engine_cs.c +2 -2
@@ -845,8 +845,8 @@ static int wa_ring_whitelist_reg(struct intel_engine_cs *engine,
 	if (WARN_ON(index >= RING_MAX_NONPRIV_SLOTS))
 		return -EINVAL;
 
-	WA_WRITE(RING_FORCE_TO_NONPRIV(engine->mmio_base, index),
-		 i915_mmio_reg_offset(reg));
+	I915_WRITE(RING_FORCE_TO_NONPRIV(engine->mmio_base, index),
+		   i915_mmio_reg_offset(reg));

#define WA_WRITE should also been removed as it is clearly dangerous. Chris pointed out that anything with nonmasked access is not part of context image, and this seems to hold true in atleast with current cases.

But removing of define can be a followup.

Quoted 5 lines
drivers/gpu/drm/i915/intel_engine_cs.c +0 -0
 	wa->hw_whitelist_count[engine->id]++;
 
 	return 0;
Signature · 1 line
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#9 lore raw

Quoting Mika Kuoppala (2017-10-04 13:39:13)

Quoted 32 lines
Quoted 17 lines · Oscar Mateo

RING_FORCE_TO_NONPRIV registers do not live in the logical context. They are simply global privileged MMIO registers that happen to be powercontext saved and restored (meaning only they can survive RC6). Therefore, there is absolutely no need to save them so that they can be restored everytime we create a new logical context.

---
 drivers/gpu/drm/i915/intel_engine_cs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_engine_cs.c +0 -0
index a28e2a8..a75f5e8 100644

drivers/gpu/drm/i915/intel_engine_cs.c static int wa_ring_whitelist_reg(struct intel_engine_cs *engine, · line 849

Quoted 7 lines
drivers/gpu/drm/i915/intel_engine_cs.c +2 -2
@@ -845,8 +845,8 @@ static int wa_ring_whitelist_reg(struct intel_engine_cs *engine,
      if (WARN_ON(index >= RING_MAX_NONPRIV_SLOTS))
              return -EINVAL;
 
-     WA_WRITE(RING_FORCE_TO_NONPRIV(engine->mmio_base, index),
-              i915_mmio_reg_offset(reg));
+     I915_WRITE(RING_FORCE_TO_NONPRIV(engine->mmio_base, index),
+                i915_mmio_reg_offset(reg));

#define WA_WRITE should also been removed as it is clearly dangerous. Chris pointed out that anything with nonmasked access is not part of context image, and this seems to hold true in atleast with current cases.

Quoted 1 line

But removing of define can be a followup.

I've picked up this patch and I'll squash in the -WA_WRITE into the removal of WA_SET_BIT and push all 3 patches at once (when the shards report back).

Thanks for the patch, review, testing, debate and keep having fun. -Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#10 lore raw
Quoted 32 lines · Chris Wilson

Quoting Mika Kuoppala (2017-10-04 13:39:13)

Quoted 31 lines
Quoted 17 lines · Oscar Mateo

RING_FORCE_TO_NONPRIV registers do not live in the logical context. They are simply global privileged MMIO registers that happen to be powercontext saved and restored (meaning only they can survive RC6). Therefore, there is absolutely no need to save them so that they can be restored everytime we create a new logical context.

---
  drivers/gpu/drm/i915/intel_engine_cs.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_engine_cs.c +0 -0
index a28e2a8..a75f5e8 100644

drivers/gpu/drm/i915/intel_engine_cs.c static int wa_ring_whitelist_reg(struct intel_engine_cs *engine, · line 849

Quoted 7 lines
drivers/gpu/drm/i915/intel_engine_cs.c +2 -2
@@ -845,8 +845,8 @@ static int wa_ring_whitelist_reg(struct intel_engine_cs *engine,
       if (WARN_ON(index >= RING_MAX_NONPRIV_SLOTS))
               return -EINVAL;
 
-     WA_WRITE(RING_FORCE_TO_NONPRIV(engine->mmio_base, index),
-              i915_mmio_reg_offset(reg));
+     I915_WRITE(RING_FORCE_TO_NONPRIV(engine->mmio_base, index),
+                i915_mmio_reg_offset(reg));

#define WA_WRITE should also been removed as it is clearly dangerous. Chris pointed out that anything with nonmasked access is not part of context image, and this seems to hold true in atleast with current cases.

Quoted 7 lines
Quoted 1 line

But removing of define can be a followup.

I've picked up this patch and I'll squash in the -WA_WRITE into the removal of WA_SET_BIT and push all 3 patches at once (when the shards report back).

Thanks for the patch, review, testing, debate and keep having fun. -Chris

We can also remove RING_MAX_NONPRIV_SLOTS from here:

#define I915_MAX_WA_REGS (16 + RING_MAX_NONPRIV_SLOTS)

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx