Forcewake binary search & code shrink
Subsystems (2)
Tvrtko Ursulin
maintainerv2 cover Forcewake binary search & code shrink
From: Tvrtko Ursulin <[email protected]>
Motivation was to replace linear search comparison if-else ladders in MMIO accessors with a data driven approach.
These lookups are needed to determine to correct forcewake domains to take when reading and writing to MMIO registers.
Going data driven and keeping the tables sorted enabled binary search to be used. Followed by gradual extraction of commonality between existing functions, accompanying code reduction, and the end result is around 15KiB less code generated and also some saving in the source code lines.
v2:
* Updated cover letter given feedback.
* Some rework for review comments.
* New patch in the series (14) to inline the binary search.
Tvrtko Ursulin (14):
drm/i915: Remove redundant hsw_write* mmio functions drm/i915: Keep track of active forcewake domains in a bitmask drm/i915: Do not inline forcewake taking in mmio accessors drm/i915: Data driven register to forcewake domains lookup drm/i915: Sort forcewake mapping tables
drm/i915: Use binary search when looking up forcewake domains drm/i915: Eliminate Gen9 special case
drm/i915: Store the active forcewake range table pointer drm/i915: Remove identical macros
drm/i915: Remove identical mmio read functions drm/i915: Remove identical write mmmio functions drm/i915: Sort the shadow register table
drm/i915: Use binary search when looking for shadowed registers drm/i915: Inline binary search
drivers/gpu/drm/i915/i915_drv.h | 12 + drivers/gpu/drm/i915/intel_uncore.c | 600 ++++++++++++++++-------------------- 2 files changed, 276 insertions(+), 336 deletions(-)
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Tvrtko Ursulin
maintainerPATCH v2 1/14 drm/i915: Remove redundant hsw_write* mmio functions
From: Tvrtko Ursulin <[email protected]>
They are completely identical to gen6_write* ones.
--- drivers/gpu/drm/i915/intel_uncore.c | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-)
drivers/gpu/drm/i915/intel_uncore.c +1 -24
@@ -1055,21 +1055,6 @@ gen6_write##x(struct drm_i915_private *dev_priv, i915_reg_t reg, u##x val, boolGEN6_WRITE_FOOTER ; \ } -#define __hsw_write (x) \ -static void \ -hsw_write##x(struct drm_i915_private *dev_priv, i915_reg_t reg, u##x val, bool trace) { \ - u32 __fifo_ret = 0; \ - GEN6_WRITE_HEADER; \ - if (NEEDS_FORCE_WAKE(offset)) { \ - __fifo_ret = __gen6_gt_wait_for_fifo(dev_priv); \ - } \ - __raw_i915_write##x(dev_priv, reg, val); \ - if (unlikely(__fifo_ret)) { \ - gen6_gt_check_fifodbg(dev_priv); \ - } \ - GEN6_WRITE_FOOTER; \ -} -#define __gen8_write (x) \ static void \ gen8_write##x(struct drm_i915_private *dev_priv, i915_reg_t reg, u##x val, bool trace) { \
@@ -1116,9 +1101,6 @@ __chv_write(32) __gen8_write(8) __gen8_write(16) __gen8_write(32) -__hsw_write(8) -__hsw_write(16) -__hsw_write(32) __gen6_write(8) __gen6_write(16)__gen6_write (32 )
@@ -1126,7 +1108,6 @@ __gen6_write(32)#undef __gen9_write#undef __chv_write#undef __gen8_write -#undef __hsw_write#undef __gen6_write#undef GEN6_WRITE_FOOTER#undef GEN6_WRITE_HEADER
@@ -1343,11 +1324,7 @@ void intel_uncore_init(struct drm_i915_private *dev_priv)break ;case 7 :case 6 : -if (IS_HASWELL (dev_priv)) { -ASSIGN_WRITE_MMIO_VFUNCS (hsw); - }else { -ASSIGN_WRITE_MMIO_VFUNCS (gen6); - } +ASSIGN_WRITE_MMIO_VFUNCS (gen6);if (IS_VALLEYVIEW (dev_priv)) {ASSIGN_READ_MMIO_VFUNCS (vlv);
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Tvrtko Ursulin
maintainerPATCH v2 2/14 drm/i915: Keep track of active forcewake domains in a bitmask
In reply to Tvrtko UrsulinFrom: Tvrtko Ursulin <[email protected]>
There are current places in the code, and there will be more in the future, which iterate the forcewake domains to find out which ones are currently active.
To save them from doing this iteration, we can cheaply keep a mask of active domains in dev_priv->uncore.fw_domains_active.
This has no cost in terms of object size, even manages to shrink it overall by 368 bytes on my config.
--- drivers/gpu/drm/i915/i915_drv.h | 2 ++ drivers/gpu/drm/i915/intel_uncore.c | 54 ++++++++++++++++--------------------- 2 files changed, 25 insertions(+), 31 deletions(-)
drivers/gpu/drm/i915/i915_drv.h +2 -0
@@ -588,7 +588,9 @@ struct intel_uncore {struct intel_uncore_funcs funcs;unsigned fifo_count; +enum forcewake_domains fw_domains; +enum forcewake_domains fw_domains_active;struct intel_uncore_forcewake_domain {struct drm_i915_private *i915;
drivers/gpu/drm/i915/intel_uncore.c +23 -31
116 lines not on this page · raw message
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Tvrtko Ursulin
maintainerPATCH v2 3/14 drm/i915: Do not inline forcewake taking in mmio accessors
In reply to Tvrtko UrsulinFrom: Tvrtko Ursulin <[email protected]>
Once we know we need to take new forcewakes, that being a slow operation, it does not make sense to inline that code into every mmio accessor.
Move it to a separate function and save some code.
v2: Be explicit with noinline and remove stale comment.
(Chris Wilson)
--- drivers/gpu/drm/i915/intel_uncore.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-)
drivers/gpu/drm/i915/intel_uncore.c +14 -10
@@ -862,11 +862,21 @@ __gen2_read(64)trace_i915_reg_rw (false, reg, val,sizeof (val), trace); \ return val -static inline void __force_wake_auto (struct drm_i915_private *dev_priv, -enum forcewake_domains fw_domains) +static noinline void ___force_wake_auto(struct drm_i915_private *dev_priv, +enum forcewake_domains fw_domains) {struct intel_uncore_forcewake_domain *domain; +for_each_fw_domain_masked (domain, fw_domains, dev_priv) +fw_domain_arm_timer (domain); + + dev_priv->uncore.funcs.force_wake_get (dev_priv, fw_domains); + dev_priv->uncore.fw_domains_active |= fw_domains; +} + +static inline void __force_wake_auto (struct drm_i915_private *dev_priv, +enum forcewake_domains fw_domains) +{if (WARN_ON (!fw_domains))return ;
@@ -874,14 +884,8 @@ static inline void __force_wake_auto(struct drm_i915_private *dev_priv, fw_domains &= dev_priv->uncore.fw_domains; fw_domains &= ~dev_priv->uncore.fw_domains_active; -if (fw_domains) { -/* Ideally GCC would be constant-fold and eliminate this loop */ -for_each_fw_domain_masked (domain, fw_domains, dev_priv) -fw_domain_arm_timer (domain); - - dev_priv->uncore.funcs.force_wake_get (dev_priv, fw_domains); - dev_priv->uncore.fw_domains_active |= fw_domains; - } +if (fw_domains) +___force_wake_auto (dev_priv, fw_domains); }#define __gen6_read (x) \
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Tvrtko Ursulin
maintainerPATCH v2 4/14 drm/i915: Data driven register to forcewake domains lookup
In reply to Tvrtko UrsulinFrom: Tvrtko Ursulin <[email protected]>
Move finding the correct forcewake domains to take for register access from code to a mapping table. This will allow more interesting work in the following patches and is easier to review if singled out early.
--- drivers/gpu/drm/i915/intel_uncore.c | 212 ++++++++++++++++++------------------ 1 file changed, 103 insertions(+), 109 deletions(-)
drivers/gpu/drm/i915/intel_uncore.c +103 -109
@@ -581,28 +581,52 @@ void assert_forcewakes_inactive(struct drm_i915_private *dev_priv) __fwd; \ }) -#define REG_RANGE (reg, start, end) ((reg) >= (start) && (reg) < (end)) +struct intel_forcewake_range +{ +u32 start; +u32 end; + +enum forcewake_domains domains; +}; -#define FORCEWAKE_VLV_RENDER_RANGE_OFFSET (reg) \ - (REG_RANGE((reg), 0x2000, 0x4000) || \ - REG_RANGE((reg), 0x5000, 0x8000) || \ - REG_RANGE((reg), 0xB000, 0x12000) || \ - REG_RANGE((reg), 0x2E000, 0x30000)) +static enum forcewake_domains +find_fw_domain (u32 offset,const struct intel_forcewake_range *ranges, +unsigned int num_ranges) +{ +unsigned int i; +struct intel_forcewake_range *entry = + (struct intel_forcewake_range *)ranges; + +for (i =0 ; i < num_ranges; i++, entry++) { +if (offset >= entry->start && offset <= entry->end) +return entry->domains; + } + +return -1 ; +} -#define FORCEWAKE_VLV_MEDIA_RANGE_OFFSET (reg) \ - (REG_RANGE((reg), 0x12000, 0x14000) || \ - REG_RANGE((reg), 0x22000, 0x24000) || \ - REG_RANGE((reg), 0x30000, 0x40000)) +#define GEN_FW_RANGE (s, e, d) \ + { .start = (s), .end = (e), .domains = (d) } + +static const struct intel_forcewake_range __vlv_fw_ranges[] = { +GEN_FW_RANGE (0x2000 ,0x3fff ,FORCEWAKE_RENDER ), +GEN_FW_RANGE (0x5000 ,0x7fff ,FORCEWAKE_RENDER ), +GEN_FW_RANGE (0xb000 ,0x11fff ,FORCEWAKE_RENDER ), +GEN_FW_RANGE (0x2e000 ,0x2ffff ,FORCEWAKE_RENDER ), +GEN_FW_RANGE (0x12000 ,0x13fff ,FORCEWAKE_MEDIA ), +GEN_FW_RANGE (0x22000 ,0x23fff ,FORCEWAKE_MEDIA ), +GEN_FW_RANGE (0x30000 ,0x3ffff ,FORCEWAKE_MEDIA ), +};#define __vlv_reg_read_fw_domains (offset) \ ({ \ enum forcewake_domains __fwd = 0; \ - if (!NEEDS_FORCE_WAKE(offset)) \ - __fwd = 0; \ - else if (FORCEWAKE_VLV_RENDER_RANGE_OFFSET(offset)) \ - __fwd = FORCEWAKE_RENDER; \ - else if (FORCEWAKE_VLV_MEDIA_RANGE_OFFSET(offset)) \ - __fwd = FORCEWAKE_MEDIA; \ + if (NEEDS_FORCE_WAKE((offset))) { \ + __fwd = find_fw_domain(offset, __vlv_fw_ranges, \ + ARRAY_SIZE(__vlv_fw_ranges)); \ + if (__fwd == -1 ) \ + __fwd = 0; \ + } \ __fwd; \ })
@@ -636,104 +660,78 @@ static bool is_gen8_shadowed(u32 offset) __fwd; \ }) -#define FORCEWAKE_CHV_RENDER_RANGE_OFFSET (reg) \ - (REG_RANGE((reg), 0x2000, 0x4000) || \ - REG_RANGE((reg), 0x5200, 0x8000) || \ - REG_RANGE((reg), 0x8300, 0x8500) || \ - REG_RANGE((reg), 0xB000, 0xB480) || \ - REG_RANGE((reg), 0xE000, 0xE800)) - -#define FORCEWAKE_CHV_MEDIA_RANGE_OFFSET (reg) \ - (REG_RANGE((reg), 0x8800, 0x8900) || \ - REG_RANGE((reg), 0xD000, 0xD800) || \ - REG_RANGE((reg), 0x12000, 0x14000) || \ - REG_RANGE((reg), 0x1A000, 0x1C000) || \ - REG_RANGE((reg), 0x1E800, 0x1EA00) || \ - REG_RANGE((reg), 0x30000, 0x38000)) - -#define FORCEWAKE_CHV_COMMON_RANGE_OFFSET (reg) \ - (REG_RANGE((reg), 0x4000, 0x5000) || \ - REG_RANGE((reg), 0x8000, 0x8300) || \ - REG_RANGE((reg), 0x8500, 0x8600) || \ - REG_RANGE((reg), 0x9000, 0xB000) || \ - REG_RANGE((reg), 0xF000, 0x10000)) +static const struct intel_forcewake_range __chv_fw_ranges[] = { +GEN_FW_RANGE (0x2000 ,0x3fff ,FORCEWAKE_RENDER ), +GEN_FW_RANGE (0x5200 ,0x7fff ,FORCEWAKE_RENDER ), +GEN_FW_RANGE (0x8300 ,0x84ff ,FORCEWAKE_RENDER ), +GEN_FW_RANGE (0xb000 ,0xb47f ,FORCEWAKE_RENDER ), +GEN_FW_RANGE (0xe000 ,0xe7ff ,FORCEWAKE_RENDER ), +GEN_FW_RANGE (0x8800 ,0x88ff ,FORCEWAKE_MEDIA ), +GEN_FW_RANGE (0xd000 ,0xd7ff ,FORCEWAKE_MEDIA ), +GEN_FW_RANGE (0x12000 ,0x13fff ,FORCEWAKE_MEDIA ), +GEN_FW_RANGE (0x1a000 ,0x1bfff ,FORCEWAKE_MEDIA ), +GEN_FW_RANGE (0x1e800 ,0x1e9ff ,FORCEWAKE_MEDIA ), +GEN_FW_RANGE (0x30000 ,0x37fff ,FORCEWAKE_MEDIA ), +GEN_FW_RANGE (0x4000 ,0x4fff ,FORCEWAKE_RENDER |FORCEWAKE_MEDIA ), +GEN_FW_RANGE (0x8000 ,0x82ff ,FORCEWAKE_RENDER |FORCEWAKE_MEDIA ), +GEN_FW_RANGE (0x8500 ,0x85ff ,FORCEWAKE_RENDER |FORCEWAKE_MEDIA ), +GEN_FW_RANGE (0x9000 ,0xafff ,FORCEWAKE_RENDER |FORCEWAKE_MEDIA ), +GEN_FW_RANGE (0xf000 ,0xffff ,FORCEWAKE_RENDER |FORCEWAKE_MEDIA ), +};#define __chv_reg_read_fw_domains (offset) \ ({ \ enum forcewake_domains __fwd = 0; \ - if (!NEEDS_FORCE_WAKE(offset)) \ - __fwd = 0; \ - else if (FORCEWAKE_CHV_RENDER_RANGE_OFFSET(offset)) \ - __fwd = FORCEWAKE_RENDER; \ - else if (FORCEWAKE_CHV_MEDIA_RANGE_OFFSET(offset)) \ - __fwd = FORCEWAKE_MEDIA; \ - else if (FORCEWAKE_CHV_COMMON_RANGE_OFFSET(offset)) \ - __fwd = FORCEWAKE_RENDER | FORCEWAKE_MEDIA; \ + if (NEEDS_FORCE_WAKE((offset))) { \ + __fwd = find_fw_domain(offset, __chv_fw_ranges, \ + ARRAY_SIZE(__chv_fw_ranges)); \ + if (__fwd == -1 ) \ + __fwd = 0; \ + } \ __fwd; \ })#define __chv_reg_write_fw_domains (offset) \ ({ \ enum forcewake_domains __fwd = 0; \ - if (!NEEDS_FORCE_WAKE(offset) || is_gen8_shadowed(offset)) \ - __fwd = 0; \ - else if (FORCEWAKE_CHV_RENDER_RANGE_OFFSET(offset)) \ - __fwd = FORCEWAKE_RENDER; \ - else if (FORCEWAKE_CHV_MEDIA_RANGE_OFFSET(offset)) \ - __fwd = FORCEWAKE_MEDIA; \ - else if (FORCEWAKE_CHV_COMMON_RANGE_OFFSET(offset)) \ - __fwd = FORCEWAKE_RENDER | FORCEWAKE_MEDIA; \ + if (NEEDS_FORCE_WAKE((offset)) && !is_gen8_shadowed(offset)) { \ + __fwd = find_fw_domain(offset, __chv_fw_ranges, \ + ARRAY_SIZE(__chv_fw_ranges)); \ + if (__fwd == -1 ) \ + __fwd = 0; \ + } \ __fwd; \ }) -#define FORCEWAKE_GEN9_UNCORE_RANGE_OFFSET (reg) \ - REG_RANGE((reg), 0xB00, 0x2000) - -#define FORCEWAKE_GEN9_RENDER_RANGE_OFFSET (reg) \ - (REG_RANGE((reg), 0x2000, 0x2700) || \ - REG_RANGE((reg), 0x3000, 0x4000) || \ - REG_RANGE((reg), 0x5200, 0x8000) || \ - REG_RANGE((reg), 0x8140, 0x8160) || \ - REG_RANGE((reg), 0x8300, 0x8500) || \ - REG_RANGE((reg), 0x8C00, 0x8D00) || \ - REG_RANGE((reg), 0xB000, 0xB480) || \ - REG_RANGE((reg), 0xE000, 0xE900) || \ - REG_RANGE((reg), 0x24400, 0x24800)) - -#define FORCEWAKE_GEN9_MEDIA_RANGE_OFFSET (reg) \ - (REG_RANGE((reg), 0x8130, 0x8140) || \ - 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)) - -#define SKL_NEEDS_FORCE_WAKE (reg) \ - ((reg) < 0x40000 && !FORCEWAKE_GEN9_UNCORE_RANGE_OFFSET(reg)) +static const struct intel_forcewake_range __gen9_fw_ranges[] = { +GEN_FW_RANGE (0xb00 ,0x1fff ,0 ),/* uncore range */ +GEN_FW_RANGE (0x2000 ,0x26ff ,FORCEWAKE_RENDER ), +GEN_FW_RANGE (0x3000 ,0x3fff ,FORCEWAKE_RENDER ), +GEN_FW_RANGE (0x5200 ,0x7fff ,FORCEWAKE_RENDER ), +GEN_FW_RANGE (0x8140 ,0x815f ,FORCEWAKE_RENDER ), +GEN_FW_RANGE (0x8300 ,0x84ff ,FORCEWAKE_RENDER ), +GEN_FW_RANGE (0x8c00 ,0x8cff ,FORCEWAKE_RENDER ), +GEN_FW_RANGE (0xb000 ,0xb47f ,FORCEWAKE_RENDER ), +GEN_FW_RANGE (0xe000 ,0xe8ff ,FORCEWAKE_RENDER ), +GEN_FW_RANGE (0x24400 ,0x247ff ,FORCEWAKE_RENDER ), +GEN_FW_RANGE (0x9400 ,0x97ff ,FORCEWAKE_RENDER |FORCEWAKE_MEDIA ), +GEN_FW_RANGE (0x8130 ,0x813f ,FORCEWAKE_MEDIA ), +GEN_FW_RANGE (0x8800 ,0x89ff ,FORCEWAKE_MEDIA ), +GEN_FW_RANGE (0xd000 ,0xd7ff ,FORCEWAKE_MEDIA ), +GEN_FW_RANGE (0x12000 ,0x13fff ,FORCEWAKE_MEDIA ), +GEN_FW_RANGE (0x1a000 ,0x1e9ff ,FORCEWAKE_MEDIA ), +GEN_FW_RANGE (0x30000 ,0x3ffff ,FORCEWAKE_MEDIA ), +};#define __gen9_reg_read_fw_domains (offset) \ ({ \ - enum forcewake_domains __fwd; \ - if (!SKL_NEEDS_FORCE_WAKE(offset)) \ - __fwd = 0; \ - else if (FORCEWAKE_GEN9_RENDER_RANGE_OFFSET(offset)) \ - __fwd = FORCEWAKE_RENDER; \ - else if (FORCEWAKE_GEN9_MEDIA_RANGE_OFFSET(offset)) \ - __fwd = FORCEWAKE_MEDIA; \ - else if (FORCEWAKE_GEN9_COMMON_RANGE_OFFSET(offset)) \ - __fwd = FORCEWAKE_RENDER | FORCEWAKE_MEDIA; \ - else \ - __fwd = FORCEWAKE_BLITTER; \ + enum forcewake_domains __fwd = 0; \ + if (NEEDS_FORCE_WAKE((offset))) { \ + __fwd = find_fw_domain(offset, __gen9_fw_ranges, \ + ARRAY_SIZE(__gen9_fw_ranges)); \ + if (__fwd == -1 ) \ + __fwd = FORCEWAKE_BLITTER; \ + } \ __fwd; \ })
@@ -759,17 +757,13 @@ static bool is_gen9_shadowed(u32 offset)#define __gen9_reg_write_fw_domains (offset) \ ({ \ - enum forcewake_domains __fwd; \ - if (!SKL_NEEDS_FORCE_WAKE(offset) || is_gen9_shadowed(offset)) \ - __fwd = 0; \ - else if (FORCEWAKE_GEN9_RENDER_RANGE_OFFSET(offset)) \ - __fwd = FORCEWAKE_RENDER; \ - else if (FORCEWAKE_GEN9_MEDIA_RANGE_OFFSET(offset)) \ - __fwd = FORCEWAKE_MEDIA; \ - else if (FORCEWAKE_GEN9_COMMON_RANGE_OFFSET(offset)) \ - __fwd = FORCEWAKE_RENDER | FORCEWAKE_MEDIA; \ - else \ - __fwd = FORCEWAKE_BLITTER; \ + enum forcewake_domains __fwd = 0; \ + if (NEEDS_FORCE_WAKE((offset)) && !is_gen9_shadowed(offset)) { \ + __fwd = find_fw_domain(offset, __gen9_fw_ranges, \ + ARRAY_SIZE(__gen9_fw_ranges)); \ + if (__fwd == -1 ) \ + __fwd = FORCEWAKE_BLITTER; \ + } \ __fwd; \ })
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 04/14] drm/i915: Data driven register to forcewake domains lookup
drivers/gpu/drm/i915/intel_uncore.c void assert_forcewakes_inactive(struct drm_i915_private *dev_priv) · line 594
Quoted 3 lines · Tvrtko Ursulin
drivers/gpu/drm/i915/intel_uncore.c +2
-0+find_fw_domain(u32 offset, const struct intel_forcewake_range *ranges, + unsigned int num_ranges)
Gotta remind that generally "fw" is associated with firmware. "forcewake" might be appropriate word in function names too.
drivers/gpu/drm/i915/intel_uncore.c void assert_forcewakes_inactive(struct drm_i915_private *dev_priv) · line 606
Quoted 13 lines
drivers/gpu/drm/i915/intel_uncore.c +12
-0+{ +unsigned int i; +struct intel_forcewake_range *entry = + (struct intel_forcewake_range *)ranges; + +for (i =0 ; i < num_ranges; i++, entry++) { +if (offset >= entry->start && offset <= entry->end) +return entry->domains; + } + +return -1 ; +}
This could be a binary search, too, with some sorting.
Already as is;
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
Re: [PATCH 04/14] drm/i915: Data driven register to forcewake domains lookup
Quoted 8 lines · Joonas Lahtinen
drivers/gpu/drm/i915/intel_uncore.c void assert_forcewakes_inactive(struct drm_i915_private *dev_priv) · line 594
Quoted 3 lines · Tvrtko Ursulin
drivers/gpu/drm/i915/intel_uncore.c +2
-0+find_fw_domain(u32 offset, const struct intel_forcewake_range *ranges, + unsigned int num_ranges)Gotta remind that generally "fw" is associated with firmware. "forcewake" might be appropriate word in function names too.
My reasoning originally was that these are static inside intel_uncore.c thus the context is clear that these are not about firmware.
Exposed ones have 'forcewake' in their name to avoid the confusion.
-Mika
Quoted 16 lines
drivers/gpu/drm/i915/intel_uncore.c void assert_forcewakes_inactive(struct drm_i915_private *dev_priv) · line 606
Quoted 13 lines
drivers/gpu/drm/i915/intel_uncore.c +12
-0+{ +unsigned int i; +struct intel_forcewake_range *entry = + (struct intel_forcewake_range *)ranges; + +for (i =0 ; i < num_ranges; i++, entry++) { +if (offset >= entry->start && offset <= entry->end) +return entry->domains; + } + +return -1 ; +}This could be a binary search, too, with some sorting.
Quoted 13 lines
Already as is;
Reviewed-by Joonas Lahtinen <[email protected]>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
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Tvrtko Ursulin
maintainerPATCH v2 5/14 drm/i915: Sort forcewake mapping tables
In reply to Tvrtko UrsulinFrom: Tvrtko Ursulin <[email protected]>
Sorting the tables (verified at runtime to help during development) is another prerequisite for interesting work which will follow.
v2:
* Remove const away cast and improve comments. (Chris Wilson)
* Check tables only when debug option is enabled.
--- drivers/gpu/drm/i915/intel_uncore.c | 56 ++++++++++++++++++++++++++++--------- 1 file changed, 43 insertions(+), 13 deletions(-)
drivers/gpu/drm/i915/intel_uncore.c +43 -13
@@ -605,16 +605,35 @@ find_fw_domain(u32 offset, const struct intel_forcewake_range *ranges,return -1 ; } +static void +intel_fw_table_check (const struct intel_forcewake_range *ranges, +unsigned int num_ranges) +{ +#ifdef CONFIG_DRM_I915_DEBUG +unsigned int i; +const struct intel_forcewake_range *entry = ranges; +s32 prev =-1 ; + +for (i =0 ; i < num_ranges; i++, entry++) { +WARN_ON_ONCE (prev >= (s32 )entry->start); + prev = entry->start; +WARN_ON_ONCE (prev >= (s32 )entry->end); + prev = entry->end; + } +#endif +} +#define GEN_FW_RANGE (s, e, d) \ { .start = (s), .end = (e), .domains = (d) } +/* *Must* be sorted by offset ranges! See intel_fw_table_check(). */ static const struct intel_forcewake_range __vlv_fw_ranges[] = {GEN_FW_RANGE (0x2000 ,0x3fff ,FORCEWAKE_RENDER ),GEN_FW_RANGE (0x5000 ,0x7fff ,FORCEWAKE_RENDER ),GEN_FW_RANGE (0xb000 ,0x11fff ,FORCEWAKE_RENDER ), -GEN_FW_RANGE (0x2e000 ,0x2ffff ,FORCEWAKE_RENDER ),GEN_FW_RANGE (0x12000 ,0x13fff ,FORCEWAKE_MEDIA ),GEN_FW_RANGE (0x22000 ,0x23fff ,FORCEWAKE_MEDIA ), +GEN_FW_RANGE (0x2e000 ,0x2ffff ,FORCEWAKE_RENDER ),GEN_FW_RANGE (0x30000 ,0x3ffff ,FORCEWAKE_MEDIA ), };
@@ -660,23 +679,24 @@ static bool is_gen8_shadowed(u32 offset) __fwd; \ }) +/* *Must* be sorted by offset ranges! See intel_fw_table_check(). */ static const struct intel_forcewake_range __chv_fw_ranges[] = {GEN_FW_RANGE (0x2000 ,0x3fff ,FORCEWAKE_RENDER ), +GEN_FW_RANGE (0x4000 ,0x4fff ,FORCEWAKE_RENDER |FORCEWAKE_MEDIA ),GEN_FW_RANGE (0x5200 ,0x7fff ,FORCEWAKE_RENDER ), +GEN_FW_RANGE (0x8000 ,0x82ff ,FORCEWAKE_RENDER |FORCEWAKE_MEDIA ),GEN_FW_RANGE (0x8300 ,0x84ff ,FORCEWAKE_RENDER ), -GEN_FW_RANGE (0xb000 ,0xb47f ,FORCEWAKE_RENDER ), -GEN_FW_RANGE (0xe000 ,0xe7ff ,FORCEWAKE_RENDER ), +GEN_FW_RANGE (0x8500 ,0x85ff ,FORCEWAKE_RENDER |FORCEWAKE_MEDIA ),GEN_FW_RANGE (0x8800 ,0x88ff ,FORCEWAKE_MEDIA ), +GEN_FW_RANGE (0x9000 ,0xafff ,FORCEWAKE_RENDER |FORCEWAKE_MEDIA ), +GEN_FW_RANGE (0xb000 ,0xb47f ,FORCEWAKE_RENDER ),GEN_FW_RANGE (0xd000 ,0xd7ff ,FORCEWAKE_MEDIA ), +GEN_FW_RANGE (0xe000 ,0xe7ff ,FORCEWAKE_RENDER ), +GEN_FW_RANGE (0xf000 ,0xffff ,FORCEWAKE_RENDER |FORCEWAKE_MEDIA ),GEN_FW_RANGE (0x12000 ,0x13fff ,FORCEWAKE_MEDIA ),GEN_FW_RANGE (0x1a000 ,0x1bfff ,FORCEWAKE_MEDIA ),GEN_FW_RANGE (0x1e800 ,0x1e9ff ,FORCEWAKE_MEDIA ),GEN_FW_RANGE (0x30000 ,0x37fff ,FORCEWAKE_MEDIA ), -GEN_FW_RANGE (0x4000 ,0x4fff ,FORCEWAKE_RENDER |FORCEWAKE_MEDIA ), -GEN_FW_RANGE (0x8000 ,0x82ff ,FORCEWAKE_RENDER |FORCEWAKE_MEDIA ), -GEN_FW_RANGE (0x8500 ,0x85ff ,FORCEWAKE_RENDER |FORCEWAKE_MEDIA ), -GEN_FW_RANGE (0x9000 ,0xafff ,FORCEWAKE_RENDER |FORCEWAKE_MEDIA ), -GEN_FW_RANGE (0xf000 ,0xffff ,FORCEWAKE_RENDER |FORCEWAKE_MEDIA ), };#define __chv_reg_read_fw_domains (offset) \
@@ -703,23 +723,24 @@ static const struct intel_forcewake_range __chv_fw_ranges[] = { __fwd; \ }) +/* *Must* be sorted by offset ranges! See intel_fw_table_check(). */ static const struct intel_forcewake_range __gen9_fw_ranges[] = {GEN_FW_RANGE (0xb00 ,0x1fff ,0 ),/* uncore range */ GEN_FW_RANGE (0x2000 ,0x26ff ,FORCEWAKE_RENDER ),GEN_FW_RANGE (0x3000 ,0x3fff ,FORCEWAKE_RENDER ),GEN_FW_RANGE (0x5200 ,0x7fff ,FORCEWAKE_RENDER ), +GEN_FW_RANGE (0x8130 ,0x813f ,FORCEWAKE_MEDIA ),GEN_FW_RANGE (0x8140 ,0x815f ,FORCEWAKE_RENDER ),GEN_FW_RANGE (0x8300 ,0x84ff ,FORCEWAKE_RENDER ), +GEN_FW_RANGE (0x8800 ,0x89ff ,FORCEWAKE_MEDIA ),GEN_FW_RANGE (0x8c00 ,0x8cff ,FORCEWAKE_RENDER ), -GEN_FW_RANGE (0xb000 ,0xb47f ,FORCEWAKE_RENDER ), -GEN_FW_RANGE (0xe000 ,0xe8ff ,FORCEWAKE_RENDER ), -GEN_FW_RANGE (0x24400 ,0x247ff ,FORCEWAKE_RENDER ),GEN_FW_RANGE (0x9400 ,0x97ff ,FORCEWAKE_RENDER |FORCEWAKE_MEDIA ), -GEN_FW_RANGE (0x8130 ,0x813f ,FORCEWAKE_MEDIA ), -GEN_FW_RANGE (0x8800 ,0x89ff ,FORCEWAKE_MEDIA ), +GEN_FW_RANGE (0xb000 ,0xb47f ,FORCEWAKE_RENDER ),GEN_FW_RANGE (0xd000 ,0xd7ff ,FORCEWAKE_MEDIA ), +GEN_FW_RANGE (0xe000 ,0xe8ff ,FORCEWAKE_RENDER ),GEN_FW_RANGE (0x12000 ,0x13fff ,FORCEWAKE_MEDIA ),GEN_FW_RANGE (0x1a000 ,0x1e9ff ,FORCEWAKE_MEDIA ), +GEN_FW_RANGE (0x24400 ,0x247ff ,FORCEWAKE_RENDER ),GEN_FW_RANGE (0x30000 ,0x3ffff ,FORCEWAKE_MEDIA ), };
@@ -1299,11 +1320,17 @@ void intel_uncore_init(struct drm_i915_private *dev_priv)switch (INTEL_INFO (dev_priv)->gen) {default :case 9 : +intel_fw_table_check (__gen9_fw_ranges, +ARRAY_SIZE (__gen9_fw_ranges)); +ASSIGN_WRITE_MMIO_VFUNCS (gen9);ASSIGN_READ_MMIO_VFUNCS (gen9);break ;case 8 :if (IS_CHERRYVIEW (dev_priv)) { +intel_fw_table_check (__chv_fw_ranges, +ARRAY_SIZE (__chv_fw_ranges)); +ASSIGN_WRITE_MMIO_VFUNCS (chv);ASSIGN_READ_MMIO_VFUNCS (chv);
@@ -1317,6 +1344,9 @@ void intel_uncore_init(struct drm_i915_private *dev_priv)ASSIGN_WRITE_MMIO_VFUNCS (gen6);if (IS_VALLEYVIEW (dev_priv)) { +intel_fw_table_check (__vlv_fw_ranges, +ARRAY_SIZE (__vlv_fw_ranges)); +ASSIGN_READ_MMIO_VFUNCS (vlv); }else {ASSIGN_READ_MMIO_VFUNCS (gen6);
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 05/14] drm/i915: Sort forcewake mapping tables
Quoted 22 lines · Tvrtko Ursulin
From: Tvrtko Ursulin <[email protected]>
Sorting the tables (verified at runtime to help during development) is another prerequisite for interesting work which will follow.
v2:
* Remove const away cast and improve comments. (Chris Wilson)
* Check tables only when debug option is enabled.Signed-off-by Tvrtko Ursulin <[email protected]>--- drivers/gpu/drm/i915/intel_uncore.c | 56 ++++++++++++++++++++++++++++--------- 1 file changed, 43 insertions(+), 13 deletions(-)drivers/gpu/drm/i915/intel_uncore.c +0
-0@@ -605,16 +605,35 @@ find_fw_domain(u32 offset, const struct intel_forcewake_range *ranges,return -1 ; }
drivers/gpu/drm/i915/intel_uncore.c find_fw_domain(u32 offset, const struct intel_forcewake_range *ranges, · line 616
Quoted 10 lines
drivers/gpu/drm/i915/intel_uncore.c +9
-0+static void +intel_fw_table_check (const struct intel_forcewake_range *ranges, +unsigned int num_ranges) +{ +#ifdef CONFIG_DRM_I915_DEBUG +unsigned int i; +const struct intel_forcewake_range *entry = ranges; +s32 prev =-1 ; +
if (!IS_ENABLED(CONFIG_DRM_I915_DEBUG)) return;
for compiler checking always.
or
#if IS_ENABLED(CONFIG_DRM_I915_DEBUG)
...
#endif
-Chris
Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Tvrtko Ursulin
maintainerPATCH v2 5/14 drm/i915: Sort forcewake mapping tables
From: Tvrtko Ursulin <[email protected]>
Sorting the tables (verified at runtime to help during development) is another prerequisite for interesting work which will follow.
v2:
* Remove const away cast and improve comments. (Chris Wilson)
* Check tables only when debug option is enabled.
v3: Use IS_ENABLED. (Chris Wilson)
--- drivers/gpu/drm/i915/intel_uncore.c | 56 ++++++++++++++++++++++++++++--------- 1 file changed, 43 insertions(+), 13 deletions(-)
drivers/gpu/drm/i915/intel_uncore.c +43 -13
@@ -605,16 +605,35 @@ find_fw_domain(u32 offset, const struct intel_forcewake_range *ranges,return -1 ; } +static void +intel_fw_table_check (const struct intel_forcewake_range *ranges, +unsigned int num_ranges) +{ +s32 prev; +unsigned int i; + +if (!IS_ENABLED (CONFIG_DRM_I915_DEBUG )) +return ; + +for (i =0 , prev =-1 ; i < num_ranges; i++, ranges++) { +WARN_ON_ONCE (prev >= (s32 )ranges->start); + prev = ranges->start; +WARN_ON_ONCE (prev >= (s32 )ranges->end); + prev = ranges->end; + } +} +#define GEN_FW_RANGE (s, e, d) \ { .start = (s), .end = (e), .domains = (d) } +/* *Must* be sorted by offset ranges! See intel_fw_table_check(). */ static const struct intel_forcewake_range __vlv_fw_ranges[] = {GEN_FW_RANGE (0x2000 ,0x3fff ,FORCEWAKE_RENDER ),GEN_FW_RANGE (0x5000 ,0x7fff ,FORCEWAKE_RENDER ),GEN_FW_RANGE (0xb000 ,0x11fff ,FORCEWAKE_RENDER ), -GEN_FW_RANGE (0x2e000 ,0x2ffff ,FORCEWAKE_RENDER ),GEN_FW_RANGE (0x12000 ,0x13fff ,FORCEWAKE_MEDIA ),GEN_FW_RANGE (0x22000 ,0x23fff ,FORCEWAKE_MEDIA ), +GEN_FW_RANGE (0x2e000 ,0x2ffff ,FORCEWAKE_RENDER ),GEN_FW_RANGE (0x30000 ,0x3ffff ,FORCEWAKE_MEDIA ), };
@@ -660,23 +679,24 @@ static bool is_gen8_shadowed(u32 offset) __fwd; \ }) +/* *Must* be sorted by offset ranges! See intel_fw_table_check(). */ static const struct intel_forcewake_range __chv_fw_ranges[] = {GEN_FW_RANGE (0x2000 ,0x3fff ,FORCEWAKE_RENDER ), +GEN_FW_RANGE (0x4000 ,0x4fff ,FORCEWAKE_RENDER |FORCEWAKE_MEDIA ),GEN_FW_RANGE (0x5200 ,0x7fff ,FORCEWAKE_RENDER ), +GEN_FW_RANGE (0x8000 ,0x82ff ,FORCEWAKE_RENDER |FORCEWAKE_MEDIA ),GEN_FW_RANGE (0x8300 ,0x84ff ,FORCEWAKE_RENDER ), -GEN_FW_RANGE (0xb000 ,0xb47f ,FORCEWAKE_RENDER ), -GEN_FW_RANGE (0xe000 ,0xe7ff ,FORCEWAKE_RENDER ), +GEN_FW_RANGE (0x8500 ,0x85ff ,FORCEWAKE_RENDER |FORCEWAKE_MEDIA ),GEN_FW_RANGE (0x8800 ,0x88ff ,FORCEWAKE_MEDIA ), +GEN_FW_RANGE (0x9000 ,0xafff ,FORCEWAKE_RENDER |FORCEWAKE_MEDIA ), +GEN_FW_RANGE (0xb000 ,0xb47f ,FORCEWAKE_RENDER ),GEN_FW_RANGE (0xd000 ,0xd7ff ,FORCEWAKE_MEDIA ), +GEN_FW_RANGE (0xe000 ,0xe7ff ,FORCEWAKE_RENDER ), +GEN_FW_RANGE (0xf000 ,0xffff ,FORCEWAKE_RENDER |FORCEWAKE_MEDIA ),GEN_FW_RANGE (0x12000 ,0x13fff ,FORCEWAKE_MEDIA ),GEN_FW_RANGE (0x1a000 ,0x1bfff ,FORCEWAKE_MEDIA ),GEN_FW_RANGE (0x1e800 ,0x1e9ff ,FORCEWAKE_MEDIA ),GEN_FW_RANGE (0x30000 ,0x37fff ,FORCEWAKE_MEDIA ), -GEN_FW_RANGE (0x4000 ,0x4fff ,FORCEWAKE_RENDER |FORCEWAKE_MEDIA ), -GEN_FW_RANGE (0x8000 ,0x82ff ,FORCEWAKE_RENDER |FORCEWAKE_MEDIA ), -GEN_FW_RANGE (0x8500 ,0x85ff ,FORCEWAKE_RENDER |FORCEWAKE_MEDIA ), -GEN_FW_RANGE (0x9000 ,0xafff ,FORCEWAKE_RENDER |FORCEWAKE_MEDIA ), -GEN_FW_RANGE (0xf000 ,0xffff ,FORCEWAKE_RENDER |FORCEWAKE_MEDIA ), };#define __chv_reg_read_fw_domains (offset) \
@@ -703,23 +723,24 @@ static const struct intel_forcewake_range __chv_fw_ranges[] = { __fwd; \ }) +/* *Must* be sorted by offset ranges! See intel_fw_table_check(). */ static const struct intel_forcewake_range __gen9_fw_ranges[] = {GEN_FW_RANGE (0xb00 ,0x1fff ,0 ),/* uncore range */ GEN_FW_RANGE (0x2000 ,0x26ff ,FORCEWAKE_RENDER ),GEN_FW_RANGE (0x3000 ,0x3fff ,FORCEWAKE_RENDER ),GEN_FW_RANGE (0x5200 ,0x7fff ,FORCEWAKE_RENDER ), +GEN_FW_RANGE (0x8130 ,0x813f ,FORCEWAKE_MEDIA ),GEN_FW_RANGE (0x8140 ,0x815f ,FORCEWAKE_RENDER ),GEN_FW_RANGE (0x8300 ,0x84ff ,FORCEWAKE_RENDER ), +GEN_FW_RANGE (0x8800 ,0x89ff ,FORCEWAKE_MEDIA ),GEN_FW_RANGE (0x8c00 ,0x8cff ,FORCEWAKE_RENDER ), -GEN_FW_RANGE (0xb000 ,0xb47f ,FORCEWAKE_RENDER ), -GEN_FW_RANGE (0xe000 ,0xe8ff ,FORCEWAKE_RENDER ), -GEN_FW_RANGE (0x24400 ,0x247ff ,FORCEWAKE_RENDER ),GEN_FW_RANGE (0x9400 ,0x97ff ,FORCEWAKE_RENDER |FORCEWAKE_MEDIA ), -GEN_FW_RANGE (0x8130 ,0x813f ,FORCEWAKE_MEDIA ), -GEN_FW_RANGE (0x8800 ,0x89ff ,FORCEWAKE_MEDIA ), +GEN_FW_RANGE (0xb000 ,0xb47f ,FORCEWAKE_RENDER ),GEN_FW_RANGE (0xd000 ,0xd7ff ,FORCEWAKE_MEDIA ), +GEN_FW_RANGE (0xe000 ,0xe8ff ,FORCEWAKE_RENDER ),GEN_FW_RANGE (0x12000 ,0x13fff ,FORCEWAKE_MEDIA ),GEN_FW_RANGE (0x1a000 ,0x1e9ff ,FORCEWAKE_MEDIA ), +GEN_FW_RANGE (0x24400 ,0x247ff ,FORCEWAKE_RENDER ),GEN_FW_RANGE (0x30000 ,0x3ffff ,FORCEWAKE_MEDIA ), };
@@ -1299,11 +1320,17 @@ void intel_uncore_init(struct drm_i915_private *dev_priv)switch (INTEL_INFO (dev_priv)->gen) {default :case 9 : +intel_fw_table_check (__gen9_fw_ranges, +ARRAY_SIZE (__gen9_fw_ranges)); +ASSIGN_WRITE_MMIO_VFUNCS (gen9);ASSIGN_READ_MMIO_VFUNCS (gen9);break ;case 8 :if (IS_CHERRYVIEW (dev_priv)) { +intel_fw_table_check (__chv_fw_ranges, +ARRAY_SIZE (__chv_fw_ranges)); +ASSIGN_WRITE_MMIO_VFUNCS (chv);ASSIGN_READ_MMIO_VFUNCS (chv);
@@ -1317,6 +1344,9 @@ void intel_uncore_init(struct drm_i915_private *dev_priv)ASSIGN_WRITE_MMIO_VFUNCS (gen6);if (IS_VALLEYVIEW (dev_priv)) { +intel_fw_table_check (__vlv_fw_ranges, +ARRAY_SIZE (__vlv_fw_ranges)); +ASSIGN_READ_MMIO_VFUNCS (vlv); }else {ASSIGN_READ_MMIO_VFUNCS (gen6);
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Tvrtko Ursulin
maintainerPATCH v2 6/14 drm/i915: Use binary search when looking up forcewake domains
In reply to Tvrtko UrsulinFrom: Tvrtko Ursulin <[email protected]>
Instead of the existing linear seach, now that we have sorted range tables, we can do a binary search on them for some potential miniscule performance gain, but more importantly for elegance and code size. Hopefully the perfomance gain is sufficient to offset the function calls which were not there before.
v2: Removed const cast away.
--- drivers/gpu/drm/i915/intel_uncore.c | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-)
drivers/gpu/drm/i915/intel_uncore.c +19 -8
@@ -26,6 +26,7 @@#include "i915_vgpu.h" #include <linux/pm_runtime.h> +#include <linux/bsearch.h> #define FORCEWAKE_ACK_TIMEOUT_MS 50
@@ -589,20 +590,30 @@ struct intel_forcewake_rangeenum forcewake_domains domains; }; +static int fw_range_cmp (const void *key,const void *elt) +{ +const struct intel_forcewake_range *entry = elt; +u32 offset = (u32)((unsigned long )key); + +if (offset < entry->start) +return -1 ; +else if (offset > entry->end) +return 1 ; +else +return 0 ; +} +static enum forcewake_domains find_fw_domain (u32 offset,const struct intel_forcewake_range *ranges,unsigned int num_ranges) { -unsigned int i; -struct intel_forcewake_range *entry = - (struct intel_forcewake_range *)ranges; +struct intel_forcewake_range *entry; -for (i =0 ; i < num_ranges; i++, entry++) { -if (offset >= entry->start && offset <= entry->end) -return entry->domains; - } + entry =bsearch ((void *)(unsigned long )offset, (const void *)ranges, + num_ranges,sizeof (struct intel_forcewake_range ), + fw_range_cmp); -return -1 ; +return entry ? entry->domains :-1 ; } static void
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Tvrtko Ursulin
maintainerPATCH v2 7/14 drm/i915: Eliminate Gen9 special case
In reply to Tvrtko UrsulinFrom: Tvrtko Ursulin <[email protected]>
If we insert blitter forcewake domain entries in the range table we can eliminate that special case and simplify the code in a few macros. This will enable more unification later.
--- drivers/gpu/drm/i915/intel_uncore.c | 42 ++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 21 deletions(-)
drivers/gpu/drm/i915/intel_uncore.c +21 -21
@@ -613,7 +613,7 @@ find_fw_domain(u32 offset, const struct intel_forcewake_range *ranges, num_ranges,sizeof (struct intel_forcewake_range ), fw_range_cmp); -return entry ? entry->domains :-1 ; +return entry ? entry->domains :0 ; } static void
@@ -651,12 +651,9 @@ static const struct intel_forcewake_range __vlv_fw_ranges[] = {#define __vlv_reg_read_fw_domains (offset) \ ({ \ enum forcewake_domains __fwd = 0; \ - if (NEEDS_FORCE_WAKE((offset))) { \ + if (NEEDS_FORCE_WAKE((offset))) \ __fwd = find_fw_domain(offset, __vlv_fw_ranges, \ ARRAY_SIZE(__vlv_fw_ranges)); \ - if (__fwd == -1 ) \ - __fwd = 0; \ - } \ __fwd; \ })
@@ -713,57 +710,63 @@ static const struct intel_forcewake_range __chv_fw_ranges[] = {#define __chv_reg_read_fw_domains (offset) \ ({ \ enum forcewake_domains __fwd = 0; \ - if (NEEDS_FORCE_WAKE((offset))) { \ + if (NEEDS_FORCE_WAKE((offset))) \ __fwd = find_fw_domain(offset, __chv_fw_ranges, \ ARRAY_SIZE(__chv_fw_ranges)); \ - if (__fwd == -1 ) \ - __fwd = 0; \ - } \ __fwd; \ })#define __chv_reg_write_fw_domains (offset) \ ({ \ enum forcewake_domains __fwd = 0; \ - if (NEEDS_FORCE_WAKE((offset)) && !is_gen8_shadowed(offset)) { \ + if (NEEDS_FORCE_WAKE((offset)) && !is_gen8_shadowed(offset)) \ __fwd = find_fw_domain(offset, __chv_fw_ranges, \ ARRAY_SIZE(__chv_fw_ranges)); \ - if (__fwd == -1 ) \ - __fwd = 0; \ - } \ __fwd; \ })/* *Must* be sorted by offset ranges! See intel_fw_table_check(). */ static const struct intel_forcewake_range __gen9_fw_ranges[] = { +GEN_FW_RANGE (0x0 ,0xaff ,FORCEWAKE_BLITTER ),GEN_FW_RANGE (0xb00 ,0x1fff ,0 ),/* uncore range */ GEN_FW_RANGE (0x2000 ,0x26ff ,FORCEWAKE_RENDER ), +GEN_FW_RANGE (0x2700 ,0x2fff ,FORCEWAKE_BLITTER ),GEN_FW_RANGE (0x3000 ,0x3fff ,FORCEWAKE_RENDER ), +GEN_FW_RANGE (0x4000 ,0x51ff ,FORCEWAKE_BLITTER ),GEN_FW_RANGE (0x5200 ,0x7fff ,FORCEWAKE_RENDER ), +GEN_FW_RANGE (0x8000 ,0x812f ,FORCEWAKE_BLITTER ),GEN_FW_RANGE (0x8130 ,0x813f ,FORCEWAKE_MEDIA ),GEN_FW_RANGE (0x8140 ,0x815f ,FORCEWAKE_RENDER ), +GEN_FW_RANGE (0x8160 ,0x82ff ,FORCEWAKE_BLITTER ),GEN_FW_RANGE (0x8300 ,0x84ff ,FORCEWAKE_RENDER ), +GEN_FW_RANGE (0x8500 ,0x87ff ,FORCEWAKE_BLITTER ),GEN_FW_RANGE (0x8800 ,0x89ff ,FORCEWAKE_MEDIA ), +GEN_FW_RANGE (0x8a00 ,0x8bff ,FORCEWAKE_BLITTER ),GEN_FW_RANGE (0x8c00 ,0x8cff ,FORCEWAKE_RENDER ), +GEN_FW_RANGE (0x8d00 ,0x93ff ,FORCEWAKE_BLITTER ),GEN_FW_RANGE (0x9400 ,0x97ff ,FORCEWAKE_RENDER |FORCEWAKE_MEDIA ), +GEN_FW_RANGE (0x9800 ,0xafff ,FORCEWAKE_BLITTER ),GEN_FW_RANGE (0xb000 ,0xb47f ,FORCEWAKE_RENDER ), +GEN_FW_RANGE (0xb480 ,0xbfff ,FORCEWAKE_BLITTER ),GEN_FW_RANGE (0xd000 ,0xd7ff ,FORCEWAKE_MEDIA ), +GEN_FW_RANGE (0xd800 ,0xdfff ,FORCEWAKE_BLITTER ),GEN_FW_RANGE (0xe000 ,0xe8ff ,FORCEWAKE_RENDER ), +GEN_FW_RANGE (0xe900 ,0x11fff ,FORCEWAKE_BLITTER ),GEN_FW_RANGE (0x12000 ,0x13fff ,FORCEWAKE_MEDIA ), +GEN_FW_RANGE (0x14000 ,0x19fff ,FORCEWAKE_BLITTER ),GEN_FW_RANGE (0x1a000 ,0x1e9ff ,FORCEWAKE_MEDIA ), +GEN_FW_RANGE (0x1ea00 ,0x243ff ,FORCEWAKE_BLITTER ),GEN_FW_RANGE (0x24400 ,0x247ff ,FORCEWAKE_RENDER ), +GEN_FW_RANGE (0x24800 ,0x2ffff ,FORCEWAKE_BLITTER ),GEN_FW_RANGE (0x30000 ,0x3ffff ,FORCEWAKE_MEDIA ), };#define __gen9_reg_read_fw_domains (offset) \ ({ \ enum forcewake_domains __fwd = 0; \ - if (NEEDS_FORCE_WAKE((offset))) { \ + if (NEEDS_FORCE_WAKE((offset))) \ __fwd = find_fw_domain(offset, __gen9_fw_ranges, \ ARRAY_SIZE(__gen9_fw_ranges)); \ - if (__fwd == -1 ) \ - __fwd = FORCEWAKE_BLITTER; \ - } \ __fwd; \ })
@@ -790,12 +793,9 @@ static bool is_gen9_shadowed(u32 offset)#define __gen9_reg_write_fw_domains (offset) \ ({ \ enum forcewake_domains __fwd = 0; \ - if (NEEDS_FORCE_WAKE((offset)) && !is_gen9_shadowed(offset)) { \ + if (NEEDS_FORCE_WAKE((offset)) && !is_gen9_shadowed(offset)) \ __fwd = find_fw_domain(offset, __gen9_fw_ranges, \ ARRAY_SIZE(__gen9_fw_ranges)); \ - if (__fwd == -1 ) \ - __fwd = FORCEWAKE_BLITTER; \ - } \ __fwd; \ })
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Tvrtko Ursulin
maintainerPATCH v2 8/14 drm/i915: Store the active forcewake range table pointer
In reply to Tvrtko UrsulinFrom: Tvrtko Ursulin <[email protected]>
If we store this in the uncore structure we are on a good way to show more commonality between the per-platform implementations.
v2: Constify table pointer and correct coding style. (Chris Wilson)
--- drivers/gpu/drm/i915/i915_drv.h | 10 +++++ drivers/gpu/drm/i915/intel_uncore.c | 73 ++++++++++++++++++------------------- 2 files changed, 46 insertions(+), 37 deletions(-)
drivers/gpu/drm/i915/i915_drv.h +10 -0
@@ -582,9 +582,19 @@ struct intel_uncore_funcs { uint32_t val, bool trace); }; +struct intel_forcewake_range { +u32 start; +u32 end; + +enum forcewake_domains domains; +}; +struct intel_uncore {spinlock_t lock;/** lock is also taken in irq contexts. */ +const struct intel_forcewake_range *fw_domains_table; +unsigned int fw_domains_table_entries; +struct intel_uncore_funcs funcs;unsigned fifo_count;
drivers/gpu/drm/i915/intel_uncore.c +36 -37
156 lines not on this page · raw message
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Tvrtko Ursulin
maintainerPATCH v2 8/14 drm/i915: Store the active forcewake range table pointer
From: Tvrtko Ursulin <[email protected]>
If we store this in the uncore structure we are on a good way to show more commonality between the per-platform implementations.
v2: Constify table pointer and correct coding style. (Chris Wilson)
v3: Rebase.
--- drivers/gpu/drm/i915/i915_drv.h | 10 ++++++ drivers/gpu/drm/i915/intel_uncore.c | 68 ++++++++++++++++++------------------- 2 files changed, 44 insertions(+), 34 deletions(-)
drivers/gpu/drm/i915/i915_drv.h +10 -0
@@ -582,9 +582,19 @@ struct intel_uncore_funcs { uint32_t val, bool trace); }; +struct intel_forcewake_range { +u32 start; +u32 end; + +enum forcewake_domains domains; +}; +struct intel_uncore {spinlock_t lock;/** lock is also taken in irq contexts. */ +const struct intel_forcewake_range *fw_domains_table; +unsigned int fw_domains_table_entries; +struct intel_uncore_funcs funcs;unsigned fifo_count;
drivers/gpu/drm/i915/intel_uncore.c +34 -34
154 lines not on this page · raw message
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Tvrtko Ursulin
maintainerPATCH v2 9/14 drm/i915: Remove identical macros
In reply to Tvrtko UrsulinFrom: Tvrtko Ursulin <[email protected]>
Remove some macros which are now obviously identical.
v2: Added HAS_FWTABLE macro and simplified intel_uncore_forcewake_for_read.
(Joonas Lahtinen)
--- drivers/gpu/drm/i915/intel_uncore.c | 70 +++++++++++-------------------------- 1 file changed, 20 insertions(+), 50 deletions(-)
drivers/gpu/drm/i915/intel_uncore.c +20 -50
@@ -638,6 +638,11 @@ intel_fw_table_check(struct drm_i915_private *dev_priv)#define GEN_FW_RANGE (s, e, d) \ { .start = (s), .end = (e), .domains = (d) } +#define HAS_FWTABLE (dev_priv) \ + (IS_GEN9(dev_priv) || \ + IS_CHERRYVIEW(dev_priv) || \ + IS_VALLEYVIEW(dev_priv)) +/* *Must* be sorted by offset ranges! See intel_fw_table_check(). */ static const struct intel_forcewake_range __vlv_fw_ranges[] = {GEN_FW_RANGE (0x2000 ,0x3fff ,FORCEWAKE_RENDER ),
@@ -649,7 +654,7 @@ static const struct intel_forcewake_range __vlv_fw_ranges[] = { GEN_FW_RANGE(0x30000, 0x3ffff, FORCEWAKE_MEDIA), }; -#define __vlv_reg_read_fw_domains (offset) \ +#define __fwtable_reg_read_fw_domains (offset) \ ({ \ enum forcewake_domains __fwd = 0; \ if (NEEDS_FORCE_WAKE((offset))) \
@@ -707,14 +712,6 @@ static const struct intel_forcewake_range __chv_fw_ranges[] = { GEN_FW_RANGE(0x30000, 0x37fff, FORCEWAKE_MEDIA), }; -#define __chv_reg_read_fw_domains (offset) \ -({ \ - enum forcewake_domains __fwd = 0; \ - if (NEEDS_FORCE_WAKE((offset))) \ - __fwd = find_fw_domain(dev_priv, offset); \ - __fwd; \ -}) -#define __chv_reg_write_fw_domains (offset) \ ({ \ enum forcewake_domains __fwd = 0; \
@@ -759,14 +756,6 @@ static const struct intel_forcewake_range __gen9_fw_ranges[] = { GEN_FW_RANGE(0x30000, 0x3ffff, FORCEWAKE_MEDIA), }; -#define __gen9_reg_read_fw_domains (offset) \ -({ \ - enum forcewake_domains __fwd = 0; \ - if (NEEDS_FORCE_WAKE((offset))) \ - __fwd = find_fw_domain(dev_priv, offset); \ - __fwd; \ -}) -static const i915_reg_t gen9_shadowed_regs[] = {RING_TAIL (RENDER_RING_BASE ),RING_TAIL (GEN6_BSD_RING_BASE ),
@@ -927,7 +916,7 @@ static u##x \ vlv_read##x(struct drm_i915_private *dev_priv, i915_reg_t reg, bool trace) { \ enum forcewake_domains fw_engine; \ GEN6_READ_HEADER(x); \ - fw_engine = __vlv_reg_read_fw_domains(offset); \ + fw_engine = __fwtable_reg_read_fw_domains(offset); \ if (fw_engine) \ __force_wake_auto(dev_priv, fw_engine); \ val = __raw_i915_read##x(dev_priv, reg); \
@@ -939,7 +928,7 @@ static u##x \ chv_read##x(struct drm_i915_private *dev_priv, i915_reg_t reg, bool trace) { \ enum forcewake_domains fw_engine; \ GEN6_READ_HEADER(x); \ - fw_engine = __chv_reg_read_fw_domains(offset); \ + fw_engine = __fwtable_reg_read_fw_domains(offset); \ if (fw_engine) \ __force_wake_auto(dev_priv, fw_engine); \ val = __raw_i915_read##x(dev_priv, reg); \
@@ -951,7 +940,7 @@ static u##x \ gen9_read##x(struct drm_i915_private *dev_priv, i915_reg_t reg, bool trace) { \ enum forcewake_domains fw_engine; \ GEN6_READ_HEADER(x); \ - fw_engine = __gen9_reg_read_fw_domains(offset); \ + fw_engine = __fwtable_reg_read_fw_domains(offset); \ if (fw_engine) \ __force_wake_auto(dev_priv, fw_engine); \ val = __raw_i915_read##x(dev_priv, reg); \
@@ -1823,35 +1812,16 @@ static enum forcewake_domains intel_uncore_forcewake_for_read(struct drm_i915_private *dev_priv, i915_reg_t reg) { +u32 offset =i915_mmio_reg_offset (reg);enum forcewake_domains fw_domains; -if (intel_vgpu_active (dev_priv)) -return 0 ; - -switch (INTEL_GEN (dev_priv)) { -case 9 : - fw_domains =__gen9_reg_read_fw_domains (i915_mmio_reg_offset (reg)); -break ; -case 8 : -if (IS_CHERRYVIEW (dev_priv)) - fw_domains =__chv_reg_read_fw_domains (i915_mmio_reg_offset (reg)); -else - fw_domains =__gen6_reg_read_fw_domains (i915_mmio_reg_offset (reg)); -break ; -case 7 : -case 6 : -if (IS_VALLEYVIEW (dev_priv)) - fw_domains =__vlv_reg_read_fw_domains (i915_mmio_reg_offset (reg)); -else - fw_domains =__gen6_reg_read_fw_domains (i915_mmio_reg_offset (reg)); -break ; -default : -MISSING_CASE (INTEL_INFO (dev_priv)->gen); -case 5 :/* forcewake was introduced with gen6 */ -case 4 : -case 3 : -case 2 : -return 0 ; +if (HAS_FWTABLE (dev_priv)) { + fw_domains =__fwtable_reg_read_fw_domains (offset); + }else if (INTEL_GEN (dev_priv) >=6 ) { + fw_domains =__gen6_reg_read_fw_domains (offset); + }else { +WARN_ON (!IS_GEN (dev_priv,2 ,5 )); + fw_domains =0 ; }WARN_ON (fw_domains & ~dev_priv->uncore.fw_domains);
@@ -1865,9 +1835,6 @@ intel_uncore_forcewake_for_write(struct drm_i915_private *dev_priv, {enum forcewake_domains fw_domains; -if (intel_vgpu_active (dev_priv)) -return 0 ; -switch (INTEL_GEN (dev_priv)) {case 9 : fw_domains =__gen9_reg_write_fw_domains (i915_mmio_reg_offset (reg));
@@ -1918,6 +1885,9 @@ intel_uncore_forcewake_for_reg(struct drm_i915_private *dev_priv,WARN_ON (!op); +if (intel_vgpu_active (dev_priv)) +return 0 ; +if (op &FW_REG_READ ) fw_domains =intel_uncore_forcewake_for_read (dev_priv, reg);
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Tvrtko Ursulin
maintainerPATCH v2 10/14 drm/i915: Remove identical mmio read functions
In reply to Tvrtko UrsulinFrom: Tvrtko Ursulin <[email protected]>
It is now obvious VLV, CHV and Gen9 mmio read fcuntions are completely identical so we can remove the three copies and just keep the newly named generic implementation.
v2: Use fwtable naming consistently. (Joonas Lahtinen)
--- drivers/gpu/drm/i915/intel_uncore.c | 54 +++++++------------------------------ 1 file changed, 10 insertions(+), 44 deletions(-)
drivers/gpu/drm/i915/intel_uncore.c +10 -44
@@ -911,9 +911,9 @@ gen6_read##x(struct drm_i915_private *dev_priv, i915_reg_t reg, bool trace) { \GEN6_READ_FOOTER ; \ } -#define __vlv_read (x) \ +#define __fwtable_read (x) \ static u##x \ -vlv_read##x(struct drm_i915_private *dev_priv, i915_reg_t reg, bool trace) { \ +fwtable_read##x(struct drm_i915_private *dev_priv, i915_reg_t reg, bool trace) { \ enum forcewake_domains fw_engine; \ GEN6_READ_HEADER(x); \ fw_engine = __fwtable_reg_read_fw_domains(offset); \
@@ -923,50 +923,16 @@ vlv_read##x(struct drm_i915_private *dev_priv, i915_reg_t reg, bool trace) { \GEN6_READ_FOOTER ; \ } -#define __chv_read (x) \ -static u##x \ -chv_read##x(struct drm_i915_private *dev_priv, i915_reg_t reg, bool trace) { \ - enum forcewake_domains fw_engine; \ - GEN6_READ_HEADER(x); \ - fw_engine = __fwtable_reg_read_fw_domains(offset); \ - if (fw_engine) \ - __force_wake_auto(dev_priv, fw_engine); \ - val = __raw_i915_read##x(dev_priv, reg); \ - GEN6_READ_FOOTER; \ -} - -#define __gen9_read (x) \ -static u##x \ -gen9_read##x(struct drm_i915_private *dev_priv, i915_reg_t reg, bool trace) { \ - enum forcewake_domains fw_engine; \ - GEN6_READ_HEADER(x); \ - fw_engine = __fwtable_reg_read_fw_domains(offset); \ - if (fw_engine) \ - __force_wake_auto(dev_priv, fw_engine); \ - val = __raw_i915_read##x(dev_priv, reg); \ - GEN6_READ_FOOTER; \ -} - -__gen9_read(8) -__gen9_read(16) -__gen9_read(32) -__gen9_read(64) -__chv_read(8) -__chv_read(16) -__chv_read(32) -__chv_read(64) -__vlv_read(8) -__vlv_read(16) -__vlv_read(32) -__vlv_read(64) +__fwtable_read(8) +__fwtable_read(16) +__fwtable_read(32) +__fwtable_read(64) __gen6_read(8) __gen6_read(16) __gen6_read(32) __gen6_read(64) -#undef __gen9_read -#undef __chv_read -#undef __vlv_read +#undef __fwtable_read#undef __gen6_read#undef GEN6_READ_FOOTER#undef GEN6_READ_HEADER
@@ -1325,13 +1291,13 @@ void intel_uncore_init(struct drm_i915_private *dev_priv)case 9 :ASSIGN_FW_DOMAINS_TABLE (__gen9_fw_ranges);ASSIGN_WRITE_MMIO_VFUNCS (gen9); -ASSIGN_READ_MMIO_VFUNCS (gen9); +ASSIGN_READ_MMIO_VFUNCS (fwtable);break ;case 8 :if (IS_CHERRYVIEW (dev_priv)) {ASSIGN_FW_DOMAINS_TABLE (__chv_fw_ranges);ASSIGN_WRITE_MMIO_VFUNCS (chv); -ASSIGN_READ_MMIO_VFUNCS (chv); +ASSIGN_READ_MMIO_VFUNCS (fwtable); }else {ASSIGN_WRITE_MMIO_VFUNCS (gen8);
@@ -1344,7 +1310,7 @@ void intel_uncore_init(struct drm_i915_private *dev_priv)if (IS_VALLEYVIEW (dev_priv)) {ASSIGN_FW_DOMAINS_TABLE (__vlv_fw_ranges); -ASSIGN_READ_MMIO_VFUNCS (vlv); +ASSIGN_READ_MMIO_VFUNCS (fwtable); }else {ASSIGN_READ_MMIO_VFUNCS (gen6); }
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Tvrtko Ursulin
maintainerPATCH v2 11/14 drm/i915: Remove identical write mmmio functions
In reply to Tvrtko UrsulinFrom: Tvrtko Ursulin <[email protected]>
We notice two identical copies of the shadow register table and following from that removal can also unify CHV and Gen9 write mmio functions and macros into a single implementation.
v2: Name fwtable consistently and use HAS_FWTABLE. (Joonas Lahtinen)
--- drivers/gpu/drm/i915/intel_uncore.c | 94 ++++++++----------------------------- 1 file changed, 19 insertions(+), 75 deletions(-)
drivers/gpu/drm/i915/intel_uncore.c +19 -75
@@ -712,7 +712,7 @@ static const struct intel_forcewake_range __chv_fw_ranges[] = { GEN_FW_RANGE(0x30000, 0x37fff, FORCEWAKE_MEDIA), }; -#define __chv_reg_write_fw_domains (offset) \ +#define __fwtable_reg_write_fw_domains (offset) \ ({ \ enum forcewake_domains __fwd = 0; \ if (NEEDS_FORCE_WAKE((offset)) && !is_gen8_shadowed(offset)) \
@@ -756,34 +756,6 @@ static const struct intel_forcewake_range __gen9_fw_ranges[] = { GEN_FW_RANGE(0x30000, 0x3ffff, FORCEWAKE_MEDIA), }; -static const i915_reg_t gen9_shadowed_regs[] = { -RING_TAIL (RENDER_RING_BASE ), -RING_TAIL (GEN6_BSD_RING_BASE ), -RING_TAIL (VEBOX_RING_BASE ), -RING_TAIL (BLT_RING_BASE ), -GEN6_RPNSWREQ , -GEN6_RC_VIDEO_FREQ , -/* TODO: Other registers are not yet used */ -}; - -static bool is_gen9_shadowed (u32 offset) -{ -int i; -for (i =0 ; i <ARRAY_SIZE (gen9_shadowed_regs); i++) -if (offset == gen9_shadowed_regs[i].reg) -return true; - -return false; -} - -#define __gen9_reg_write_fw_domains (offset) \ -({ \ - enum forcewake_domains __fwd = 0; \ - if (NEEDS_FORCE_WAKE((offset)) && !is_gen9_shadowed(offset)) \ - __fwd = find_fw_domain(dev_priv, offset); \ - __fwd; \ -}) -static void ilk_dummy_write (struct drm_i915_private *dev_priv) {
@@ -1040,37 +1012,21 @@ gen8_write##x(struct drm_i915_private *dev_priv, i915_reg_t reg, u##x val, boolGEN6_WRITE_FOOTER ; \ } -#define __chv_write (x) \ +#define __fwtable_write (x) \ static void \ -chv_write##x(struct drm_i915_private *dev_priv, i915_reg_t reg, u##x val, bool trace) { \ +fwtable_write##x(struct drm_i915_private *dev_priv, i915_reg_t reg, u##x val, bool trace) { \ enum forcewake_domains fw_engine; \ GEN6_WRITE_HEADER; \ - fw_engine = __chv_reg_write_fw_domains(offset); \ + fw_engine = __fwtable_reg_write_fw_domains(offset); \ if (fw_engine) \ __force_wake_auto(dev_priv, fw_engine); \ __raw_i915_write##x(dev_priv, reg, val); \ GEN6_WRITE_FOOTER; \ } -#define __gen9_write (x) \ -static void \ -gen9_write##x(struct drm_i915_private *dev_priv, i915_reg_t reg, u##x val, \ - bool trace) { \ - enum forcewake_domains fw_engine; \ - GEN6_WRITE_HEADER; \ - fw_engine = __gen9_reg_write_fw_domains(offset); \ - if (fw_engine) \ - __force_wake_auto(dev_priv, fw_engine); \ - __raw_i915_write##x(dev_priv, reg, val); \ - GEN6_WRITE_FOOTER; \ -} - -__gen9_write(8) -__gen9_write(16) -__gen9_write(32) -__chv_write(8) -__chv_write(16) -__chv_write(32) +__fwtable_write(8) +__fwtable_write(16) +__fwtable_write(32) __gen8_write(8) __gen8_write(16)__gen8_write (32 )
@@ -1078,8 +1034,7 @@ __gen6_write(8) __gen6_write(16) __gen6_write(32) -#undef __gen9_write -#undef __chv_write +#undef __fwtable_write#undef __gen8_write#undef __gen6_write#undef GEN6_WRITE_FOOTER
@@ -1290,13 +1245,13 @@ void intel_uncore_init(struct drm_i915_private *dev_priv)default :case 9 :ASSIGN_FW_DOMAINS_TABLE (__gen9_fw_ranges); -ASSIGN_WRITE_MMIO_VFUNCS (gen9); +ASSIGN_WRITE_MMIO_VFUNCS (fwtable);ASSIGN_READ_MMIO_VFUNCS (fwtable);break ;case 8 :if (IS_CHERRYVIEW (dev_priv)) {ASSIGN_FW_DOMAINS_TABLE (__chv_fw_ranges); -ASSIGN_WRITE_MMIO_VFUNCS (chv); +ASSIGN_WRITE_MMIO_VFUNCS (fwtable);ASSIGN_READ_MMIO_VFUNCS (fwtable); }else {
@@ -1799,29 +1754,18 @@ static enum forcewake_domains intel_uncore_forcewake_for_write(struct drm_i915_private *dev_priv, i915_reg_t reg) { +u32 offset =i915_mmio_reg_offset (reg);enum forcewake_domains fw_domains; -switch (INTEL_GEN (dev_priv)) { -case 9 : - fw_domains =__gen9_reg_write_fw_domains (i915_mmio_reg_offset (reg)); -break ; -case 8 : -if (IS_CHERRYVIEW (dev_priv)) - fw_domains =__chv_reg_write_fw_domains (i915_mmio_reg_offset (reg)); -else - fw_domains =__gen8_reg_write_fw_domains (i915_mmio_reg_offset (reg)); -break ; -case 7 : -case 6 : +if (HAS_FWTABLE (dev_priv) && !IS_VALLEYVIEW (dev_priv)) { + fw_domains =__fwtable_reg_write_fw_domains (offset); + }else if (IS_GEN8 (dev_priv)) { + fw_domains =__gen8_reg_write_fw_domains (offset); + }else if (IS_GEN (dev_priv,6 ,7 )) { fw_domains =FORCEWAKE_RENDER ; -break ; -default : -MISSING_CASE (INTEL_INFO (dev_priv)->gen); -case 5 : -case 4 : -case 3 : -case 2 : -return 0 ; + }else { +WARN_ON (!IS_GEN (dev_priv,2 ,5 )); + fw_domains =0 ; }WARN_ON (fw_domains & ~dev_priv->uncore.fw_domains);
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Tvrtko Ursulin
maintainerPATCH v2 12/14 drm/i915: Sort the shadow register table
In reply to Tvrtko UrsulinFrom: Tvrtko Ursulin <[email protected]>
Also verify the order at runtime. This was we can start using binary search on it in a following patch.
v2: Add comment on the sorted array and only check it when
debug option is enabled.
--- drivers/gpu/drm/i915/intel_uncore.c | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-)
drivers/gpu/drm/i915/intel_uncore.c +25 -6
@@ -662,16 +662,33 @@ static const struct intel_forcewake_range __vlv_fw_ranges[] = { __fwd; \ }) +/* *Must* be sorted by offset! See intel_shadow_table_check(). */ static const i915_reg_t gen8_shadowed_regs[] = { -GEN6_RPNSWREQ , -GEN6_RC_VIDEO_FREQ , -RING_TAIL (RENDER_RING_BASE ), -RING_TAIL (GEN6_BSD_RING_BASE ), -RING_TAIL (VEBOX_RING_BASE ), -RING_TAIL (BLT_RING_BASE ), +RING_TAIL (RENDER_RING_BASE ),/* 0x2000 (base) */ +GEN6_RPNSWREQ ,/* 0xA008 */ +GEN6_RC_VIDEO_FREQ ,/* 0xA00C */ +RING_TAIL (GEN6_BSD_RING_BASE ),/* 0x12000 (base) */ +RING_TAIL (VEBOX_RING_BASE ),/* 0x1a000 (base) */ +RING_TAIL (BLT_RING_BASE ),/* 0x22000 (base) */ /* TODO: Other registers are not yet used */ }; +static void intel_shadow_table_check (void ) +{ +#ifdef CONFIG_DRM_I915_DEBUG +const i915_reg_t *reg = gen8_shadowed_regs; +s32 prev =-1 ; +u32 offset; +unsigned int i; + +for (i =0 ; i <ARRAY_SIZE (gen8_shadowed_regs); i++, reg++) { + offset =i915_mmio_reg_offset (*reg); +WARN_ON_ONCE (prev >= (s32 )offset); + prev = offset; + } +#endif +} +static bool is_gen8_shadowed (u32 offset) {int i;
@@ -1283,6 +1300,8 @@ void intel_uncore_init(struct drm_i915_private *dev_priv) }intel_fw_table_check (dev_priv); +if (INTEL_GEN (dev_priv) >=8 ) +intel_shadow_table_check ();if (intel_vgpu_active (dev_priv)) {ASSIGN_WRITE_MMIO_VFUNCS (vgpu);
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Tvrtko Ursulin
maintainerPATCH v2 12/14 drm/i915: Sort the shadow register table
From: Tvrtko Ursulin <[email protected]>
Also verify the order at runtime. This was we can start using binary search on it in a following patch.
v2: Add comment on the sorted array and only check it when
debug option is enabled.
v3: Use IS_ENABLED. (Chris Wilson)
--- drivers/gpu/drm/i915/intel_uncore.c | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-)
drivers/gpu/drm/i915/intel_uncore.c +26 -6
@@ -663,16 +663,34 @@ static const struct intel_forcewake_range __vlv_fw_ranges[] = { __fwd; \ }) +/* *Must* be sorted by offset! See intel_shadow_table_check(). */ static const i915_reg_t gen8_shadowed_regs[] = { -GEN6_RPNSWREQ , -GEN6_RC_VIDEO_FREQ , -RING_TAIL (RENDER_RING_BASE ), -RING_TAIL (GEN6_BSD_RING_BASE ), -RING_TAIL (VEBOX_RING_BASE ), -RING_TAIL (BLT_RING_BASE ), +RING_TAIL (RENDER_RING_BASE ),/* 0x2000 (base) */ +GEN6_RPNSWREQ ,/* 0xA008 */ +GEN6_RC_VIDEO_FREQ ,/* 0xA00C */ +RING_TAIL (GEN6_BSD_RING_BASE ),/* 0x12000 (base) */ +RING_TAIL (VEBOX_RING_BASE ),/* 0x1a000 (base) */ +RING_TAIL (BLT_RING_BASE ),/* 0x22000 (base) */ /* TODO: Other registers are not yet used */ }; +static void intel_shadow_table_check (void ) +{ +const i915_reg_t *reg = gen8_shadowed_regs; +s32 prev; +u32 offset; +unsigned int i; + +if (!IS_ENABLED (CONFIG_DRM_I915_DEBUG )) +return ; + +for (i =0 , prev =-1 ; i <ARRAY_SIZE (gen8_shadowed_regs); i++, reg++) { + offset =i915_mmio_reg_offset (*reg); +WARN_ON_ONCE (prev >= (s32 )offset); + prev = offset; + } +} +static bool is_gen8_shadowed (u32 offset) {int i;
@@ -1284,6 +1302,8 @@ void intel_uncore_init(struct drm_i915_private *dev_priv) }intel_fw_table_check (dev_priv); +if (INTEL_GEN (dev_priv) >=8 ) +intel_shadow_table_check ();if (intel_vgpu_active (dev_priv)) {ASSIGN_WRITE_MMIO_VFUNCS (vgpu);
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Tvrtko Ursulin
maintainerPATCH v2 13/14 drm/i915: Use binary search when looking for shadowed registers
In reply to Tvrtko UrsulinFrom: Tvrtko Ursulin <[email protected]>
Simply replace the linear search with the kernel's binary search implementation. There is only six registers currently in that table so this may not be that interesting. It adds a function call so hopefully remains performance neutral for now.
v2: No need for manual conversion to bool for return.
(Joonas Lahtinen)
--- drivers/gpu/drm/i915/intel_uncore.c | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-)
drivers/gpu/drm/i915/intel_uncore.c +21 -5
@@ -689,14 +689,30 @@ static void intel_shadow_table_check(void)#endif } +static int mmio_reg_cmp (const void *key,const void *elt) +{ +u32 offset = (u32 )(unsigned long )key; +i915_reg_t *reg = (i915_reg_t *)elt; + +if (offset <i915_mmio_reg_offset (*reg)) +return -1 ; +else if (offset >i915_mmio_reg_offset (*reg)) +return 1 ; +else +return 0 ; +} +static bool is_gen8_shadowed (u32 offset) { -int i; -for (i =0 ; i <ARRAY_SIZE (gen8_shadowed_regs); i++) -if (offset == gen8_shadowed_regs[i].reg) -return true; +i915_reg_t *reg; -return false; + reg =bsearch ((void *)(unsigned long )offset, + (const void *)gen8_shadowed_regs, +ARRAY_SIZE (gen8_shadowed_regs), +sizeof (i915_reg_t), + mmio_reg_cmp); + +return reg; }#define __gen8_reg_write_fw_domains (offset) \
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 13/14] drm/i915: Use binary search when looking for shadowed registers
Quoted 25 lines · Tvrtko Ursulin
From: Tvrtko Ursulin <[email protected]>
Simply replace the linear search with the kernel's binary search implementation. There is only six registers currently in that table so this may not be that interesting. It adds a function call so hopefully remains performance neutral for now.
v2: No need for manual conversion to bool for return.
(Joonas Lahtinen)Signed-off-by Tvrtko Ursulin <[email protected]>Reviewed-by Joonas Lahtinen <[email protected]>--- drivers/gpu/drm/i915/intel_uncore.c | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-)drivers/gpu/drm/i915/intel_uncore.c +1
-0@@ -689,14 +689,30 @@ static void intel_shadow_table_check(void)#endif } +static int mmio_reg_cmp (const void *key,const void *elt)
drivers/gpu/drm/i915/intel_uncore.c static void intel_shadow_table_check(void) · line 702
Quoted 10 lines
drivers/gpu/drm/i915/intel_uncore.c +10
-0+{ +u32 offset = (u32 )(unsigned long )key; +i915_reg_t *reg = (i915_reg_t *)elt; + +if (offset <i915_mmio_reg_offset (*reg)) +return -1 ; +else if (offset >i915_mmio_reg_offset (*reg)) +return 1 ; +else +return 0 ;
There's no issue with using
return offset - i915_mmio_reg_offset(*reg)
here.
Quoted 8 lines
drivers/gpu/drm/i915/intel_uncore.c +2
-4+} +static bool is_gen8_shadowed (u32 offset) { -int i; -for (i =0 ; i <ARRAY_SIZE (gen8_shadowed_regs); i++) -if (offset == gen8_shadowed_regs[i].reg) -return true;
drivers/gpu/drm/i915/intel_uncore.c static void intel_shadow_table_check(void) · line 715
Quoted 10 lines
drivers/gpu/drm/i915/intel_uncore.c +8
-1+i915_reg_t *reg; -return false; + reg =bsearch ((void *)(unsigned long )offset, + (const void *)gen8_shadowed_regs, +ARRAY_SIZE (gen8_shadowed_regs), +sizeof (i915_reg_t), + mmio_reg_cmp); + +return reg;
Or just return bseearch() ? (Probably like this for easing future patches.)
-Chris
Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Joonas Lahtinen
maintainerRe: [PATCH 13/14] drm/i915: Use binary search when looking for shadowed registers
Quoted 15 lines · Chris Wilson
drivers/gpu/drm/i915/intel_uncore.c static void intel_shadow_table_check(void) · line 702
Quoted 11 lines · Tvrtko Ursulin
drivers/gpu/drm/i915/intel_uncore.c +11
-0+static int mmio_reg_cmp (const void *key,const void *elt) +{ +u32 offset = (u32 )(unsigned long )key; +i915_reg_t *reg = (i915_reg_t *)elt; + +if (offset <i915_mmio_reg_offset (*reg)) +return -1 ; +else if (offset >i915_mmio_reg_offset (*reg)) +return 1 ; +else +return 0 ;There's no issue with using
Quoted 4 lines
return offset -
i915_mmio_reg_offset(*reg)here.
Why not?
Quoted 10 lines
drivers/gpu/drm/i915/intel_uncore.c static void intel_shadow_table_check(void) · line 715
Quoted 7 lines
drivers/gpu/drm/i915/intel_uncore.c +7
-0+ reg =bsearch ((void *)(unsigned long )offset, + (const void *)gen8_shadowed_regs, + ARRAY_SIZE(gen8_shadowed_regs), + sizeof(i915_reg_t), + mmio_reg_cmp); + +return reg;Or just return
bseearch()? (Probably like this for easing future patches.)
Suggested that too, but obviously he has something in mind.
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
Re: [PATCH 13/14] drm/i915: Use binary search when looking for shadowed registers
Quoted 30 lines · Joonas Lahtinen
Quoted 14 lines · Chris Wilson
drivers/gpu/drm/i915/intel_uncore.c static void intel_shadow_table_check(void) · line 702
Quoted 11 lines · Tvrtko Ursulin
drivers/gpu/drm/i915/intel_uncore.c +11
-0+static int mmio_reg_cmp (const void *key,const void *elt) +{ +u32 offset = (u32 )(unsigned long )key; +i915_reg_t *reg = (i915_reg_t *)elt; + +if (offset <i915_mmio_reg_offset (*reg)) +return -1 ; +else if (offset >i915_mmio_reg_offset (*reg)) +return 1 ; +else +return 0 ;There's no issue with using
Quoted 4 lines
return offset -
i915_mmio_reg_offset(*reg)here.
Why not?
Quoted 9 lines
drivers/gpu/drm/i915/intel_uncore.c static void intel_shadow_table_check(void) · line 715
Quoted 7 lines
drivers/gpu/drm/i915/intel_uncore.c +7
-0+ reg =bsearch ((void *)(unsigned long )offset, + (const void *)gen8_shadowed_regs, +ARRAY_SIZE (gen8_shadowed_regs), +sizeof (i915_reg_t), + mmio_reg_cmp); + +return reg;Or just return
bseearch()? (Probably like this for easing future patches.)
Quoted 1 line
Suggested that too, but obviously he has something in mind.
It becomes a direct return in a following patch. It is just a virtue of me wanting to split out the series a lot for easier review, and then not picking up all relevant places to tidy when acting on review feedback. But this one as I said happens in a following patch.
Regards,
Tvrtko
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Tvrtko Ursulin
maintainerPATCH v2 14/14 drm/i915: Inline binary search
In reply to Tvrtko UrsulinFrom: Tvrtko Ursulin <[email protected]>
Instead of using bsearch library function make a local generator macro out of it so the comparison callback can be inlined.
--- drivers/gpu/drm/i915/intel_uncore.c | 56 ++++++++++++++++++++----------------- 1 file changed, 31 insertions(+), 25 deletions(-)
drivers/gpu/drm/i915/intel_uncore.c +31 -25
@@ -26,7 +26,6 @@#include "i915_vgpu.h" #include <linux/pm_runtime.h> -#include <linux/bsearch.h> #define FORCEWAKE_ACK_TIMEOUT_MS 50
@@ -582,11 +581,8 @@ void assert_forcewakes_inactive(struct drm_i915_private *dev_priv) __fwd; \ }) -static int fw_range_cmp (const void *key,const void *elt) +static int fw_range_cmp (u32 offset,const struct intel_forcewake_range *entry) { -const struct intel_forcewake_range *entry = elt; -u32 offset = (u32)((unsigned long )key); -if (offset < entry->start)return -1 ;else if (offset > entry->end)
@@ -595,17 +591,33 @@ static int fw_range_cmp(const void *key, const void *elt)return 0 ; } +/* Copied and "macroized" from lib/bsearch.c */ +#define BSEARCH (key, base, num, cmp) ({ \ + unsigned int start__ = 0, end__ = (num); \ + typeof(base) result__ = NULL; \ + while (start__ < end__) { \ + unsigned int mid__ = start__ + (end__ - start__) / 2; \ + int ret__ = (cmp)((key), (base) + mid__); \ + if (ret__ < 0) { \ + end__ = mid__; \ + } else if (ret__ > 0) { \ + start__ = mid__ + 1; \ + } else { \ + result__ = (base) + mid__; \ + break; \ + } \ + } \ + result__; \ +}) +static enum forcewake_domains find_fw_domain (struct drm_i915_private *dev_priv,u32 offset) { -const struct intel_forcewake_range *table, *entry; -unsigned int num_entries; - - table = dev_priv->uncore.fw_domains_table; - num_entries = dev_priv->uncore.fw_domains_table_entries; +const struct intel_forcewake_range *entry; - entry =bsearch ((void *)(unsigned long )offset, (const void *)table, - num_entries,sizeof (struct intel_forcewake_range ), + entry =BSEARCH (offset, + dev_priv->uncore.fw_domains_table, + dev_priv->uncore.fw_domains_table_entries, fw_range_cmp);return entry ? entry->domains :0 ;
@@ -689,14 +701,13 @@ static void intel_shadow_table_check(void)#endif } -static int mmio_reg_cmp (const void *key,const void *elt) +static int mmio_reg_cmp (u32 key,const i915_reg_t *reg) { -u32 offset = (u32 )(unsigned long )key; -i915_reg_t *reg = (i915_reg_t *)elt; +u32 offset =i915_mmio_reg_offset (*reg); -if (offset <i915_mmio_reg_offset (*reg)) +if (key < offset)return -1 ; -else if (offset >i915_mmio_reg_offset (*reg)) +else if (key > offset)return 1 ;else return 0 ;
@@ -704,15 +715,10 @@ static int mmio_reg_cmp(const void *key, const void *elt)static bool is_gen8_shadowed (u32 offset) { -i915_reg_t *reg; - - reg =bsearch ((void *)(unsigned long )offset, - (const void *)gen8_shadowed_regs, -ARRAY_SIZE (gen8_shadowed_regs), -sizeof (i915_reg_t), - mmio_reg_cmp); +const i915_reg_t *regs = gen8_shadowed_regs; -return reg; +return BSEARCH (offset, regs,ARRAY_SIZE (gen8_shadowed_regs), + mmio_reg_cmp); }#define __gen8_reg_write_fw_domains (offset) \
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 18 lines · Tvrtko Ursulin
From: Tvrtko Ursulin <[email protected]>
Motivation was to replace linear search comparison if-else ladders in MMIO accessors with a data driven approach.
These lookups are needed to determine to correct forcewake domains to take when reading and writing to MMIO registers.
Going data driven and keeping the tables sorted enabled binary search to be used. Followed by gradual extraction of commonality between existing functions, accompanying code reduction, and the end result is around 15KiB less code generated and also some saving in the source code lines.
v2:
* Updated cover letter given feedback.
* Some rework for review comments.
* New patch in the series (14) to inline the binary search.
Quoted 15 lines
Tvrtko Ursulin (14):
drm/i915: Remove redundant hsw_write* mmio functions drm/i915: Keep track of active forcewake domains in a bitmask drm/i915: Do not inline forcewake taking in mmio accessors drm/i915: Data driven register to forcewake domains lookup drm/i915: Sort forcewake mapping tables
drm/i915: Use binary search when looking up forcewake domains drm/i915: Eliminate Gen9 special case
drm/i915: Store the active forcewake range table pointer drm/i915: Remove identical macros
drm/i915: Remove identical mmio read functions drm/i915: Remove identical write mmmio functions drm/i915: Sort the shadow register table
drm/i915: Use binary search when looking for shadowed registers drm/i915: Inline binary search
Minor comments notwithstanding,
-Chris
Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✗ Fi.CI.BAT: warning for Forcewake binary search & code shrink (rev3)
In reply to Tvrtko Ursulin== Series Details ==
== Series Details ==
Series: Forcewake binary search & code shrink (rev3)
URL : https://patchwork.freedesktop.org/series/13080/
State : warning
== Summary ==
Series 13080v3 Forcewake binary search & code shrink
https://patchwork.freedesktop.org/api/1.0/series/13080/revisions/3/mbox/
Test drv_module_reload_basic:
pass -> SKIP (fi-skl-6770hq)
Test kms_pipe_crc_basic:
Subgroup suspend-read-crc-pipe-c:
pass -> DMESG-WARN (fi-skl-6770hq)
Test kms_psr_sink_crc:
Subgroup psr_basic:
dmesg-warn -> PASS (fi-skl-6700hq)fi-bdw-5557u total:244 pass:229 dwarn:0 dfail:0 fail:0 skip:15 fi-bsw-n3050 total:244 pass:202 dwarn:0 dfail:0 fail:0 skip:42 fi-bxt-t5700 total:244 pass:214 dwarn:0 dfail:0 fail:0 skip:30 fi-byt-j1900 total:244 pass:212 dwarn:0 dfail:0 fail:1 skip:31 fi-byt-n2820 total:244 pass:208 dwarn:0 dfail:0 fail:1 skip:35 fi-hsw-4770 total:244 pass:222 dwarn:0 dfail:0 fail:0 skip:22 fi-hsw-4770r total:244 pass:222 dwarn:0 dfail:0 fail:0 skip:22 fi-ilk-650 total:244 pass:182 dwarn:0 dfail:0 fail:2 skip:60 fi-ivb-3520m total:244 pass:219 dwarn:0 dfail:0 fail:0 skip:25 fi-ivb-3770 total:244 pass:207 dwarn:0 dfail:0 fail:0 skip:37 fi-skl-6260u total:244 pass:230 dwarn:0 dfail:0 fail:0 skip:14 fi-skl-6700hq total:244 pass:222 dwarn:0 dfail:0 fail:0 skip:22 fi-skl-6700k total:244 pass:219 dwarn:1 dfail:0 fail:0 skip:24 fi-skl-6770hq total:244 pass:226 dwarn:2 dfail:0 fail:1 skip:15 fi-snb-2520m total:244 pass:208 dwarn:0 dfail:0 fail:0 skip:36 fi-snb-2600 total:244 pass:207 dwarn:0 dfail:0 fail:0 skip:37
Results at /archive/results/CI_IGT_test/Patchwork_2608/
d0534bd0217c83c083ba146b9c987e19b219e0e4 drm-intel-nightly: 2016y-09m-30d-10h-31m-00s UTC integration manifest a77551d drm/i915: Inline binary search
3275a3c drm/i915: Use binary search when looking for shadowed registers
933eef3 drm/i915: Sort the shadow register table
569af7c drm/i915: Remove identical write mmmio functions
c7bfcc2 drm/i915: Remove identical mmio read functions
8e1c3a2 drm/i915: Remove identical macros
2736ef1 drm/i915: Store the active forcewake range table pointer
42ba155 drm/i915: Eliminate Gen9 special case
b249ec5 drm/i915: Use binary search when looking up forcewake domains
904768b drm/i915: Sort forcewake mapping tables
9d1baf6 drm/i915: Data driven register to forcewake domains lookup
17975ae drm/i915: Do not inline forcewake taking in mmio accessors
5b92076 drm/i915: Keep track of active forcewake domains in a bitmask
8d9b34c drm/i915: Remove redundant hsw_write* mmio functions
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✗ Fi.CI.BAT: warning for Forcewake binary search & code shrink (rev6)
In reply to Tvrtko Ursulin== Series Details ==
== Series Details ==
Series: Forcewake binary search & code shrink (rev6)
URL : https://patchwork.freedesktop.org/series/13080/
State : warning
== Summary ==
Series 13080v6 Forcewake binary search & code shrink
https://patchwork.freedesktop.org/api/1.0/series/13080/revisions/6/mbox/
Test kms_pipe_crc_basic:
Subgroup nonblocking-crc-pipe-b:
pass -> DMESG-WARN (fi-skl-6700k)
Subgroup suspend-read-crc-pipe-a:
pass -> DMESG-WARN (fi-byt-j1900)fi-bdw-5557u total:236 pass:220 dwarn:0 dfail:0 fail:0 skip:15 fi-bxt-t5700 total:236 pass:205 dwarn:0 dfail:0 fail:0 skip:30 fi-byt-j1900 total:236 pass:202 dwarn:1 dfail:0 fail:1 skip:31 fi-byt-n2820 total:245 pass:208 dwarn:0 dfail:0 fail:2 skip:35 fi-hsw-4770 total:236 pass:213 dwarn:0 dfail:0 fail:0 skip:22 fi-hsw-4770r total:245 pass:222 dwarn:0 dfail:0 fail:1 skip:22 fi-ilk-650 total:236 pass:173 dwarn:0 dfail:0 fail:2 skip:60 fi-skl-6700k total:236 pass:209 dwarn:2 dfail:0 fail:0 skip:24 fi-skl-6770hq total:245 pass:228 dwarn:1 dfail:0 fail:2 skip:14 fi-snb-2520m total:245 pass:208 dwarn:0 dfail:0 fail:1 skip:36 fi-snb-2600 total:236 pass:198 dwarn:0 dfail:0 fail:0 skip:37
fi-ivb-3520m failed to connect after reboot
fi-ivb-3770 failed to collect. IGT log at Patchwork_2612/fi-ivb-3770/igt.log fi-skl-6260u failed to collect. IGT log at Patchwork_2612/fi-skl-6260u/igt.log fi-skl-6700hq failed to collect. IGT log at Patchwork_2612/fi-skl-6700hq/igt.log
Results at /archive/results/CI_IGT_test/Patchwork_2612/
d0534bd0217c83c083ba146b9c987e19b219e0e4 drm-intel-nightly: 2016y-09m-30d-10h-31m-00s UTC integration manifest c5237e5 drm/i915: Inline binary search
9b4e3c9 drm/i915: Use binary search when looking for shadowed registers
0b12dbd drm/i915: Sort the shadow register table
7978e69 drm/i915: Remove identical write mmmio functions
b0960d1 drm/i915: Remove identical mmio read functions
354b09a drm/i915: Remove identical macros
e608845 drm/i915: Store the active forcewake range table pointer
79f3cb4 drm/i915: Eliminate Gen9 special case
7fe1499 drm/i915: Use binary search when looking up forcewake domains
1a71a14 drm/i915: Sort forcewake mapping tables
d34328e drm/i915: Data driven register to forcewake domains lookup
82e0e23 drm/i915: Do not inline forcewake taking in mmio accessors
920037b drm/i915: Keep track of active forcewake domains in a bitmask
e6741b5 drm/i915: Remove redundant hsw_write* mmio functions
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: ✗ Fi.CI.BAT: warning for Forcewake binary search & code shrink (rev6)
Quoted 6 lines · Patchwork
== Series Details ==
Series: Forcewake binary search & code shrink (rev6)
URL : https://patchwork.freedesktop.org/series/13080/
State : warning
Quoted 8 lines
== Summary ==
Series 13080v6 Forcewake binary search & code shrink
https://patchwork.freedesktop.org/api/1.0/series/13080/revisions/6/mbox/Test
kms_pipe_crc_basic:Subgroup nonblocking-crc-pipe-b: pass -> DMESG-WARN (fi-skl-6700k)
Test passed but kernel logged:
[ 520.080543] [drm:intel_cpu_fifo_underrun_irq_handler [i915]] *ERROR* CPU pipe B FIFO underrun
Sporadically happening since CI_DRM_1645.
Raised new bug https://bugs.freedesktop.org/show_bug.cgi?id=98041
Quoted 2 lines
Subgroup suspend-read-crc-pipe-a:
pass -> DMESG-WARN (fi-byt-j1900)Test passes but kernel error is logged:
[ 626.726086] [drm:intel_dp_aux_ch] *ERROR* dp_aux_ch not done status 0x00050000
Happening since mid-September, build CI_DRM_1635.
Raised new https://bugs.freedesktop.org/show_bug.cgi?id=98040
Quoted 18 lines
fi-bdw-5557u total:236 pass:220 dwarn:0 dfail:0 fail:0 skip:15 fi-bxt-t5700 total:236 pass:205 dwarn:0 dfail:0 fail:0 skip:30 fi-byt-j1900 total:236 pass:202 dwarn:1 dfail:0 fail:1 skip:31 fi-byt-n2820 total:245 pass:208 dwarn:0 dfail:0 fail:2 skip:35 fi-hsw-4770 total:236 pass:213 dwarn:0 dfail:0 fail:0 skip:22 fi-hsw-4770r total:245 pass:222 dwarn:0 dfail:0 fail:1 skip:22 fi-ilk-650 total:236 pass:173 dwarn:0 dfail:0 fail:2 skip:60 fi-skl-6700k total:236 pass:209 dwarn:2 dfail:0 fail:0 skip:24 fi-skl-6770hq total:245 pass:228 dwarn:1 dfail:0 fail:2 skip:14 fi-snb-2520m total:245 pass:208 dwarn:0 dfail:0 fail:1 skip:36 fi-snb-2600 total:236 pass:198 dwarn:0 dfail:0 fail:0 skip:37fi-ivb-3520m failed to connect after reboot
fi-ivb-3770 failed to collect. IGT log at Patchwork_2612/fi-ivb-3770/igt.log fi-skl-6260u failed to collect. IGT log at Patchwork_2612/fi-skl-6260u/igt.log fi-skl-6700hq failed to collect. IGT log at Patchwork_2612/fi-skl-6700hq/igt.logResults at /archive/results/CI_IGT_test/Patchwork_2612/
Quoted 15 lines
d0534bd0217c83c083ba146b9c987e19b219e0e4drm-intel-nightly: 2016y-09m-30d-10h-31m-00s UTC integration manifest c5237e5 drm/i915: Inline binary search
9b4e3c9 drm/i915: Use binary search when looking for shadowed registers
0b12dbd drm/i915: Sort the shadow register table
7978e69 drm/i915: Remove identical write mmmio functions
b0960d1 drm/i915: Remove identical mmio read functions
354b09a drm/i915: Remove identical macros
e608845 drm/i915: Store the active forcewake range table pointer
79f3cb4 drm/i915: Eliminate Gen9 special case
7fe1499 drm/i915: Use binary search when looking up forcewake domains
1a71a14 drm/i915: Sort forcewake mapping tables
d34328e drm/i915: Data driven register to forcewake domains lookup
82e0e23 drm/i915: Do not inline forcewake taking in mmio accessors
920037b drm/i915: Keep track of active forcewake domains in a bitmask
e6741b5 drm/i915: Remove redundant hsw_write* mmio functions
Results look good. If everyone is happy we could merge this.
Regards,
Tvrtko
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: ✗ Fi.CI.BAT: warning for Forcewake binary search & code shrink (rev6)
Quoted 35 lines · Tvrtko Ursulin
Quoted 18 lines · Patchwork
fi-bdw-5557u total:236 pass:220 dwarn:0 dfail:0 fail:0 skip:15 fi-bxt-t5700 total:236 pass:205 dwarn:0 dfail:0 fail:0 skip:30 fi-byt-j1900 total:236 pass:202 dwarn:1 dfail:0 fail:1 skip:31 fi-byt-n2820 total:245 pass:208 dwarn:0 dfail:0 fail:2 skip:35 fi-hsw-4770 total:236 pass:213 dwarn:0 dfail:0 fail:0 skip:22 fi-hsw-4770r total:245 pass:222 dwarn:0 dfail:0 fail:1 skip:22 fi-ilk-650 total:236 pass:173 dwarn:0 dfail:0 fail:2 skip:60 fi-skl-6700k total:236 pass:209 dwarn:2 dfail:0 fail:0 skip:24 fi-skl-6770hq total:245 pass:228 dwarn:1 dfail:0 fail:2 skip:14 fi-snb-2520m total:245 pass:208 dwarn:0 dfail:0 fail:1 skip:36 fi-snb-2600 total:236 pass:198 dwarn:0 dfail:0 fail:0 skip:37fi-ivb-3520m failed to connect after reboot
fi-ivb-3770 failed to collect. IGT log at Patchwork_2612/fi-ivb-3770/igt.log fi-skl-6260u failed to collect. IGT log at Patchwork_2612/fi-skl-6260u/igt.log fi-skl-6700hq failed to collect. IGT log at Patchwork_2612/fi-skl-6700hq/igt.logResults at /archive/results/CI_IGT_test/Patchwork_2612/
Quoted 15 lines
d0534bd0217c83c083ba146b9c987e19b219e0e4drm-intel-nightly: 2016y-09m-30d-10h-31m-00s UTC integration manifest c5237e5 drm/i915: Inline binary search
9b4e3c9 drm/i915: Use binary search when looking for shadowed registers
0b12dbd drm/i915: Sort the shadow register table
7978e69 drm/i915: Remove identical write mmmio functions
b0960d1 drm/i915: Remove identical mmio read functions
354b09a drm/i915: Remove identical macros
e608845 drm/i915: Store the active forcewake range table pointer
79f3cb4 drm/i915: Eliminate Gen9 special case
7fe1499 drm/i915: Use binary search when looking up forcewake domains
1a71a14 drm/i915: Sort forcewake mapping tables
d34328e drm/i915: Data driven register to forcewake domains lookup
82e0e23 drm/i915: Do not inline forcewake taking in mmio accessors
920037b drm/i915: Keep track of active forcewake domains in a bitmask
e6741b5 drm/i915: Remove redundant hsw_write* mmio functions
Quoted 1 line
Results look good. If everyone is happy we could merge this.
Hmm, ivb a sporadic fail? That both died is a bit concerning, but
https://patchwork.freedesktop.org/series/13264/ is happy, right?
Lgtm.
-Chris
Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: ✗ Fi.CI.BAT: warning for Forcewake binary search & code shrink (rev6)
Quoted 35 lines · Chris Wilson
Quoted 34 lines · Tvrtko Ursulin
Quoted 33 lines · Patchwork
fi-bdw-5557u total:236 pass:220 dwarn:0 dfail:0 fail:0 skip:15 fi-bxt-t5700 total:236 pass:205 dwarn:0 dfail:0 fail:0 skip:30 fi-byt-j1900 total:236 pass:202 dwarn:1 dfail:0 fail:1 skip:31 fi-byt-n2820 total:245 pass:208 dwarn:0 dfail:0 fail:2 skip:35 fi-hsw-4770 total:236 pass:213 dwarn:0 dfail:0 fail:0 skip:22 fi-hsw-4770r total:245 pass:222 dwarn:0 dfail:0 fail:1 skip:22 fi-ilk-650 total:236 pass:173 dwarn:0 dfail:0 fail:2 skip:60 fi-skl-6700k total:236 pass:209 dwarn:2 dfail:0 fail:0 skip:24 fi-skl-6770hq total:245 pass:228 dwarn:1 dfail:0 fail:2 skip:14 fi-snb-2520m total:245 pass:208 dwarn:0 dfail:0 fail:1 skip:36 fi-snb-2600 total:236 pass:198 dwarn:0 dfail:0 fail:0 skip:37fi-ivb-3520m failed to connect after reboot
fi-ivb-3770 failed to collect. IGT log at Patchwork_2612/fi-ivb-3770/igt.log fi-skl-6260u failed to collect. IGT log at Patchwork_2612/fi-skl-6260u/igt.log fi-skl-6700hq failed to collect. IGT log at Patchwork_2612/fi-skl-6700hq/igt.logResults at /archive/results/CI_IGT_test/Patchwork_2612/
d0534bd0217c83c083ba146b9c987e19b219e0e4drm-intel-nightly: 2016y-09m-30d-10h-31m-00s UTC integration manifest c5237e5 drm/i915: Inline binary search
9b4e3c9 drm/i915: Use binary search when looking for shadowed registers
0b12dbd drm/i915: Sort the shadow register table
7978e69 drm/i915: Remove identical write mmmio functions
b0960d1 drm/i915: Remove identical mmio read functions
354b09a drm/i915: Remove identical macros
e608845 drm/i915: Store the active forcewake range table pointer
79f3cb4 drm/i915: Eliminate Gen9 special case
7fe1499 drm/i915: Use binary search when looking up forcewake domains
1a71a14 drm/i915: Sort forcewake mapping tables
d34328e drm/i915: Data driven register to forcewake domains lookup
82e0e23 drm/i915: Do not inline forcewake taking in mmio accessors
920037b drm/i915: Keep track of active forcewake domains in a bitmask
e6741b5 drm/i915: Remove redundant hsw_write* mmio functions
Quoted 3 lines
Quoted 1 line
Results look good. If everyone is happy we could merge this.
Hmm, ivb a sporadic fail? That both died is a bit concerning, but
https://patchwork.freedesktop.org/series/13264/ is happy, right?
Yes, and also they did not both die, one was just over the allocated time for the run. Same with the two SKLs. So perhaps we are close to the cut off with the whole suite again.
Quoted 1 line
Lgtm.
Cool, thanks.
Joonas what do you think, worth merging on balance?
Regards,
Tvrtko
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Joonas Lahtinen
maintainerRe: ✗ Fi.CI.BAT: warning for Forcewake binary search & code shrink (rev6)
Quoted 3 lines · Tvrtko Ursulin
Joonas what do you think, worth merging on balance?
+1 on merging.
Regards, Joonas
--
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Tvrtko Ursulin
AppliedRe: ✗ Fi.CI.BAT: warning for Forcewake binary search & code shrink (rev6)
Quoted 5 lines · Joonas Lahtinen
Quoted 3 lines · Tvrtko Ursulin
Joonas what do you think, worth merging on balance?
+1 on merging.
Pushed to dinq, first one from the new office. :)
Thanks for the review guys!
Regards,
Tvrtko
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx