From patchwork Thu Nov 24 08:46:59 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Gmeiner X-Patchwork-Id: 9444985 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 696716071C for ; Thu, 24 Nov 2016 08:47:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6588B2711E for ; Thu, 24 Nov 2016 08:47:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5A3782787D; Thu, 24 Nov 2016 08:47:27 +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.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID 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 EDB732711E for ; Thu, 24 Nov 2016 08:47:26 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 299346E84D; Thu, 24 Nov 2016 08:47:23 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm0-x243.google.com (mail-wm0-x243.google.com [IPv6:2a00:1450:400c:c09::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3359F6E835 for ; Thu, 24 Nov 2016 08:47:12 +0000 (UTC) Received: by mail-wm0-x243.google.com with SMTP id g23so4329060wme.1 for ; Thu, 24 Nov 2016 00:47:12 -0800 (PST) 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=gmjSecg+Ja1ZKSwQYFQ8tRh5Gos+5Mgs43vLDVD/eUE=; b=e2fBlUK9m9bD3zt3pw5aj32p6n0Ni4ycACuxHbVOCASCT5eVR7foPo/yjXhGy0as0h ZhYaw61MWxrrUev1nB03zcR3XWsqUUiKKqp555QAF56wubyrXmEsKNT0U4rekVLZ2bWD 1dljypOmQPDXg8MkQEV7d2Y9K4ASDn9IoPCVs9I8rj5aeGTC1sRSjcxVtSypApKVCQar 9dFk/04TzFXOxr6zoBrLhrbrXbc1HQAUAoaX3pOs9oY3pZY2mXg8yj54HB0dCnGo2DDO REyz/CTTzxC7AE/o46zpe9Xb/OErR5nxdiFkzTS+ArKVq2azgAsESGjS+azfiyaukl3l TvKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=gmjSecg+Ja1ZKSwQYFQ8tRh5Gos+5Mgs43vLDVD/eUE=; b=F9minwNo7vCdNkikwanzas2i5Vki/rN7r55jzyGLMGywkDv7A9rgpW5+X3DwFSfhbF nWtyfGrfYCDmXj/znLaqyGS5ZcpZgal6rq9eQzPCSHuNtYNTBK/eNyqM9dJerVcUXJCo kdj3inXeu9yO+vbzOc5kLL5IzjcwckKPncAe4rQDWRmerGyMlKYE+PCvgvdsWu2Fdtr4 y/tRLz9ZSaDUTBL9urAqqPj4eLM+HCR8RyYazAc0UZOE6L1mCtW/5Em26pBEDXZN3o29 ao7Stv/psLWUw/QksDZt1sFnhH5Vyksoh17cWMR8TkfOzLgXBnapyoRdPMFkolAFU6QZ vfyQ== X-Gm-Message-State: AKaTC02lyvH4SqJyCcoDud/+nNwf2J6wlUIcvnR4RIlLbYiw2uzMfvugKIDYqGDi2WgHvg== X-Received: by 10.28.0.13 with SMTP id 13mr1245277wma.126.1479977230507; Thu, 24 Nov 2016 00:47:10 -0800 (PST) Received: from chgm-pc.bachmann.at ([185.67.228.2]) by smtp.gmail.com with ESMTPSA id l67sm7110065wmf.0.2016.11.24.00.47.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 24 Nov 2016 00:47:09 -0800 (PST) From: Christian Gmeiner To: dri-devel@lists.freedesktop.org Subject: [PATCH libdrm v4 2/2] etnaviv: add etna_pipe_wait_ns(..) Date: Thu, 24 Nov 2016 09:46:59 +0100 Message-Id: <1479977219-11477-3-git-send-email-christian.gmeiner@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1479977219-11477-1-git-send-email-christian.gmeiner@gmail.com> References: <1479977219-11477-1-git-send-email-christian.gmeiner@gmail.com> 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-Virus-Scanned: ClamAV using ClamSMTP We need to pass through a timeout parameter to implement pipe->fence_finish() properly. The new fxn accepts a timeout in nanoseconds. Simplify etna_pipe_wait(..) by using etna_pipe_wait_ns(..). Signed-off-by: Christian Gmeiner --- etnaviv/etnaviv-symbol-check | 1 + etnaviv/etnaviv_drmif.h | 1 + etnaviv/etnaviv_pipe.c | 9 +++++++-- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/etnaviv/etnaviv-symbol-check b/etnaviv/etnaviv-symbol-check index 72f2bc5..22afd16 100755 --- a/etnaviv/etnaviv-symbol-check +++ b/etnaviv/etnaviv-symbol-check @@ -21,6 +21,7 @@ etna_gpu_get_param etna_pipe_new etna_pipe_del etna_pipe_wait +etna_pipe_wait_ns etna_bo_new etna_bo_from_handle etna_bo_from_name diff --git a/etnaviv/etnaviv_drmif.h b/etnaviv/etnaviv_drmif.h index fe9d5db..8119baa 100644 --- a/etnaviv/etnaviv_drmif.h +++ b/etnaviv/etnaviv_drmif.h @@ -104,6 +104,7 @@ int etna_gpu_get_param(struct etna_gpu *gpu, enum etna_param_id param, struct etna_pipe *etna_pipe_new(struct etna_gpu *gpu, enum etna_pipe_id id); void etna_pipe_del(struct etna_pipe *pipe); int etna_pipe_wait(struct etna_pipe *pipe, uint32_t timestamp, uint32_t ms); +int etna_pipe_wait_ns(struct etna_pipe *pipe, uint32_t timestamp, uint64_t ns); /* buffer-object functions: diff --git a/etnaviv/etnaviv_pipe.c b/etnaviv/etnaviv_pipe.c index 1157fa6..94c5d37 100644 --- a/etnaviv/etnaviv_pipe.c +++ b/etnaviv/etnaviv_pipe.c @@ -32,6 +32,11 @@ int etna_pipe_wait(struct etna_pipe *pipe, uint32_t timestamp, uint32_t ms) { + return etna_pipe_wait_ns(pipe, timestamp, ms * 1000000); +} + +int etna_pipe_wait_ns(struct etna_pipe *pipe, uint32_t timestamp, uint64_t ns) +{ struct etna_device *dev = pipe->gpu->dev; int ret; @@ -40,10 +45,10 @@ int etna_pipe_wait(struct etna_pipe *pipe, uint32_t timestamp, uint32_t ms) .fence = timestamp, }; - if (ms == 0) + if (ns == 0) req.flags |= ETNA_WAIT_NONBLOCK; - get_abs_timeout(&req.timeout, ms * 1000000); + get_abs_timeout(&req.timeout, ns); ret = drmCommandWrite(dev->fd, DRM_ETNAVIV_WAIT_FENCE, &req, sizeof(req)); if (ret) {