Module: Mesa
Branch: main
Commit: 1ba3e83958e15c8c3de7e02e87540a41801195d5
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=1ba3e83958e15c8c3de7e02e87540a41801195d5

Author: Sui Jingfeng <[email protected]>
Date:   Wed Feb  8 09:36:24 2023 +0800

meson: add basic support for loongarch

Acked-by: Erik Faye-Lund <[email protected]>
Signed-off-by: Sui Jingfeng <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21182>

---

 meson.build | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/meson.build b/meson.build
index 91a7fb8669e..621f0675489 100644
--- a/meson.build
+++ b/meson.build
@@ -154,6 +154,10 @@ if gallium_drivers.contains('auto')
       gallium_drivers = [
         'r300', 'r600', 'radeonsi', 'nouveau', 'virgl', 'swrast'
       ]
+    elif ['loongarch64'].contains(host_machine.cpu_family())
+      gallium_drivers = [
+        'r300', 'r600', 'radeonsi', 'nouveau', 'virgl', 'etnaviv', 'swrast'
+      ]
     else
       error('Unknown architecture @0@. Please pass -Dgallium-drivers to set 
driver options. Patches gladly accepted to fix this.'.format(
             host_machine.cpu_family()))
@@ -218,6 +222,8 @@ if _vulkan_drivers.contains('auto')
       _vulkan_drivers = ['swrast']
     elif ['mips', 'mips64', 'riscv32', 
'riscv64'].contains(host_machine.cpu_family())
       _vulkan_drivers = ['amd', 'swrast']
+    elif ['loongarch64'].contains(host_machine.cpu_family())
+      _vulkan_drivers = ['amd', 'swrast']
     else
       error('Unknown architecture @0@. Please pass -Dvulkan-drivers to set 
driver options. Patches gladly accepted to fix this.'.format(
             host_machine.cpu_family()))
@@ -1241,6 +1247,11 @@ elif host_machine.cpu_family() == 'mips64' and 
host_machine.endian() == 'little'
     with_asm_arch = 'mips64el'
     pre_args += ['-DUSE_MIPS64EL_ASM']
   endif
+elif host_machine.cpu_family() == 'loongarch64'
+  if system_has_kms_drm
+    with_asm_arch = 'loongarch64'
+    pre_args += ['-DUSE_LOONGARCH64_ASM']
+  endif
 endif
 
 # Check for standard headers and functions

Reply via email to