From patchwork Thu Apr 2 15:29:28 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lucas Stach X-Patchwork-Id: 6149221 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 2687EBF4A6 for ; Thu, 2 Apr 2015 15:31:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 48E2A203AD for ; Thu, 2 Apr 2015 15:31:17 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id B990C203AE for ; Thu, 2 Apr 2015 15:31:14 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 16F286EA4E; Thu, 2 Apr 2015 08:30:59 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [92.198.50.35]) by gabe.freedesktop.org (Postfix) with ESMTP id 66EA96EA43 for ; Thu, 2 Apr 2015 08:30:57 -0700 (PDT) Received: from dude.hi.4.pengutronix.de ([10.1.0.7] helo=dude.pengutronix.de.) by metis.ext.pengutronix.de with esmtp (Exim 4.72) (envelope-from ) id 1Ydh56-0005OD-L8; Thu, 02 Apr 2015 17:30:56 +0200 From: Lucas Stach To: dri-devel@lists.freedesktop.org Subject: [PATCH RFC 026/111] staging: etnaviv: track the last known GPU position Date: Thu, 2 Apr 2015 17:29:28 +0200 Message-Id: <1427988653-754-27-git-send-email-l.stach@pengutronix.de> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1427988653-754-1-git-send-email-l.stach@pengutronix.de> References: <1427988653-754-1-git-send-email-l.stach@pengutronix.de> X-SA-Exim-Connect-IP: 10.1.0.7 X-SA-Exim-Mail-From: l.stach@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: dri-devel@lists.freedesktop.org Cc: Russell King , kernel@pengutronix.de X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 From: Russell King Signed-off-by: Russell King --- drivers/staging/etnaviv/etnaviv_buffer.c | 4 ++++ drivers/staging/etnaviv/etnaviv_gpu.c | 3 +-- drivers/staging/etnaviv/etnaviv_gpu.h | 2 ++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/staging/etnaviv/etnaviv_buffer.c b/drivers/staging/etnaviv/etnaviv_buffer.c index be2b02ce9a46..a93d5091828e 100644 --- a/drivers/staging/etnaviv/etnaviv_buffer.c +++ b/drivers/staging/etnaviv/etnaviv_buffer.c @@ -159,6 +159,10 @@ void etnaviv_buffer_queue(struct etnaviv_gpu *gpu, unsigned int event, struct et link_target = buffer->paddr + buffer->offset * 4; link_size = 6; + /* Save the event and buffer position of the new event trigger */ + gpu->event[event].fence = submit->fence; + gpu->event[event].ring_pos = buffer->offset; + /* trigger event */ CMD_LOAD_STATE(buffer, VIVS_GL_EVENT, VIVS_GL_EVENT_EVENT_ID(event) | VIVS_GL_EVENT_FROM_PE); diff --git a/drivers/staging/etnaviv/etnaviv_gpu.c b/drivers/staging/etnaviv/etnaviv_gpu.c index 55a58cb27a3d..8c88940a2bc6 100644 --- a/drivers/staging/etnaviv/etnaviv_gpu.c +++ b/drivers/staging/etnaviv/etnaviv_gpu.c @@ -781,8 +781,6 @@ int etnaviv_gpu_submit(struct etnaviv_gpu *gpu, struct etnaviv_gem_submit *submi goto fail; } - gpu->event[event].fence = submit->fence; - etnaviv_buffer_queue(gpu, event, submit); priv->lastctx = ctx; @@ -834,6 +832,7 @@ static irqreturn_t irq_handler(int irq, void *data) uint8_t event = __fls(intr); dev_dbg(gpu->dev->dev, "event %u\n", event); gpu->retired_fence = gpu->event[event].fence; + gpu->last_ring_pos = gpu->event[event].ring_pos; event_free(gpu, event); etnaviv_gpu_retire(gpu); } diff --git a/drivers/staging/etnaviv/etnaviv_gpu.h b/drivers/staging/etnaviv/etnaviv_gpu.h index 519b9344ed0c..52db3dc54079 100644 --- a/drivers/staging/etnaviv/etnaviv_gpu.h +++ b/drivers/staging/etnaviv/etnaviv_gpu.h @@ -81,6 +81,7 @@ struct etnaviv_chip_identity { struct etnaviv_event { bool used; uint32_t fence; + uint32_t ring_pos; }; struct etnaviv_gpu { @@ -102,6 +103,7 @@ struct etnaviv_gpu { uint32_t submitted_fence; uint32_t retired_fence; + uint32_t last_ring_pos; /* worker for handling active-list retiring: */ struct work_struct retire_work;