From 1543e317f1da31b75942316931e8f491a8920811 Mon Sep 17 00:00:00 2001
From: hc <hc@nodka.com>
Date: Thu, 04 Jan 2024 10:08:02 +0000
Subject: [PATCH] disable FB
---
kernel/drivers/gpu/arm/bifrost/mali_kbase_fence_ops.c | 54 +++++++++++++++++++++++++++++++++++++++++-------------
1 files changed, 41 insertions(+), 13 deletions(-)
diff --git a/kernel/drivers/gpu/arm/bifrost/mali_kbase_fence_ops.c b/kernel/drivers/gpu/arm/bifrost/mali_kbase_fence_ops.c
index 14ddf03..25b4c9c 100644
--- a/kernel/drivers/gpu/arm/bifrost/mali_kbase_fence_ops.c
+++ b/kernel/drivers/gpu/arm/bifrost/mali_kbase_fence_ops.c
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note
/*
*
- * (C) COPYRIGHT 2020-2021 ARM Limited. All rights reserved.
+ * (C) COPYRIGHT 2020-2022 ARM Limited. All rights reserved.
*
* This program is free software and is provided to you under the terms of the
* GNU General Public License version 2 as published by the Free Software
@@ -21,7 +21,7 @@
#include <linux/atomic.h>
#include <linux/list.h>
-#include <mali_kbase_fence_defs.h>
+#include <mali_kbase_fence.h>
#include <mali_kbase.h>
static const char *
@@ -41,7 +41,13 @@
kbase_fence_get_timeline_name(struct dma_fence *fence)
#endif
{
+#if MALI_USE_CSF
+ struct kbase_kcpu_dma_fence *kcpu_fence = (struct kbase_kcpu_dma_fence *)fence;
+
+ return kcpu_fence->metadata->timeline_name;
+#else
return kbase_timeline_name;
+#endif /* MALI_USE_CSF */
}
static bool
@@ -62,22 +68,44 @@
#endif
{
#if (KERNEL_VERSION(5, 1, 0) > LINUX_VERSION_CODE)
- snprintf(str, size, "%u", fence->seqno);
+ const char *format = "%u";
#else
- snprintf(str, size, "%llu", fence->seqno);
+ const char *format = "%llu";
#endif
+ if (unlikely(!scnprintf(str, size, format, fence->seqno)))
+ pr_err("Fail to encode fence seqno to string");
}
+#if MALI_USE_CSF
+static void
#if (KERNEL_VERSION(4, 10, 0) > LINUX_VERSION_CODE)
-const struct fence_ops kbase_fence_ops = {
- .wait = fence_default_wait,
+kbase_fence_release(struct fence *fence)
#else
-const struct dma_fence_ops kbase_fence_ops = {
- .wait = dma_fence_default_wait,
+kbase_fence_release(struct dma_fence *fence)
#endif
- .get_driver_name = kbase_fence_get_driver_name,
- .get_timeline_name = kbase_fence_get_timeline_name,
- .enable_signaling = kbase_fence_enable_signaling,
- .fence_value_str = kbase_fence_fence_value_str
-};
+{
+ struct kbase_kcpu_dma_fence *kcpu_fence = (struct kbase_kcpu_dma_fence *)fence;
+ kbase_kcpu_dma_fence_meta_put(kcpu_fence->metadata);
+ kfree(kcpu_fence);
+}
+#endif
+
+#if (KERNEL_VERSION(4, 10, 0) > LINUX_VERSION_CODE)
+extern const struct fence_ops kbase_fence_ops; /* silence checker warning */
+const struct fence_ops kbase_fence_ops = { .wait = fence_default_wait,
+#else
+extern const struct dma_fence_ops kbase_fence_ops; /* silence checker warning */
+const struct dma_fence_ops kbase_fence_ops = { .wait = dma_fence_default_wait,
+#endif
+ .get_driver_name = kbase_fence_get_driver_name,
+ .get_timeline_name = kbase_fence_get_timeline_name,
+ .enable_signaling = kbase_fence_enable_signaling,
+#if MALI_USE_CSF
+ .fence_value_str = kbase_fence_fence_value_str,
+ .release = kbase_fence_release
+#else
+ .fence_value_str = kbase_fence_fence_value_str
+#endif
+};
+KBASE_EXPORT_TEST_API(kbase_fence_ops);
--
Gitblit v1.6.2