public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Make sample_c messages go faster on Haswell.
@ 2014-10-29 22:12 Kenneth Graunke
  2014-10-30  8:50 ` Ville Syrjälä
  2014-11-07 18:46 ` Matt Turner
  0 siblings, 2 replies; 23+ messages in thread
From: Kenneth Graunke @ 2014-10-29 22:12 UTC (permalink / raw)
  To: intel-gfx

Haswell significantly improved the performance of sampler_c messages,
but the optimization appears to be off by default.  Later platforms
remove this bit, and apparently always enable the optimization.

Improves performance in "Counter Strike: Global Offensive" by 18%
at default settings on Iris Pro.  No Piglit regressions.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
---
 drivers/gpu/drm/i915/i915_reg.h | 1 +
 drivers/gpu/drm/i915/intel_pm.c | 4 ++++
 2 files changed, 5 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index 77fce96..340821a 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -5952,6 +5952,7 @@ enum punit_power_well {
 #define  HSW_ROW_CHICKEN3_L3_GLOBAL_ATOMICS_DISABLE    (1 << 6)
 
 #define HALF_SLICE_CHICKEN3		0xe184
+#define   HSW_SAMPLE_C_PERFORMANCE	(1<<9)
 #define   GEN8_CENTROID_PIXEL_OPT_DIS	(1<<8)
 #define   GEN8_SAMPLER_POWER_BYPASS_DIS	(1<<1)
 
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index 7a69eba..50c72a7 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -5736,6 +5736,10 @@ static void haswell_init_clock_gating(struct drm_device *dev)
 	I915_WRITE(GEN7_GT_MODE,
 		   GEN6_WIZ_HASHING_MASK | GEN6_WIZ_HASHING_16x4);
 
+	/* Make sample_c messages faster. */
+	I915_WRITE(HALF_SLICE_CHICKEN3,
+		   _MASKED_BIT_ENABLE(HSW_SAMPLE_C_PERFORMANCE));
+
 	/* WaSwitchSolVfFArbitrationPriority:hsw */
 	I915_WRITE(GAM_ECOCHK, I915_READ(GAM_ECOCHK) | HSW_ECOCHK_ARB_PRIO_SOL);
 
-- 
2.1.2

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

^ permalink raw reply related	[flat|nested] 23+ messages in thread
* [PATCH] drm/i915: Make sample_c messages go faster on Haswell.
@ 2015-01-01  0:23 Kenneth Graunke
  2015-01-05  0:48 ` shuang.he
  2015-01-05 13:19 ` Daniel Vetter
  0 siblings, 2 replies; 23+ messages in thread
From: Kenneth Graunke @ 2015-01-01  0:23 UTC (permalink / raw)
  To: intel-gfx

Haswell significantly improved the performance of sampler_c messages,
but the optimization appears to be off by default.  Later platforms
remove this bit, and apparently always enable the optimization.

Improves performance in "Counter Strike: Global Offensive" by 18%
at default settings on Iris Pro.

This may break sampling of paletted formats (P8/A8P8/P8A8).  It's
unclear whether it affects sampling of paletted formats in general,
or just the sample_c message (which is never used).

While libva does have support for using paletted formats (primarily
for OSDs), that support appears to have been broken for at least a
year, so I couldn't observe a regression from this.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
---
 drivers/gpu/drm/i915/i915_reg.h | 1 +
 drivers/gpu/drm/i915/intel_pm.c | 4 ++++
 2 files changed, 5 insertions(+)

Resubmitting the patch to unconditionally enable this.  I tried to get
libva-intel to use paletted formats, and observe a regression...but the
only thing I found that used it was mplayer's OSD (on screen display).
Even without my patch, the colors were totally wrong with that, and it's
according to a few distro wikis, that's been the case for over a year.

If libva's code for paletted formats /is/ broken, they could always add
code to disable this bit using the command validator when fixing it.

Could we try merging this, and back it out if someone reports a
regression?  I haven't observed any problems.  It's also been quite
stable.

diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index 40ca873..0f32fd1a 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -6167,6 +6167,7 @@ enum punit_power_well {
 #define  HSW_ROW_CHICKEN3_L3_GLOBAL_ATOMICS_DISABLE    (1 << 6)
 
 #define HALF_SLICE_CHICKEN3		0xe184
+#define   HSW_SAMPLE_C_PERFORMANCE	(1<<9)
 #define   GEN8_CENTROID_PIXEL_OPT_DIS	(1<<8)
 #define   GEN8_SAMPLER_POWER_BYPASS_DIS	(1<<1)
 
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index 7d99a9c..17e84dc 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -5974,6 +5974,10 @@ static void haswell_init_clock_gating(struct drm_device *dev)
 	I915_WRITE(GEN7_GT_MODE,
 		   _MASKED_FIELD(GEN6_WIZ_HASHING_MASK, GEN6_WIZ_HASHING_16x4));
 
+	/* Make sample_c messages faster. */
+	I915_WRITE(HALF_SLICE_CHICKEN3,
+		   _MASKED_BIT_ENABLE(HSW_SAMPLE_C_PERFORMANCE));
+
 	/* WaSwitchSolVfFArbitrationPriority:hsw */
 	I915_WRITE(GAM_ECOCHK, I915_READ(GAM_ECOCHK) | HSW_ECOCHK_ARB_PRIO_SOL);
 
-- 
2.2.1

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

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

end of thread, other threads:[~2015-01-06  7:03 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-29 22:12 [PATCH] drm/i915: Make sample_c messages go faster on Haswell Kenneth Graunke
2014-10-30  8:50 ` Ville Syrjälä
2014-10-30  9:00   ` Ville Syrjälä
2014-10-30  9:32     ` Kenneth Graunke
2014-10-30 11:01       ` Ville Syrjälä
2014-10-30 17:32         ` Kenneth Graunke
2014-10-30 19:26           ` Ville Syrjälä
2014-10-30 19:57             ` Kenneth Graunke
2014-10-31  9:27               ` Ville Syrjälä
2014-10-31  9:43                 ` Jani Nikula
2014-11-03 12:48                 ` Daniel Vetter
     [not found]                   ` <CAKMK7uH7-ar7OB2sdZ0phoZJ6j8-660Nr_c5CyiZRqTfgtMGHQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-11-04  8:48                     ` [Intel-gfx] " Xiang, Haihao
2014-11-03 16:15             ` Dave Gordon
2014-11-07 18:46 ` Matt Turner
2014-11-11 10:16   ` Daniel Vetter
  -- strict thread matches above, loose matches on Subject: below --
2015-01-01  0:23 Kenneth Graunke
2015-01-05  0:48 ` shuang.he
2015-01-05 13:19 ` Daniel Vetter
2015-01-05 21:39   ` Kenneth Graunke
2015-01-06  5:11     ` Xiang, Haihao
2015-01-06  5:54       ` Kenneth Graunke
2015-01-06  6:39         ` Xiang, Haihao
2015-01-06  7:03           ` Kenneth Graunke

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox