summaryrefslogtreecommitdiff
path: root/mali_kbase/mali_kbase_fence.h
diff options
context:
space:
mode:
authorJörg Wagner <jorwag@google.com>2023-12-14 09:44:26 +0000
committerJörg Wagner <jorwag@google.com>2023-12-14 09:44:26 +0000
commit049a542207ed694271316782397b78b2e202086a (patch)
tree105e9378d4d5062dc72109fdd4a77c915bd9425d /mali_kbase/mali_kbase_fence.h
parente61eb93296e9f940b32d4ad4b0c3a5557cbeaf17 (diff)
downloadgpu-049a542207ed694271316782397b78b2e202086a.tar.gz
Update KMD to r47p0
Provenance: ipdelivery@ad01e50d640910a99224382bb227e6d4de627657 Change-Id: I19ac9bce34a5c5a319c1b4a388e8b037b3dfe6e7
Diffstat (limited to 'mali_kbase/mali_kbase_fence.h')
-rw-r--r--mali_kbase/mali_kbase_fence.h44
1 files changed, 8 insertions, 36 deletions
diff --git a/mali_kbase/mali_kbase_fence.h b/mali_kbase/mali_kbase_fence.h
index ea2ac34..06690d4 100644
--- a/mali_kbase/mali_kbase_fence.h
+++ b/mali_kbase/mali_kbase_fence.h
@@ -29,10 +29,9 @@
#if IS_ENABLED(CONFIG_SYNC_FILE)
-#include <linux/list.h>
-#include "mali_kbase_fence_defs.h"
#include "mali_kbase.h"
-#include "mali_kbase_refcount_defs.h"
+
+#include <linux/list.h>
#include <linux/version_compat_defs.h>
#if MALI_USE_CSF
@@ -53,7 +52,7 @@
struct kbase_kcpu_dma_fence_meta {
kbase_refcount_t refcount;
struct kbase_device *kbdev;
- int kctx_id;
+ u32 kctx_id;
char timeline_name[MAX_TIMELINE_NAME];
};
@@ -65,20 +64,12 @@ struct kbase_kcpu_dma_fence_meta {
* @metadata: Pointer to metadata structure.
*/
struct kbase_kcpu_dma_fence {
-#if (KERNEL_VERSION(4, 10, 0) > LINUX_VERSION_CODE)
- struct fence base;
-#else
struct dma_fence base;
-#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0) */
struct kbase_kcpu_dma_fence_meta *metadata;
};
#endif
-#if (KERNEL_VERSION(4, 10, 0) > LINUX_VERSION_CODE)
-extern const struct fence_ops kbase_fence_ops;
-#else
extern const struct dma_fence_ops kbase_fence_ops;
-#endif
/**
* kbase_fence_out_new() - Creates a new output fence and puts it on the atom
@@ -86,11 +77,7 @@ extern const struct dma_fence_ops kbase_fence_ops;
*
* Return: A new fence object on success, NULL on failure.
*/
-#if (KERNEL_VERSION(4, 10, 0) > LINUX_VERSION_CODE)
-struct fence *kbase_fence_out_new(struct kbase_jd_atom *katom);
-#else
struct dma_fence *kbase_fence_out_new(struct kbase_jd_atom *katom);
-#endif
#if IS_ENABLED(CONFIG_SYNC_FILE)
/**
@@ -100,14 +87,13 @@ struct dma_fence *kbase_fence_out_new(struct kbase_jd_atom *katom);
*
* This function will take ownership of one fence reference!
*/
-#define kbase_fence_fence_in_set(katom, fence) \
- do { \
+#define kbase_fence_fence_in_set(katom, fence) \
+ do { \
WARN_ON((katom)->dma_fence.fence_in); \
- (katom)->dma_fence.fence_in = fence; \
+ (katom)->dma_fence.fence_in = fence; \
} while (0)
#endif
-
#if !MALI_USE_CSF
/**
* kbase_fence_out_remove() - Removes the output fence from atom
@@ -147,8 +133,7 @@ static inline void kbase_fence_in_remove(struct kbase_jd_atom *katom)
*/
static inline bool kbase_fence_out_is_ours(struct kbase_jd_atom *katom)
{
- return katom->dma_fence.fence &&
- katom->dma_fence.fence->ops == &kbase_fence_ops;
+ return katom->dma_fence.fence && katom->dma_fence.fence->ops == &kbase_fence_ops;
}
/**
@@ -158,8 +143,7 @@ static inline bool kbase_fence_out_is_ours(struct kbase_jd_atom *katom)
*
* Return: 0 on success, < 0 on error
*/
-static inline int kbase_fence_out_signal(struct kbase_jd_atom *katom,
- int status)
+static inline int kbase_fence_out_signal(struct kbase_jd_atom *katom, int status)
{
if (status)
dma_fence_set_error_helper(katom->dma_fence.fence, status);
@@ -201,11 +185,7 @@ static inline int kbase_fence_out_signal(struct kbase_jd_atom *katom,
#define kbase_fence_get(fence_info) dma_fence_get((fence_info)->fence)
#if MALI_USE_CSF
-#if (KERNEL_VERSION(4, 10, 0) > LINUX_VERSION_CODE)
-static inline struct kbase_kcpu_dma_fence *kbase_kcpu_dma_fence_get(struct fence *fence)
-#else
static inline struct kbase_kcpu_dma_fence *kbase_kcpu_dma_fence_get(struct dma_fence *fence)
-#endif
{
if (fence->ops == &kbase_fence_ops)
return (struct kbase_kcpu_dma_fence *)fence;
@@ -221,11 +201,7 @@ static inline void kbase_kcpu_dma_fence_meta_put(struct kbase_kcpu_dma_fence_met
}
}
-#if (KERNEL_VERSION(4, 10, 0) > LINUX_VERSION_CODE)
-static inline void kbase_kcpu_dma_fence_put(struct fence *fence)
-#else
static inline void kbase_kcpu_dma_fence_put(struct dma_fence *fence)
-#endif
{
struct kbase_kcpu_dma_fence *kcpu_fence = kbase_kcpu_dma_fence_get(fence);
@@ -238,11 +214,7 @@ static inline void kbase_kcpu_dma_fence_put(struct dma_fence *fence)
* kbase_fence_put() - Releases a reference to a fence
* @fence: Fence to release reference for.
*/
-#if (KERNEL_VERSION(4, 10, 0) > LINUX_VERSION_CODE)
-static inline void kbase_fence_put(struct fence *fence)
-#else
static inline void kbase_fence_put(struct dma_fence *fence)
-#endif
{
dma_fence_put(fence);
}