From mboxrd@z Thu Jan 1 00:00:00 1970 From: Zhenyu Wang Subject: Re: [PATCH 3/4] drm/i915: Store a pointer to intel_context in i915_request Date: Fri, 18 May 2018 18:04:57 +0800 Message-ID: <20180518100457.bvres2maie662tmm@zhen-hp.sh.intel.com> References: <20180517212633.24934-1-chris@chris-wilson.co.uk> <20180517212633.24934-3-chris@chris-wilson.co.uk> <20180518032146.iuogvb4ltddj2k4a@zhen-hp.sh.intel.com> <853c767c-e1db-50ca-5b52-6ba5fef8ee01@linux.intel.com> <152663296712.4210.4267258137100448064@mail.alporthouse.com> Reply-To: Zhenyu Wang Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1327419962==" Return-path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id D36246ECFA for ; Fri, 18 May 2018 10:15:07 +0000 (UTC) In-Reply-To: <152663296712.4210.4267258137100448064@mail.alporthouse.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: Chris Wilson Cc: intel-gfx@lists.freedesktop.org, yan.y.zhao@intel.com List-Id: intel-gfx@lists.freedesktop.org --===============1327419962== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="jfgibr7wi7ei3o2p" Content-Disposition: inline --jfgibr7wi7ei3o2p Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2018.05.18 09:42:47 +0100, Chris Wilson wrote: > Quoting Tvrtko Ursulin (2018-05-18 08:43:33) > >=20 > > On 18/05/2018 04:21, Zhenyu Wang wrote: > > > On 2018.05.17 22:26:32 +0100, Chris Wilson wrote: > > >> To ease the frequent and ugly pointer dance of > > >> &request->gem_context->engine[request->engine->id] during request > > >> submission, store that pointer as request->hw_context. One major > > >> advantage that we will exploit later is that this decouples the logi= cal > > >> context state from the engine itself. > > >> > > >> v2: Set mock_context->ops so we don't crash and burn in selftests. > > >> Cleanups from Tvrtko. > > >> > > >> Signed-off-by: Chris Wilson > > >> Cc: Tvrtko Ursulin > > >> --- > > >> drivers/gpu/drm/i915/gvt/mmio_context.c | 6 +- > > >> drivers/gpu/drm/i915/gvt/mmio_context.h | 2 +- > > >> drivers/gpu/drm/i915/gvt/scheduler.c | 141 +++++++-------= ---- > > >> drivers/gpu/drm/i915/gvt/scheduler.h | 1 - > > >=20 > > > gvt change looks fine to me. > > >=20 > > > Acked-by: Zhenyu Wang > >=20 > > Excellent, thanks! > >=20 > > And I think I already have my r-b earlier for non-GVT parts. So let me= =20 > > repeat it: > >=20 > > Reviewed-by: Tvrtko Ursulin >=20 > Thanks. Applied, please yell if I broke anything, or better yet donate > some machines to testing intel-gfx@ :) Well, looks it does break guest boot, patch mail is following. ;) I do like to have gvt regression test for CI at least for easy case e.g VM boot normal and better instruct some igt cases after boot. If that's just machine resource issue, I can raise to mangement to see if anyone can help. >=20 > There will be a few more changes to make struct intel_context a first > class citizen for i915_request if Tvrtko manages to whip me or the api > into shape. So expect a little more upheaval in the coming months. > I'm thinking an api like: >=20 > ce =3D intel_context_get_and_lock(context, engine); >=20 > rq =3D i915_request_get(ce); > ... > i915_request_add(rq); >=20 > intel_context_put_and_unlock(ce); >=20 > (get_and_lock() is a helper around _get() and _lock()) >=20 > In the gvt case, I expect you will want to manage your intel_contexts > explicitly as the ref/pin/locked phases is slightly longer for you than > the typical construct-a-request used elsewhere. Note also that the goal > is to replace the struct_mutex with fine grained locks. yeah, looks we do need better refactor for those request/context preparation and shadowing steps, even we've tried twice. --=20 Open Source Technology Center, Intel ltd. $gpg --keyserver wwwkeys.pgp.net --recv-keys 4D781827 --jfgibr7wi7ei3o2p Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EARECAB0WIQTXuabgHDW6LPt9CICxBBozTXgYJwUCWv6lSQAKCRCxBBozTXgY JxcCAKCPcgsyoqDk0JrGznirQ6wSjMWyZQCfXahZ8+XWML5QuxRinBva0rJXBiQ= =PYzC -----END PGP SIGNATURE----- --jfgibr7wi7ei3o2p-- --===============1327419962== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KSW50ZWwtZ2Z4 IG1haWxpbmcgbGlzdApJbnRlbC1nZnhAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vaW50ZWwtZ2Z4Cg== --===============1327419962==--