From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ben Widawsky Subject: [PATCH 12/18] drm/i915: try to reset the gpu before unload Date: Sun, 18 Mar 2012 13:39:52 -0700 Message-ID: <1332103198-25852-13-git-send-email-ben@bwidawsk.net> References: <1332103198-25852-1-git-send-email-ben@bwidawsk.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from cloud01.chad-versace.us (184-106-247-128.static.cloud-ips.com [184.106.247.128]) by gabe.freedesktop.org (Postfix) with ESMTP id B7B2B9F4C7 for ; Sun, 18 Mar 2012 13:41:41 -0700 (PDT) In-Reply-To: <1332103198-25852-1-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: intel-gfx@lists.freedesktop.org Cc: Ben Widawsky List-Id: intel-gfx@lists.freedesktop.org paranoia 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. The best we can do to remedy the situation is to attempt a GPU reset when doing the unload. NOTE: this patch isn't *really* required to go with the rest of the context serious. Signed-off-by: Ben Widawsky --- drivers/gpu/drm/i915/i915_gem.c | 3 +++ 1 file changed, 3 insertions(+) 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 = i915_gem_idle(dev); if (ret) DRM_ERROR("failed to idle hardware: %d\n", ret); + ret = i915_reset(dev, GRDOM_FULL); + if (ret) + DRM_ERROR("failed to reset gpu: %d\n", ret); } static void -- 1.7.9.4