diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2022-01-31 08:47:04 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2022-01-31 08:47:04 +0000 |
commit | 84825755f4a4a86ba0e626b7257b22da076d7f03 (patch) | |
tree | 0353f7a47f393070cb07a045e96be03eb1e13db6 /sys/dev/pci/drm | |
parent | a6146dce014caca7968692b31b8cffbf8bbe5e9f (diff) |
enable the movntdqa version of drm_memcpy_from_wc()
only caller is ttm_move_memcpy()
inteldrm has equivalent bits in i915_memcpy.c
Diffstat (limited to 'sys/dev/pci/drm')
-rw-r--r-- | sys/dev/pci/drm/drm_cache.c | 21 |
1 files changed, 20 insertions, 1 deletions
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 <asm/fpu/api.h> + +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) { |