From: Kenneth Graunke Subject: Re: [PATCH] drm/i915: Make sample_c messages go faster on Haswell. Date: Thu, 30 Oct 2014 10:32:38 -0700 Message-ID: <3172682.WiaV6hDkmN@vakarian> References: <1414620763-2841-1-git-send-email-kenneth@whitecape.org> <4380504.nITrtgCgRI@vakarian> <20141030110130.GS10649@intel.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0776302790==" Return-path: Received: from smtp153.dfw.emailsrvr.com (smtp153.dfw.emailsrvr.com [67.192.241.153]) by gabe.freedesktop.org (Postfix) with ESMTP id 9FF6B6E0B8 for ; Thu, 30 Oct 2014 10:29:43 -0700 (PDT) In-Reply-To: <20141030110130.GS10649@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: Ville =?ISO-8859-1?Q?Syrj=E4l=E4?= , intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org --===============0776302790== Content-Type: multipart/signed; boundary="nextPart1604688.NI8XW0rBn8"; micalg="pgp-sha1"; protocol="application/pgp-signature" --nextPart1604688.NI8XW0rBn8 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="iso-8859-1" On Thursday, October 30, 2014 01:01:30 PM Ville Syrj=E4l=E4 wrote: > On Thu, Oct 30, 2014 at 02:32:40AM -0700, Kenneth Graunke wrote: > > On Thursday, October 30, 2014 11:00:51 AM Ville Syrj=E4l=E4 wrote: > > > On Thu, Oct 30, 2014 at 10:50:03AM +0200, Ville Syrj=E4l=E4 wrote= : > > > > On Wed, Oct 29, 2014 at 03:12:43PM -0700, Kenneth Graunke wrote= : > > > > > Haswell significantly improved the performance of sampler_c=20= messages, > > > > > but the optimization appears to be off by default. Later pla= tforms > > > > > remove this bit, and apparently always enable the optimizatio= n. > > > > >=20 > > > > > Improves performance in "Counter Strike: Global Offensive" by= 18% > > > > > at default settings on Iris Pro. No Piglit regressions. > > > >=20 > > > > Nice. We need more bits like this ;) > > > >=20 > > > > >=20 > > > > > Signed-off-by: Kenneth Graunke > > > > > --- > > > > > drivers/gpu/drm/i915/i915_reg.h | 1 + > > > > > drivers/gpu/drm/i915/intel_pm.c | 4 ++++ > > > > > 2 files changed, 5 insertions(+) > > > > >=20 > > > > > diff --git a/drivers/gpu/drm/i915/i915_reg.h=20 > > 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) > > > > > =20 > > > > > #define HALF_SLICE_CHICKEN3=09=090xe184 > > > > > +#define HSW_SAMPLE_C_PERFORMANCE=09(1<<9) > > > > > #define GEN8_CENTROID_PIXEL_OPT_DIS=09(1<<8) > > > > > #define GEN8_SAMPLER_POWER_BYPASS_DIS=09(1<<1) > > > > > =20 > > > > > diff --git a/drivers/gpu/drm/i915/intel_pm.c=20 > > 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=20 > > drm_device *dev) > > > > > =09I915_WRITE(GEN7_GT_MODE, > > > > > =09=09 GEN6_WIZ_HASHING_MASK | GEN6_WIZ_HASHING_16x4); > > > > > =20 > > > > > +=09/* Make sample_c messages faster. */ > > > >=20 > > > > I found a name for it in the w/a database. > > > >=20 > > > > WaSampleCChickenBitEnable:hsw > > > >=20 > > > > Reviewed-by: Ville Syrj=E4l=E4 > > >=20 > > > Oh actually it says palette won't work when this bit is on. I'm a= ssuming > > > that's the texture palette. Do we have any use of that anywhere? > >=20 > > That's a good point. 3DSTATE_SAMPLER_PALETTE_LOAD and the A8P8/ind= exed=20 > > formats aren't used by Mesa or xf86-video-intel, but it looks like = they=20 might=20 > > be used by libva. > >=20 > > Can someone confirm that libva does use the sampler palette? > >=20 > > If they do, what do we do about it? >=20 > I suppose the best option then would be to use an LRI from a batch, > which means the register would need to be added to the cmd parser > white list. This is one of the context saved registers so doing the > LRI just once per context should be enough. I don't like that solution. For one, it's impossible - you can't LRI f= rom=20 userspace batches, even if you add it to the kernel command parser's=20= whitelist, because the hardware scanner is still enabled. Given that I= 've=20 been waiting two years for this capability, I want to find a more immed= iate=20 solution. Another option is to have some sort of execbuf flag...maybe a 3D/Media = "usage"=20 flag. If set to 3D, write 0x6000200...if media, write 0x6000000. Or=20= something specific. I do hate adding more junk to the execbuf path, th= ough. Other ideas? > Well that's assuming libva doesn't use the default context. I'm getti= ng > another itch to drop the restore inhibit flag for default contexts. > That would actually make it possible to do these sort of things witho= ut > risking breakage to existing userspace. But I think Chris is going > scream unless the patch comes with performance data that shows it > doesn't hurt too much. I suppose it wouldn't affect Mesa much, since we never use the default = context=20 on Gen6+. But otherwise I'd probably want to see the data, like Chris.= .. --nextPart1604688.NI8XW0rBn8 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAABAgAGBQJUUnY7AAoJEFtb2gcdScw4qGcP/1PaBamNCXc72siOB0TxWg1N bhydz+/IfeOsi9HBz3OVyRfmqgyovof2ndH+UzXW7LZMoF0yWj3nDNytW+60V2qi HNqljw9SOP9PdMTzE68Xd+HICE7/U8T6+EEs3wlfSPd7NL4LDHjd++k2O484QQ3X I44Egj4Q9xpNmR9plFyvwXtlTIiO2zpNKzP8qZANkI4yURF+s4KbdwYabLTQfx3h Bc9Av+IVeww71RV+ZQdQaTMQUNjpoBtzMj/kVmtJ5NZL36gfOiFo8tu4z2nS0mrK +idIpZObpILihCeoeuvD1NyWlnq8mt6usd43Q3kvXN5VHdJhk1fAI34pbkqCjE/H Iud7vTw8f1qy5l3cMhRDiXnDGqB8YsDHER4sLJ0oy8G95UrkxJ4g96/lWKwj49Ys SvDJwhYoP8Rf8rFq39axUqPn09Rz0xY66a2BEueFC10XySQ/yvup4m74exoworz6 wz9UcEQ4EYcDlj1UbqCbc0Gdll88+S0svov50O7iJ2i7X4H0y/VGOnwqXBZzvbAx yA2gBThqcpOM7UCLXPCcBTwO90LCZK4dAXOlj/0hS55mRaZiDPu0D4c2Ver/WYED 7SUxJ2l4VjHOuM9LG96R0cObuqnsyObqExN7max9VTrOA5GQchxOcUde/K1HExvU AzUY2LXwRKESVcC0Wv/7 =NELN -----END PGP SIGNATURE----- --nextPart1604688.NI8XW0rBn8-- --===============0776302790== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KSW50ZWwtZ2Z4 IG1haWxpbmcgbGlzdApJbnRlbC1nZnhAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHA6Ly9saXN0 cy5mcmVlZGVza3RvcC5vcmcvbWFpbG1hbi9saXN0aW5mby9pbnRlbC1nZngK --===============0776302790==--