Pispbe/rpi 6.6.y/backport mainline pispbe
This MR contains the PiSP BE mainline version as per https://lore.kernel.org/linux-media/[email protected]/ https://lore.kernel.org/linux-media/[email protected]/
backported to rpi-6.6.y with re-introduction of multi-context support that has been dropped from the mainline kernel version.
I applied patches from both series series without squashing, in order to maintain the history as close as possible to mainline.
The MR introduces the include/uapi/linux/media/raspberrypi/pisp_be_config.h uAPI header which will now be the authoritative header for pisp_be. libpisp and libcamera will have to be ported to use this new header, and once I have published this MR I'll create one for the two projects referencing this one.
The combination of this MR, libpisp and libcamera has been tested on RPi5 with 2 cameras (imx219 and ov5647) with both the libcamera utilities (cam and qcam) and with rpicam-apps.
This are 2 qcam instances running concurrently with 2 cameras
https://github.com/raspberrypi/libpisp/pull/30 https://github.com/raspberrypi/libcamera/pull/155
All our tests look to be passing with this change. It also keeps backward compatibility with existing userland libraries (mostly, see below) which is great.
When we decide to break userland combability with the CFE merge, we ought to get rid of https://github.com/raspberrypi/linux/pull/6249/commits/23e1b4d3fded9c366c1bc8d2cea56d5b0d14934d and https://github.com/raspberrypi/linux/pull/6249/commits/7e13ef2a35bea4c3fa2e5f52642b1693f065b58a to match the upstream UAPI fully.
@jmondi one thing that does break is picamera2 because it assumes that the CFE dev nodes come before the backend dev nodes. We will fix this in picamera2, but for now, can we add a commit with the following diff:
diff --git a/drivers/media/platform/raspberrypi/pisp_be/pisp_be.c b/drivers/media/platform/raspberrypi/pisp_be/pisp_be.c
index f0365c7305cf..4dbff250cafb 100644
--- a/drivers/media/platform/raspberrypi/pisp_be/pisp_be.c
+++ b/drivers/media/platform/raspberrypi/pisp_be/pisp_be.c
@@ -21,6 +21,9 @@
#include "pisp_be_formats.h"
+/* Offset to use when registering the /dev/videoX node */
+#define PISPBE_VIDEO_NODE_OFFSET 20
+
/* Maximum number of config buffers possible */
#define PISP_BE_NUM_CONFIG_BUFFERS VB2_MAX_FRAME
@@ -1484,7 +1487,8 @@ static int pispbe_init_node(struct pispbe_node_group *node_group,
goto err_unregister_queue;
}
- ret = video_register_device(vdev, VFL_TYPE_VIDEO, -1);
+ ret = video_register_device(vdev, VFL_TYPE_VIDEO,
+ PISP_BE_VIDEO_NODE_OFFSET);
This can also be removed when we finally do break userland when the CFE lands.
@jmondi I'm keen on getting this merged soon. Are you ok with me adding the above change to the PR? Anyone else have any objections to this or the rest of the patchset?
@jmondi I'm keen on getting this merged soon. Are you ok with me adding the above change to the PR? Anyone else have any objections to this or the rest of the patchset?
@naushir the PISP_BE_VIDEO_NODE_OFFSET one ? Sure, please go ahead with that patch on top!
@naushir the
PISP_BE_VIDEO_NODE_OFFSETone ? Sure, please go ahead with that patch on top!
That's the one!
Closing this and opened a new PR at https://github.com/raspberrypi/linux/pull/6259 with the extra commit.