From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kenneth Graunke Subject: Re: [PATCH 1/4] i965: Transplant PIPE_CONTROL routines to brw_pipe_control Date: Fri, 01 May 2015 10:58:18 -0700 Message-ID: <2138903.0rBzGEVZ1X@eiger> References: <1421459160-2323-1-git-send-email-krh@bitplanet.net> <1430492023-20296-1-git-send-email-chris@chris-wilson.co.uk> <1430492023-20296-2-git-send-email-chris@chris-wilson.co.uk> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1648332390==" Return-path: In-Reply-To: <1430492023-20296-2-git-send-email-chris@chris-wilson.co.uk> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: mesa-dev-bounces@lists.freedesktop.org Sender: "mesa-dev" To: mesa-dev@lists.freedesktop.org, Chris Wilson Cc: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org --===============1648332390== Content-Type: multipart/signed; boundary="nextPart42074253.ztmpFNR7YY"; micalg="pgp-sha256"; protocol="application/pgp-signature" --nextPart42074253.ztmpFNR7YY Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="iso-8859-1" On Friday, May 01, 2015 03:53:40 PM Chris Wilson wrote: > Start trimming the fat from intel_batchbuffer.c. First by moving the = set > of routines for emitting PIPE_CONTROLS (along with the lore concernin= g > hardware workarounds) to a separate brw_pipe_control.c >=20 > Signed-off-by: Chris Wilson > --- > src/mesa/drivers/dri/i965/Makefile.sources | 1 + > src/mesa/drivers/dri/i965/brw_context.h | 12 + > src/mesa/drivers/dri/i965/brw_pipe_control.c | 335 ++++++++++++++++= ++++++++++ > src/mesa/drivers/dri/i965/intel_batchbuffer.c | 304 ----------------= =2D------ > src/mesa/drivers/dri/i965/intel_batchbuffer.h | 10 - > 5 files changed, 348 insertions(+), 314 deletions(-) > create mode 100644 src/mesa/drivers/dri/i965/brw_pipe_control.c >=20 > diff --git a/src/mesa/drivers/dri/i965/Makefile.sources b/src/mesa/dr= ivers/dri/i965/Makefile.sources > index 6d4659f..a9f9129 100644 > --- a/src/mesa/drivers/dri/i965/Makefile.sources > +++ b/src/mesa/drivers/dri/i965/Makefile.sources > @@ -82,6 +82,7 @@ i965_FILES =3D \ > =09brw_object_purgeable.c \ > =09brw_packed_float.c \ > =09brw_performance_monitor.c \ > +=09brw_pipe_control.c \ > =09brw_primitive_restart.c \ > =09brw_program.c \ > =09brw_program.h \ > diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drive= rs/dri/i965/brw_context.h > index e2f26f5..7241816 100644 > --- a/src/mesa/drivers/dri/i965/brw_context.h > +++ b/src/mesa/drivers/dri/i965/brw_context.h > @@ -1945,6 +1945,18 @@ gen6_upload_push_constants(struct brw_context = *brw, > struct brw_stage_state *stage_state, > enum aub_state_struct_type type); > =20 > +/* brw_pipe_control.c */ > +void brw_emit_pipe_control_flush(struct brw_context *brw, uint32_t f= lags); > +void brw_emit_pipe_control_write(struct brw_context *brw, uint32_t f= lags, > + drm_intel_bo *bo, uint32_t offset, > + uint32_t imm_lower, uint32_t imm_up= per); > +void intel_batchbuffer_emit_mi_flush(struct brw_context *brw); > +void intel_emit_post_sync_nonzero_flush(struct brw_context *brw); > +void intel_emit_depth_stall_flushes(struct brw_context *brw); > +void gen7_emit_vs_workaround_flush(struct brw_context *brw); > +void gen7_emit_cs_stall_flush(struct brw_context *brw); > + > + > #ifdef __cplusplus > } > #endif > diff --git a/src/mesa/drivers/dri/i965/brw_pipe_control.c b/src/mesa/= drivers/dri/i965/brw_pipe_control.c > new file mode 100644 > index 0000000..c216f6d > --- /dev/null > +++ b/src/mesa/drivers/dri/i965/brw_pipe_control.c > @@ -0,0 +1,335 @@ > +/*******************************************************************= ******* > + * > + * Copyright 2006 VMware, Inc. > + * All Rights Reserved. > + * > + * Permission is hereby granted, free of charge, to any person obtai= ning a > + * copy of this software and associated documentation files (the > + * "Software"), to deal in the Software without restriction, includi= ng > + * without limitation the rights to use, copy, modify, merge, publis= h, > + * distribute, sub license, and/or sell copies of the Software, and = to > + * permit persons to whom the Software is furnished to do so, subjec= t to > + * the following conditions: > + * > + * The above copyright notice and this permission notice (including = the > + * next paragraph) shall be included in all copies or substantial po= rtions > + * of the Software. > + * > + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, E= XPRESS > + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF > + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRING= EMENT. > + * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR > + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CO= NTRACT, > + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE= > + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. > + * > + *******************************************************************= *******/ I did a bit of archaeology, and all of the Tungsten Graphics code appea= rs to be long gone: gen8_add_cs_stall_workaround_bits - me (2014) gen7_cs_stall_every_four_pipe_controls - me (2014) brw_emit_pipe_control_flush - me (2013) brw_emit_pipe_control_write - me (2013) intel_emit_post_sync_nonzero_flush - Eric (2011) intel_emit_depth_stall_flushes - me (2011) gen7_emit_vs_workaround_flush - me (2012) gen7_emit_cs_stall_flush - Paul (2013) intel_batchbuffer_emit_mi_flush - Zhenyu (2010), Eric, and I So I'd use this copyright instead (with more typical formatting): /* * Copyright =A9 2010 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtainin= g a * copy of this software and associated documentation files (the "Softw= are"), * to deal in the Software without restriction, including without limit= ation * the rights to use, copy, modify, merge, publish, distribute, sublice= nse, * and/or sell copies of the Software, and to permit persons to whom th= e * Software is furnished to do so, subject to the following conditions:= * * The above copyright notice and this permission notice (including the= next * paragraph) shall be included in all copies or substantial portions o= f the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPR= ESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL= ITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT S= HALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR= OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARIS= ING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER = DEALINGS * IN THE SOFTWARE. */ I love that PIPE_CONTROL has its own source file now :D Patches 1-2 are: Reviewed-by: Kenneth Graunke --nextPart42074253.ztmpFNR7YY 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 iQIcBAABCAAGBQJVQ766AAoJEFtb2gcdScw4bLYP/3AUjEaHi4I8cF5BbJ58wb4s 75n5dTaPiX9T0nDbB8MkN86kAFX/6u7A9pSCcS7lDA/laDU2TjEP1qxI0lxFCx0e UsZhdYeFq1IVQiqNTft5SzsiylUicCjnS2DylamzRCKeRKvVmc8znRYqxB5lyRV/ /gaRohWInJ/C3IDW3STiPDZ8e9xvwaVgeq7e7CEzmljRXYkZ8vCyywWwoMm0JlhS X48U1V2U0jf8uR3LoVWqD39sLoXxSpT4XZXAhD4tRCkYzzQ61ktMtLvj3Vs+HAPs 4r1spZeTaPPDRVJB8FAhwimMNIGuAwZQsYCgWi2tJTryd/xkz+pUusEwbfXPNG/W OgYZgmrkwTcBaE7vcK+KNgx9C3aYCzMZbwX0gukfGf1JurN4trI/is8q2yu/fwY4 TPFBTlTOF3GGCClDvxLHJahqpJ9CUigrWbVQkmhLpbGUcJwqO+V+40vkAy0aLPnO WOlp8GMpz3DOrrobc6TISKgLMV7LCkOhFQDjlnredaYRPZybl3Gyp5A7TMIX0yUI Dn4GmUBU1IAzjWV2JPYQt7/uxCK+jT3uXMMv8tixXqGh7gMAjBqH9Ig7rh6Q5NxP 03zll+HnZ+kQalwGhzdWPG4J0zaIkBvtRkCrOxVXHJjK1LEnq3Kv9aaJgV5UN8hq fs/JSETfJ64YEyixgN6w =/3tV -----END PGP SIGNATURE----- --nextPart42074253.ztmpFNR7YY-- --===============1648332390== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KbWVzYS1kZXYg bWFpbGluZyBsaXN0Cm1lc2EtZGV2QGxpc3RzLmZyZWVkZXNrdG9wLm9yZwpodHRwOi8vbGlzdHMu ZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vbWVzYS1kZXYK --===============1648332390==--