From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jesse Barnes Subject: Re: [PATCH 12/18] drm/i915: try to reset the gpu before unload Date: Fri, 30 Mar 2012 09:54:31 -0700 Message-ID: <20120330095431.1185a765@jbarnes-desktop> References: <1332103198-25852-1-git-send-email-ben@bwidawsk.net> <1332103198-25852-13-git-send-email-ben@bwidawsk.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0114994953==" Return-path: Received: from oproxy4-pub.bluehost.com (oproxy4-pub.bluehost.com [69.89.21.11]) by gabe.freedesktop.org (Postfix) with SMTP id 644569E9F2 for ; Fri, 30 Mar 2012 09:54:40 -0700 (PDT) In-Reply-To: <1332103198-25852-13-git-send-email-ben@bwidawsk.net> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: Ben Widawsky Cc: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org --===============0114994953== Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/D4k=xfgI/4kuNdZ7ZRR47DB"; protocol="application/pgp-signature" --Sig_/D4k=xfgI/4kuNdZ7ZRR47DB Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Sun, 18 Mar 2012 13:39:52 -0700 Ben Widawsky wrote: > paranoia >=20 > For context support the HW expects the default context to always be > available as there is no way to shut off HW contexts once turned on > (afaics). This is problematic when unloading the driver as we have no > way to prevent the GPU from expecting the BO to still be present once > unloaded. >=20 > The best we can do to remedy the situation is to attempt a GPU reset > when doing the unload. >=20 > NOTE: this patch isn't *really* required to go with the rest of the > context serious. >=20 > Signed-off-by: Ben Widawsky > --- > drivers/gpu/drm/i915/i915_gem.c | 3 +++ > 1 file changed, 3 insertions(+) >=20 > diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_= gem.c > index c1aab45..848cc45 100644 > --- a/drivers/gpu/drm/i915/i915_gem.c > +++ b/drivers/gpu/drm/i915/i915_gem.c > @@ -3910,6 +3910,9 @@ i915_gem_lastclose(struct drm_device *dev) > ret =3D i915_gem_idle(dev); > if (ret) > DRM_ERROR("failed to idle hardware: %d\n", ret); > + ret =3D i915_reset(dev, GRDOM_FULL); > + if (ret) > + DRM_ERROR("failed to reset gpu: %d\n", ret); > } > =20 > static void This reminds me that we should make our reset finer grained. We generally only need to reset the render engine when we detect an error, but today we reset display and media unconditionally too. Not resetting the display would make reset more invisible like it ought to be... I haven't tested it, but it's yet another thing for our TODO list. --=20 Jesse Barnes, Intel Open Source Technology Center --Sig_/D4k=xfgI/4kuNdZ7ZRR47DB Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iQIcBAEBAgAGBQJPdeVHAAoJEIEoDkX4Qk9hh00P/3TFoirzwLECWXynBL0741VT IwQG3w8eCzZptu+nGYy+nHbXY2bWJqtBqdG1NSS/fGnfLuQZXw/a8xwuv31I5Z8q /xm3WjhaZX69IsOEJuBWBNRu0j8ulpDxg3dBTOoGm0HQ5Ku1k++83uKQ2YKai/FC taLsiTdBnPqu1hKuzmDn9Xh8avtxnaNqz5jq91fuftV7GH/jtCq2gy2D+NwWHG65 MKO36toABGfaQ4XlwCTSMdxrWgZ/WQkXEMBwEW20PBnDL879bL7hohu1XgNA0tP4 /nIlS1OjzNl4zfD0m43ZQFnhQgieHHk3AidCFOJ56/qLLzxbjjtMBeSl1Y0M86ur TSSKNtAyzbVDtkbNk8AR6AX4wr8mm0vqLb57yPhL7Hx1LTOR3D+/H5ievoQ7MHcr Cpx+3iPYuPi3NYBMNO64Y6EpUkGhacpLJ4hrKI58vvDGkenEip1gx7FixyWijXPO mLPR3Q++nkfROCGJFzyLTSBLEISly6t+tgz3+sBnIK9pVV6e65v8+CReDDcyqisP cZ+5VE9kyYGAQDW/XRxDmOdADlwtpsPIUHW1Nep1l3v5upyZBzmS7vR1lyzqHl94 zsKxTcwjj6LNpgCJXrq8Zuv8Kcx9BrViW7zSRCKovnAsv5B0J1ds8q0Rh+ZclPDl mvemJZNnki55677ys/AM =Sspv -----END PGP SIGNATURE----- --Sig_/D4k=xfgI/4kuNdZ7ZRR47DB-- --===============0114994953== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx --===============0114994953==--