From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Du, Changbin" Subject: Re: [PATCH] drm/i915: make context status notifier head be per engine Date: Mon, 13 Mar 2017 10:14:26 +0800 Message-ID: <20170313021426.GA4657@intel.com> References: <20170302112305.9628-1-changbin.du@intel.com> <20170309112724.5263-1-changbin.du@intel.com> <20170310171717.GF28427@nuc-i3427.alporthouse.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0427622474==" Return-path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by gabe.freedesktop.org (Postfix) with ESMTPS id DAC196E24C for ; Mon, 13 Mar 2017 02:16:56 +0000 (UTC) In-Reply-To: <20170310171717.GF28427@nuc-i3427.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, daniel.vetter@intel.com List-Id: intel-gfx@lists.freedesktop.org --===============0427622474== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="XsQoSWH+UP9D9v3l" Content-Disposition: inline --XsQoSWH+UP9D9v3l Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable hi, chris, On Fri, Mar 10, 2017 at 05:17:17PM +0000, Chris Wilson wrote: > On Thu, Mar 09, 2017 at 07:27:24PM +0800, changbin.du@intel.com wrote: > > From: Changbin Du > >=20 > > GVTg has introduced the context status notifier to schedule the GVTg > > workload. At that time, the notifier is bound to GVTg context only, > > so GVTg is not aware of host workloads. > >=20 > > Now we are going to improve GVTg's guest workload scheduler policy, > > and add Guc emulation support for new Gen graphics. Both these two > > features require acknowledgment for all contexts running on hardware. > > (But will not alter host workload.) So here try to make some change. > >=20 > > The change is simple: > > 1. Move the context status notifier head from i915_gem_context to > > intel_engine_cs. Which means there is a notifier head per engine > > instead of per context. Execlist driver still call notifier for > > each context sched-in/out events of current engine. > > 2. At GVTg side, it binds a notifier_block for each physical engine > > at GVTg initialization period. Then GVTg can hear all context > > status events. > >=20 > > In this patch, GVTg do nothing for host context event, but later > > will add a function there. But in any case, the notifier callback is > > a noop if this is no active vGPU. > >=20 > > Since intel_gvt_init() is called at early initialization stage and > > require the status notifier head has been initiated, I initiate it in > > intel_engine_setup(). > >=20 > > Signed-off-by: Changbin Du > Reviewed-by: Chris Wilson >=20 > I presume you will apply this via gvt? > Sure, I'll sync with zhenyu about this. Then update patch with below 'bonus newline' fixed. Thanks. > > diff --git a/drivers/gpu/drm/i915/gvt/scheduler.c b/drivers/gpu/drm/i91= 5/gvt/scheduler.c > > index d3a56c9..64875ec 100644 > > --- a/drivers/gpu/drm/i915/gvt/scheduler.c > > +++ b/drivers/gpu/drm/i915/gvt/scheduler.c > > @@ -127,15 +127,14 @@ static int populate_shadow_context(struct intel_v= gpu_workload *workload) > > return 0; > > } > > =20 > > + >=20 > Bonus newline >=20 > > static int shadow_context_status_change(struct notifier_block *nb, > > unsigned long action, void *data) > > { > > - struct intel_vgpu *vgpu =3D container_of(nb, > > - struct intel_vgpu, shadow_ctx_notifier_block); > > - struct drm_i915_gem_request *req =3D > > - (struct drm_i915_gem_request *)data; > > - struct intel_gvt_workload_scheduler *scheduler =3D > > - &vgpu->gvt->scheduler; > > + struct drm_i915_gem_request *req =3D (struct drm_i915_gem_request *)d= ata; > > + struct intel_gvt *gvt =3D container_of(nb, struct intel_gvt, > > + shadow_ctx_notifier_block[req->engine->id]); > > + struct intel_gvt_workload_scheduler *scheduler =3D &gvt->scheduler; > > struct intel_vgpu_workload *workload =3D > > scheduler->current_workload[req->engine->id]; > > =20 >=20 > --=20 > Chris Wilson, Intel Open Source Technology Centre --=20 Thanks, Changbin Du --XsQoSWH+UP9D9v3l Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJYxgCCAAoJEAanuZwLnPNUraIH/iev04eyHfHWfEL9jc2kMBV3 Uspe3TNgRU02IpxjBY7cAzvH8dDVV9fLl2pt+W2AaGdEEL3uhXGmJi38JTOVI+R9 7agt24xftORtdrw3Vy7wz413I2ofd9uRLU9huL7qFsbD2pMz5M2sDIi1/ZORvJ9P IBQcigfF8asjtDWW9Xfb7GEk7Px2yozt1ZH73byb3gJmNEsscCeA+MCq3WPfYUW2 suGb4d0swS4Wl9wN6lrZPHK5ZYFlpl9Jom2UCc6wXMKgdrtLPcoek4csKvJDgOL1 dJQfKAXpS4VrdjjFq636lAl3N54Sf5mQZB4CegnrBYba9/AbL6W6y+nP7nOTL48= =bRH4 -----END PGP SIGNATURE----- --XsQoSWH+UP9D9v3l-- --===============0427622474== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KSW50ZWwtZ2Z4 IG1haWxpbmcgbGlzdApJbnRlbC1nZnhAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vaW50ZWwtZ2Z4Cg== --===============0427622474==--