From patchwork Tue Dec 2 01:19:15 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Roper X-Patchwork-Id: 5416411 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.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E823FBEEA8 for ; Tue, 2 Dec 2014 01:19:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 33B0F20274 for ; Tue, 2 Dec 2014 01:19:41 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 4A1F020211 for ; Tue, 2 Dec 2014 01:19:40 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AC0436E795; Mon, 1 Dec 2014 17:19:39 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTP id D5A416E795 for ; Mon, 1 Dec 2014 17:19:38 -0800 (PST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 01 Dec 2014 17:19:36 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.07,497,1413270000"; d="scan'208";a="641053485" Received: from mdroper-hswdev.fm.intel.com (HELO mdroper-hswdev) ([10.1.134.215]) by fmsmga002.fm.intel.com with ESMTP; 01 Dec 2014 17:19:31 -0800 Received: from mattrope by mdroper-hswdev with local (Exim 4.82) (envelope-from ) id 1Xvc7n-00009G-0B; Mon, 01 Dec 2014 17:19:31 -0800 From: Matt Roper To: intel-gfx@lists.freedesktop.org Date: Mon, 1 Dec 2014 17:19:15 -0800 Message-Id: <1417483155-537-1-git-send-email-matthew.d.roper@intel.com> X-Mailer: git-send-email 1.8.5.1 Subject: [Intel-gfx] [PATCH] drm/i915: Fix build warning in debugfs 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.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_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 i915_gem_obj_ggtt_pin() is marked as __must_check, but one callsite in debugfs (i915_dump_lrc) was not checking the return value. Add the necessary check and make the debugfs node print something semi-reasonable if we were to fail to pin. I believe there's already in-progress discussion on the mailing list about how this area of the code is going to be reworked in general. But in the meantime, this is just a quick fix to shut up the compiler warning. This warning was added in commit: commit dcb4c12a687710ab745c2cdee8298c3e97f6f707 Author: Oscar Mateo Date: Thu Nov 13 10:28:10 2014 +0000 drm/i915/bdw: Pin the context backing objects to GGTT on-demand Cc: Oscar Mateo Cc: Thomas Daniel Signed-off-by: Matt Roper Tested-By: PRC QA PRTS (Patch Regression Test System Contact: shuang.he@intel.com) --- drivers/gpu/drm/i915/i915_debugfs.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c index 7ea3843..9934ec9 100644 --- a/drivers/gpu/drm/i915/i915_debugfs.c +++ b/drivers/gpu/drm/i915/i915_debugfs.c @@ -1801,10 +1801,15 @@ static int i915_dump_lrc(struct seq_file *m, void *unused) if (ctx_obj) { struct page *page; uint32_t *reg_state; - int j; + int ret, j; - i915_gem_obj_ggtt_pin(ctx_obj, + ret = i915_gem_obj_ggtt_pin(ctx_obj, GEN8_LR_CONTEXT_ALIGN, 0); + if (ret) { + seq_printf(m, "CONTEXT: %s (unavail)\n", + ring->name); + continue; + } page = i915_gem_object_get_page(ctx_obj, 1); reg_state = kmap_atomic(page);