[openwrt/openwrt] kernel: modules: video: adapt for loongarch64

LEDE Commits lede-commits at lists.infradead.org
Fri May 3 23:41:00 PDT 2024


981213 pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/159a2857360a0755c5bcf14d2d4d65bf04022936

commit 159a2857360a0755c5bcf14d2d4d65bf04022936
Author: Weijie Gao <hackpascal at gmail.com>
AuthorDate: Sun Jan 7 03:27:57 2024 +0800

    kernel: modules: video: adapt for loongarch64
    
    * Allow kmod-acpi-video to be built for loongarch64:
    The x86-specific CONFIG_ACPI_WMI will be split from default
    kmod-acpi-video as a board-specific addition.
    
    * Allow kmod-drm-amdgpu to be built for loongarch64:
    Also add loongarch64-specific configs and modules.
    
    Signed-off-by: Weijie Gao <hackpascal at gmail.com>
---
 package/kernel/linux/modules/video.mk | 25 ++++++++++++++++++-------
 1 file changed, 18 insertions(+), 7 deletions(-)

diff --git a/package/kernel/linux/modules/video.mk b/package/kernel/linux/modules/video.mk
index b282d7695c..dc1953279e 100644
--- a/package/kernel/linux/modules/video.mk
+++ b/package/kernel/linux/modules/video.mk
@@ -19,19 +19,23 @@ V4L2_MEM2MEM_DIR=platform
 define KernelPackage/acpi-video
   SUBMENU:=$(VIDEO_MENU)
   TITLE:=ACPI Extensions For Display Adapters
-  DEPENDS:=@TARGET_x86 +kmod-backlight
+  DEPENDS:=@TARGET_x86||TARGET_loongarch64 +kmod-backlight
   HIDDEN:=1
-  KCONFIG:=CONFIG_ACPI_VIDEO \
-	CONFIG_ACPI_WMI
-  FILES:=$(LINUX_DIR)/drivers/acpi/video.ko \
-	$(LINUX_DIR)/drivers/platform/x86/wmi.ko
-  AUTOLOAD:=$(call AutoProbe,wmi video)
+  KCONFIG:=CONFIG_ACPI_VIDEO
+  FILES:=$(LINUX_DIR)/drivers/acpi/video.ko
+  AUTOLOAD:=$(call AutoProbe,video)
 endef
 
 define KernelPackage/acpi-video/description
   Kernel support for integrated graphics devices.
 endef
 
+define KernelPackage/acpi-video/x86
+  KCONFIG+=CONFIG_ACPI_WMI
+  FILES+=$(LINUX_DIR)/drivers/platform/x86/wmi.ko
+  AUTOLOAD:=$(call AutoProbe,wmi video)
+endef
+
 $(eval $(call KernelPackage,acpi-video))
 
 define KernelPackage/backlight
@@ -372,7 +376,7 @@ $(eval $(call KernelPackage,drm-suballoc-helper))
 define KernelPackage/drm-amdgpu
   SUBMENU:=$(VIDEO_MENU)
   TITLE:=AMDGPU DRM support
-  DEPENDS:=@TARGET_x86 @DISPLAY_SUPPORT +kmod-backlight +kmod-drm-ttm \
+  DEPENDS:=@TARGET_x86||TARGET_loongarch64 @DISPLAY_SUPPORT +kmod-backlight +kmod-drm-ttm \
 	+kmod-drm-ttm-helper +kmod-drm-kms-helper +kmod-i2c-algo-bit +amdgpu-firmware \
 	+kmod-drm-display-helper +kmod-drm-buddy +kmod-acpi-video \
 	+LINUX_6_6:kmod-drm-exec +LINUX_6_6:kmod-drm-suballoc-helper
@@ -391,6 +395,13 @@ define KernelPackage/drm-amdgpu/description
   Direct Rendering Manager (DRM) support for AMDGPU Cards
 endef
 
+define KernelPackage/drm-amdgpu/loongarch64
+  KCONFIG+=CONFIG_DRM_AMDGPU_USERPTR=y \
+	CONFIG_DRM_AMD_DC=y \
+	CONFIG_DRM_AMD_DC_FP=y \
+	CONFIG_DRM_AMD_DC_SI=y
+endef
+
 $(eval $(call KernelPackage,drm-amdgpu))
 
 




More information about the lede-commits mailing list