diff --git a/package/system/hardware-support/Makefile b/package/system/hardware-support/Makefile index 338f5743b07..457926fdad1 100644 --- a/package/system/hardware-support/Makefile +++ b/package/system/hardware-support/Makefile @@ -62,6 +62,22 @@ define Package/video-support/install $(call InstallFragment,$(1),30-video.json) endef +define Package/accel-support + $(call Package/hardware-support/Default) + TITLE:=Render and compute device support + USERID:=:render=43 +endef + +define Package/accel-support/description + Feature gate for GPU render and compute devices. Allocates the render + group and installs the hotplug rules which put the DRM render, accel and + kfd character devices into it. +endef + +define Package/accel-support/install + $(call InstallFragment,$(1),35-accel.json) +endef + define Build/Prepare endef @@ -73,3 +89,4 @@ endef $(eval $(call BuildPackage,audio-support)) $(eval $(call BuildPackage,video-support)) +$(eval $(call BuildPackage,accel-support)) diff --git a/package/system/hardware-support/files/35-accel.json b/package/system/hardware-support/files/35-accel.json new file mode 100644 index 00000000000..6ef81be8c97 --- /dev/null +++ b/package/system/hardware-support/files/35-accel.json @@ -0,0 +1,19 @@ +[ + [ "if", + [ "eq", "SUBSYSTEM", "drm" ], + [ + [ "if", + [ "regex", "DEVNAME", "^dri/renderD" ], + [ + [ "makedev", "/dev/%DEVNAME%", "0660", "render" ], + [ "return" ] + ] + ], + [ "return" ] + ] + ], + [ "if", + [ "eq", "SUBSYSTEM", [ "accel", "kfd" ] ], + [ "makedev", "/dev/%DEVNAME%", "0660", "render" ] + ] +]