From 7a726297a7bad1a71e17dcebf0849f0da0468d40 Mon Sep 17 00:00:00 2001 From: Koen Vandeputte Date: Wed, 5 Jul 2023 13:19:28 +0200 Subject: [PATCH] kernel: add support for imx vpu This adds support for the Video Processing Unit IP block which is present in certain i.MX SOC's. The vpu used in imx6 is the coda960 which supports: - h264 enc - h264 dec - jpeg enc - jpeg dec Please note that the required firmware needs to be added by yourself as it's not available currently in linux-firmware upstream. The firmware package can be found on the internet and it will decompress itself exposing all binaries after accepting the EULA. The binaries should be placed at exactly these paths: - /lib/firmware/vpu_fw_imx6d.bin - /lib/firmware/vpu_fw_imx6q.bin Following output will be printed at boottime if all is well: [ 9.769638] coda 2040000.vpu: Firmware code revision: 46076 [ 9.775277] coda 2040000.vpu: Initialized CODA960. [ 9.780082] coda 2040000.vpu: Firmware version: 3.1.1 [ 9.785312] coda 2040000.vpu: coda-jpeg-encoder registered as video0 [ 9.791859] coda 2040000.vpu: coda-jpeg-decoder registered as video1 [ 9.798375] coda 2040000.vpu: coda-video-encoder registered as video2 [ 9.805013] coda 2040000.vpu: coda-video-decoder registered as video3 gstreamer will automatically detect and use all encoders/decoders. Please note that a FILES catch-all is required for the videobuf-dma objects as some modules enabling this could require (and thus generating) only 1 of them. Signed-off-by: Koen Vandeputte --- package/kernel/linux/modules/video.mk | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/package/kernel/linux/modules/video.mk b/package/kernel/linux/modules/video.mk index 68a1d32e76e3..7dfeec9d9138 100644 --- a/package/kernel/linux/modules/video.mk +++ b/package/kernel/linux/modules/video.mk @@ -1085,3 +1085,23 @@ define KernelPackage/video-dma/description endef $(eval $(call KernelPackage,video-dma)) + +define KernelPackage/video-coda + TITLE:=i.MX VPU support + DEPENDS:=@(TARGET_imx&&!TARGET_imx_cortexa7) +kmod-video-mem2mem +kmod-video-dma + KCONFIG:= \ + CONFIG_VIDEO_CODA \ + CONFIG_VIDEO_IMX_VDOA + FILES:= \ + $(LINUX_DIR)/drivers/media/$(V4L2_MEM2MEM_DIR)/coda/coda-vpu.ko \ + $(LINUX_DIR)/drivers/media/$(V4L2_MEM2MEM_DIR)/coda/imx-vdoa.ko \ + $(LINUX_DIR)/drivers/media/$(V4L2_DIR)/v4l2-jpeg.ko + AUTOLOAD:=$(call AutoProbe,coda-vpu imx-vdoa v4l2-jpeg) + $(call AddDepends/video) +endef + +define KernelPackage/video-coda/description + The i.MX Video Processing Unit (VPU) kernel module +endef + +$(eval $(call KernelPackage,video-coda)) -- 2.30.2