From patchwork Tue Nov 10 23:27:36 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: yu.dai@intel.com X-Patchwork-Id: 7592631 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id B0A76BF90C for ; Tue, 10 Nov 2015 23:30:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F07C9205E6 for ; Tue, 10 Nov 2015 23:30:31 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 2AFB6205E3 for ; Tue, 10 Nov 2015 23:30:31 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9B8E16E514; Tue, 10 Nov 2015 15:30:30 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTP id 531296E514 for ; Tue, 10 Nov 2015 15:30:29 -0800 (PST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP; 10 Nov 2015 15:30:07 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,272,1444719600"; d="scan'208";a="833444234" Received: from alex-hsw.fm.intel.com ([10.19.83.10]) by fmsmga001.fm.intel.com with ESMTP; 10 Nov 2015 15:30:07 -0800 From: yu.dai@intel.com To: intel-gfx@lists.freedesktop.org Date: Tue, 10 Nov 2015 15:27:36 -0800 Message-Id: <1447198056-24065-1-git-send-email-yu.dai@intel.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <20151109101509.GD22414@nuc-i3427.alporthouse.com> References: <20151109101509.GD22414@nuc-i3427.alporthouse.com> Subject: [Intel-gfx] [PATCH v1] drm/i915/guc: Fix a fw content lost issue after it is evicted X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Alex Dai We keep a copy of GuC fw in a GEM obj. However its content is lost if the GEM obj is swapped (igt/gem_evict_*). Therefore, the later fw loading during GPU reset will fail. Mark the obj dirty after copying data into the pages. So its content will be kept during swapped out. Signed-off-by: Alex Dai --- drivers/gpu/drm/i915/i915_gem.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index f1e3fde..3b15167 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -5199,6 +5199,7 @@ i915_gem_object_create_from_data(struct drm_device *dev, i915_gem_object_pin_pages(obj); sg = obj->pages; bytes = sg_copy_from_buffer(sg->sgl, sg->nents, (void *)data, size); + obj->dirty = 1; i915_gem_object_unpin_pages(obj); if (WARN_ON(bytes != size)) {