From: jsg Date: Mon, 31 Jan 2022 08:47:03 +0000 (+0000) Subject: enable the movntdqa version of drm_memcpy_from_wc() X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=b05db03c9b94bb801ca64317821c9c28cec99d1b;p=openbsd enable the movntdqa version of drm_memcpy_from_wc() only caller is ttm_move_memcpy() inteldrm has equivalent bits in i915_memcpy.c --- 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) {