From patchwork Thu Nov 24 08:46:58 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Gmeiner X-Patchwork-Id: 9444983 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 521026071C for ; Thu, 24 Nov 2016 08:47:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4DE6D2787D for ; Thu, 24 Nov 2016 08:47:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4105C27A98; Thu, 24 Nov 2016 08:47:24 +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 69C762787D for ; Thu, 24 Nov 2016 08:47:23 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2D6826E828; Thu, 24 Nov 2016 08:47:22 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm0-x242.google.com (mail-wm0-x242.google.com [IPv6:2a00:1450:400c:c09::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id F09996E828 for ; Thu, 24 Nov 2016 08:47:10 +0000 (UTC) Received: by mail-wm0-x242.google.com with SMTP id a20so4327778wme.2 for ; Thu, 24 Nov 2016 00:47:10 -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=1+Bh9aLa9DedlOgr7573J5hQZn/6kh9C1A0ZkeFGG88=; b=it/x0Gz+25jSVYBOZawG+8ovBoqhrChDnRqNKZ56Xu2ypdm7QNRwOOstJzJWWRab8F vkp8MxKT6nE7f9kZjtN81ImBRzYwH9Ue/mNPjxvPhuo8mhH0zopft/bkHyEF9fV/cZic DUs5l3haYPXVSqxUuzexA1XEbIopPljomZ2JnclZC/gZhHsiWVDbk1ILHbKhDH7nJKCJ pGxsZIlczMw/ilVMpgxoCGt+47DtDFX1sRcaigyb9rsNa9teScFBPtuDdJxyOAUKv0p6 j3ZQMxG1mz66l6sr6LMAczfFmVOKeZWGcte8Eq9OQUQgFGJC3XxxbWShTf93Ocf3udPW bu3w== 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=1+Bh9aLa9DedlOgr7573J5hQZn/6kh9C1A0ZkeFGG88=; b=Yp2yXP7ZjG+bc4bZFBGqRMmYssB61yDuAigH1caz61G1WwZJYFvziOsuoXdJmwBRhu xTUQLB5/w+y0JcdB2FwXJyXT4Rtj9XrxvS6ISaSv+4kaccYrXW6GdDyjPy0uN/hneDt4 aLUxb6dleH0eJOyiOFSdxcH4ghlVSe07tjyj3C2ow3wsOlOyzjwK80i3pYGf7KGrX9Na fihT0bK1kLKADLfqRJ3wkSCJw+asScQOqpLXmmKvsK/CM54o/isR5dZswPQuHV7F1IHX bAdCiwYb9SAScqEN1bLaZvS2lvdoJh7Ljgx99x8KNKMcpRFCcRIYQTVLhAe2pz3k8SeI 8fOQ== X-Gm-Message-State: AKaTC00b31cBQdsW5stc6k/ZuXmKWn3PryiQbI/JiL/7D5jHlV92UlHILAWH1A0P+sDvdg== X-Received: by 10.28.105.78 with SMTP id e75mr1359587wmc.55.1479977229282; Thu, 24 Nov 2016 00:47:09 -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.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 24 Nov 2016 00:47:08 -0800 (PST) From: Christian Gmeiner To: dri-devel@lists.freedesktop.org Subject: [PATCH libdrm v4 1/2] etnaviv: change get_abs_timeout(..) to use ns. Date: Thu, 24 Nov 2016 09:46:58 +0100 Message-Id: <1479977219-11477-2-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 Also update all callers. Signed-off-by: Christian Gmeiner --- etnaviv/etnaviv_bo.c | 2 +- etnaviv/etnaviv_pipe.c | 2 +- etnaviv/etnaviv_priv.h | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/etnaviv/etnaviv_bo.c b/etnaviv/etnaviv_bo.c index 833f8bd..4ad0434 100644 --- a/etnaviv/etnaviv_bo.c +++ b/etnaviv/etnaviv_bo.c @@ -330,7 +330,7 @@ int etna_bo_cpu_prep(struct etna_bo *bo, uint32_t op) .op = op, }; - get_abs_timeout(&req.timeout, 5000); + get_abs_timeout(&req.timeout, 5000000000); return drmCommandWrite(bo->dev->fd, DRM_ETNAVIV_GEM_CPU_PREP, &req, sizeof(req)); diff --git a/etnaviv/etnaviv_pipe.c b/etnaviv/etnaviv_pipe.c index 402b71d..1157fa6 100644 --- a/etnaviv/etnaviv_pipe.c +++ b/etnaviv/etnaviv_pipe.c @@ -43,7 +43,7 @@ int etna_pipe_wait(struct etna_pipe *pipe, uint32_t timestamp, uint32_t ms) if (ms == 0) req.flags |= ETNA_WAIT_NONBLOCK; - get_abs_timeout(&req.timeout, ms); + get_abs_timeout(&req.timeout, ms * 1000000); ret = drmCommandWrite(dev->fd, DRM_ETNAVIV_WAIT_FENCE, &req, sizeof(req)); if (ret) { diff --git a/etnaviv/etnaviv_priv.h b/etnaviv/etnaviv_priv.h index eb62ed3..feaa5ad 100644 --- a/etnaviv/etnaviv_priv.h +++ b/etnaviv/etnaviv_priv.h @@ -189,13 +189,13 @@ struct etna_cmd_stream_priv { #define VOID2U64(x) ((uint64_t)(unsigned long)(x)) -static inline void get_abs_timeout(struct drm_etnaviv_timespec *tv, uint32_t ms) +static inline void get_abs_timeout(struct drm_etnaviv_timespec *tv, uint64_t ns) { struct timespec t; - uint32_t s = ms / 1000; + uint32_t s = ns / 1000000000; clock_gettime(CLOCK_MONOTONIC, &t); tv->tv_sec = t.tv_sec + s; - tv->tv_nsec = t.tv_nsec + ((ms - (s * 1000)) * 1000000); + tv->tv_nsec = t.tv_nsec + ns - (s * 1000000000); } #endif /* ETNAVIV_PRIV_H_ */