From patchwork Wed Nov 12 10:53:24 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick Hoath X-Patchwork-Id: 5287581 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 B0EA4C11AC for ; Wed, 12 Nov 2014 10:57:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BB51020155 for ; Wed, 12 Nov 2014 10:57:36 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id B27592015D for ; Wed, 12 Nov 2014 10:57:35 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 347A56E48C; Wed, 12 Nov 2014 02:57:35 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTP id DAF2B6E47B for ; Wed, 12 Nov 2014 02:57:33 -0800 (PST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 12 Nov 2014 02:57:33 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.07,368,1413270000"; d="scan'208";a="606501938" Received: from nthoath-linux.isw.intel.com ([10.102.226.65]) by orsmga001.jf.intel.com with ESMTP; 12 Nov 2014 02:57:32 -0800 From: Nick Hoath To: intel-gfx@lists.freedesktop.org Date: Wed, 12 Nov 2014 10:53:24 +0000 Message-Id: <1415789607-10243-3-git-send-email-nicholas.hoath@intel.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1415789607-10243-1-git-send-email-nicholas.hoath@intel.com> References: <1415789607-10243-1-git-send-email-nicholas.hoath@intel.com> Subject: [Intel-gfx] [PATCH 2/5] drm/i915: Removed duplicate members from submit_request 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.8 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 Where there were duplicate variables for the tail, context and ring (engine) in the gem request and the execlist queue item, use the one from the request and remove the duplicate from the execlist queue item. Issue: VIZ-4274 Signed-off-by: Nick Hoath --- drivers/gpu/drm/i915/i915_debugfs.c | 4 ++-- drivers/gpu/drm/i915/i915_gem.c | 2 +- drivers/gpu/drm/i915/intel_lrc.c | 21 +++++++++------------ drivers/gpu/drm/i915/intel_lrc.h | 4 ---- 4 files changed, 12 insertions(+), 19 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c index 0d6af1c..45da79e 100644 --- a/drivers/gpu/drm/i915/i915_debugfs.c +++ b/drivers/gpu/drm/i915/i915_debugfs.c @@ -1891,11 +1891,11 @@ static int i915_execlists(struct seq_file *m, void *data) if (head_req) { struct drm_i915_gem_object *ctx_obj; - ctx_obj = head_req->ctx->engine[ring_id].state; + ctx_obj = head_req->request->ctx->engine[ring_id].state; seq_printf(m, "\tHead request id: %u\n", intel_execlists_ctx_id(ctx_obj)); seq_printf(m, "\tHead request tail: %u\n", - head_req->tail); + head_req->request->tail); } seq_putc(m, '\n'); diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 860c296..e5f521f 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -2704,7 +2704,7 @@ static void i915_gem_reset_ring_cleanup(struct drm_i915_private *dev_priv, execlist_link); list_del(&submit_req->execlist_link); intel_runtime_pm_put(dev_priv); - i915_gem_context_unreference(submit_req->ctx); + i915_gem_context_unreference(submit_req->request->ctx); kfree(submit_req); } diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c index 593471f..0e2e33b 100644 --- a/drivers/gpu/drm/i915/intel_lrc.c +++ b/drivers/gpu/drm/i915/intel_lrc.c @@ -396,7 +396,7 @@ static void execlists_context_unqueue(struct intel_engine_cs *ring) execlist_link) { if (!req0) { req0 = cursor; - } else if (req0->ctx == cursor->ctx) { + } else if (req0->request->ctx == cursor->request->ctx) { /* Same ctx: ignore first request, as second request * will update tail past first request's workload */ cursor->elsp_submitted = req0->elsp_submitted; @@ -411,9 +411,9 @@ static void execlists_context_unqueue(struct intel_engine_cs *ring) WARN_ON(req1 && req1->elsp_submitted); - execlists_submit_contexts(ring, req0->ctx, req0->tail, - req1 ? req1->ctx : NULL, - req1 ? req1->tail : 0); + execlists_submit_contexts(ring, req0->request->ctx, req0->request->tail, + req1 ? req1->request->ctx : NULL, + req1 ? req1->request->tail : 0); req0->elsp_submitted++; if (req1) @@ -434,7 +434,7 @@ static bool execlists_check_remove_request(struct intel_engine_cs *ring, if (head_req != NULL) { struct drm_i915_gem_object *ctx_obj = - head_req->ctx->engine[ring->id].state; + head_req->request->ctx->engine[ring->id].state; if (intel_execlists_ctx_id(ctx_obj) == request_id) { WARN(head_req->elsp_submitted == 0, "Never submitted head request\n"); @@ -514,13 +514,13 @@ static void execlists_free_request_task(struct work_struct *work) { struct intel_ctx_submit_request *req = container_of(work, struct intel_ctx_submit_request, work); - struct drm_device *dev = req->ring->dev; + struct drm_device *dev = req->request->ring->dev; struct drm_i915_private *dev_priv = dev->dev_private; intel_runtime_pm_put(dev_priv); mutex_lock(&dev->struct_mutex); - i915_gem_context_unreference(req->ctx); + i915_gem_context_unreference(req->request->ctx); i915_gem_request_unreference(req->request); mutex_unlock(&dev->struct_mutex); @@ -540,10 +540,6 @@ static int execlists_context_queue(struct intel_engine_cs *ring, req = kzalloc(sizeof(*req), GFP_KERNEL); if (req == NULL) return -ENOMEM; - req->ctx = to; - i915_gem_context_reference(req->ctx); - req->ring = ring; - req->tail = tail; INIT_WORK(&req->work, execlists_free_request_task); if(!request) @@ -561,6 +557,7 @@ static int execlists_context_queue(struct intel_engine_cs *ring, } req->request = request; i915_gem_request_reference(request); + i915_gem_context_reference(req->request->ctx); intel_runtime_pm_get(dev_priv); @@ -577,7 +574,7 @@ static int execlists_context_queue(struct intel_engine_cs *ring, struct intel_ctx_submit_request, execlist_link); - if (to == tail_req->ctx) { + if (to == tail_req->request->ctx) { WARN(tail_req->elsp_submitted != 0, "More than 2 already-submitted reqs queued\n"); list_del(&tail_req->execlist_link); diff --git a/drivers/gpu/drm/i915/intel_lrc.h b/drivers/gpu/drm/i915/intel_lrc.h index 6f81669..76141ce 100644 --- a/drivers/gpu/drm/i915/intel_lrc.h +++ b/drivers/gpu/drm/i915/intel_lrc.h @@ -100,10 +100,6 @@ u32 intel_execlists_ctx_id(struct drm_i915_gem_object *ctx_obj); * All accesses to the queue are mediated by a spinlock (ring->execlist_lock). */ struct intel_ctx_submit_request { - struct intel_context *ctx; - struct intel_engine_cs *ring; - u32 tail; - struct list_head execlist_link; struct work_struct work;