SKL stage 1 part 4
Subsystems (2)
cover SKL stage 1 part 4
A couple more patches around gen9 forcewake have just been r-bed by Mika. The changes are fairly contained and shouldn't affect other platforms, a nice property this late in the cycle (I won't be able to say the same for AUX power well, so well ahem 3.20 for them maybe, ...)
This also means current work to simplify fw handling will need to be rebased on top.
Signature · 16 lines
Damien Zhe Wang (2): drm/i915/skl: Gen9 multi-engine forcewake drm/i915: Gen9 shadowed registers drivers/gpu/drm/i915/intel_uncore.c | 139 ++++++++++++++++++++++++++++++++++++ 1 file changed, 139 insertions(+) -- 1.8.3.1 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 1/2 drm/i915/skl: Gen9 multi-engine forcewake
From: Zhe Wang <[email protected]>
Enable multi-engine forcewake for Gen9.
v2: (Damien)
- Rebase on top of nightly
- Move the register range definitions to intel_uncore.c
- Whitespace fixes
v3: (Addressing Mika's comment, done by Damien)
- Use REG_RANGE() (introduced after the patch was written)
- Add a SKL_NEEDS_FORCE_WAKE() macro that gets rid of a useless comparison to FORCEWAKE (reg 0xa18c is not used on SKL)
v4: (Damien)
- Use newly introduced ASSIGN_READ/WRITE_MMIO_VFUNCS() macros
--- drivers/gpu/drm/i915/intel_uncore.c | 115 ++++++++++++++++++++++++++++++++++++ 1 file changed, 115 insertions(+)
drivers/gpu/drm/i915/intel_uncore.c +115 -0
@@ -670,6 +670,34 @@ void assert_force_wake_inactive(struct drm_i915_private *dev_priv) REG_RANGE((reg), 0x14000, 0x14400) || \ REG_RANGE((reg), 0x22000, 0x24000)) +#define FORCEWAKE_GEN9_UNCORE_RANGE_OFFSET (reg) \ + REG_RANGE((reg), 0xC00, 0x2000) + +#define FORCEWAKE_GEN9_RENDER_RANGE_OFFSET (reg) \ + (REG_RANGE((reg), 0x2000, 0x4000) || \ + REG_RANGE((reg), 0x5200, 0x8000) || \ + REG_RANGE((reg), 0x8300, 0x8500) || \ + REG_RANGE((reg), 0x8C00, 0x8D00) || \ + REG_RANGE((reg), 0xB000, 0xB480) || \ + REG_RANGE((reg), 0xE000, 0xE800)) + +#define FORCEWAKE_GEN9_MEDIA_RANGE_OFFSET (reg) \ + (REG_RANGE((reg), 0x8800, 0x8A00) || \ + REG_RANGE((reg), 0xD000, 0xD800) || \ + REG_RANGE((reg), 0x12000, 0x14000) || \ + REG_RANGE((reg), 0x1A000, 0x1EA00) || \ + REG_RANGE((reg), 0x30000, 0x40000)) + +#define FORCEWAKE_GEN9_COMMON_RANGE_OFFSET (reg) \ + REG_RANGE((reg), 0x9400, 0x9800) + +#define FORCEWAKE_GEN9_BLITTER_RANGE_OFFSET (reg) \ + ((reg) < 0x40000 &&\ + !FORCEWAKE_GEN9_UNCORE_RANGE_OFFSET(reg) && \ + !FORCEWAKE_GEN9_RENDER_RANGE_OFFSET(reg) && \ + !FORCEWAKE_GEN9_MEDIA_RANGE_OFFSET(reg) && \ + !FORCEWAKE_GEN9_COMMON_RANGE_OFFSET(reg)) +static void ilk_dummy_write (struct drm_i915_private *dev_priv) {
@@ -800,6 +828,45 @@ chv_read##x(struct drm_i915_private *dev_priv, off_t reg, bool trace) { \REG_READ_FOOTER ; \ } +#define SKL_NEEDS_FORCE_WAKE (dev_priv, reg) \ + ((reg) < 0x40000 && !FORCEWAKE_GEN9_UNCORE_RANGE_OFFSET(reg)) + +#define __gen9_read (x) \ +static u##x \ +gen9_read##x(struct drm_i915_private *dev_priv, off_t reg, bool trace) { \ + REG_READ_HEADER(x); \ + if (!SKL_NEEDS_FORCE_WAKE((dev_priv), (reg))) { \ + val = __raw_i915_read##x(dev_priv, reg); \ + } else { \ + unsigned fwengine = 0; \ + if (FORCEWAKE_GEN9_RENDER_RANGE_OFFSET(reg)) { \ + if (dev_priv->uncore.fw_rendercount == 0) \ + fwengine = FORCEWAKE_RENDER; \ + } else if (FORCEWAKE_GEN9_MEDIA_RANGE_OFFSET(reg)) { \ + if (dev_priv->uncore.fw_mediacount == 0) \ + fwengine = FORCEWAKE_MEDIA; \ + } else if (FORCEWAKE_GEN9_COMMON_RANGE_OFFSET(reg)) { \ + if (dev_priv->uncore.fw_rendercount == 0) \ + fwengine |= FORCEWAKE_RENDER; \ + if (dev_priv->uncore.fw_mediacount == 0) \ + fwengine |= FORCEWAKE_MEDIA; \ + } else { \ + if (dev_priv->uncore.fw_blittercount == 0) \ + fwengine = FORCEWAKE_BLITTER; \ + } \ + if (fwengine) \ + dev_priv->uncore.funcs.force_wake_get(dev_priv, fwengine); \ + val = __raw_i915_read##x(dev_priv, reg); \ + if (fwengine) \ + dev_priv->uncore.funcs.force_wake_put(dev_priv, fwengine); \ + } \ + REG_READ_FOOTER; \ +} + +__gen9_read(8) +__gen9_read(16) +__gen9_read(32) +__gen9_read(64) __chv_read(8) __chv_read(16)__chv_read (32 )
@@ -821,6 +888,7 @@ __gen4_read(16) __gen4_read(32) __gen4_read(64) +#undef __gen9_read#undef __chv_read#undef __vlv_read#undef __gen6_read
@@ -958,6 +1026,45 @@ chv_write##x(struct drm_i915_private *dev_priv, off_t reg, u##x val, bool trace)REG_WRITE_FOOTER ; \ } +#define __gen9_write (x) \ +static void \ +gen9_write##x(struct drm_i915_private *dev_priv, off_t reg, u##x val, \ + bool trace) { \ + REG_WRITE_HEADER; \ + if (!SKL_NEEDS_FORCE_WAKE((dev_priv), (reg))) { \ + __raw_i915_write##x(dev_priv, reg, val); \ + } else { \ + unsigned fwengine = 0; \ + if (FORCEWAKE_GEN9_RENDER_RANGE_OFFSET(reg)) { \ + if (dev_priv->uncore.fw_rendercount == 0) \ + fwengine = FORCEWAKE_RENDER; \ + } else if (FORCEWAKE_GEN9_MEDIA_RANGE_OFFSET(reg)) { \ + if (dev_priv->uncore.fw_mediacount == 0) \ + fwengine = FORCEWAKE_MEDIA; \ + } else if (FORCEWAKE_GEN9_COMMON_RANGE_OFFSET(reg)) { \ + if (dev_priv->uncore.fw_rendercount == 0) \ + fwengine |= FORCEWAKE_RENDER; \ + if (dev_priv->uncore.fw_mediacount == 0) \ + fwengine |= FORCEWAKE_MEDIA; \ + } else { \ + if (dev_priv->uncore.fw_blittercount == 0) \ + fwengine = FORCEWAKE_BLITTER; \ + } \ + if (fwengine) \ + dev_priv->uncore.funcs.force_wake_get(dev_priv, \ + fwengine); \ + __raw_i915_write##x(dev_priv, reg, val); \ + if (fwengine) \ + dev_priv->uncore.funcs.force_wake_put(dev_priv, \ + fwengine); \ + } \ + REG_WRITE_FOOTER; \ +} + +__gen9_write(8) +__gen9_write(16) +__gen9_write(32) +__gen9_write(64) __chv_write(8) __chv_write(16)__chv_write (32 )
@@ -983,6 +1090,7 @@ __gen4_write(16) __gen4_write(32) __gen4_write(64) +#undef __gen9_write#undef __chv_write#undef __gen8_write#undef __hsw_write
@@ -1066,6 +1174,13 @@ void intel_uncore_init(struct drm_device *dev)switch (INTEL_INFO (dev)->gen) {default : +WARN_ON (1 ); +return ; +case 9 : +ASSIGN_WRITE_MMIO_VFUNCS (gen9); +ASSIGN_READ_MMIO_VFUNCS (gen9); +break ; +case 8 :if (IS_CHERRYVIEW (dev)) {ASSIGN_WRITE_MMIO_VFUNCS (chv);ASSIGN_READ_MMIO_VFUNCS (chv);
Signature · 6 lines
1.8.3.1 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 2/2 drm/i915: Gen9 shadowed registers
In reply to Damien LespiauFrom: Zhe Wang <[email protected]>
For MMIO registers which are shadowed, force wake is not needed to write to these registers.
v2: Rebase on top of nightly (Damien)
v3: Rebase on top of "Gen9 multiple-engine forcewake" changes
v4: (Mika, Bob, done by Damien)
- Reorder the shadowed registers by popularity
--- drivers/gpu/drm/i915/intel_uncore.c | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_uncore.c +25 -1
@@ -1026,12 +1026,36 @@ chv_write##x(struct drm_i915_private *dev_priv, off_t reg, u##x val, bool trace)REG_WRITE_FOOTER ; \ } +static const u32 gen9_shadowed_regs[] = { +RING_TAIL (RENDER_RING_BASE ), +RING_TAIL (GEN6_BSD_RING_BASE ), +RING_TAIL (VEBOX_RING_BASE ), +RING_TAIL (BLT_RING_BASE ), +FORCEWAKE_BLITTER_GEN9 , +FORCEWAKE_RENDER_GEN9 , +FORCEWAKE_MEDIA_GEN9 , +GEN6_RPNSWREQ , +GEN6_RC_VIDEO_FREQ , +/* TODO: Other registers are not yet used */ +}; + +static bool is_gen9_shadowed (struct drm_i915_private *dev_priv,u32 reg) +{ +int i; +for (i =0 ; i <ARRAY_SIZE (gen9_shadowed_regs); i++) +if (reg == gen9_shadowed_regs[i]) +return true; + +return false; +} +#define __gen9_write (x) \ static void \ gen9_write##x(struct drm_i915_private *dev_priv, off_t reg, u##x val, \ bool trace) { \ REG_WRITE_HEADER; \ - if (!SKL_NEEDS_FORCE_WAKE((dev_priv), (reg))) { \ + if (!SKL_NEEDS_FORCE_WAKE((dev_priv), (reg)) || \ + is_gen9_shadowed(dev_priv, reg)) { \ __raw_i915_write##x(dev_priv, reg, val); \ } else { \ unsigned fwengine = 0; \
Signature · 6 lines
1.8.3.1 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 2/2] drm/i915: Gen9 shadowed registers
-------------------------------------Summary-------------------------------------
Platform Delta drm-intel-nightly Series Applied
PNV 367/367 367/367
ILK +2 373/375 375/375
SNB 450/450 450/450
IVB -2 503/503 501/503
BYT 289/289 289/289
HSW -3 567/567 564/567
BDW 417/417 417/417
-------------------------------------Detailed-------------------------------------
Platform Test drm-intel-nightly Series Applied
ILK igt_kms_flip_flip-vs-panning NSPT(1, M26) PASS(2, M37) ILK igt_kms_flip_nonexisting-fb DMESG_WARN(1, M26) PASS(2, M37) IVB igt_gem_bad_reloc_negative-reloc PASS(1, M21) NSPT(2, M34) IVB igt_gem_bad_reloc_negative-reloc-lut PASS(1, M21) NSPT(1, M34)PASS(1, M34) HSW igt_gem_bad_reloc_negative-reloc-lut PASS(1, M19) NSPT(2, M40) HSW igt_kms_rotation_crc_primary-rotation PASS(1, M19) DMESG_WARN(1, M40)PASS(1, M40) HSW igt_pm_rc6_residency_rc6-accuracy PASS(1, M19) FAIL(1, M40)PASS(1, M40)
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 7 lines · Damien Lespiau
A couple more patches around gen9 forcewake have just been r-bed by Mika. The changes are fairly contained and shouldn't affect other platforms, a nice property this late in the cycle (I won't be able to say the same for AUX power well, so well ahem 3.20 for them maybe, ...)
This also means current work to simplify fw handling will need to be rebased on top.
Both merged to dinq, thanks.
-Daniel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx