From patchwork Thu Nov 30 12:45:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Mika Kuoppala X-Patchwork-Id: 10084775 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 09871602B9 for ; Thu, 30 Nov 2017 12:46:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EAAA829F10 for ; Thu, 30 Nov 2017 12:46:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DF90129F7A; Thu, 30 Nov 2017 12:46:39 +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=-4.2 required=2.0 tests=BAYES_00, 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 813AE29F10 for ; Thu, 30 Nov 2017 12:46:39 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BDAF06EAD5; Thu, 30 Nov 2017 12:46:38 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by gabe.freedesktop.org (Postfix) with ESMTPS id 657F06E130 for ; Thu, 30 Nov 2017 12:46:33 +0000 (UTC) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 30 Nov 2017 04:46:32 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,341,1508828400"; d="scan'208";a="11427102" Received: from rosetta.fi.intel.com ([10.237.72.186]) by orsmga001.jf.intel.com with ESMTP; 30 Nov 2017 04:46:31 -0800 Received: by rosetta.fi.intel.com (Postfix, from userid 1000) id 4F959840017; Thu, 30 Nov 2017 14:45:59 +0200 (EET) From: Mika Kuoppala To: intel-gfx@lists.freedesktop.org Date: Thu, 30 Nov 2017 14:45:53 +0200 Message-Id: <20171130124554.21746-2-mika.kuoppala@linux.intel.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171130124554.21746-1-mika.kuoppala@linux.intel.com> References: <20171130124554.21746-1-mika.kuoppala@linux.intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [CI 2/3] drm/i915: Move execlists port head instead of memmoving array 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: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP From: Mika Kuoppala As all our access to execlist ports are through head and tail helpers, we can now move the head instead of memmoving the array. v2: use memset (Chris) Cc: MichaƂ Winiarski Cc: Joonas Lahtinen Cc: Chris Wilson Signed-off-by: Mika Kuoppala Reviewed-by: Chris Wilson --- drivers/gpu/drm/i915/intel_ringbuffer.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.h b/drivers/gpu/drm/i915/intel_ringbuffer.h index 17f1fb4ded89..6a3cb8e09ed6 100644 --- a/drivers/gpu/drm/i915/intel_ringbuffer.h +++ b/drivers/gpu/drm/i915/intel_ringbuffer.h @@ -685,13 +685,13 @@ static inline struct execlist_port * execlists_head_complete(struct intel_engine_execlists * const execlists, struct execlist_port * const port) { - const unsigned int m = execlists->port_mask; - - GEM_BUG_ON(port_index(port, execlists) != 0); + GEM_BUG_ON(port_index(port, execlists) != execlists->port_head); + GEM_BUG_ON(!port_isset(port)); GEM_BUG_ON(!execlists_is_active(execlists, EXECLISTS_ACTIVE_USER)); - memmove(port, port + 1, m * sizeof(struct execlist_port)); - memset(port + m, 0, sizeof(struct execlist_port)); + memset(port, 0, sizeof(*port)); + + execlists->port_head = port_head_add(execlists, 1); return execlists_port_head(execlists); }