0003-vc4-add-meson-option-to-disable-optional-neon-suppor.patch 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. From e3b47c1b84964c62b3e1fa782f1ffa4be0ae62f9 Mon Sep 17 00:00:00 2001
  2. From: Peter Seiderer <ps.report@gmx.net>
  3. Date: Mon, 9 Mar 2020 13:01:14 +0100
  4. Subject: [PATCH] vc4: add meson option to disable optional neon support
  5. Not all toolchains are able to compile the runtime
  6. optional vc4 neon support, so add an meson option
  7. to force disabling it at compile time.
  8. [Upstream: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4114]
  9. Signed-off-by: Peter Seiderer <ps.report@gmx.net>
  10. Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
  11. [rebased for 20.2.0]
  12. ---
  13. meson_options.txt | 7 +++++++
  14. src/gallium/drivers/vc4/meson.build | 4 ++--
  15. src/gallium/drivers/vc4/vc4_tiling.h | 4 ++--
  16. 3 files changed, 11 insertions(+), 4 deletions(-)
  17. diff --git a/meson_options.txt b/meson_options.txt
  18. index a39596a6f19..0f6b6c62b55 100644
  19. --- a/meson_options.txt
  20. +++ b/meson_options.txt
  21. @@ -124,6 +124,13 @@ option(
  22. choices : ['auto', 'true', 'false', 'enabled', 'disabled'],
  23. description : 'enable gallium va frontend.',
  24. )
  25. +option(
  26. + 'gallium-vc4-neon',
  27. + type : 'combo',
  28. + value : 'auto',
  29. + choices : ['auto', 'disabled'],
  30. + description : 'enable gallium vc4 optional neon support.',
  31. +)
  32. option(
  33. 'va-libs-path',
  34. type : 'string',
  35. diff --git a/src/gallium/drivers/vc4/meson.build b/src/gallium/drivers/vc4/meson.build
  36. index 5ce5af5f6b4..e3f7d8d62ae 100644
  37. --- a/src/gallium/drivers/vc4/meson.build
  38. +++ b/src/gallium/drivers/vc4/meson.build
  39. @@ -84,7 +84,7 @@ files_libvc4 = files(
  40. vc4_c_args = []
  41. libvc4_neon = []
  42. -if host_machine.cpu_family() == 'arm'
  43. +if host_machine.cpu_family() == 'arm' and get_option('gallium-vc4-neon') != 'disabled'
  44. libvc4_neon = static_library(
  45. 'vc4_neon',
  46. 'vc4_tiling_lt_neon.c',
  47. @@ -93,7 +93,7 @@ if host_machine.cpu_family() == 'arm'
  48. ],
  49. c_args : '-mfpu=neon',
  50. )
  51. - vc4_c_args += '-DUSE_ARM_ASM'
  52. + vc4_c_args += '-DVC4_TILING_LT_NEON'
  53. endif
  54. if dep_simpenrose.found()
  55. diff --git a/src/gallium/drivers/vc4/vc4_tiling.h b/src/gallium/drivers/vc4/vc4_tiling.h
  56. index 66767e7f1f8..7446f1c3d0c 100644
  57. --- a/src/gallium/drivers/vc4/vc4_tiling.h
  58. +++ b/src/gallium/drivers/vc4/vc4_tiling.h
  59. @@ -89,7 +89,7 @@ vc4_load_lt_image(void *dst, uint32_t dst_stride,
  60. void *src, uint32_t src_stride,
  61. int cpp, const struct pipe_box *box)
  62. {
  63. -#ifdef USE_ARM_ASM
  64. +#ifdef VC4_TILING_LT_NEON
  65. if (util_cpu_caps.has_neon) {
  66. vc4_load_lt_image_neon(dst, dst_stride, src, src_stride,
  67. cpp, box);
  68. @@ -105,7 +105,7 @@ vc4_store_lt_image(void *dst, uint32_t dst_stride,
  69. void *src, uint32_t src_stride,
  70. int cpp, const struct pipe_box *box)
  71. {
  72. -#ifdef USE_ARM_ASM
  73. +#ifdef VC4_TILING_LT_NEON
  74. if (util_cpu_caps.has_neon) {
  75. vc4_store_lt_image_neon(dst, dst_stride, src, src_stride,
  76. cpp, box);
  77. --
  78. 2.25.1