From patchwork Mon Aug 26 22:50:54 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rodrigo Vivi X-Patchwork-Id: 2849839 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 27366BF546 for ; Mon, 26 Aug 2013 22:54:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BAB99202AC for ; Mon, 26 Aug 2013 22:54:06 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 3722F201D3 for ; Mon, 26 Aug 2013 22:54:05 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2DBB8E5CDD for ; Mon, 26 Aug 2013 15:54:05 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-gh0-f173.google.com (mail-gh0-f173.google.com [209.85.160.173]) by gabe.freedesktop.org (Postfix) with ESMTP id 2F805E743F for ; Mon, 26 Aug 2013 15:51:24 -0700 (PDT) Received: by mail-gh0-f173.google.com with SMTP id g16so1009972ghb.4 for ; Mon, 26 Aug 2013 15:51:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=gI4ctAAZEmvYXpBsoVswJFcciI3EWsiZDa030MsNs0o=; b=Vg/zJ6QAIBgeOX6RAmrB6JzPwRvMzovCYQVzsgZuGPGmmnPEQz27QyExAVbPAlBDiu iifnCBylY3UOtdFR1HASzVvBmFyu2D1x6xkUcjR6a2SWuWkYVWMwUzCBRoZ8WEt/zy5Q sD3IwWYMUIibnpW+uZE864VstWuQ/5kYmdlT5MLkVNWE3W9BKvvxBUgOmo4VwVNy8R0S 8bwgAjMXRTiIpymYnRK0bY8doSetUwsraa6TFlDvQLIxmcdblRVRidfzrgXchqw2ABKs Y5/iWbIBE4mEIhESx1kkJli6NTsxoHBgum6nEd2akRx0XEo/HUkv67J0c9Ufg8Wmvphw 4Qqw== X-Received: by 10.236.27.3 with SMTP id d3mr2784861yha.61.1377557483622; Mon, 26 Aug 2013 15:51:23 -0700 (PDT) Received: from localhost.localdomain ([186.204.164.107]) by mx.google.com with ESMTPSA id w42sm20745880yhb.8.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 26 Aug 2013 15:51:23 -0700 (PDT) From: Rodrigo Vivi To: intel-gfx@lists.freedesktop.org Date: Mon, 26 Aug 2013 19:50:54 -0300 Message-Id: <1377557469-4078-3-git-send-email-rodrigo.vivi@gmail.com> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1377557469-4078-1-git-send-email-rodrigo.vivi@gmail.com> References: <1377557469-4078-1-git-send-email-rodrigo.vivi@gmail.com> Subject: [Intel-gfx] [PATCH 02/17] drm/i915: Rearrange the comments in i915_add_request() X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org X-Spam-Status: No, score=-6.5 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, 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: Chris Wilson The comments were a little out-of-sequence with the code, forcing the reader to jump around whilst reading. Whilst moving the comments around, add one to explain the context reference. Signed-off-by: Chris Wilson Reviewed-by: Damien Lespiau --- drivers/gpu/drm/i915/i915_gem.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 56c9104..d5c8a02 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -2063,8 +2063,6 @@ int __i915_add_request(struct intel_ring_buffer *ring, request->ring = ring; request->head = request_start; request->tail = request_ring_position; - request->ctx = ring->last_context; - request->batch_obj = obj; /* Whilst this request exists, batch_obj will be on the * active_list, and so will hold the active reference. Only when this @@ -2072,7 +2070,12 @@ int __i915_add_request(struct intel_ring_buffer *ring, * inactive_list and lose its active reference. Hence we do not need * to explicitly hold another reference here. */ + request->batch_obj = obj; + /* Hold a reference to the current context so that we can inspect + * it later in case a hangcheck error event fires. + */ + request->ctx = ring->last_context; if (request->ctx) i915_gem_context_reference(request->ctx);