All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] Misc forcewake patches
@ 2016-09-28 12:25 Tvrtko Ursulin
  2016-09-28 12:25 ` [PATCH 1/3] drm/i915: Remove redundant hsw_write* mmio functions Tvrtko Ursulin
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Tvrtko Ursulin @ 2016-09-28 12:25 UTC (permalink / raw)
  To: Intel-gfx

From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Apart from 2/3 which I already sent yesterday, there are
two new patches here and the end result of the series is
approximately 3KiB reduction in i915.ko text size.

Tvrtko Ursulin (3):
  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

 drivers/gpu/drm/i915/i915_drv.h     |  2 +
 drivers/gpu/drm/i915/intel_uncore.c | 90 +++++++++++++------------------------
 2 files changed, 34 insertions(+), 58 deletions(-)

-- 
2.7.4

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* [PATCH 1/3] drm/i915: Remove redundant hsw_write* mmio functions
  2016-09-28 12:25 [PATCH 0/3] Misc forcewake patches Tvrtko Ursulin
@ 2016-09-28 12:25 ` Tvrtko Ursulin
  2016-09-28 13:28   ` Joonas Lahtinen
  2016-09-28 19:09   ` Chris Wilson
  2016-09-28 12:25 ` [PATCH 2/3] drm/i915: Keep track of active forcewake domains in a bitmask Tvrtko Ursulin
                   ` (3 subsequent siblings)
  4 siblings, 2 replies; 11+ messages in thread
From: Tvrtko Ursulin @ 2016-09-28 12:25 UTC (permalink / raw)
  To: Intel-gfx

From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

They are completely identical to gen6_write* ones.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 drivers/gpu/drm/i915/intel_uncore.c | 25 +------------------------
 1 file changed, 1 insertion(+), 24 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c
index a9b6c936aadd..478364057812 100644
--- a/drivers/gpu/drm/i915/intel_uncore.c
+++ b/drivers/gpu/drm/i915/intel_uncore.c
@@ -1055,21 +1055,6 @@ gen6_write##x(struct drm_i915_private *dev_priv, i915_reg_t reg, u##x val, bool
 	GEN6_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);
-- 
2.7.4

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* [PATCH 2/3] drm/i915: Keep track of active forcewake domains in a bitmask
  2016-09-28 12:25 [PATCH 0/3] Misc forcewake patches Tvrtko Ursulin
  2016-09-28 12:25 ` [PATCH 1/3] drm/i915: Remove redundant hsw_write* mmio functions Tvrtko Ursulin
@ 2016-09-28 12:25 ` Tvrtko Ursulin
  2016-09-28 12:25 ` [PATCH 3/3] drm/i915: Do not inline forcewake taking in mmio accessors Tvrtko Ursulin
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 11+ messages in thread
From: Tvrtko Ursulin @ 2016-09-28 12:25 UTC (permalink / raw)
  To: Intel-gfx; +Cc: Paneri, Praveen

From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

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.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: "Paneri, Praveen" <praveen.paneri@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/i915_drv.h     |  2 ++
 drivers/gpu/drm/i915/intel_uncore.c | 54 ++++++++++++++++---------------------
 2 files changed, 25 insertions(+), 31 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 23bc43d23d2c..4cd727376d1d 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -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;
diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c
index 478364057812..079102b46fd3 100644
--- a/drivers/gpu/drm/i915/intel_uncore.c
+++ b/drivers/gpu/drm/i915/intel_uncore.c
@@ -231,19 +231,21 @@ intel_uncore_fw_release_timer(struct hrtimer *timer)
 {
 	struct intel_uncore_forcewake_domain *domain =
 	       container_of(timer, struct intel_uncore_forcewake_domain, timer);
+	struct drm_i915_private *dev_priv = domain->i915;
 	unsigned long irqflags;
 
-	assert_rpm_device_not_suspended(domain->i915);
+	assert_rpm_device_not_suspended(dev_priv);
 
-	spin_lock_irqsave(&domain->i915->uncore.lock, irqflags);
+	spin_lock_irqsave(&dev_priv->uncore.lock, irqflags);
 	if (WARN_ON(domain->wake_count == 0))
 		domain->wake_count++;
 
-	if (--domain->wake_count == 0)
-		domain->i915->uncore.funcs.force_wake_put(domain->i915,
-							  1 << domain->id);
+	if (--domain->wake_count == 0) {
+		dev_priv->uncore.funcs.force_wake_put(dev_priv, domain->mask);
+		dev_priv->uncore.fw_domains_active &= ~domain->mask;
+	}
 
-	spin_unlock_irqrestore(&domain->i915->uncore.lock, irqflags);
+	spin_unlock_irqrestore(&dev_priv->uncore.lock, irqflags);
 
 	return HRTIMER_NORESTART;
 }
@@ -254,7 +256,7 @@ void intel_uncore_forcewake_reset(struct drm_i915_private *dev_priv,
 	unsigned long irqflags;
 	struct intel_uncore_forcewake_domain *domain;
 	int retry_count = 100;
-	enum forcewake_domains fw = 0, active_domains;
+	enum forcewake_domains fw, active_domains;
 
 	/* Hold uncore.lock across reset to prevent any register access
 	 * with forcewake not set correctly. Wait until all pending
@@ -291,10 +293,7 @@ void intel_uncore_forcewake_reset(struct drm_i915_private *dev_priv,
 
 	WARN_ON(active_domains);
 
-	for_each_fw_domain(domain, dev_priv)
-		if (domain->wake_count)
-			fw |= domain->mask;
-
+	fw = dev_priv->uncore.fw_domains_active;
 	if (fw)
 		dev_priv->uncore.funcs.force_wake_put(dev_priv, fw);
 
@@ -443,9 +442,6 @@ static void __intel_uncore_forcewake_get(struct drm_i915_private *dev_priv,
 {
 	struct intel_uncore_forcewake_domain *domain;
 
-	if (!dev_priv->uncore.funcs.force_wake_get)
-		return;
-
 	fw_domains &= dev_priv->uncore.fw_domains;
 
 	for_each_fw_domain_masked(domain, fw_domains, dev_priv) {
@@ -453,8 +449,10 @@ static void __intel_uncore_forcewake_get(struct drm_i915_private *dev_priv,
 			fw_domains &= ~domain->mask;
 	}
 
-	if (fw_domains)
+	if (fw_domains) {
 		dev_priv->uncore.funcs.force_wake_get(dev_priv, fw_domains);
+		dev_priv->uncore.fw_domains_active |= fw_domains;
+	}
 }
 
 /**
@@ -509,9 +507,6 @@ static void __intel_uncore_forcewake_put(struct drm_i915_private *dev_priv,
 {
 	struct intel_uncore_forcewake_domain *domain;
 
-	if (!dev_priv->uncore.funcs.force_wake_put)
-		return;
-
 	fw_domains &= dev_priv->uncore.fw_domains;
 
 	for_each_fw_domain_masked(domain, fw_domains, dev_priv) {
@@ -567,13 +562,10 @@ void intel_uncore_forcewake_put__locked(struct drm_i915_private *dev_priv,
 
 void assert_forcewakes_inactive(struct drm_i915_private *dev_priv)
 {
-	struct intel_uncore_forcewake_domain *domain;
-
 	if (!dev_priv->uncore.funcs.force_wake_get)
 		return;
 
-	for_each_fw_domain(domain, dev_priv)
-		WARN_ON(domain->wake_count);
+	WARN_ON(dev_priv->uncore.fw_domains_active);
 }
 
 /* We give fast paths for the really cool registers */
@@ -878,18 +870,18 @@ static inline void __force_wake_auto(struct drm_i915_private *dev_priv,
 	if (WARN_ON(!fw_domains))
 		return;
 
-	/* Ideally GCC would be constant-fold and eliminate this loop */
-	for_each_fw_domain_masked(domain, fw_domains, dev_priv) {
-		if (domain->wake_count) {
-			fw_domains &= ~domain->mask;
-			continue;
-		}
+	/* Turn on all requested but inactive supported forcewake domains. */
+	fw_domains &= dev_priv->uncore.fw_domains;
+	fw_domains &= ~dev_priv->uncore.fw_domains_active;
 
-		fw_domain_arm_timer(domain);
-	}
+	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);
 
-	if (fw_domains)
 		dev_priv->uncore.funcs.force_wake_get(dev_priv, fw_domains);
+		dev_priv->uncore.fw_domains_active |= fw_domains;
+	}
 }
 
 #define __gen6_read(x) \
-- 
2.7.4

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* [PATCH 3/3] drm/i915: Do not inline forcewake taking in mmio accessors
  2016-09-28 12:25 [PATCH 0/3] Misc forcewake patches Tvrtko Ursulin
  2016-09-28 12:25 ` [PATCH 1/3] drm/i915: Remove redundant hsw_write* mmio functions Tvrtko Ursulin
  2016-09-28 12:25 ` [PATCH 2/3] drm/i915: Keep track of active forcewake domains in a bitmask Tvrtko Ursulin
@ 2016-09-28 12:25 ` Tvrtko Ursulin
  2016-09-28 12:38   ` Chris Wilson
  2016-09-28 13:22 ` ✗ Fi.CI.BAT: warning for Misc forcewake patches Patchwork
  2016-09-28 16:28 ` ✓ Fi.CI.BAT: success for Misc forcewake patches (rev2) Patchwork
  4 siblings, 1 reply; 11+ messages in thread
From: Tvrtko Ursulin @ 2016-09-28 12:25 UTC (permalink / raw)
  To: Intel-gfx

From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

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.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 drivers/gpu/drm/i915/intel_uncore.c | 25 +++++++++++++++----------
 1 file changed, 15 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c
index 079102b46fd3..c887ab0947c6 100644
--- a/drivers/gpu/drm/i915/intel_uncore.c
+++ b/drivers/gpu/drm/i915/intel_uncore.c
@@ -862,11 +862,22 @@ __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 void ___force_wake_auto(struct drm_i915_private *dev_priv,
+			       enum forcewake_domains fw_domains)
 {
 	struct intel_uncore_forcewake_domain *domain;
 
+	/* 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;
+}
+
+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 +885,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) \
-- 
2.7.4

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH 3/3] drm/i915: Do not inline forcewake taking in mmio accessors
  2016-09-28 12:25 ` [PATCH 3/3] drm/i915: Do not inline forcewake taking in mmio accessors Tvrtko Ursulin
@ 2016-09-28 12:38   ` Chris Wilson
  2016-09-28 15:23     ` [PATCH v2] " Tvrtko Ursulin
  0 siblings, 1 reply; 11+ messages in thread
From: Chris Wilson @ 2016-09-28 12:38 UTC (permalink / raw)
  To: Tvrtko Ursulin; +Cc: Intel-gfx

On Wed, Sep 28, 2016 at 01:25:46PM +0100, Tvrtko Ursulin wrote:
> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> 
> 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.
> 
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_uncore.c | 25 +++++++++++++++----------
>  1 file changed, 15 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c
> index 079102b46fd3..c887ab0947c6 100644
> --- a/drivers/gpu/drm/i915/intel_uncore.c
> +++ b/drivers/gpu/drm/i915/intel_uncore.c
> @@ -862,11 +862,22 @@ __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)

noinline just to reinforce?

> +static void ___force_wake_auto(struct drm_i915_private *dev_priv,
> +			       enum forcewake_domains fw_domains)
>  {
>  	struct intel_uncore_forcewake_domain *domain;
>  
> +	/* Ideally GCC would be constant-fold and eliminate this loop */

That comment no longer applies, since we are now out of line.

> +	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 +885,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;

Ok, that seems a reasonable justification (and that is what would neuter
the /* Ideally... */ comment).
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* ✗ Fi.CI.BAT: warning for Misc forcewake patches
  2016-09-28 12:25 [PATCH 0/3] Misc forcewake patches Tvrtko Ursulin
                   ` (2 preceding siblings ...)
  2016-09-28 12:25 ` [PATCH 3/3] drm/i915: Do not inline forcewake taking in mmio accessors Tvrtko Ursulin
@ 2016-09-28 13:22 ` Patchwork
  2016-09-28 16:28 ` ✓ Fi.CI.BAT: success for Misc forcewake patches (rev2) Patchwork
  4 siblings, 0 replies; 11+ messages in thread
From: Patchwork @ 2016-09-28 13:22 UTC (permalink / raw)
  To: Tvrtko Ursulin; +Cc: intel-gfx

== Series Details ==

Series: Misc forcewake patches
URL   : https://patchwork.freedesktop.org/series/13016/
State : warning

== Summary ==

Series 13016v1 Misc forcewake patches
https://patchwork.freedesktop.org/api/1.0/series/13016/revisions/1/mbox/

Test kms_pipe_crc_basic:
        Subgroup nonblocking-crc-pipe-b-frame-sequence:
                dmesg-warn -> PASS       (fi-ilk-650)
Test kms_psr_sink_crc:
        Subgroup psr_basic:
                pass       -> DMESG-WARN (fi-skl-6700hq)
Test pm_rpm:
        Subgroup basic-pci-d3-state:
                pass       -> DMESG-WARN (fi-skl-6770hq)

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-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:221  dwarn:1   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:227  dwarn:2   dfail:0   fail:1   skip:14 
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_2585/

bdb6dbd5e9c1a8dc3ccdd7964092cf5d6bc08ca2 drm-intel-nightly: 2016y-09m-28d-12h-10m-04s UTC integration manifest
3a2cfbd drm/i915: Do not inline forcewake taking in mmio accessors
75ee595 drm/i915: Keep track of active forcewake domains in a bitmask
47cf3c0 drm/i915: Remove redundant hsw_write* mmio functions

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH 1/3] drm/i915: Remove redundant hsw_write* mmio functions
  2016-09-28 12:25 ` [PATCH 1/3] drm/i915: Remove redundant hsw_write* mmio functions Tvrtko Ursulin
@ 2016-09-28 13:28   ` Joonas Lahtinen
  2016-09-28 19:09   ` Chris Wilson
  1 sibling, 0 replies; 11+ messages in thread
From: Joonas Lahtinen @ 2016-09-28 13:28 UTC (permalink / raw)
  To: Tvrtko Ursulin, Intel-gfx

On ke, 2016-09-28 at 13:25 +0100, Tvrtko Ursulin wrote:
> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> 
> They are completely identical to gen6_write* ones.

Seems to be true.

Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>

Regards, Joonas
-- 
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* [PATCH v2] drm/i915: Do not inline forcewake taking in mmio accessors
  2016-09-28 12:38   ` Chris Wilson
@ 2016-09-28 15:23     ` Tvrtko Ursulin
  2016-09-28 19:10       ` Chris Wilson
  0 siblings, 1 reply; 11+ messages in thread
From: Tvrtko Ursulin @ 2016-09-28 15:23 UTC (permalink / raw)
  To: Intel-gfx

From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

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)

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 drivers/gpu/drm/i915/intel_uncore.c | 24 ++++++++++++++----------
 1 file changed, 14 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c
index 079102b46fd3..60137a164094 100644
--- a/drivers/gpu/drm/i915/intel_uncore.c
+++ b/drivers/gpu/drm/i915/intel_uncore.c
@@ -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) \
-- 
2.7.4

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* ✓ Fi.CI.BAT: success for Misc forcewake patches (rev2)
  2016-09-28 12:25 [PATCH 0/3] Misc forcewake patches Tvrtko Ursulin
                   ` (3 preceding siblings ...)
  2016-09-28 13:22 ` ✗ Fi.CI.BAT: warning for Misc forcewake patches Patchwork
@ 2016-09-28 16:28 ` Patchwork
  4 siblings, 0 replies; 11+ messages in thread
From: Patchwork @ 2016-09-28 16:28 UTC (permalink / raw)
  To: Tvrtko Ursulin; +Cc: intel-gfx

== Series Details ==

Series: Misc forcewake patches (rev2)
URL   : https://patchwork.freedesktop.org/series/13016/
State : success

== Summary ==

Series 13016v2 Misc forcewake patches
https://patchwork.freedesktop.org/api/1.0/series/13016/revisions/2/mbox/


fi-bdw-5557u     total:33   pass:26   dwarn:0   dfail:1   fail:0   skip:5  
fi-bsw-n3050     total:33   pass:24   dwarn:0   dfail:1   fail:0   skip:7  
fi-bxt-t5700     total:33   pass:24   dwarn:0   dfail:1   fail:0   skip:7  
fi-byt-j1900     total:33   pass:27   dwarn:0   dfail:1   fail:0   skip:4  
fi-byt-n2820     total:33   pass:23   dwarn:0   dfail:1   fail:0   skip:8  
fi-hsw-4770      total:33   pass:24   dwarn:0   dfail:1   fail:0   skip:7  
fi-hsw-4770r     total:33   pass:24   dwarn:0   dfail:1   fail:0   skip:7  
fi-ilk-650       total:33   pass:12   dwarn:0   dfail:1   fail:0   skip:19 
fi-ivb-3520m     total:33   pass:27   dwarn:0   dfail:1   fail:0   skip:4  
fi-ivb-3770      total:33   pass:27   dwarn:0   dfail:1   fail:0   skip:4  
fi-skl-6260u     total:33   pass:26   dwarn:0   dfail:1   fail:0   skip:5  
fi-skl-6700hq    total:33   pass:25   dwarn:0   dfail:1   fail:0   skip:6  
fi-skl-6700k     total:33   pass:23   dwarn:1   dfail:1   fail:0   skip:7  
fi-skl-6770hq    total:33   pass:26   dwarn:0   dfail:1   fail:0   skip:5  
fi-snb-2520m     total:33   pass:26   dwarn:0   dfail:1   fail:0   skip:5  
fi-snb-2600      total:33   pass:26   dwarn:0   dfail:1   fail:0   skip:5  

Results at /archive/results/CI_IGT_test/Patchwork_2587/

edf68a3aacccc2ad1ff8915fcc8011ad43d53be9 drm-intel-nightly: 2016y-09m-28d-15h-13m-34s UTC integration manifest
6ea9a57 drm/i915: Do not inline forcewake taking in mmio accessors
ce3df76 drm/i915: Keep track of active forcewake domains in a bitmask
338c6a5 drm/i915: Remove redundant hsw_write* mmio functions

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH 1/3] drm/i915: Remove redundant hsw_write* mmio functions
  2016-09-28 12:25 ` [PATCH 1/3] drm/i915: Remove redundant hsw_write* mmio functions Tvrtko Ursulin
  2016-09-28 13:28   ` Joonas Lahtinen
@ 2016-09-28 19:09   ` Chris Wilson
  1 sibling, 0 replies; 11+ messages in thread
From: Chris Wilson @ 2016-09-28 19:09 UTC (permalink / raw)
  To: Tvrtko Ursulin; +Cc: Intel-gfx

On Wed, Sep 28, 2016 at 01:25:44PM +0100, Tvrtko Ursulin wrote:
> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> 
> They are completely identical to gen6_write* ones.

iirc, the difference used to be mmiodebug.
 
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH v2] drm/i915: Do not inline forcewake taking in mmio accessors
  2016-09-28 15:23     ` [PATCH v2] " Tvrtko Ursulin
@ 2016-09-28 19:10       ` Chris Wilson
  0 siblings, 0 replies; 11+ messages in thread
From: Chris Wilson @ 2016-09-28 19:10 UTC (permalink / raw)
  To: Tvrtko Ursulin; +Cc: Intel-gfx

On Wed, Sep 28, 2016 at 04:23:50PM +0100, Tvrtko Ursulin wrote:
> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> 
> 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)
> 
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

end of thread, other threads:[~2016-09-28 19:10 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-28 12:25 [PATCH 0/3] Misc forcewake patches Tvrtko Ursulin
2016-09-28 12:25 ` [PATCH 1/3] drm/i915: Remove redundant hsw_write* mmio functions Tvrtko Ursulin
2016-09-28 13:28   ` Joonas Lahtinen
2016-09-28 19:09   ` Chris Wilson
2016-09-28 12:25 ` [PATCH 2/3] drm/i915: Keep track of active forcewake domains in a bitmask Tvrtko Ursulin
2016-09-28 12:25 ` [PATCH 3/3] drm/i915: Do not inline forcewake taking in mmio accessors Tvrtko Ursulin
2016-09-28 12:38   ` Chris Wilson
2016-09-28 15:23     ` [PATCH v2] " Tvrtko Ursulin
2016-09-28 19:10       ` Chris Wilson
2016-09-28 13:22 ` ✗ Fi.CI.BAT: warning for Misc forcewake patches Patchwork
2016-09-28 16:28 ` ✓ Fi.CI.BAT: success for Misc forcewake patches (rev2) Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.