diff options
author | Jörg Wagner <jorwag@google.com> | 2023-12-14 09:44:26 +0000 |
---|---|---|
committer | Jörg Wagner <jorwag@google.com> | 2023-12-14 09:44:26 +0000 |
commit | 049a542207ed694271316782397b78b2e202086a (patch) | |
tree | 105e9378d4d5062dc72109fdd4a77c915bd9425d /mali_kbase/mali_kbase_fence_ops.c | |
parent | e61eb93296e9f940b32d4ad4b0c3a5557cbeaf17 (diff) | |
download | gpu-049a542207ed694271316782397b78b2e202086a.tar.gz |
Update KMD to r47p0
Provenance: ipdelivery@ad01e50d640910a99224382bb227e6d4de627657
Change-Id: I19ac9bce34a5c5a319c1b4a388e8b037b3dfe6e7
Diffstat (limited to 'mali_kbase/mali_kbase_fence_ops.c')
-rw-r--r-- | mali_kbase/mali_kbase_fence_ops.c | 90 |
1 files changed, 37 insertions, 53 deletions
diff --git a/mali_kbase/mali_kbase_fence_ops.c b/mali_kbase/mali_kbase_fence_ops.c index f14a55e..b10e69c 100644 --- a/mali_kbase/mali_kbase_fence_ops.c +++ b/mali_kbase/mali_kbase_fence_ops.c @@ -24,88 +24,72 @@ #include <mali_kbase_fence.h> #include <mali_kbase.h> -static const char * -#if (KERNEL_VERSION(4, 10, 0) > LINUX_VERSION_CODE) -kbase_fence_get_driver_name(struct fence *fence) -#else -kbase_fence_get_driver_name(struct dma_fence *fence) -#endif +static const char *kbase_fence_get_driver_name(struct dma_fence *fence) { + CSTD_UNUSED(fence); + return KBASE_DRV_NAME; } -static const char * -#if (KERNEL_VERSION(4, 10, 0) > LINUX_VERSION_CODE) -kbase_fence_get_timeline_name(struct fence *fence) -#else -kbase_fence_get_timeline_name(struct dma_fence *fence) -#endif -{ #if MALI_USE_CSF +static const char *kbase_fence_get_timeline_name(struct dma_fence *fence) +{ struct kbase_kcpu_dma_fence *kcpu_fence = (struct kbase_kcpu_dma_fence *)fence; return kcpu_fence->metadata->timeline_name; +} #else +static const char *kbase_fence_get_timeline_name(struct dma_fence *fence) +{ + CSTD_UNUSED(fence); + return KBASE_TIMELINE_NAME; -#endif /* MALI_USE_CSF */ } +#endif /* MALI_USE_CSF */ -static bool -#if (KERNEL_VERSION(4, 10, 0) > LINUX_VERSION_CODE) -kbase_fence_enable_signaling(struct fence *fence) -#else -kbase_fence_enable_signaling(struct dma_fence *fence) -#endif +static bool kbase_fence_enable_signaling(struct dma_fence *fence) { + CSTD_UNUSED(fence); + return true; } -static void -#if (KERNEL_VERSION(4, 10, 0) > LINUX_VERSION_CODE) -kbase_fence_fence_value_str(struct fence *fence, char *str, int size) -#else -kbase_fence_fence_value_str(struct dma_fence *fence, char *str, int size) -#endif +static void kbase_fence_fence_value_str(struct dma_fence *fence, char *str, int size) { -#if (KERNEL_VERSION(5, 1, 0) > LINUX_VERSION_CODE) - const char *format = "%u"; -#else - const char *format = "%llu"; -#endif - if (unlikely(!scnprintf(str, size, format, fence->seqno))) + char *format; + + if (KERNEL_VERSION(5, 1, 0) > LINUX_VERSION_CODE) + format = "%u"; + else + format = "%llu"; + + if (unlikely(!scnprintf(str, (size_t)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) -kbase_fence_release(struct fence *fence) -#else -kbase_fence_release(struct dma_fence *fence) -#endif +static void kbase_fence_release(struct dma_fence *fence) { 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 + .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, + .release = kbase_fence_release }; #else - .fence_value_str = kbase_fence_fence_value_str -#endif -}; +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, + .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 }; +#endif /* MALI_USE_CSF */ + KBASE_EXPORT_TEST_API(kbase_fence_ops); |