From patchwork Mon Nov 21 03:48:13 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Gustavo Padovan X-Patchwork-Id: 9438695 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 0F07F600BA for ; Mon, 21 Nov 2016 03:48:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DD756287E1 for ; Mon, 21 Nov 2016 03:48:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BDCF528985; Mon, 21 Nov 2016 03:48:56 +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.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED 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 5F6F3287E1 for ; Mon, 21 Nov 2016 03:48:30 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 44ABF6E0FA; Mon, 21 Nov 2016 03:48:25 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pg0-f65.google.com (mail-pg0-f65.google.com [74.125.83.65]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9ECE76E0FA for ; Mon, 21 Nov 2016 03:48:23 +0000 (UTC) Received: by mail-pg0-f65.google.com with SMTP id p66so27235573pga.2 for ; Sun, 20 Nov 2016 19:48:23 -0800 (PST) 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:mime-version :content-transfer-encoding; bh=GTZk0yPmAPKNZO2/E449hiUQrhhaJGn1tJd4GTwGrm4=; b=Y0EUnJq/IMHmoy0U7RqGgHVViDmCanSl9oR6pM7OCzOyFKnaU/5sqMej9kIs5R1UMX C4AL/Uj2TgUiKYwixIWKve8xpPpdFg9YDSA4lqQSYReQQfTBPVc5UcCjw56mCZYaArzE VfqyKUrWl9qoWhXzJy5fFM6GatuTS1ew9Sk6aaQy6PL67PEmjn6W6/oTZuMx1pYGaW1/ 8SMAddCQPrW/pb/rkhG70Vk6iW7OEIsU2FYHEDfHdSR3VxLTHr/wWbOcZ2yZoNMijjei 1S6zTqZeJ1/+PSDJLP2oPC4fArCePaZ19qpHFNZWn4MNal93jhVXFJF49+MmKweMQCiW KqDA== X-Gm-Message-State: AKaTC01IFymuJ9iH4R1dvMjqp+u9prNdtaEuRZ53CKfQiX7FlsHo7ImWtHynaeg9vjtuDQ== X-Received: by 10.99.143.13 with SMTP id n13mr27234899pgd.70.1479700102865; Sun, 20 Nov 2016 19:48:22 -0800 (PST) Received: from jade.nodan1.kt.home.ne.jp (202-72-64-164.koalanet.ne.jp. [202.72.64.164]) by smtp.gmail.com with ESMTPSA id z9sm15047911pge.44.2016.11.20.19.48.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 20 Nov 2016 19:48:21 -0800 (PST) From: Gustavo Padovan To: dri-devel@lists.freedesktop.org Subject: [PATCH] drm/fences: add DOC: for explicit fencing Date: Mon, 21 Nov 2016 12:48:13 +0900 Message-Id: <1479700093-4034-1-git-send-email-gustavo@padovan.org> X-Mailer: git-send-email 2.5.5 MIME-Version: 1.0 Cc: Gustavo Padovan 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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Gustavo Padovan Document IN_FENCE_FD and OUT_FENCE_PTR properties. Signed-off-by: Gustavo Padovan --- Documentation/gpu/drm-kms.rst | 6 ++++++ drivers/gpu/drm/drm_atomic.c | 31 +++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/Documentation/gpu/drm-kms.rst b/Documentation/gpu/drm-kms.rst index 568f3c2..cdc9539 100644 --- a/Documentation/gpu/drm-kms.rst +++ b/Documentation/gpu/drm-kms.rst @@ -287,6 +287,12 @@ Tile Group Property .. kernel-doc:: drivers/gpu/drm/drm_connector.c :doc: Tile group +Explicit Fencing Properties +--------------------------- + +.. kernel-doc:: drivers/gpu/drm/drm_atomic.c + :doc: explicit fencing properties + Existing KMS Properties ----------------------- diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c index b476ec5..7f33031 100644 --- a/drivers/gpu/drm/drm_atomic.c +++ b/drivers/gpu/drm/drm_atomic.c @@ -1809,6 +1809,37 @@ void drm_atomic_clean_old_fb(struct drm_device *dev, } EXPORT_SYMBOL(drm_atomic_clean_old_fb); +/** + * DOC: explicit fencing properties + * + * Explicit fencing allows userspace to control the buffer synchronization + * between devices. A Fence or a group of fences are trasnfered to/from + * userspace using Sync File fds and there are two DRM properties for that. + * IN_FENCE_FD on each DRM Plane to send fences to the kernel and + * OUT_FENCE_PTR on each DRM CRTC to receive fences from the kernel. + * + * "IN_FENCE_FD”: + * Use this property to pass a fence that DRM should wait on before + * proceeding with the Atomic Commit request and show the framebuffer for + * the plane on the screen. The fence can be either a normal fence or a + * merged one, the sync_file framework will handle both case and use a + * fence_array if a merged fence is received. Passing -1 here means no + * fences to wait on. + * + * "OUT_FENCE_PTR”: + * Use this property to pass a file descriptor pointer to DRM. Once the + * Atomic Commit request call returns OUT_FENCE_PTR will be filled with + * the file descriptor number of a Sync File. This Sync File contains the + * CRTC fence that will be signaled when all framebuffers present on the + * Atomic Commit * request for that given CRTC are scanned out on the + * screen. + * + * The Atomic Commit request fails if a invalid pointer is passed. If the + * Atomic Commit request fails for any other reason the out fence fd + * returned will be -1. On a Atomic Commit with the + * DRM_MODE_ATOMIC_TEST_ONLY flag the out fence will also be set to -1. + */ + static struct dma_fence *get_crtc_fence(struct drm_crtc *crtc) { struct dma_fence *fence;