2
1

0001-vc4-add-meson-option-to-disable-optional-neon-suppor.patch 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. From f719e942dde0a46a9ff0080001cb3466012ffcc0 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.net>
  11. [rebased for 20.2.0, 20.3.0, 21.1.0, 23.1.0, 23.2.0, 24.3.0 & 25.1.0]
  12. Signed-off-by: Peter Seiderer <ps.report@gmx.net>
  13. [fix syntax error after previous rebases]
  14. ---
  15. meson.options | 7 +++++++
  16. src/gallium/drivers/vc4/meson.build | 4 ++--
  17. src/gallium/drivers/vc4/vc4_tiling.h | 4 ++--
  18. 3 files changed, 11 insertions(+), 4 deletions(-)
  19. diff --git a/meson.options b/meson.options
  20. index 8e0bf2a..1cf0e07 100644
  21. --- a/meson.options
  22. +++ b/meson.options
  23. @@ -117,6 +117,13 @@ option(
  24. description : 'enable gallium va frontend.',
  25. )
  26. +option(
  27. + 'gallium-vc4-neon',
  28. + type : 'feature',
  29. + deprecated: {'true': 'enabled', 'false': 'disabled'},
  30. + description : 'enable gallium vc4 optional neon support.',
  31. +)
  32. +
  33. option(
  34. 'va-libs-path',
  35. type : 'string',
  36. diff --git a/src/gallium/drivers/vc4/meson.build b/src/gallium/drivers/vc4/meson.build
  37. index 84da951..7f950de 100644
  38. --- a/src/gallium/drivers/vc4/meson.build
  39. +++ b/src/gallium/drivers/vc4/meson.build
  40. @@ -72,7 +72,7 @@ files_libvc4 = files(
  41. ]
  42. libvc4_neon = []
  43. -if host_machine.cpu_family() == 'arm'
  44. +if host_machine.cpu_family() == 'arm' and not get_option('gallium-vc4-neon').disabled()
  45. libvc4_neon = static_library(
  46. 'vc4_neon',
  47. 'vc4_tiling_lt.c',
  48. @@ -82,7 +82,7 @@ if host_machine.cpu_family() == 'arm'
  49. c_args : ['-mfpu=neon', '-DV3D_BUILD_NEON'],
  50. dependencies : vc4_deps,
  51. )
  52. - vc4_c_args += '-DUSE_ARM_ASM'
  53. + vc4_c_args += '-DVC4_TILING_LT_NEON'
  54. endif
  55. if dep_simpenrose.found()
  56. diff --git a/src/gallium/drivers/vc4/vc4_tiling.h b/src/gallium/drivers/vc4/vc4_tiling.h
  57. index 5afe329..919b299 100644
  58. --- a/src/gallium/drivers/vc4/vc4_tiling.h
  59. +++ b/src/gallium/drivers/vc4/vc4_tiling.h
  60. @@ -89,7 +89,7 @@ vc4_load_lt_image(void *dst, uint32_t dst_stride,
  61. void *src, uint32_t src_stride,
  62. int cpp, const struct pipe_box *box)
  63. {
  64. -#ifdef USE_ARM_ASM
  65. +#ifdef VC4_TILING_LT_NEON
  66. if (util_get_cpu_caps()->has_neon) {
  67. vc4_load_lt_image_neon(dst, dst_stride, src, src_stride,
  68. cpp, box);
  69. @@ -105,7 +105,7 @@ vc4_store_lt_image(void *dst, uint32_t dst_stride,
  70. void *src, uint32_t src_stride,
  71. int cpp, const struct pipe_box *box)
  72. {
  73. -#ifdef USE_ARM_ASM
  74. +#ifdef VC4_TILING_LT_NEON
  75. if (util_get_cpu_caps()->has_neon) {
  76. vc4_store_lt_image_neon(dst, dst_stride, src, src_stride,
  77. cpp, box);
  78. --
  79. 2.41.0