Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2019-01-16 15:23:05 +0100
committerTakashi Iwai <tiwai@suse.de>2019-01-16 15:27:09 +0100
commita124c0d1eeb9653807e0ca10871bd7a7d01ea910 (patch)
tree42acdfaeacfe2374d01845666415e5466e93e6be
parenta459a230ce4fd488bfe692ab9b2836a21cfa85ac (diff)
dma-fence: Make ->enable_signaling optional (bsc#794563).
-rw-r--r--patches.drivers/dma-fence-Make-enable_signaling-optional-2.patch96
-rw-r--r--series.conf1
2 files changed, 97 insertions, 0 deletions
diff --git a/patches.drivers/dma-fence-Make-enable_signaling-optional-2.patch b/patches.drivers/dma-fence-Make-enable_signaling-optional-2.patch
new file mode 100644
index 0000000000..2f376ce63a
--- /dev/null
+++ b/patches.drivers/dma-fence-Make-enable_signaling-optional-2.patch
@@ -0,0 +1,96 @@
+From c701317a3eb8c012364a8d468f20eabf6df1ad77 Mon Sep 17 00:00:00 2001
+From: Daniel Vetter <daniel.vetter@ffwll.ch>
+Date: Fri, 4 May 2018 16:10:34 +0200
+Subject: [PATCH] dma-fence: Make ->enable_signaling optional
+Mime-version: 1.0
+Content-type: text/plain; charset=UTF-8
+Content-transfer-encoding: 8bit
+Git-commit: c701317a3eb8c012364a8d468f20eabf6df1ad77
+Patch-mainline: v4.19-rc1
+References: bsc#794563
+
+Many drivers have a trivial implementation for ->enable_signaling.
+Let's make it optional by assuming that signalling is already
+available when the callback isn't present.
+
+V2: Don't do the trick to set the ENABLE_SIGNAL_BIT
+unconditionally, it results in an expensive spinlock take for
+everyone. Instead just check if the callback is present. Suggested by
+Maarten.
+
+Also move misplaced kerneldoc hunk to the right patch.
+
+Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
+Reviewed-by: Christian K├Ânig <christian.koenig@amd.com> (v1)
+Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
+Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
+Cc: Sumit Semwal <sumit.semwal@linaro.org>
+Cc: Gustavo Padovan <gustavo@padovan.org>
+Cc: linux-media@vger.kernel.org
+Cc: linaro-mm-sig@lists.linaro.org
+Link: https://patchwork.freedesktop.org/patch/msgid/20180504141034.27727-1-daniel.vetter@ffwll.ch
+Acked-by: Takashi Iwai <tiwai@suse.de>
+
+---
+ drivers/dma-buf/dma-fence.c | 9 +++++----
+ include/linux/dma-fence.h | 3 ++-
+ 2 files changed, 7 insertions(+), 5 deletions(-)
+
+diff --git a/drivers/dma-buf/dma-fence.c b/drivers/dma-buf/dma-fence.c
+index 4edb9fd3cf47..dd01a1720be9 100644
+--- a/drivers/dma-buf/dma-fence.c
++++ b/drivers/dma-buf/dma-fence.c
+@@ -200,7 +200,8 @@ void dma_fence_enable_sw_signaling(struct dma_fence *fence)
+
+ if (!test_and_set_bit(DMA_FENCE_FLAG_ENABLE_SIGNAL_BIT,
+ &fence->flags) &&
+- !test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->flags)) {
++ !test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->flags) &&
++ fence->ops->enable_signaling) {
+ trace_dma_fence_enable_signal(fence);
+
+ spin_lock_irqsave(fence->lock, flags);
+@@ -260,7 +261,7 @@ int dma_fence_add_callback(struct dma_fence *fence, struct dma_fence_cb *cb,
+
+ if (test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->flags))
+ ret = -ENOENT;
+- else if (!was_set) {
++ else if (!was_set && fence->ops->enable_signaling) {
+ trace_dma_fence_enable_signal(fence);
+
+ if (!fence->ops->enable_signaling(fence)) {
+@@ -388,7 +389,7 @@ dma_fence_default_wait(struct dma_fence *fence, bool intr, signed long timeout)
+ if (test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->flags))
+ goto out;
+
+- if (!was_set) {
++ if (!was_set && fence->ops->enable_signaling) {
+ trace_dma_fence_enable_signal(fence);
+
+ if (!fence->ops->enable_signaling(fence)) {
+@@ -560,7 +561,7 @@ dma_fence_init(struct dma_fence *fence, const struct dma_fence_ops *ops,
+ spinlock_t *lock, u64 context, unsigned seqno)
+ {
+ BUG_ON(!lock);
+- BUG_ON(!ops || !ops->wait || !ops->enable_signaling ||
++ BUG_ON(!ops || !ops->wait ||
+ !ops->get_driver_name || !ops->get_timeline_name);
+
+ kref_init(&fence->refcount);
+diff --git a/include/linux/dma-fence.h b/include/linux/dma-fence.h
+index 111aefe1c956..c053d19e1e24 100644
+--- a/include/linux/dma-fence.h
++++ b/include/linux/dma-fence.h
+@@ -166,7 +166,8 @@ struct dma_fence_ops {
+ * released when the fence is signalled (through e.g. the interrupt
+ * handler).
+ *
+- * This callback is mandatory.
++ * This callback is optional. If this callback is not present, then the
++ * driver must always have signaling enabled.
+ */
+ bool (*enable_signaling)(struct dma_fence *fence);
+
+--
+2.20.1
+
diff --git a/series.conf b/series.conf
index b9aacd8b92..c47d08d456 100644
--- a/series.conf
+++ b/series.conf
@@ -36546,6 +36546,7 @@
patches.drm/7879-drm-vc4-make-dsi-call-into-the-bridge-after-the-dsi-link-is-enabled
patches.drm/7880-drm-pl111-support-nomadik-lcdc-variant
patches.drivers/dma-fence-remove-fill_driver_data-callback-2.patch
+ patches.drivers/dma-fence-Make-enable_signaling-optional-2.patch
patches.drm/7881-drm-atomic-helper-use-old-new-state-in-drm_atomic_helper_commit_planes_on_crtc
patches.drm/7882-drm-add-drm_plane_mask
patches.drm/7883-drm-use-drm_crtc_mask