From patchwork Fri Mar 8 07:52:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhenyu Wang X-Patchwork-Id: 10844295 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2EC1B17E4 for ; Fri, 8 Mar 2019 07:53:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 10A8E2E1CE for ; Fri, 8 Mar 2019 07:53:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 03C072E1E7; Fri, 8 Mar 2019 07:53:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9A4B52E1CE for ; Fri, 8 Mar 2019 07:53:12 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DAD976E296; Fri, 8 Mar 2019 07:53:10 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by gabe.freedesktop.org (Postfix) with ESMTPS id EC8906E296; Fri, 8 Mar 2019 07:53:09 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Mar 2019 23:53:09 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,455,1544515200"; d="scan'208";a="140191910" Received: from debian-nuc.sh.intel.com ([10.239.160.36]) by orsmga002.jf.intel.com with ESMTP; 07 Mar 2019 23:53:08 -0800 From: Zhenyu Wang To: intel-gfx@lists.freedesktop.org Date: Fri, 8 Mar 2019 15:52:37 +0800 Message-Id: <20190308075238.1778-1-zhenyuw@linux.intel.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH] drm/i915: relax debug BUG_ON() for closed context in hw_id pin X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: intel-gvt-dev@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP Current GVT created context is marked closed as not to be used for host user. But its hw_id should still be used. So this is to relax debug BUG_ON() in __i915_gem_context_pin_hw_id() for GVT contexts which can use force single submission flag to identify. Cc: Chris Wilson Signed-off-by: Zhenyu Wang --- drivers/gpu/drm/i915/i915_gem_context.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c index b9f321947982..0cbc5293da1c 100644 --- a/drivers/gpu/drm/i915/i915_gem_context.c +++ b/drivers/gpu/drm/i915/i915_gem_context.c @@ -1400,7 +1400,8 @@ int __i915_gem_context_pin_hw_id(struct i915_gem_context *ctx) mutex_lock(&i915->contexts.mutex); - GEM_BUG_ON(i915_gem_context_is_closed(ctx)); + GEM_BUG_ON(i915_gem_context_is_closed(ctx) && + !i915_gem_context_force_single_submission(ctx)); if (list_empty(&ctx->hw_id_link)) { GEM_BUG_ON(atomic_read(&ctx->hw_id_pin_count));