diff -uNr mesa-21.3.1-old/include/pci_ids/ls7a1000_pci_ids.h mesa-21.3.1/include/pci_ids/ls7a1000_pci_ids.h
--- mesa-21.3.1-old/include/pci_ids/ls7a1000_pci_ids.h	1970-01-01 08:00:00.000000000 +0800
+++ mesa-21.3.1/include/pci_ids/ls7a1000_pci_ids.h	2024-01-03 10:23:01.401894312 +0800
@@ -0,0 +1,2 @@
+CHIPSET(0x7A15, GC1000, LOONGSON)
+CHIPSET(0x7A06, DC, LOONGSON)
diff -uNr mesa-21.3.1-old/src/gallium/targets/dri/meson.build mesa-21.3.1/src/gallium/targets/dri/meson.build
--- mesa-21.3.1-old/src/gallium/targets/dri/meson.build	2021-12-02 03:04:14.000000000 +0800
+++ mesa-21.3.1/src/gallium/targets/dri/meson.build	2024-01-03 10:25:16.252537398 +0800
@@ -75,6 +75,7 @@
                'imx-drm_dri.so',
                'imx-dcss_dri.so',
                'ingenic-drm_dri.so',
+	       'loongson-drm_dri.so',
                'kirin_dri.so',
                'mali-dp_dri.so',
                'mcde_dri.so',
diff -uNr mesa-21.3.1-old/src/gallium/targets/dri/target.c mesa-21.3.1/src/gallium/targets/dri/target.c
--- mesa-21.3.1-old/src/gallium/targets/dri/target.c	2021-12-02 03:04:14.000000000 +0800
+++ mesa-21.3.1/src/gallium/targets/dri/target.c	2024-01-03 10:25:56.102318459 +0800
@@ -104,6 +104,7 @@
 DEFINE_LOADER_DRM_ENTRYPOINT(imx_drm)
 DEFINE_LOADER_DRM_ENTRYPOINT(imx_dcss)
 DEFINE_LOADER_DRM_ENTRYPOINT(ingenic_drm)
+DEFINE_LOADER_DRM_ENTRYPOINT(loongson_drm)
 DEFINE_LOADER_DRM_ENTRYPOINT(kirin)
 DEFINE_LOADER_DRM_ENTRYPOINT(mali_dp)
 DEFINE_LOADER_DRM_ENTRYPOINT(mcde)
diff -uNr mesa-21.3.1-old/src/loader/pci_id_driver_map.h mesa-21.3.1/src/loader/pci_id_driver_map.h
--- mesa-21.3.1-old/src/loader/pci_id_driver_map.h	2021-12-02 03:04:14.000000000 +0800
+++ mesa-21.3.1/src/loader/pci_id_driver_map.h	2024-01-03 10:28:54.123807700 +0800
@@ -68,6 +68,13 @@
 #undef CHIPSET
 };
 
+static const int ls7a_chip_ids[] = {
+#define CHIPSET(chip, name, family) chip,
+#include "pci_ids/ls7a1000_pci_ids.h"
+#undef CHIPSET
+};
+
+
 bool is_nouveau_vieux(int fd);
 bool is_kernel_i915(int fd);
 
@@ -90,6 +97,7 @@
    { 0x1002, "radeonsi", NULL, -1 },
    { 0x10de, "nouveau_vieux", NULL, -1, is_nouveau_vieux },
    { 0x10de, "nouveau", NULL, -1, },
+   { 0x0014, "loongson-drm", ls7a_chip_ids, ARRAY_SIZE(ls7a_chip_ids) },
    { 0x1af4, "virtio_gpu", virtio_gpu_chip_ids, ARRAY_SIZE(virtio_gpu_chip_ids) },
    { 0x15ad, "vmwgfx", vmwgfx_chip_ids, ARRAY_SIZE(vmwgfx_chip_ids) },
 };
