From patchwork Mon Jun 20 15:53:12 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gustavo Padovan X-Patchwork-Id: 9187895 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 E7F9C6075E for ; Mon, 20 Jun 2016 15:53:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D7338279E0 for ; Mon, 20 Jun 2016 15:53:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CC34727A98; Mon, 20 Jun 2016 15:53:58 +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]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3C3DE223B3 for ; Mon, 20 Jun 2016 15:53:57 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3E3D86E459; Mon, 20 Jun 2016 15:53:56 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-yw0-f196.google.com (mail-yw0-f196.google.com [209.85.161.196]) by gabe.freedesktop.org (Postfix) with ESMTPS id 356D96E459 for ; Mon, 20 Jun 2016 15:53:50 +0000 (UTC) Received: by mail-yw0-f196.google.com with SMTP id i12so2038087ywa.0 for ; Mon, 20 Jun 2016 08:53:50 -0700 (PDT) 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=/YP1VWf1bBEUVFRc8lklrt5VeyAYKPFDbXApkoVXMhY=; b=mxQLFHyUROUsVkZqxj0p5kd4aql4dygEAb3DSiarCEYzR7Geyqol5JBHQbxnL6VuxL m9bYPQfLG48gTP2kVVRnlzfWVuZiitZAi9AK6EUMS/TPHHYLjnwduA3MioHSjoPtTiHB 7pBhvHHsCu5OQC/rdj1XpRPmXU5ICEjE+JbGB/XXDEek4FfC3nm3gXdSmPCDr3Kxfw0Q XMBsl10dxOfeKvpAWc8jvmxaNR3WZcyih1GlersM/vyk+RjhWtS55O9QtJLHs6vrD3n9 6zReYUR4jTTWdskEwb1yLhzO6Lo/6UNp1chJl7Uu3SJxc98orl/Um5WKPkbE7Y3ceEyB yU0w== X-Gm-Message-State: ALyK8tL5+6d36AjpQLj6c4+FNJhUhuimkcidRGdIER5FwMaLcAE3bGZP+Nar37U/wFrbhg== X-Received: by 10.37.5.201 with SMTP id 192mr9020632ybf.174.1466438028888; Mon, 20 Jun 2016 08:53:48 -0700 (PDT) Received: from jade.localdomain ([189.61.225.79]) by smtp.gmail.com with ESMTPSA id d205sm29098234ywe.49.2016.06.20.08.53.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Jun 2016 08:53:48 -0700 (PDT) From: Gustavo Padovan To: Greg Kroah-Hartman Subject: [PATCH 6/7] dma-buf/sw_sync: de-stage SW_SYNC Date: Mon, 20 Jun 2016 12:53:12 -0300 Message-Id: <1466437993-21573-7-git-send-email-gustavo@padovan.org> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1466437993-21573-1-git-send-email-gustavo@padovan.org> References: <1466437993-21573-1-git-send-email-gustavo@padovan.org> Cc: devel@driverdev.osuosl.org, Daniel Stone , Daniel Vetter , Riley Andrews , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , Gustavo Padovan , John Harrison 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: Gustavo Padovan SW_SYNC allows to run tests on the sync_file framework via debugfs on /sync/sw_sync Opening and closing the file triggers creation and release of a sync timeline. To create fences on this timeline the SW_SYNC_IOC_CREATE_FENCE ioctl should be used. To increment the timeline value use SW_SYNC_IOC_INC. Also it exports Sync information on /sync/info Signed-off-by: Gustavo Padovan --- drivers/dma-buf/Kconfig | 14 ++++++++++++++ drivers/dma-buf/Makefile | 1 + drivers/{staging/android => dma-buf}/sw_sync.c | 0 drivers/{staging/android => dma-buf}/sync_debug.c | 0 drivers/{staging/android => dma-buf}/sync_debug.h | 0 drivers/{staging/android => dma-buf}/sync_trace.h | 2 +- drivers/staging/android/Kconfig | 13 ------------- drivers/staging/android/Makefile | 1 - 8 files changed, 16 insertions(+), 15 deletions(-) rename drivers/{staging/android => dma-buf}/sw_sync.c (100%) rename drivers/{staging/android => dma-buf}/sync_debug.c (100%) rename drivers/{staging/android => dma-buf}/sync_debug.h (100%) rename drivers/{staging/android => dma-buf}/sync_trace.h (92%) diff --git a/drivers/dma-buf/Kconfig b/drivers/dma-buf/Kconfig index 9824bc4..7227022 100644 --- a/drivers/dma-buf/Kconfig +++ b/drivers/dma-buf/Kconfig @@ -8,4 +8,18 @@ config SYNC_FILE ---help--- This option enables the fence framework synchronization to export sync_files to userspace that can represent one or more fences. + +config SW_SYNC + bool "Sync File Validation Framework" + default n + depends on SYNC_FILE + depends on DEBUG_FS + ---help--- + A sync object driver that uses a 32bit counter to coordinate + synchronization. Useful when there is no hardware primitive backing + the synchronization. + + WARNING: improper use of this can result in deadlocking kernel + drivers from userspace. Intended for test and debug only. + endmenu diff --git a/drivers/dma-buf/Makefile b/drivers/dma-buf/Makefile index 4a424ec..d2d02fc 100644 --- a/drivers/dma-buf/Makefile +++ b/drivers/dma-buf/Makefile @@ -1,2 +1,3 @@ obj-y := dma-buf.o fence.o reservation.o seqno-fence.o obj-$(CONFIG_SYNC_FILE) += sync_file.o +obj-$(CONFIG_SW_SYNC) += sw_sync.o sync_debug.o diff --git a/drivers/staging/android/sw_sync.c b/drivers/dma-buf/sw_sync.c similarity index 100% rename from drivers/staging/android/sw_sync.c rename to drivers/dma-buf/sw_sync.c diff --git a/drivers/staging/android/sync_debug.c b/drivers/dma-buf/sync_debug.c similarity index 100% rename from drivers/staging/android/sync_debug.c rename to drivers/dma-buf/sync_debug.c diff --git a/drivers/staging/android/sync_debug.h b/drivers/dma-buf/sync_debug.h similarity index 100% rename from drivers/staging/android/sync_debug.h rename to drivers/dma-buf/sync_debug.h diff --git a/drivers/staging/android/sync_trace.h b/drivers/dma-buf/sync_trace.h similarity index 92% rename from drivers/staging/android/sync_trace.h rename to drivers/dma-buf/sync_trace.h index ea485f7..d13d59f 100644 --- a/drivers/staging/android/sync_trace.h +++ b/drivers/dma-buf/sync_trace.h @@ -1,5 +1,5 @@ #undef TRACE_SYSTEM -#define TRACE_INCLUDE_PATH ../../drivers/staging/android +#define TRACE_INCLUDE_PATH ../../drivers/dma-buf #define TRACE_SYSTEM sync_trace #if !defined(_TRACE_SYNC_H) || defined(TRACE_HEADER_MULTI_READ) diff --git a/drivers/staging/android/Kconfig b/drivers/staging/android/Kconfig index 06e41d2..6c00d6f 100644 --- a/drivers/staging/android/Kconfig +++ b/drivers/staging/android/Kconfig @@ -24,19 +24,6 @@ config ANDROID_LOW_MEMORY_KILLER scripts (/init.rc), and it defines priority values with minimum free memory size for each priority. -config SW_SYNC - bool "Software synchronization framework" - default n - depends on SYNC_FILE - depends on DEBUG_FS - ---help--- - A sync object driver that uses a 32bit counter to coordinate - synchronization. Useful when there is no hardware primitive backing - the synchronization. - - WARNING: improper use of this can result in deadlocking kernel - drivers from userspace. Intended for test and debug only. - source "drivers/staging/android/ion/Kconfig" endif # if ANDROID diff --git a/drivers/staging/android/Makefile b/drivers/staging/android/Makefile index 7ca61b7..7ed1be7 100644 --- a/drivers/staging/android/Makefile +++ b/drivers/staging/android/Makefile @@ -4,4 +4,3 @@ obj-y += ion/ obj-$(CONFIG_ASHMEM) += ashmem.o obj-$(CONFIG_ANDROID_LOW_MEMORY_KILLER) += lowmemorykiller.o -obj-$(CONFIG_SW_SYNC) += sw_sync.o sync_debug.o