From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kenneth Graunke Subject: Re: [rong.r.yang@intel.com: [Intel-gfx] How user space applications load registers on HSW?] Date: Tue, 06 May 2014 11:57:24 -0700 Message-ID: <53693094.5060504@whitecape.org> References: <20140506181145.GA25374@bwidawsk.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1243697894==" Return-path: In-Reply-To: <20140506181145.GA25374@bwidawsk.net> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: mesa-dev-bounces@lists.freedesktop.org Sender: "mesa-dev" To: rong.r.yang@intel.com Cc: mesa-dev , Ben Widawsky , intel-gfx List-Id: intel-gfx@lists.freedesktop.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --===============1243697894== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="pRBoECDSOdHAtDKI3xIw5UcmMFNKx152u" This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --pRBoECDSOdHAtDKI3xIw5UcmMFNKx152u Content-Type: multipart/mixed; boundary="------------060208030906030305050807" This is a multi-part message in MIME format. --------------060208030906030305050807 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 05/06/2014 08:26:15 AM, Yang, Rong R wrote: > Hi, >=20 > I am developing the HSW=92s OCL driver in the linux. I encounter a LRI > problem on HSW. >=20 >=20 > Some gpgpu's applications, which use the shared local memory, must load= > the L3CTRLREG2 and L3CTRLREG3 registers to allocate the SLM in the L3 > cache. >=20 > So I add L3CTRLREG2 and L3CTRLREG3 to the gen7_render_regs to pass the > cmds parse when exec buffer. But it still don=92t work. >=20 > I notice that, on HSW, the commands that load the register, such as > MI_LOAD_REGISTER_IMM, will be converted to NOOP by the GPU if the batch= > buffer's MI_BATCH_NON_SECURE_HSW bit is set. And after parse cmd, the > MI_BATCH_NON_SECURE_HSW still set in the kernel. So HSW don=92t accept > LRI commands. >=20 >=20 > Can I load these registers in the user space? Or should I hack the > kernel? >=20 >=20 > Yang Rong I've been asking the kernel developers for the ability to LRI/LRM from userspace batches for around 1.5 years. Unfortunately, we're still waiting, and I honestly have no idea when they're going to finish it. In the meantime, you can apply the attached patch to your kernel tree to disable the hardware scanner, letting you run whatever commands you want. Obviously, we can't ship this on production systems, but it will allow you to do your development without having to wait for the kernel te= am. --Ken --------------060208030906030305050807 Content-Type: text/x-patch; name="disable-batchbuffer-security.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="disable-batchbuffer-security.patch" diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm= /i915/i915_gem_execbuffer.c index a3ba9a8..86c173b 100644 --- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c +++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c @@ -995,6 +995,7 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *= data, return ret; =20 flags =3D 0; + flags |=3D I915_DISPATCH_SECURE; if (args->flags & I915_EXEC_SECURE) { if (!file->is_master || !capable(CAP_SYS_ADMIN)) return -EPERM; --------------060208030906030305050807-- --pRBoECDSOdHAtDKI3xIw5UcmMFNKx152u Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQIcBAEBAgAGBQJTaTCcAAoJEFtb2gcdScw4SxUP/1e7vuYKdQcr7gd/o/METV/V MUUW0m0H1yQ7nlsP3KMKi+DmarQtK1+gYJFpBA4h02tKUtgFPkQOcGJLX49jQeHt tlIwS51td/G41dR7hUJ3ZCzahoUbIL7IB2RI/kWSTdvrsETsSHiNSqVqmEl5yrFN HmBEqLDCPB9ZWmQopHdexjwVIX5N9/OWXyahjtmM70W8ZQEeXQtZBE5CBzpnIIQM VMwMiuSEf+gexUV/mk/EhH2h+xpQYiK98FTm1p0JpTUBl4K1mC6sfatMHX6vdZWv YtSnRCfkc8/f3iE7sGH3aND73+T+3ti/InmDd5hQrfeQUh6RI/+3VL0AQ4TDC4gy KHHBbwBLDFOzlf7hw1Utyt9RJn5YEUoAWaHWZbCWAdwc/2dLCzrr3yWnBVI14zyJ F8ZTDqFpSL8NuNDQvii9wHm2P51Vpqu3jwFQ7ou5rSeIdtKrfd592aXX/S/QFqdO FXiSz9o+TeXy1wPgrgtL6xEF0hWzAPg51rDRaYsO701ZEShaEkzYwiXGISz4cGY3 IW36vlrYemg17s+2SF5Gx2lbxhq9tmbQPMobvRrppdfc/HdvfUM4TOOrOIR0eW9s tJv1H28RW3+TJCHW+2yny/hXZrOdh5x9rjVceHHoVL0o2Wf3EQ6S5u4+mn5vakpF x4tLilbrSAbDYszpaYoo =uu6E -----END PGP SIGNATURE----- --pRBoECDSOdHAtDKI3xIw5UcmMFNKx152u-- --===============1243697894== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev --===============1243697894==--