From patchwork Thu Jan 11 22:22:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 10158793 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 687AD60170 for ; Thu, 11 Jan 2018 22:23:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 59BD2285FD for ; Thu, 11 Jan 2018 22:23:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4E19A286A1; Thu, 11 Jan 2018 22:23:05 +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 0040C285FD for ; Thu, 11 Jan 2018 22:23:04 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 20C5B6E4B5; Thu, 11 Jan 2018 22:23:00 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qk0-x244.google.com (mail-qk0-x244.google.com [IPv6:2607:f8b0:400d:c09::244]) by gabe.freedesktop.org (Postfix) with ESMTPS id D431F6E4A7; Thu, 11 Jan 2018 22:22:58 +0000 (UTC) Received: by mail-qk0-x244.google.com with SMTP id z12so6321898qkf.12; Thu, 11 Jan 2018 14:22:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=t7JKuIR0U0epRUlu0/o7y42UZ3OD08a5gJ6TYLpkIV4=; b=QaIrtq38863rwcGcHDdTnJzicGIb8Ff3O3mUK4B2tjCdlipkxdkBh1W9iFUUNAcHwe yyivQyPv1urSXO9vbZIMG7q0hztia46yaklpQb11LM/FScLG1qddtfrXknrnLKgx2egw JtTJjts3imORl6Bk9KzclArpHdC94gg5298MIUPmvnr/ufG5UYd36oeHbCpwPOywX9zy Nds28tWFQR6mwHgcE5G5Inzj5Yemy5zD5YXsJnDSq1gV4D89ncFFtV9CsZ2LOik5ZEgS 3W79uxQdU88Y3kfKSvd2ggDrvvIcKSLKafRU874W6VfJZCzWxE5+z8KpGSOR2a9byDi+ kUig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=t7JKuIR0U0epRUlu0/o7y42UZ3OD08a5gJ6TYLpkIV4=; b=XIujxOdi2T/NtjbhwHhBRoiqpOG14DmJcb0EZH7bkrs5aseQYn63VrkQTL9o4nCmni MOETSpwlvWoQ6pHESRp0BSWfj5PClXwD5H2gRilwMGc4mmASnvDZLcltAuYLkw7AUSpU IsLVCmUVUoOje/4NMkSaRHywJ3CuEP9e3pLmYwIC4Dq+vQ8dVU82u+jyC/6eRvm3V65u QGUqPdV6j9F7Ob9OKDIHA4L4icqrBTCcN0BOM+iwbV5auHaebqF6GSITV3iCRq1mYz+y Vh0WQ0Q6W2ZHMw/zlygABUjFezzM/OGuJ5SjavglrASlrAUqGmSs0xi2uSoyZbCa9Kmw aYSQ== X-Gm-Message-State: AKwxytdmSx+h+tzjBWFq4cpxl7dvYIYZgouWprr5Hk5XkbRZKU9thfNL GaHmncxlRYAiriL0O3TFNWU= X-Google-Smtp-Source: ACJfBoupoMedw5KQ78UiR57taiFbM5R51IynYVHkISWybUPiVTSkMJR1MQisIzvo0jy7UAsCck3ZIw== X-Received: by 10.55.54.140 with SMTP id d134mr249421qka.351.1515709377900; Thu, 11 Jan 2018 14:22:57 -0800 (PST) Received: from localhost (p200300E41F21CF00227DB10B7BBDB590.dip0.t-ipconnect.de. [2003:e4:1f21:cf00:227d:b10b:7bbd:b590]) by smtp.gmail.com with ESMTPSA id w41sm12806866qtc.19.2018.01.11.14.22.57 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 11 Jan 2018 14:22:57 -0800 (PST) From: Thierry Reding To: Thierry Reding Subject: [PATCH 2/3] drm/tegra: Add sync file support to submit interface Date: Thu, 11 Jan 2018 23:22:48 +0100 Message-Id: <20180111222249.29105-3-thierry.reding@gmail.com> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180111222249.29105-1-thierry.reding@gmail.com> References: <20180111222249.29105-1-thierry.reding@gmail.com> Cc: linux-tegra@vger.kernel.org, nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Mikko Perttunen 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 From: Mikko Perttunen Adds ability to pass sync file based prefences and get back sync file based postfences during job submission. Both fence fd's are passed in the `fence` field. A new `flags` field is used to specify if the prefence should be waited or a postfence created. Signed-off-by: Mikko Perttunen Signed-off-by: Thierry Reding --- include/uapi/drm/tegra_drm.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/include/uapi/drm/tegra_drm.h b/include/uapi/drm/tegra_drm.h index d954f8c33321..03492d6670a5 100644 --- a/include/uapi/drm/tegra_drm.h +++ b/include/uapi/drm/tegra_drm.h @@ -117,6 +117,11 @@ struct drm_tegra_waitchk { __u32 thresh; }; +#define DRM_TEGRA_SUBMIT_WAIT_FENCE_FD (1 << 0) +#define DRM_TEGRA_SUBMIT_CREATE_FENCE_FD (1 << 1) +#define DRM_TEGRA_SUBMIT_FLAGS (DRM_TEGRA_SUBMIT_WAIT_FENCE_FD | \ + DRM_TEGRA_SUBMIT_CREATE_FENCE_FD) + struct drm_tegra_submit { __u64 context; __u32 num_syncpts; @@ -129,9 +134,10 @@ struct drm_tegra_submit { __u64 cmdbufs; __u64 relocs; __u64 waitchks; - __u32 fence; /* Return value */ + __u32 fence; + __u32 flags; - __u32 reserved[5]; /* future expansion */ + __u32 reserved[4]; /* future expansion */ }; #define DRM_TEGRA_GEM_TILING_MODE_PITCH 0