From b05db03c9b94bb801ca64317821c9c28cec99d1b Mon Sep 17 00:00:00 2001 From: jsg Date: Mon, 31 Jan 2022 08:47:03 +0000 Subject: [PATCH] enable the movntdqa version of drm_memcpy_from_wc() only caller is ttm_move_memcpy() inteldrm has equivalent bits in i915_memcpy.c --- sys/dev/pci/drm/drm_cache.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/sys/dev/pci/drm/drm_cache.c b/sys/dev/pci/drm/drm_cache.c index c5f586456fb..1fb8f883c4c 100644 --- a/sys/dev/pci/drm/drm_cache.c +++ b/sys/dev/pci/drm/drm_cache.c @@ -253,9 +253,28 @@ static void memcpy_fallback(struct dma_buf_map *dst, } } -#if defined(CONFIG_X86) && defined(__linux__) +#ifdef CONFIG_X86 +#ifdef __linux__ static DEFINE_STATIC_KEY_FALSE(has_movntdqa); +#else +static int has_movntdqa; + +#include + +static inline void +static_branch_enable(int *x) +{ + *x = 1; +} + +static inline int +static_branch_likely(int *x) +{ + return (likely(*x == 1)); +} + +#endif static void __memcpy_ntdqa(void *dst, const void *src, unsigned long len) { -- 2.20.1