[v1,0/4] Raspberry Pi: Add support for Pi 5 (PiSP)
mbox series

Message ID 20250113093532.4054142-1-naush@raspberrypi.com
Headers show
Series
  • Raspberry Pi: Add support for Pi 5 (PiSP)
Related show

Message

Naushir Patuck Jan. 13, 2025, 9:24 a.m. UTC
Hi,

A long time coming... this series add support for Raspberry Pi 5 (PiSP) to
upstream libcamera. The IPA and pipeline handler code have been taken mostly
unchanged from the Raspberry Pi downstream libcamera tree:
https://github.com/raspberrypi/libcamera. Support for IMX500 and CNNs are not
available in this series since we have yet to attempt to upstream the kernel
changes.

IMPORTANT NOTE
--------------
The Pi 5 pipeline handler in this commit is NOT COMPATIBLE with the Raspberry Pi
kernel drivers just yet! Instead, you must use the mainline kernel upstream
drivers with this pipeline handler. When futher upstreaming development for
embedded data is completed, RPi will backport the upstream kernel drives to our
tree and this pipeline handler will then begin to work with both upstream and
downstream kernel trees.

Thanks,
Naush

Naushir Patuck (4):
  meson: Add libpisp.wrap
  ipa: rpi: Add support for Raspberry Pi 5
  pipeline: rpi: Add new stream flags for PiSP
  pipeline: rpi: Add support for Raspberry Pi 5

 Documentation/guides/pipeline-handler.rst     |    2 +-
 include/libcamera/ipa/meson.build             |    1 +
 include/libcamera/meson.build                 |    1 +
 meson.build                                   |    1 +
 meson_options.txt                             |    4 +-
 src/ipa/rpi/pisp/data/imx219.json             | 1187 +++++++++
 src/ipa/rpi/pisp/data/imx219_noir.json        | 1112 ++++++++
 src/ipa/rpi/pisp/data/imx290.json             |  341 +++
 src/ipa/rpi/pisp/data/imx296.json             | 1194 +++++++++
 src/ipa/rpi/pisp/data/imx296_16mm.json        | 1247 +++++++++
 src/ipa/rpi/pisp/data/imx296_6mm.json         | 1247 +++++++++
 src/ipa/rpi/pisp/data/imx296_mono.json        |  960 +++++++
 src/ipa/rpi/pisp/data/imx378.json             |  634 +++++
 src/ipa/rpi/pisp/data/imx415.json             | 1159 ++++++++
 src/ipa/rpi/pisp/data/imx462.json             |  342 +++
 src/ipa/rpi/pisp/data/imx477.json             | 1186 +++++++++
 src/ipa/rpi/pisp/data/imx477_16mm.json        | 1240 +++++++++
 src/ipa/rpi/pisp/data/imx477_6mm.json         | 1240 +++++++++
 src/ipa/rpi/pisp/data/imx477_noir.json        | 1148 ++++++++
 src/ipa/rpi/pisp/data/imx477_scientific.json  |  546 ++++
 src/ipa/rpi/pisp/data/imx519.json             |  634 +++++
 src/ipa/rpi/pisp/data/imx708.json             | 1270 +++++++++
 src/ipa/rpi/pisp/data/imx708_noir.json        | 1233 +++++++++
 src/ipa/rpi/pisp/data/imx708_wide.json        | 1293 +++++++++
 src/ipa/rpi/pisp/data/imx708_wide_noir.json   | 1148 ++++++++
 src/ipa/rpi/pisp/data/meson.build             |   29 +
 src/ipa/rpi/pisp/data/ov5647.json             | 1186 +++++++++
 src/ipa/rpi/pisp/data/ov5647_noir.json        | 1121 ++++++++
 src/ipa/rpi/pisp/data/ov64a40.json            | 1133 ++++++++
 src/ipa/rpi/pisp/data/ov9281_mono.json        |  215 ++
 src/ipa/rpi/pisp/data/se327m12.json           |  639 +++++
 src/ipa/rpi/pisp/data/uncalibrated.json       |  135 +
 src/ipa/rpi/pisp/meson.build                  |   49 +
 src/ipa/rpi/pisp/pisp.cpp                     | 1068 ++++++++
 src/libcamera/control_ids_rpi.yaml            |   13 +
 .../pipeline/rpi/common/rpi_stream.h          |   10 +
 .../pipeline/rpi/pisp/data/example.yaml       |   45 +
 .../pipeline/rpi/pisp/data/meson.build        |    8 +
 src/libcamera/pipeline/rpi/pisp/meson.build   |   12 +
 src/libcamera/pipeline/rpi/pisp/pisp.cpp      | 2372 +++++++++++++++++
 subprojects/.gitignore                        |    1 +
 subprojects/libpisp.wrap                      |    6 +
 42 files changed, 28410 insertions(+), 2 deletions(-)
 create mode 100644 src/ipa/rpi/pisp/data/imx219.json
 create mode 100644 src/ipa/rpi/pisp/data/imx219_noir.json
 create mode 100644 src/ipa/rpi/pisp/data/imx290.json
 create mode 100644 src/ipa/rpi/pisp/data/imx296.json
 create mode 100644 src/ipa/rpi/pisp/data/imx296_16mm.json
 create mode 100644 src/ipa/rpi/pisp/data/imx296_6mm.json
 create mode 100644 src/ipa/rpi/pisp/data/imx296_mono.json
 create mode 100644 src/ipa/rpi/pisp/data/imx378.json
 create mode 100755 src/ipa/rpi/pisp/data/imx415.json
 create mode 100644 src/ipa/rpi/pisp/data/imx462.json
 create mode 100644 src/ipa/rpi/pisp/data/imx477.json
 create mode 100644 src/ipa/rpi/pisp/data/imx477_16mm.json
 create mode 100644 src/ipa/rpi/pisp/data/imx477_6mm.json
 create mode 100644 src/ipa/rpi/pisp/data/imx477_noir.json
 create mode 100644 src/ipa/rpi/pisp/data/imx477_scientific.json
 create mode 100644 src/ipa/rpi/pisp/data/imx519.json
 create mode 100644 src/ipa/rpi/pisp/data/imx708.json
 create mode 100644 src/ipa/rpi/pisp/data/imx708_noir.json
 create mode 100644 src/ipa/rpi/pisp/data/imx708_wide.json
 create mode 100644 src/ipa/rpi/pisp/data/imx708_wide_noir.json
 create mode 100644 src/ipa/rpi/pisp/data/meson.build
 create mode 100644 src/ipa/rpi/pisp/data/ov5647.json
 create mode 100644 src/ipa/rpi/pisp/data/ov5647_noir.json
 create mode 100755 src/ipa/rpi/pisp/data/ov64a40.json
 create mode 100644 src/ipa/rpi/pisp/data/ov9281_mono.json
 create mode 100644 src/ipa/rpi/pisp/data/se327m12.json
 create mode 100644 src/ipa/rpi/pisp/data/uncalibrated.json
 create mode 100644 src/ipa/rpi/pisp/meson.build
 create mode 100644 src/ipa/rpi/pisp/pisp.cpp
 create mode 100644 src/libcamera/pipeline/rpi/pisp/data/example.yaml
 create mode 100644 src/libcamera/pipeline/rpi/pisp/data/meson.build
 create mode 100644 src/libcamera/pipeline/rpi/pisp/meson.build
 create mode 100644 src/libcamera/pipeline/rpi/pisp/pisp.cpp
 create mode 100644 subprojects/libpisp.wrap

Comments

Kieran Bingham Jan. 13, 2025, 12:12 p.m. UTC | #1
Hi Naush,

Quoting Naushir Patuck (2025-01-13 09:24:42)
> Hi,
> 
> A long time coming... this series add support for Raspberry Pi 5 (PiSP) to
> upstream libcamera. The IPA and pipeline handler code have been taken mostly
> unchanged from the Raspberry Pi downstream libcamera tree:
> https://github.com/raspberrypi/libcamera. Support for IMX500 and CNNs are not
> available in this series since we have yet to attempt to upstream the kernel
> changes.
> 
> IMPORTANT NOTE
> --------------
> The Pi 5 pipeline handler in this commit is NOT COMPATIBLE with the Raspberry Pi
> kernel drivers just yet! Instead, you must use the mainline kernel upstream
> drivers with this pipeline handler. When futher upstreaming development for
> embedded data is completed, RPi will backport the upstream kernel drives to our
> tree and this pipeline handler will then begin to work with both upstream and
> downstream kernel trees.

Thanks for posting this!

The first issue we face is the dependency in libpisp in the CI loops it
seems:

https://gitlab.freedesktop.org/camera/libcamera/-/pipelines/1344547

has many failed jobs, which I believe are all going to be more or less
instances of:

https://gitlab.freedesktop.org/camera/libcamera/-/jobs/69247972

 src/libcamera/pipeline/rpi/pisp/meson.build:8:14: ERROR: Dependency 'libpisp' is required but not found.

I think we disable subprojects in the CI build maybe ?

Any thoughts anyone?

Do we need to build in libpisp into the CI as a dependency directly? Do
we need to manage keeping libcamera in sync with specific versions/API
compatibility of libpisp ?

--
Kieran

> 
> Thanks,
> Naush
> 
> Naushir Patuck (4):
>   meson: Add libpisp.wrap
>   ipa: rpi: Add support for Raspberry Pi 5
>   pipeline: rpi: Add new stream flags for PiSP
>   pipeline: rpi: Add support for Raspberry Pi 5
> 
>  Documentation/guides/pipeline-handler.rst     |    2 +-
>  include/libcamera/ipa/meson.build             |    1 +
>  include/libcamera/meson.build                 |    1 +
>  meson.build                                   |    1 +
>  meson_options.txt                             |    4 +-
>  src/ipa/rpi/pisp/data/imx219.json             | 1187 +++++++++
>  src/ipa/rpi/pisp/data/imx219_noir.json        | 1112 ++++++++
>  src/ipa/rpi/pisp/data/imx290.json             |  341 +++
>  src/ipa/rpi/pisp/data/imx296.json             | 1194 +++++++++
>  src/ipa/rpi/pisp/data/imx296_16mm.json        | 1247 +++++++++
>  src/ipa/rpi/pisp/data/imx296_6mm.json         | 1247 +++++++++
>  src/ipa/rpi/pisp/data/imx296_mono.json        |  960 +++++++
>  src/ipa/rpi/pisp/data/imx378.json             |  634 +++++
>  src/ipa/rpi/pisp/data/imx415.json             | 1159 ++++++++
>  src/ipa/rpi/pisp/data/imx462.json             |  342 +++
>  src/ipa/rpi/pisp/data/imx477.json             | 1186 +++++++++
>  src/ipa/rpi/pisp/data/imx477_16mm.json        | 1240 +++++++++
>  src/ipa/rpi/pisp/data/imx477_6mm.json         | 1240 +++++++++
>  src/ipa/rpi/pisp/data/imx477_noir.json        | 1148 ++++++++
>  src/ipa/rpi/pisp/data/imx477_scientific.json  |  546 ++++
>  src/ipa/rpi/pisp/data/imx519.json             |  634 +++++
>  src/ipa/rpi/pisp/data/imx708.json             | 1270 +++++++++
>  src/ipa/rpi/pisp/data/imx708_noir.json        | 1233 +++++++++
>  src/ipa/rpi/pisp/data/imx708_wide.json        | 1293 +++++++++
>  src/ipa/rpi/pisp/data/imx708_wide_noir.json   | 1148 ++++++++
>  src/ipa/rpi/pisp/data/meson.build             |   29 +
>  src/ipa/rpi/pisp/data/ov5647.json             | 1186 +++++++++
>  src/ipa/rpi/pisp/data/ov5647_noir.json        | 1121 ++++++++
>  src/ipa/rpi/pisp/data/ov64a40.json            | 1133 ++++++++
>  src/ipa/rpi/pisp/data/ov9281_mono.json        |  215 ++
>  src/ipa/rpi/pisp/data/se327m12.json           |  639 +++++
>  src/ipa/rpi/pisp/data/uncalibrated.json       |  135 +
>  src/ipa/rpi/pisp/meson.build                  |   49 +
>  src/ipa/rpi/pisp/pisp.cpp                     | 1068 ++++++++
>  src/libcamera/control_ids_rpi.yaml            |   13 +
>  .../pipeline/rpi/common/rpi_stream.h          |   10 +
>  .../pipeline/rpi/pisp/data/example.yaml       |   45 +
>  .../pipeline/rpi/pisp/data/meson.build        |    8 +
>  src/libcamera/pipeline/rpi/pisp/meson.build   |   12 +
>  src/libcamera/pipeline/rpi/pisp/pisp.cpp      | 2372 +++++++++++++++++
>  subprojects/.gitignore                        |    1 +
>  subprojects/libpisp.wrap                      |    6 +
>  42 files changed, 28410 insertions(+), 2 deletions(-)
>  create mode 100644 src/ipa/rpi/pisp/data/imx219.json
>  create mode 100644 src/ipa/rpi/pisp/data/imx219_noir.json
>  create mode 100644 src/ipa/rpi/pisp/data/imx290.json
>  create mode 100644 src/ipa/rpi/pisp/data/imx296.json
>  create mode 100644 src/ipa/rpi/pisp/data/imx296_16mm.json
>  create mode 100644 src/ipa/rpi/pisp/data/imx296_6mm.json
>  create mode 100644 src/ipa/rpi/pisp/data/imx296_mono.json
>  create mode 100644 src/ipa/rpi/pisp/data/imx378.json
>  create mode 100755 src/ipa/rpi/pisp/data/imx415.json
>  create mode 100644 src/ipa/rpi/pisp/data/imx462.json
>  create mode 100644 src/ipa/rpi/pisp/data/imx477.json
>  create mode 100644 src/ipa/rpi/pisp/data/imx477_16mm.json
>  create mode 100644 src/ipa/rpi/pisp/data/imx477_6mm.json
>  create mode 100644 src/ipa/rpi/pisp/data/imx477_noir.json
>  create mode 100644 src/ipa/rpi/pisp/data/imx477_scientific.json
>  create mode 100644 src/ipa/rpi/pisp/data/imx519.json
>  create mode 100644 src/ipa/rpi/pisp/data/imx708.json
>  create mode 100644 src/ipa/rpi/pisp/data/imx708_noir.json
>  create mode 100644 src/ipa/rpi/pisp/data/imx708_wide.json
>  create mode 100644 src/ipa/rpi/pisp/data/imx708_wide_noir.json
>  create mode 100644 src/ipa/rpi/pisp/data/meson.build
>  create mode 100644 src/ipa/rpi/pisp/data/ov5647.json
>  create mode 100644 src/ipa/rpi/pisp/data/ov5647_noir.json
>  create mode 100755 src/ipa/rpi/pisp/data/ov64a40.json
>  create mode 100644 src/ipa/rpi/pisp/data/ov9281_mono.json
>  create mode 100644 src/ipa/rpi/pisp/data/se327m12.json
>  create mode 100644 src/ipa/rpi/pisp/data/uncalibrated.json
>  create mode 100644 src/ipa/rpi/pisp/meson.build
>  create mode 100644 src/ipa/rpi/pisp/pisp.cpp
>  create mode 100644 src/libcamera/pipeline/rpi/pisp/data/example.yaml
>  create mode 100644 src/libcamera/pipeline/rpi/pisp/data/meson.build
>  create mode 100644 src/libcamera/pipeline/rpi/pisp/meson.build
>  create mode 100644 src/libcamera/pipeline/rpi/pisp/pisp.cpp
>  create mode 100644 subprojects/libpisp.wrap
> 
> -- 
> 2.43.0
>
Barnabás Pőcze Jan. 13, 2025, 12:29 p.m. UTC | #2
Hi


2025. január 13., hétfő 13:12 keltezéssel, Kieran Bingham <kieran.bingham@ideasonboard.com> írta:

> Hi Naush,
> 
> Quoting Naushir Patuck (2025-01-13 09:24:42)
> > Hi,
> >
> > A long time coming... this series add support for Raspberry Pi 5 (PiSP) to
> > upstream libcamera. The IPA and pipeline handler code have been taken mostly
> > unchanged from the Raspberry Pi downstream libcamera tree:
> > https://github.com/raspberrypi/libcamera. Support for IMX500 and CNNs are not
> > available in this series since we have yet to attempt to upstream the kernel
> > changes.
> >
> > IMPORTANT NOTE
> > --------------
> > The Pi 5 pipeline handler in this commit is NOT COMPATIBLE with the Raspberry Pi
> > kernel drivers just yet! Instead, you must use the mainline kernel upstream
> > drivers with this pipeline handler. When futher upstreaming development for
> > embedded data is completed, RPi will backport the upstream kernel drives to our
> > tree and this pipeline handler will then begin to work with both upstream and
> > downstream kernel trees.
> 
> Thanks for posting this!
> 
> The first issue we face is the dependency in libpisp in the CI loops it
> seems:
> 
> https://gitlab.freedesktop.org/camera/libcamera/-/pipelines/1344547
> 
> has many failed jobs, which I believe are all going to be more or less
> instances of:
> 
> https://gitlab.freedesktop.org/camera/libcamera/-/jobs/69247972
> 
>  src/libcamera/pipeline/rpi/pisp/meson.build:8:14: ERROR: Dependency 'libpisp' is required but not found.
> 
> I think we disable subprojects in the CI build maybe ?
> 
> Any thoughts anyone?

The `wrap_mode=nofallback` option causes the error. But `libpisp` should
also probably call

  meson.override_dependency('libpisp', libpisp_dep)

in its `src/meson.build`. And then there is no need for the explicit
`fallback: ['libpisp', 'libpisp_dep']` when calling `dependency()`.


Regards,
Barnabás Pőcze


> 
> Do we need to build in libpisp into the CI as a dependency directly? Do
> we need to manage keeping libcamera in sync with specific versions/API
> compatibility of libpisp ?
> 
> --
> Kieran
> 
> >
> > Thanks,
> > Naush
> >
> > Naushir Patuck (4):
> >   meson: Add libpisp.wrap
> >   ipa: rpi: Add support for Raspberry Pi 5
> >   pipeline: rpi: Add new stream flags for PiSP
> >   pipeline: rpi: Add support for Raspberry Pi 5
> >
> >  Documentation/guides/pipeline-handler.rst     |    2 +-
> >  include/libcamera/ipa/meson.build             |    1 +
> >  include/libcamera/meson.build                 |    1 +
> >  meson.build                                   |    1 +
> >  meson_options.txt                             |    4 +-
> >  src/ipa/rpi/pisp/data/imx219.json             | 1187 +++++++++
> >  src/ipa/rpi/pisp/data/imx219_noir.json        | 1112 ++++++++
> >  src/ipa/rpi/pisp/data/imx290.json             |  341 +++
> >  src/ipa/rpi/pisp/data/imx296.json             | 1194 +++++++++
> >  src/ipa/rpi/pisp/data/imx296_16mm.json        | 1247 +++++++++
> >  src/ipa/rpi/pisp/data/imx296_6mm.json         | 1247 +++++++++
> >  src/ipa/rpi/pisp/data/imx296_mono.json        |  960 +++++++
> >  src/ipa/rpi/pisp/data/imx378.json             |  634 +++++
> >  src/ipa/rpi/pisp/data/imx415.json             | 1159 ++++++++
> >  src/ipa/rpi/pisp/data/imx462.json             |  342 +++
> >  src/ipa/rpi/pisp/data/imx477.json             | 1186 +++++++++
> >  src/ipa/rpi/pisp/data/imx477_16mm.json        | 1240 +++++++++
> >  src/ipa/rpi/pisp/data/imx477_6mm.json         | 1240 +++++++++
> >  src/ipa/rpi/pisp/data/imx477_noir.json        | 1148 ++++++++
> >  src/ipa/rpi/pisp/data/imx477_scientific.json  |  546 ++++
> >  src/ipa/rpi/pisp/data/imx519.json             |  634 +++++
> >  src/ipa/rpi/pisp/data/imx708.json             | 1270 +++++++++
> >  src/ipa/rpi/pisp/data/imx708_noir.json        | 1233 +++++++++
> >  src/ipa/rpi/pisp/data/imx708_wide.json        | 1293 +++++++++
> >  src/ipa/rpi/pisp/data/imx708_wide_noir.json   | 1148 ++++++++
> >  src/ipa/rpi/pisp/data/meson.build             |   29 +
> >  src/ipa/rpi/pisp/data/ov5647.json             | 1186 +++++++++
> >  src/ipa/rpi/pisp/data/ov5647_noir.json        | 1121 ++++++++
> >  src/ipa/rpi/pisp/data/ov64a40.json            | 1133 ++++++++
> >  src/ipa/rpi/pisp/data/ov9281_mono.json        |  215 ++
> >  src/ipa/rpi/pisp/data/se327m12.json           |  639 +++++
> >  src/ipa/rpi/pisp/data/uncalibrated.json       |  135 +
> >  src/ipa/rpi/pisp/meson.build                  |   49 +
> >  src/ipa/rpi/pisp/pisp.cpp                     | 1068 ++++++++
> >  src/libcamera/control_ids_rpi.yaml            |   13 +
> >  .../pipeline/rpi/common/rpi_stream.h          |   10 +
> >  .../pipeline/rpi/pisp/data/example.yaml       |   45 +
> >  .../pipeline/rpi/pisp/data/meson.build        |    8 +
> >  src/libcamera/pipeline/rpi/pisp/meson.build   |   12 +
> >  src/libcamera/pipeline/rpi/pisp/pisp.cpp      | 2372 +++++++++++++++++
> >  subprojects/.gitignore                        |    1 +
> >  subprojects/libpisp.wrap                      |    6 +
> >  42 files changed, 28410 insertions(+), 2 deletions(-)
> >  create mode 100644 src/ipa/rpi/pisp/data/imx219.json
> >  create mode 100644 src/ipa/rpi/pisp/data/imx219_noir.json
> >  create mode 100644 src/ipa/rpi/pisp/data/imx290.json
> >  create mode 100644 src/ipa/rpi/pisp/data/imx296.json
> >  create mode 100644 src/ipa/rpi/pisp/data/imx296_16mm.json
> >  create mode 100644 src/ipa/rpi/pisp/data/imx296_6mm.json
> >  create mode 100644 src/ipa/rpi/pisp/data/imx296_mono.json
> >  create mode 100644 src/ipa/rpi/pisp/data/imx378.json
> >  create mode 100755 src/ipa/rpi/pisp/data/imx415.json
> >  create mode 100644 src/ipa/rpi/pisp/data/imx462.json
> >  create mode 100644 src/ipa/rpi/pisp/data/imx477.json
> >  create mode 100644 src/ipa/rpi/pisp/data/imx477_16mm.json
> >  create mode 100644 src/ipa/rpi/pisp/data/imx477_6mm.json
> >  create mode 100644 src/ipa/rpi/pisp/data/imx477_noir.json
> >  create mode 100644 src/ipa/rpi/pisp/data/imx477_scientific.json
> >  create mode 100644 src/ipa/rpi/pisp/data/imx519.json
> >  create mode 100644 src/ipa/rpi/pisp/data/imx708.json
> >  create mode 100644 src/ipa/rpi/pisp/data/imx708_noir.json
> >  create mode 100644 src/ipa/rpi/pisp/data/imx708_wide.json
> >  create mode 100644 src/ipa/rpi/pisp/data/imx708_wide_noir.json
> >  create mode 100644 src/ipa/rpi/pisp/data/meson.build
> >  create mode 100644 src/ipa/rpi/pisp/data/ov5647.json
> >  create mode 100644 src/ipa/rpi/pisp/data/ov5647_noir.json
> >  create mode 100755 src/ipa/rpi/pisp/data/ov64a40.json
> >  create mode 100644 src/ipa/rpi/pisp/data/ov9281_mono.json
> >  create mode 100644 src/ipa/rpi/pisp/data/se327m12.json
> >  create mode 100644 src/ipa/rpi/pisp/data/uncalibrated.json
> >  create mode 100644 src/ipa/rpi/pisp/meson.build
> >  create mode 100644 src/ipa/rpi/pisp/pisp.cpp
> >  create mode 100644 src/libcamera/pipeline/rpi/pisp/data/example.yaml
> >  create mode 100644 src/libcamera/pipeline/rpi/pisp/data/meson.build
> >  create mode 100644 src/libcamera/pipeline/rpi/pisp/meson.build
> >  create mode 100644 src/libcamera/pipeline/rpi/pisp/pisp.cpp
> >  create mode 100644 subprojects/libpisp.wrap
> >
> > --
> > 2.43.0
> >
>
Naushir Patuck Jan. 14, 2025, 9:54 a.m. UTC | #3
Hi,

On Mon, 13 Jan 2025 at 12:30, Barnabás Pőcze <pobrn@protonmail.com> wrote:
>
> Hi
>
>
> 2025. január 13., hétfő 13:12 keltezéssel, Kieran Bingham <kieran.bingham@ideasonboard.com> írta:
>
> > Hi Naush,
> >
> > Quoting Naushir Patuck (2025-01-13 09:24:42)
> > > Hi,
> > >
> > > A long time coming... this series add support for Raspberry Pi 5 (PiSP) to
> > > upstream libcamera. The IPA and pipeline handler code have been taken mostly
> > > unchanged from the Raspberry Pi downstream libcamera tree:
> > > https://github.com/raspberrypi/libcamera. Support for IMX500 and CNNs are not
> > > available in this series since we have yet to attempt to upstream the kernel
> > > changes.
> > >
> > > IMPORTANT NOTE
> > > --------------
> > > The Pi 5 pipeline handler in this commit is NOT COMPATIBLE with the Raspberry Pi
> > > kernel drivers just yet! Instead, you must use the mainline kernel upstream
> > > drivers with this pipeline handler. When futher upstreaming development for
> > > embedded data is completed, RPi will backport the upstream kernel drives to our
> > > tree and this pipeline handler will then begin to work with both upstream and
> > > downstream kernel trees.
> >
> > Thanks for posting this!
> >
> > The first issue we face is the dependency in libpisp in the CI loops it
> > seems:
> >
> > https://gitlab.freedesktop.org/camera/libcamera/-/pipelines/1344547
> >
> > has many failed jobs, which I believe are all going to be more or less
> > instances of:
> >
> > https://gitlab.freedesktop.org/camera/libcamera/-/jobs/69247972
> >
> >  src/libcamera/pipeline/rpi/pisp/meson.build:8:14: ERROR: Dependency 'libpisp' is required but not found.
> >
> > I think we disable subprojects in the CI build maybe ?
> >
> > Any thoughts anyone?
>
> The `wrap_mode=nofallback` option causes the error. But `libpisp` should
> also probably call
>
>   meson.override_dependency('libpisp', libpisp_dep)
>
> in its `src/meson.build`. And then there is no need for the explicit
> `fallback: ['libpisp', 'libpisp_dep']` when calling `dependency()`.

I presume this is just a syntactic change and will not fix the CI
issue?  I can remove the libpisp wrap file and have a hard dependency
on libpisp for the pipeline handler/ipa, but that will mean it won't
be tested under CI...

Naush

>
>
> Regards,
> Barnabás Pőcze
>
>
> >
> > Do we need to build in libpisp into the CI as a dependency directly? Do
> > we need to manage keeping libcamera in sync with specific versions/API
> > compatibility of libpisp ?
> >
> > --
> > Kieran
> >
> > >
> > > Thanks,
> > > Naush
> > >
> > > Naushir Patuck (4):
> > >   meson: Add libpisp.wrap
> > >   ipa: rpi: Add support for Raspberry Pi 5
> > >   pipeline: rpi: Add new stream flags for PiSP
> > >   pipeline: rpi: Add support for Raspberry Pi 5
> > >
> > >  Documentation/guides/pipeline-handler.rst     |    2 +-
> > >  include/libcamera/ipa/meson.build             |    1 +
> > >  include/libcamera/meson.build                 |    1 +
> > >  meson.build                                   |    1 +
> > >  meson_options.txt                             |    4 +-
> > >  src/ipa/rpi/pisp/data/imx219.json             | 1187 +++++++++
> > >  src/ipa/rpi/pisp/data/imx219_noir.json        | 1112 ++++++++
> > >  src/ipa/rpi/pisp/data/imx290.json             |  341 +++
> > >  src/ipa/rpi/pisp/data/imx296.json             | 1194 +++++++++
> > >  src/ipa/rpi/pisp/data/imx296_16mm.json        | 1247 +++++++++
> > >  src/ipa/rpi/pisp/data/imx296_6mm.json         | 1247 +++++++++
> > >  src/ipa/rpi/pisp/data/imx296_mono.json        |  960 +++++++
> > >  src/ipa/rpi/pisp/data/imx378.json             |  634 +++++
> > >  src/ipa/rpi/pisp/data/imx415.json             | 1159 ++++++++
> > >  src/ipa/rpi/pisp/data/imx462.json             |  342 +++
> > >  src/ipa/rpi/pisp/data/imx477.json             | 1186 +++++++++
> > >  src/ipa/rpi/pisp/data/imx477_16mm.json        | 1240 +++++++++
> > >  src/ipa/rpi/pisp/data/imx477_6mm.json         | 1240 +++++++++
> > >  src/ipa/rpi/pisp/data/imx477_noir.json        | 1148 ++++++++
> > >  src/ipa/rpi/pisp/data/imx477_scientific.json  |  546 ++++
> > >  src/ipa/rpi/pisp/data/imx519.json             |  634 +++++
> > >  src/ipa/rpi/pisp/data/imx708.json             | 1270 +++++++++
> > >  src/ipa/rpi/pisp/data/imx708_noir.json        | 1233 +++++++++
> > >  src/ipa/rpi/pisp/data/imx708_wide.json        | 1293 +++++++++
> > >  src/ipa/rpi/pisp/data/imx708_wide_noir.json   | 1148 ++++++++
> > >  src/ipa/rpi/pisp/data/meson.build             |   29 +
> > >  src/ipa/rpi/pisp/data/ov5647.json             | 1186 +++++++++
> > >  src/ipa/rpi/pisp/data/ov5647_noir.json        | 1121 ++++++++
> > >  src/ipa/rpi/pisp/data/ov64a40.json            | 1133 ++++++++
> > >  src/ipa/rpi/pisp/data/ov9281_mono.json        |  215 ++
> > >  src/ipa/rpi/pisp/data/se327m12.json           |  639 +++++
> > >  src/ipa/rpi/pisp/data/uncalibrated.json       |  135 +
> > >  src/ipa/rpi/pisp/meson.build                  |   49 +
> > >  src/ipa/rpi/pisp/pisp.cpp                     | 1068 ++++++++
> > >  src/libcamera/control_ids_rpi.yaml            |   13 +
> > >  .../pipeline/rpi/common/rpi_stream.h          |   10 +
> > >  .../pipeline/rpi/pisp/data/example.yaml       |   45 +
> > >  .../pipeline/rpi/pisp/data/meson.build        |    8 +
> > >  src/libcamera/pipeline/rpi/pisp/meson.build   |   12 +
> > >  src/libcamera/pipeline/rpi/pisp/pisp.cpp      | 2372 +++++++++++++++++
> > >  subprojects/.gitignore                        |    1 +
> > >  subprojects/libpisp.wrap                      |    6 +
> > >  42 files changed, 28410 insertions(+), 2 deletions(-)
> > >  create mode 100644 src/ipa/rpi/pisp/data/imx219.json
> > >  create mode 100644 src/ipa/rpi/pisp/data/imx219_noir.json
> > >  create mode 100644 src/ipa/rpi/pisp/data/imx290.json
> > >  create mode 100644 src/ipa/rpi/pisp/data/imx296.json
> > >  create mode 100644 src/ipa/rpi/pisp/data/imx296_16mm.json
> > >  create mode 100644 src/ipa/rpi/pisp/data/imx296_6mm.json
> > >  create mode 100644 src/ipa/rpi/pisp/data/imx296_mono.json
> > >  create mode 100644 src/ipa/rpi/pisp/data/imx378.json
> > >  create mode 100755 src/ipa/rpi/pisp/data/imx415.json
> > >  create mode 100644 src/ipa/rpi/pisp/data/imx462.json
> > >  create mode 100644 src/ipa/rpi/pisp/data/imx477.json
> > >  create mode 100644 src/ipa/rpi/pisp/data/imx477_16mm.json
> > >  create mode 100644 src/ipa/rpi/pisp/data/imx477_6mm.json
> > >  create mode 100644 src/ipa/rpi/pisp/data/imx477_noir.json
> > >  create mode 100644 src/ipa/rpi/pisp/data/imx477_scientific.json
> > >  create mode 100644 src/ipa/rpi/pisp/data/imx519.json
> > >  create mode 100644 src/ipa/rpi/pisp/data/imx708.json
> > >  create mode 100644 src/ipa/rpi/pisp/data/imx708_noir.json
> > >  create mode 100644 src/ipa/rpi/pisp/data/imx708_wide.json
> > >  create mode 100644 src/ipa/rpi/pisp/data/imx708_wide_noir.json
> > >  create mode 100644 src/ipa/rpi/pisp/data/meson.build
> > >  create mode 100644 src/ipa/rpi/pisp/data/ov5647.json
> > >  create mode 100644 src/ipa/rpi/pisp/data/ov5647_noir.json
> > >  create mode 100755 src/ipa/rpi/pisp/data/ov64a40.json
> > >  create mode 100644 src/ipa/rpi/pisp/data/ov9281_mono.json
> > >  create mode 100644 src/ipa/rpi/pisp/data/se327m12.json
> > >  create mode 100644 src/ipa/rpi/pisp/data/uncalibrated.json
> > >  create mode 100644 src/ipa/rpi/pisp/meson.build
> > >  create mode 100644 src/ipa/rpi/pisp/pisp.cpp
> > >  create mode 100644 src/libcamera/pipeline/rpi/pisp/data/example.yaml
> > >  create mode 100644 src/libcamera/pipeline/rpi/pisp/data/meson.build
> > >  create mode 100644 src/libcamera/pipeline/rpi/pisp/meson.build
> > >  create mode 100644 src/libcamera/pipeline/rpi/pisp/pisp.cpp
> > >  create mode 100644 subprojects/libpisp.wrap
> > >
> > > --
> > > 2.43.0
> > >
> >
Barnabás Pőcze Jan. 14, 2025, 4:29 p.m. UTC | #4
2025. január 14., kedd 10:54 keltezéssel, Naushir Patuck <naush@raspberrypi.com> írta:

> Hi,
> 
> On Mon, 13 Jan 2025 at 12:30, Barnabás Pőcze <pobrn@protonmail.com> wrote:
> >
> > Hi
> >
> >
> > 2025. január 13., hétfő 13:12 keltezéssel, Kieran Bingham <kieran.bingham@ideasonboard.com> írta:
> >
> > > Hi Naush,
> > >
> > > Quoting Naushir Patuck (2025-01-13 09:24:42)
> > > > Hi,
> > > >
> > > > A long time coming... this series add support for Raspberry Pi 5 (PiSP) to
> > > > upstream libcamera. The IPA and pipeline handler code have been taken mostly
> > > > unchanged from the Raspberry Pi downstream libcamera tree:
> > > > https://github.com/raspberrypi/libcamera. Support for IMX500 and CNNs are not
> > > > available in this series since we have yet to attempt to upstream the kernel
> > > > changes.
> > > >
> > > > IMPORTANT NOTE
> > > > --------------
> > > > The Pi 5 pipeline handler in this commit is NOT COMPATIBLE with the Raspberry Pi
> > > > kernel drivers just yet! Instead, you must use the mainline kernel upstream
> > > > drivers with this pipeline handler. When futher upstreaming development for
> > > > embedded data is completed, RPi will backport the upstream kernel drives to our
> > > > tree and this pipeline handler will then begin to work with both upstream and
> > > > downstream kernel trees.
> > >
> > > Thanks for posting this!
> > >
> > > The first issue we face is the dependency in libpisp in the CI loops it
> > > seems:
> > >
> > > https://gitlab.freedesktop.org/camera/libcamera/-/pipelines/1344547
> > >
> > > has many failed jobs, which I believe are all going to be more or less
> > > instances of:
> > >
> > > https://gitlab.freedesktop.org/camera/libcamera/-/jobs/69247972
> > >
> > >  src/libcamera/pipeline/rpi/pisp/meson.build:8:14: ERROR: Dependency 'libpisp' is required but not found.
> > >
> > > I think we disable subprojects in the CI build maybe ?
> > >
> > > Any thoughts anyone?
> >
> > The `wrap_mode=nofallback` option causes the error. But `libpisp` should
> > also probably call
> >
> >   meson.override_dependency('libpisp', libpisp_dep)
> >
> > in its `src/meson.build`. And then there is no need for the explicit
> > `fallback: ['libpisp', 'libpisp_dep']` when calling `dependency()`.
> 
> I presume this is just a syntactic change and will not fix the CI
> issue?  I can remove the libpisp wrap file and have a hard dependency
> on libpisp for the pipeline handler/ipa, but that will mean it won't
> be tested under CI...

Yes, this will not solve the issue, but useful nonetheless. It would appear that
`-D force_fallback_for=libpisp` is enough to make it work, but there are other
jobs that want to use that option, and multiple occurrences overwrite each other.
I am not sure what the best approach is. `--wrap-mode=nofallback` could be removed
altogether, or replaced with `--wrap-mode=nodownload` + some magic to bring in the
necessary dependencies, or something else.


Regards,
Barnabás Pőcze


> 
> Naush
> 
> >
> >
> > Regards,
> > Barnabás Pőcze
> >
> >
> > >
> > > Do we need to build in libpisp into the CI as a dependency directly? Do
> > > we need to manage keeping libcamera in sync with specific versions/API
> > > compatibility of libpisp ?
> > >
> > > --
> > > Kieran
> > >
> > > >
> > > > Thanks,
> > > > Naush
> > > >
> > > > Naushir Patuck (4):
> > > >   meson: Add libpisp.wrap
> > > >   ipa: rpi: Add support for Raspberry Pi 5
> > > >   pipeline: rpi: Add new stream flags for PiSP
> > > >   pipeline: rpi: Add support for Raspberry Pi 5
> > > >
> > > >  Documentation/guides/pipeline-handler.rst     |    2 +-
> > > >  include/libcamera/ipa/meson.build             |    1 +
> > > >  include/libcamera/meson.build                 |    1 +
> > > >  meson.build                                   |    1 +
> > > >  meson_options.txt                             |    4 +-
> > > >  src/ipa/rpi/pisp/data/imx219.json             | 1187 +++++++++
> > > >  src/ipa/rpi/pisp/data/imx219_noir.json        | 1112 ++++++++
> > > >  src/ipa/rpi/pisp/data/imx290.json             |  341 +++
> > > >  src/ipa/rpi/pisp/data/imx296.json             | 1194 +++++++++
> > > >  src/ipa/rpi/pisp/data/imx296_16mm.json        | 1247 +++++++++
> > > >  src/ipa/rpi/pisp/data/imx296_6mm.json         | 1247 +++++++++
> > > >  src/ipa/rpi/pisp/data/imx296_mono.json        |  960 +++++++
> > > >  src/ipa/rpi/pisp/data/imx378.json             |  634 +++++
> > > >  src/ipa/rpi/pisp/data/imx415.json             | 1159 ++++++++
> > > >  src/ipa/rpi/pisp/data/imx462.json             |  342 +++
> > > >  src/ipa/rpi/pisp/data/imx477.json             | 1186 +++++++++
> > > >  src/ipa/rpi/pisp/data/imx477_16mm.json        | 1240 +++++++++
> > > >  src/ipa/rpi/pisp/data/imx477_6mm.json         | 1240 +++++++++
> > > >  src/ipa/rpi/pisp/data/imx477_noir.json        | 1148 ++++++++
> > > >  src/ipa/rpi/pisp/data/imx477_scientific.json  |  546 ++++
> > > >  src/ipa/rpi/pisp/data/imx519.json             |  634 +++++
> > > >  src/ipa/rpi/pisp/data/imx708.json             | 1270 +++++++++
> > > >  src/ipa/rpi/pisp/data/imx708_noir.json        | 1233 +++++++++
> > > >  src/ipa/rpi/pisp/data/imx708_wide.json        | 1293 +++++++++
> > > >  src/ipa/rpi/pisp/data/imx708_wide_noir.json   | 1148 ++++++++
> > > >  src/ipa/rpi/pisp/data/meson.build             |   29 +
> > > >  src/ipa/rpi/pisp/data/ov5647.json             | 1186 +++++++++
> > > >  src/ipa/rpi/pisp/data/ov5647_noir.json        | 1121 ++++++++
> > > >  src/ipa/rpi/pisp/data/ov64a40.json            | 1133 ++++++++
> > > >  src/ipa/rpi/pisp/data/ov9281_mono.json        |  215 ++
> > > >  src/ipa/rpi/pisp/data/se327m12.json           |  639 +++++
> > > >  src/ipa/rpi/pisp/data/uncalibrated.json       |  135 +
> > > >  src/ipa/rpi/pisp/meson.build                  |   49 +
> > > >  src/ipa/rpi/pisp/pisp.cpp                     | 1068 ++++++++
> > > >  src/libcamera/control_ids_rpi.yaml            |   13 +
> > > >  .../pipeline/rpi/common/rpi_stream.h          |   10 +
> > > >  .../pipeline/rpi/pisp/data/example.yaml       |   45 +
> > > >  .../pipeline/rpi/pisp/data/meson.build        |    8 +
> > > >  src/libcamera/pipeline/rpi/pisp/meson.build   |   12 +
> > > >  src/libcamera/pipeline/rpi/pisp/pisp.cpp      | 2372 +++++++++++++++++
> > > >  subprojects/.gitignore                        |    1 +
> > > >  subprojects/libpisp.wrap                      |    6 +
> > > >  42 files changed, 28410 insertions(+), 2 deletions(-)
> > > >  create mode 100644 src/ipa/rpi/pisp/data/imx219.json
> > > >  create mode 100644 src/ipa/rpi/pisp/data/imx219_noir.json
> > > >  create mode 100644 src/ipa/rpi/pisp/data/imx290.json
> > > >  create mode 100644 src/ipa/rpi/pisp/data/imx296.json
> > > >  create mode 100644 src/ipa/rpi/pisp/data/imx296_16mm.json
> > > >  create mode 100644 src/ipa/rpi/pisp/data/imx296_6mm.json
> > > >  create mode 100644 src/ipa/rpi/pisp/data/imx296_mono.json
> > > >  create mode 100644 src/ipa/rpi/pisp/data/imx378.json
> > > >  create mode 100755 src/ipa/rpi/pisp/data/imx415.json
> > > >  create mode 100644 src/ipa/rpi/pisp/data/imx462.json
> > > >  create mode 100644 src/ipa/rpi/pisp/data/imx477.json
> > > >  create mode 100644 src/ipa/rpi/pisp/data/imx477_16mm.json
> > > >  create mode 100644 src/ipa/rpi/pisp/data/imx477_6mm.json
> > > >  create mode 100644 src/ipa/rpi/pisp/data/imx477_noir.json
> > > >  create mode 100644 src/ipa/rpi/pisp/data/imx477_scientific.json
> > > >  create mode 100644 src/ipa/rpi/pisp/data/imx519.json
> > > >  create mode 100644 src/ipa/rpi/pisp/data/imx708.json
> > > >  create mode 100644 src/ipa/rpi/pisp/data/imx708_noir.json
> > > >  create mode 100644 src/ipa/rpi/pisp/data/imx708_wide.json
> > > >  create mode 100644 src/ipa/rpi/pisp/data/imx708_wide_noir.json
> > > >  create mode 100644 src/ipa/rpi/pisp/data/meson.build
> > > >  create mode 100644 src/ipa/rpi/pisp/data/ov5647.json
> > > >  create mode 100644 src/ipa/rpi/pisp/data/ov5647_noir.json
> > > >  create mode 100755 src/ipa/rpi/pisp/data/ov64a40.json
> > > >  create mode 100644 src/ipa/rpi/pisp/data/ov9281_mono.json
> > > >  create mode 100644 src/ipa/rpi/pisp/data/se327m12.json
> > > >  create mode 100644 src/ipa/rpi/pisp/data/uncalibrated.json
> > > >  create mode 100644 src/ipa/rpi/pisp/meson.build
> > > >  create mode 100644 src/ipa/rpi/pisp/pisp.cpp
> > > >  create mode 100644 src/libcamera/pipeline/rpi/pisp/data/example.yaml
> > > >  create mode 100644 src/libcamera/pipeline/rpi/pisp/data/meson.build
> > > >  create mode 100644 src/libcamera/pipeline/rpi/pisp/meson.build
> > > >  create mode 100644 src/libcamera/pipeline/rpi/pisp/pisp.cpp
> > > >  create mode 100644 subprojects/libpisp.wrap
> > > >
> > > > --
> > > > 2.43.0
> > > >
> > >
>
Laurent Pinchart Jan. 14, 2025, 8:46 p.m. UTC | #5
On Tue, Jan 14, 2025 at 04:29:14PM +0000, Barnabás Pőcze wrote:
> 2025. január 14., kedd 10:54 keltezéssel, Naushir Patuck írta:
> > On Mon, 13 Jan 2025 at 12:30, Barnabás Pőcze wrote:
> > > 2025. január 13., hétfő 13:12 keltezéssel, Kieran Bingham írta:
> > > > Quoting Naushir Patuck (2025-01-13 09:24:42)
> > > > > Hi,
> > > > >
> > > > > A long time coming... this series add support for Raspberry Pi 5 (PiSP) to
> > > > > upstream libcamera. The IPA and pipeline handler code have been taken mostly
> > > > > unchanged from the Raspberry Pi downstream libcamera tree:
> > > > > https://github.com/raspberrypi/libcamera. Support for IMX500 and CNNs are not
> > > > > available in this series since we have yet to attempt to upstream the kernel
> > > > > changes.
> > > > >
> > > > > IMPORTANT NOTE
> > > > > --------------
> > > > > The Pi 5 pipeline handler in this commit is NOT COMPATIBLE with the Raspberry Pi
> > > > > kernel drivers just yet! Instead, you must use the mainline kernel upstream
> > > > > drivers with this pipeline handler. When futher upstreaming development for
> > > > > embedded data is completed, RPi will backport the upstream kernel drives to our
> > > > > tree and this pipeline handler will then begin to work with both upstream and
> > > > > downstream kernel trees.
> > > >
> > > > Thanks for posting this!
> > > >
> > > > The first issue we face is the dependency in libpisp in the CI loops it
> > > > seems:
> > > >
> > > > https://gitlab.freedesktop.org/camera/libcamera/-/pipelines/1344547
> > > >
> > > > has many failed jobs, which I believe are all going to be more or less
> > > > instances of:
> > > >
> > > > https://gitlab.freedesktop.org/camera/libcamera/-/jobs/69247972
> > > >
> > > >  src/libcamera/pipeline/rpi/pisp/meson.build:8:14: ERROR: Dependency 'libpisp' is required but not found.
> > > >
> > > > I think we disable subprojects in the CI build maybe ?
> > > >
> > > > Any thoughts anyone?
> > >
> > > The `wrap_mode=nofallback` option causes the error. But `libpisp` should
> > > also probably call
> > >
> > >   meson.override_dependency('libpisp', libpisp_dep)
> > >
> > > in its `src/meson.build`. And then there is no need for the explicit
> > > `fallback: ['libpisp', 'libpisp_dep']` when calling `dependency()`.
> > 
> > I presume this is just a syntactic change and will not fix the CI
> > issue?  I can remove the libpisp wrap file and have a hard dependency
> > on libpisp for the pipeline handler/ipa, but that will mean it won't
> > be tested under CI...
> 
> Yes, this will not solve the issue, but useful nonetheless. It would appear that
> `-D force_fallback_for=libpisp` is enough to make it work, but there are other
> jobs that want to use that option, and multiple occurrences overwrite each other.
> I am not sure what the best approach is. `--wrap-mode=nofallback` could be removed
> altogether, or replaced with `--wrap-mode=nodownload` + some magic to bring in the
> necessary dependencies, or something else.

If we have to compile the dependencies from source, I would rather do
this at container build time to avoid CI failures unrelated to libcamera
itself.

> > > > Do we need to build in libpisp into the CI as a dependency directly? Do
> > > > we need to manage keeping libcamera in sync with specific versions/API
> > > > compatibility of libpisp ?
> > > >
> > > > > Naushir Patuck (4):
> > > > >   meson: Add libpisp.wrap
> > > > >   ipa: rpi: Add support for Raspberry Pi 5
> > > > >   pipeline: rpi: Add new stream flags for PiSP
> > > > >   pipeline: rpi: Add support for Raspberry Pi 5
> > > > >
> > > > >  Documentation/guides/pipeline-handler.rst     |    2 +-
> > > > >  include/libcamera/ipa/meson.build             |    1 +
> > > > >  include/libcamera/meson.build                 |    1 +
> > > > >  meson.build                                   |    1 +
> > > > >  meson_options.txt                             |    4 +-
> > > > >  src/ipa/rpi/pisp/data/imx219.json             | 1187 +++++++++
> > > > >  src/ipa/rpi/pisp/data/imx219_noir.json        | 1112 ++++++++
> > > > >  src/ipa/rpi/pisp/data/imx290.json             |  341 +++
> > > > >  src/ipa/rpi/pisp/data/imx296.json             | 1194 +++++++++
> > > > >  src/ipa/rpi/pisp/data/imx296_16mm.json        | 1247 +++++++++
> > > > >  src/ipa/rpi/pisp/data/imx296_6mm.json         | 1247 +++++++++
> > > > >  src/ipa/rpi/pisp/data/imx296_mono.json        |  960 +++++++
> > > > >  src/ipa/rpi/pisp/data/imx378.json             |  634 +++++
> > > > >  src/ipa/rpi/pisp/data/imx415.json             | 1159 ++++++++
> > > > >  src/ipa/rpi/pisp/data/imx462.json             |  342 +++
> > > > >  src/ipa/rpi/pisp/data/imx477.json             | 1186 +++++++++
> > > > >  src/ipa/rpi/pisp/data/imx477_16mm.json        | 1240 +++++++++
> > > > >  src/ipa/rpi/pisp/data/imx477_6mm.json         | 1240 +++++++++
> > > > >  src/ipa/rpi/pisp/data/imx477_noir.json        | 1148 ++++++++
> > > > >  src/ipa/rpi/pisp/data/imx477_scientific.json  |  546 ++++
> > > > >  src/ipa/rpi/pisp/data/imx519.json             |  634 +++++
> > > > >  src/ipa/rpi/pisp/data/imx708.json             | 1270 +++++++++
> > > > >  src/ipa/rpi/pisp/data/imx708_noir.json        | 1233 +++++++++
> > > > >  src/ipa/rpi/pisp/data/imx708_wide.json        | 1293 +++++++++
> > > > >  src/ipa/rpi/pisp/data/imx708_wide_noir.json   | 1148 ++++++++
> > > > >  src/ipa/rpi/pisp/data/meson.build             |   29 +
> > > > >  src/ipa/rpi/pisp/data/ov5647.json             | 1186 +++++++++
> > > > >  src/ipa/rpi/pisp/data/ov5647_noir.json        | 1121 ++++++++
> > > > >  src/ipa/rpi/pisp/data/ov64a40.json            | 1133 ++++++++
> > > > >  src/ipa/rpi/pisp/data/ov9281_mono.json        |  215 ++
> > > > >  src/ipa/rpi/pisp/data/se327m12.json           |  639 +++++
> > > > >  src/ipa/rpi/pisp/data/uncalibrated.json       |  135 +
> > > > >  src/ipa/rpi/pisp/meson.build                  |   49 +
> > > > >  src/ipa/rpi/pisp/pisp.cpp                     | 1068 ++++++++
> > > > >  src/libcamera/control_ids_rpi.yaml            |   13 +
> > > > >  .../pipeline/rpi/common/rpi_stream.h          |   10 +
> > > > >  .../pipeline/rpi/pisp/data/example.yaml       |   45 +
> > > > >  .../pipeline/rpi/pisp/data/meson.build        |    8 +
> > > > >  src/libcamera/pipeline/rpi/pisp/meson.build   |   12 +
> > > > >  src/libcamera/pipeline/rpi/pisp/pisp.cpp      | 2372 +++++++++++++++++
> > > > >  subprojects/.gitignore                        |    1 +
> > > > >  subprojects/libpisp.wrap                      |    6 +
> > > > >  42 files changed, 28410 insertions(+), 2 deletions(-)
> > > > >  create mode 100644 src/ipa/rpi/pisp/data/imx219.json
> > > > >  create mode 100644 src/ipa/rpi/pisp/data/imx219_noir.json
> > > > >  create mode 100644 src/ipa/rpi/pisp/data/imx290.json
> > > > >  create mode 100644 src/ipa/rpi/pisp/data/imx296.json
> > > > >  create mode 100644 src/ipa/rpi/pisp/data/imx296_16mm.json
> > > > >  create mode 100644 src/ipa/rpi/pisp/data/imx296_6mm.json
> > > > >  create mode 100644 src/ipa/rpi/pisp/data/imx296_mono.json
> > > > >  create mode 100644 src/ipa/rpi/pisp/data/imx378.json
> > > > >  create mode 100755 src/ipa/rpi/pisp/data/imx415.json
> > > > >  create mode 100644 src/ipa/rpi/pisp/data/imx462.json
> > > > >  create mode 100644 src/ipa/rpi/pisp/data/imx477.json
> > > > >  create mode 100644 src/ipa/rpi/pisp/data/imx477_16mm.json
> > > > >  create mode 100644 src/ipa/rpi/pisp/data/imx477_6mm.json
> > > > >  create mode 100644 src/ipa/rpi/pisp/data/imx477_noir.json
> > > > >  create mode 100644 src/ipa/rpi/pisp/data/imx477_scientific.json
> > > > >  create mode 100644 src/ipa/rpi/pisp/data/imx519.json
> > > > >  create mode 100644 src/ipa/rpi/pisp/data/imx708.json
> > > > >  create mode 100644 src/ipa/rpi/pisp/data/imx708_noir.json
> > > > >  create mode 100644 src/ipa/rpi/pisp/data/imx708_wide.json
> > > > >  create mode 100644 src/ipa/rpi/pisp/data/imx708_wide_noir.json
> > > > >  create mode 100644 src/ipa/rpi/pisp/data/meson.build
> > > > >  create mode 100644 src/ipa/rpi/pisp/data/ov5647.json
> > > > >  create mode 100644 src/ipa/rpi/pisp/data/ov5647_noir.json
> > > > >  create mode 100755 src/ipa/rpi/pisp/data/ov64a40.json
> > > > >  create mode 100644 src/ipa/rpi/pisp/data/ov9281_mono.json
> > > > >  create mode 100644 src/ipa/rpi/pisp/data/se327m12.json
> > > > >  create mode 100644 src/ipa/rpi/pisp/data/uncalibrated.json
> > > > >  create mode 100644 src/ipa/rpi/pisp/meson.build
> > > > >  create mode 100644 src/ipa/rpi/pisp/pisp.cpp
> > > > >  create mode 100644 src/libcamera/pipeline/rpi/pisp/data/example.yaml
> > > > >  create mode 100644 src/libcamera/pipeline/rpi/pisp/data/meson.build
> > > > >  create mode 100644 src/libcamera/pipeline/rpi/pisp/meson.build
> > > > >  create mode 100644 src/libcamera/pipeline/rpi/pisp/pisp.cpp
> > > > >  create mode 100644 subprojects/libpisp.wrap
Laurent Pinchart Jan. 14, 2025, 8:51 p.m. UTC | #6
On Tue, Jan 14, 2025 at 10:46:18PM +0200, Laurent Pinchart wrote:
> On Tue, Jan 14, 2025 at 04:29:14PM +0000, Barnabás Pőcze wrote:
> > 2025. január 14., kedd 10:54 keltezéssel, Naushir Patuck írta:
> > > On Mon, 13 Jan 2025 at 12:30, Barnabás Pőcze wrote:
> > > > 2025. január 13., hétfő 13:12 keltezéssel, Kieran Bingham írta:
> > > > > Quoting Naushir Patuck (2025-01-13 09:24:42)
> > > > > > Hi,
> > > > > >
> > > > > > A long time coming... this series add support for Raspberry Pi 5 (PiSP) to
> > > > > > upstream libcamera. The IPA and pipeline handler code have been taken mostly
> > > > > > unchanged from the Raspberry Pi downstream libcamera tree:
> > > > > > https://github.com/raspberrypi/libcamera. Support for IMX500 and CNNs are not
> > > > > > available in this series since we have yet to attempt to upstream the kernel
> > > > > > changes.
> > > > > >
> > > > > > IMPORTANT NOTE
> > > > > > --------------
> > > > > > The Pi 5 pipeline handler in this commit is NOT COMPATIBLE with the Raspberry Pi
> > > > > > kernel drivers just yet! Instead, you must use the mainline kernel upstream
> > > > > > drivers with this pipeline handler. When futher upstreaming development for
> > > > > > embedded data is completed, RPi will backport the upstream kernel drives to our
> > > > > > tree and this pipeline handler will then begin to work with both upstream and
> > > > > > downstream kernel trees.
> > > > >
> > > > > Thanks for posting this!
> > > > >
> > > > > The first issue we face is the dependency in libpisp in the CI loops it
> > > > > seems:
> > > > >
> > > > > https://gitlab.freedesktop.org/camera/libcamera/-/pipelines/1344547
> > > > >
> > > > > has many failed jobs, which I believe are all going to be more or less
> > > > > instances of:
> > > > >
> > > > > https://gitlab.freedesktop.org/camera/libcamera/-/jobs/69247972
> > > > >
> > > > >  src/libcamera/pipeline/rpi/pisp/meson.build:8:14: ERROR: Dependency 'libpisp' is required but not found.
> > > > >
> > > > > I think we disable subprojects in the CI build maybe ?
> > > > >
> > > > > Any thoughts anyone?
> > > >
> > > > The `wrap_mode=nofallback` option causes the error. But `libpisp` should
> > > > also probably call
> > > >
> > > >   meson.override_dependency('libpisp', libpisp_dep)
> > > >
> > > > in its `src/meson.build`. And then there is no need for the explicit
> > > > `fallback: ['libpisp', 'libpisp_dep']` when calling `dependency()`.
> > > 
> > > I presume this is just a syntactic change and will not fix the CI
> > > issue?  I can remove the libpisp wrap file and have a hard dependency
> > > on libpisp for the pipeline handler/ipa, but that will mean it won't
> > > be tested under CI...
> > 
> > Yes, this will not solve the issue, but useful nonetheless. It would appear that
> > `-D force_fallback_for=libpisp` is enough to make it work, but there are other
> > jobs that want to use that option, and multiple occurrences overwrite each other.
> > I am not sure what the best approach is. `--wrap-mode=nofallback` could be removed
> > altogether, or replaced with `--wrap-mode=nodownload` + some magic to bring in the
> > necessary dependencies, or something else.
> 
> If we have to compile the dependencies from source, I would rather do
> this at container build time to avoid CI failures unrelated to libcamera
> itself.

Also, when compiling libcamera today with a gcc 13.3.0 cross-compiler
from buildroot 2024.11.1, I got the following error:

../../src/libcamera/pipeline/rpi/pisp/pisp.cpp: In member function ‘void libcamera::PiSPCameraData::cfeBufferDequeue(libcamera::FrameBuffer*)’:
../../src/libcamera/pipeline/rpi/pisp/pisp.cpp:1680:28: error: ‘index’ may be used uninitialized [-Werror=maybe-uninitialized]
 1680 |                         << ", timestamp: " << buffer->metadata().timestamp;
      |                            ^~~~~~~~~~~~~~~
../../src/libcamera/pipeline/rpi/pisp/pisp.cpp:1656:13: note: ‘index’ was declared here
 1656 |         int index;
      |             ^~~~~

I haven't tested with other compiler versions yet, CI will give us more
information once we handle the libpisp dependency.

> > > > > Do we need to build in libpisp into the CI as a dependency directly? Do
> > > > > we need to manage keeping libcamera in sync with specific versions/API
> > > > > compatibility of libpisp ?
> > > > >
> > > > > > Naushir Patuck (4):
> > > > > >   meson: Add libpisp.wrap
> > > > > >   ipa: rpi: Add support for Raspberry Pi 5
> > > > > >   pipeline: rpi: Add new stream flags for PiSP
> > > > > >   pipeline: rpi: Add support for Raspberry Pi 5
> > > > > >
> > > > > >  Documentation/guides/pipeline-handler.rst     |    2 +-
> > > > > >  include/libcamera/ipa/meson.build             |    1 +
> > > > > >  include/libcamera/meson.build                 |    1 +
> > > > > >  meson.build                                   |    1 +
> > > > > >  meson_options.txt                             |    4 +-
> > > > > >  src/ipa/rpi/pisp/data/imx219.json             | 1187 +++++++++
> > > > > >  src/ipa/rpi/pisp/data/imx219_noir.json        | 1112 ++++++++
> > > > > >  src/ipa/rpi/pisp/data/imx290.json             |  341 +++
> > > > > >  src/ipa/rpi/pisp/data/imx296.json             | 1194 +++++++++
> > > > > >  src/ipa/rpi/pisp/data/imx296_16mm.json        | 1247 +++++++++
> > > > > >  src/ipa/rpi/pisp/data/imx296_6mm.json         | 1247 +++++++++
> > > > > >  src/ipa/rpi/pisp/data/imx296_mono.json        |  960 +++++++
> > > > > >  src/ipa/rpi/pisp/data/imx378.json             |  634 +++++
> > > > > >  src/ipa/rpi/pisp/data/imx415.json             | 1159 ++++++++
> > > > > >  src/ipa/rpi/pisp/data/imx462.json             |  342 +++
> > > > > >  src/ipa/rpi/pisp/data/imx477.json             | 1186 +++++++++
> > > > > >  src/ipa/rpi/pisp/data/imx477_16mm.json        | 1240 +++++++++
> > > > > >  src/ipa/rpi/pisp/data/imx477_6mm.json         | 1240 +++++++++
> > > > > >  src/ipa/rpi/pisp/data/imx477_noir.json        | 1148 ++++++++
> > > > > >  src/ipa/rpi/pisp/data/imx477_scientific.json  |  546 ++++
> > > > > >  src/ipa/rpi/pisp/data/imx519.json             |  634 +++++
> > > > > >  src/ipa/rpi/pisp/data/imx708.json             | 1270 +++++++++
> > > > > >  src/ipa/rpi/pisp/data/imx708_noir.json        | 1233 +++++++++
> > > > > >  src/ipa/rpi/pisp/data/imx708_wide.json        | 1293 +++++++++
> > > > > >  src/ipa/rpi/pisp/data/imx708_wide_noir.json   | 1148 ++++++++
> > > > > >  src/ipa/rpi/pisp/data/meson.build             |   29 +
> > > > > >  src/ipa/rpi/pisp/data/ov5647.json             | 1186 +++++++++
> > > > > >  src/ipa/rpi/pisp/data/ov5647_noir.json        | 1121 ++++++++
> > > > > >  src/ipa/rpi/pisp/data/ov64a40.json            | 1133 ++++++++
> > > > > >  src/ipa/rpi/pisp/data/ov9281_mono.json        |  215 ++
> > > > > >  src/ipa/rpi/pisp/data/se327m12.json           |  639 +++++
> > > > > >  src/ipa/rpi/pisp/data/uncalibrated.json       |  135 +
> > > > > >  src/ipa/rpi/pisp/meson.build                  |   49 +
> > > > > >  src/ipa/rpi/pisp/pisp.cpp                     | 1068 ++++++++
> > > > > >  src/libcamera/control_ids_rpi.yaml            |   13 +
> > > > > >  .../pipeline/rpi/common/rpi_stream.h          |   10 +
> > > > > >  .../pipeline/rpi/pisp/data/example.yaml       |   45 +
> > > > > >  .../pipeline/rpi/pisp/data/meson.build        |    8 +
> > > > > >  src/libcamera/pipeline/rpi/pisp/meson.build   |   12 +
> > > > > >  src/libcamera/pipeline/rpi/pisp/pisp.cpp      | 2372 +++++++++++++++++
> > > > > >  subprojects/.gitignore                        |    1 +
> > > > > >  subprojects/libpisp.wrap                      |    6 +
> > > > > >  42 files changed, 28410 insertions(+), 2 deletions(-)
> > > > > >  create mode 100644 src/ipa/rpi/pisp/data/imx219.json
> > > > > >  create mode 100644 src/ipa/rpi/pisp/data/imx219_noir.json
> > > > > >  create mode 100644 src/ipa/rpi/pisp/data/imx290.json
> > > > > >  create mode 100644 src/ipa/rpi/pisp/data/imx296.json
> > > > > >  create mode 100644 src/ipa/rpi/pisp/data/imx296_16mm.json
> > > > > >  create mode 100644 src/ipa/rpi/pisp/data/imx296_6mm.json
> > > > > >  create mode 100644 src/ipa/rpi/pisp/data/imx296_mono.json
> > > > > >  create mode 100644 src/ipa/rpi/pisp/data/imx378.json
> > > > > >  create mode 100755 src/ipa/rpi/pisp/data/imx415.json
> > > > > >  create mode 100644 src/ipa/rpi/pisp/data/imx462.json
> > > > > >  create mode 100644 src/ipa/rpi/pisp/data/imx477.json
> > > > > >  create mode 100644 src/ipa/rpi/pisp/data/imx477_16mm.json
> > > > > >  create mode 100644 src/ipa/rpi/pisp/data/imx477_6mm.json
> > > > > >  create mode 100644 src/ipa/rpi/pisp/data/imx477_noir.json
> > > > > >  create mode 100644 src/ipa/rpi/pisp/data/imx477_scientific.json
> > > > > >  create mode 100644 src/ipa/rpi/pisp/data/imx519.json
> > > > > >  create mode 100644 src/ipa/rpi/pisp/data/imx708.json
> > > > > >  create mode 100644 src/ipa/rpi/pisp/data/imx708_noir.json
> > > > > >  create mode 100644 src/ipa/rpi/pisp/data/imx708_wide.json
> > > > > >  create mode 100644 src/ipa/rpi/pisp/data/imx708_wide_noir.json
> > > > > >  create mode 100644 src/ipa/rpi/pisp/data/meson.build
> > > > > >  create mode 100644 src/ipa/rpi/pisp/data/ov5647.json
> > > > > >  create mode 100644 src/ipa/rpi/pisp/data/ov5647_noir.json
> > > > > >  create mode 100755 src/ipa/rpi/pisp/data/ov64a40.json
> > > > > >  create mode 100644 src/ipa/rpi/pisp/data/ov9281_mono.json
> > > > > >  create mode 100644 src/ipa/rpi/pisp/data/se327m12.json
> > > > > >  create mode 100644 src/ipa/rpi/pisp/data/uncalibrated.json
> > > > > >  create mode 100644 src/ipa/rpi/pisp/meson.build
> > > > > >  create mode 100644 src/ipa/rpi/pisp/pisp.cpp
> > > > > >  create mode 100644 src/libcamera/pipeline/rpi/pisp/data/example.yaml
> > > > > >  create mode 100644 src/libcamera/pipeline/rpi/pisp/data/meson.build
> > > > > >  create mode 100644 src/libcamera/pipeline/rpi/pisp/meson.build
> > > > > >  create mode 100644 src/libcamera/pipeline/rpi/pisp/pisp.cpp
> > > > > >  create mode 100644 subprojects/libpisp.wrap
Christian Rauch March 18, 2025, 10:30 p.m. UTC | #7
Hi Naush,

Thanks for the efforts upstreaming the Raspberry Pi 5 support. Is this
something that is still being worked on? Is there a rough timeline when
the Raspberry Pi 5 will be supported via the upstream libcamera version?

As far as I understand from Jacopo's patch to the LKML [1], all the
kernel bits are in place and only the "PiSP Front End" (in libpisp?) and
the actual libcamera IPAs and pipelines are missing. But this is already
10 months ago and I am not fully aware of the progress and to which
degree the Raspberry Pi 5 is already supported by upstream libcamera.

Since I am providing an application based on libcamera (a ROS 2 node) to
cover generic V4L2 devices as well as the Raspberry Pi Camera Modules,
and I am dealing with frequent issue reports as to why the Raspberry Pi
Camera Modules do not work with libcamera, I am essentially wondering if
this situation will resolve itself in the near future, or if the
Raspberry Pi fork of libcamera and the upstream version will continue to
exist in parallel like this indefinitely.

Is there anything I could help with to make this upstreaming of the
Raspberry Pi 5 support happen?

Best,
Christian

[1]
https://lore.kernel.org/all/20240531080707.34568-1-jacopo.mondi@ideasonboard.com/


Am 13.01.25 um 10:24 schrieb Naushir Patuck:
> Hi,
>
> A long time coming... this series add support for Raspberry Pi 5 (PiSP) to
> upstream libcamera. The IPA and pipeline handler code have been taken mostly
> unchanged from the Raspberry Pi downstream libcamera tree:
> https://github.com/raspberrypi/libcamera. Support for IMX500 and CNNs are not
> available in this series since we have yet to attempt to upstream the kernel
> changes.
>
> IMPORTANT NOTE
> --------------
> The Pi 5 pipeline handler in this commit is NOT COMPATIBLE with the Raspberry Pi
> kernel drivers just yet! Instead, you must use the mainline kernel upstream
> drivers with this pipeline handler. When futher upstreaming development for
> embedded data is completed, RPi will backport the upstream kernel drives to our
> tree and this pipeline handler will then begin to work with both upstream and
> downstream kernel trees.
>
> Thanks,
> Naush
>
> Naushir Patuck (4):
>    meson: Add libpisp.wrap
>    ipa: rpi: Add support for Raspberry Pi 5
>    pipeline: rpi: Add new stream flags for PiSP
>    pipeline: rpi: Add support for Raspberry Pi 5
>
>   Documentation/guides/pipeline-handler.rst     |    2 +-
>   include/libcamera/ipa/meson.build             |    1 +
>   include/libcamera/meson.build                 |    1 +
>   meson.build                                   |    1 +
>   meson_options.txt                             |    4 +-
>   src/ipa/rpi/pisp/data/imx219.json             | 1187 +++++++++
>   src/ipa/rpi/pisp/data/imx219_noir.json        | 1112 ++++++++
>   src/ipa/rpi/pisp/data/imx290.json             |  341 +++
>   src/ipa/rpi/pisp/data/imx296.json             | 1194 +++++++++
>   src/ipa/rpi/pisp/data/imx296_16mm.json        | 1247 +++++++++
>   src/ipa/rpi/pisp/data/imx296_6mm.json         | 1247 +++++++++
>   src/ipa/rpi/pisp/data/imx296_mono.json        |  960 +++++++
>   src/ipa/rpi/pisp/data/imx378.json             |  634 +++++
>   src/ipa/rpi/pisp/data/imx415.json             | 1159 ++++++++
>   src/ipa/rpi/pisp/data/imx462.json             |  342 +++
>   src/ipa/rpi/pisp/data/imx477.json             | 1186 +++++++++
>   src/ipa/rpi/pisp/data/imx477_16mm.json        | 1240 +++++++++
>   src/ipa/rpi/pisp/data/imx477_6mm.json         | 1240 +++++++++
>   src/ipa/rpi/pisp/data/imx477_noir.json        | 1148 ++++++++
>   src/ipa/rpi/pisp/data/imx477_scientific.json  |  546 ++++
>   src/ipa/rpi/pisp/data/imx519.json             |  634 +++++
>   src/ipa/rpi/pisp/data/imx708.json             | 1270 +++++++++
>   src/ipa/rpi/pisp/data/imx708_noir.json        | 1233 +++++++++
>   src/ipa/rpi/pisp/data/imx708_wide.json        | 1293 +++++++++
>   src/ipa/rpi/pisp/data/imx708_wide_noir.json   | 1148 ++++++++
>   src/ipa/rpi/pisp/data/meson.build             |   29 +
>   src/ipa/rpi/pisp/data/ov5647.json             | 1186 +++++++++
>   src/ipa/rpi/pisp/data/ov5647_noir.json        | 1121 ++++++++
>   src/ipa/rpi/pisp/data/ov64a40.json            | 1133 ++++++++
>   src/ipa/rpi/pisp/data/ov9281_mono.json        |  215 ++
>   src/ipa/rpi/pisp/data/se327m12.json           |  639 +++++
>   src/ipa/rpi/pisp/data/uncalibrated.json       |  135 +
>   src/ipa/rpi/pisp/meson.build                  |   49 +
>   src/ipa/rpi/pisp/pisp.cpp                     | 1068 ++++++++
>   src/libcamera/control_ids_rpi.yaml            |   13 +
>   .../pipeline/rpi/common/rpi_stream.h          |   10 +
>   .../pipeline/rpi/pisp/data/example.yaml       |   45 +
>   .../pipeline/rpi/pisp/data/meson.build        |    8 +
>   src/libcamera/pipeline/rpi/pisp/meson.build   |   12 +
>   src/libcamera/pipeline/rpi/pisp/pisp.cpp      | 2372 +++++++++++++++++
>   subprojects/.gitignore                        |    1 +
>   subprojects/libpisp.wrap                      |    6 +
>   42 files changed, 28410 insertions(+), 2 deletions(-)
>   create mode 100644 src/ipa/rpi/pisp/data/imx219.json
>   create mode 100644 src/ipa/rpi/pisp/data/imx219_noir.json
>   create mode 100644 src/ipa/rpi/pisp/data/imx290.json
>   create mode 100644 src/ipa/rpi/pisp/data/imx296.json
>   create mode 100644 src/ipa/rpi/pisp/data/imx296_16mm.json
>   create mode 100644 src/ipa/rpi/pisp/data/imx296_6mm.json
>   create mode 100644 src/ipa/rpi/pisp/data/imx296_mono.json
>   create mode 100644 src/ipa/rpi/pisp/data/imx378.json
>   create mode 100755 src/ipa/rpi/pisp/data/imx415.json
>   create mode 100644 src/ipa/rpi/pisp/data/imx462.json
>   create mode 100644 src/ipa/rpi/pisp/data/imx477.json
>   create mode 100644 src/ipa/rpi/pisp/data/imx477_16mm.json
>   create mode 100644 src/ipa/rpi/pisp/data/imx477_6mm.json
>   create mode 100644 src/ipa/rpi/pisp/data/imx477_noir.json
>   create mode 100644 src/ipa/rpi/pisp/data/imx477_scientific.json
>   create mode 100644 src/ipa/rpi/pisp/data/imx519.json
>   create mode 100644 src/ipa/rpi/pisp/data/imx708.json
>   create mode 100644 src/ipa/rpi/pisp/data/imx708_noir.json
>   create mode 100644 src/ipa/rpi/pisp/data/imx708_wide.json
>   create mode 100644 src/ipa/rpi/pisp/data/imx708_wide_noir.json
>   create mode 100644 src/ipa/rpi/pisp/data/meson.build
>   create mode 100644 src/ipa/rpi/pisp/data/ov5647.json
>   create mode 100644 src/ipa/rpi/pisp/data/ov5647_noir.json
>   create mode 100755 src/ipa/rpi/pisp/data/ov64a40.json
>   create mode 100644 src/ipa/rpi/pisp/data/ov9281_mono.json
>   create mode 100644 src/ipa/rpi/pisp/data/se327m12.json
>   create mode 100644 src/ipa/rpi/pisp/data/uncalibrated.json
>   create mode 100644 src/ipa/rpi/pisp/meson.build
>   create mode 100644 src/ipa/rpi/pisp/pisp.cpp
>   create mode 100644 src/libcamera/pipeline/rpi/pisp/data/example.yaml
>   create mode 100644 src/libcamera/pipeline/rpi/pisp/data/meson.build
>   create mode 100644 src/libcamera/pipeline/rpi/pisp/meson.build
>   create mode 100644 src/libcamera/pipeline/rpi/pisp/pisp.cpp
>   create mode 100644 subprojects/libpisp.wrap
>
Kieran Bingham March 18, 2025, 11:29 p.m. UTC | #8
Hi Christian,

Quoting Christian Rauch (2025-03-18 22:30:31)
> Hi Naush,
> 
> Thanks for the efforts upstreaming the Raspberry Pi 5 support. Is this
> something that is still being worked on? Is there a rough timeline when
> the Raspberry Pi 5 will be supported via the upstream libcamera version?

I'm afraid the biggest delay was getting the CI integrated and then to
build cleanly, after these patches were posted. Naush did a great job
at fixing libpisp before Embedded World, so everything is ready as far
as I'm aware for Pi5 libcamera support to be merged ...

The only issue remaining is that this week the gitlab.freedesktop.org
servers are down for migration as the hosting providers are being
changed over.

> As far as I understand from Jacopo's patch to the LKML [1], all the
> kernel bits are in place and only the "PiSP Front End" (in libpisp?) and
> the actual libcamera IPAs and pipelines are missing. But this is already
> 10 months ago and I am not fully aware of the progress and to which
> degree the Raspberry Pi 5 is already supported by upstream libcamera.
> 
> Since I am providing an application based on libcamera (a ROS 2 node) to
> cover generic V4L2 devices as well as the Raspberry Pi Camera Modules,
> and I am dealing with frequent issue reports as to why the Raspberry Pi
> Camera Modules do not work with libcamera, I am essentially wondering if
> this situation will resolve itself in the near future, or if the
> Raspberry Pi fork of libcamera and the upstream version will continue to
> exist in parallel like this indefinitely.
> 
> Is there anything I could help with to make this upstreaming of the
> Raspberry Pi 5 support happen?

I very sincerely hope and expect to be able to merge it next week, and
will be targetting the next libcamera release the week after.

Please keep an eye on the IMPORTANT NOTE below though. I believe there
is still some compatibility issues between 'mainline' kernel and
'raspberry pi' kernel to keep an eye on.

--
Kieran


> 
> Best,
> Christian
> 
> [1]
> https://lore.kernel.org/all/20240531080707.34568-1-jacopo.mondi@ideasonboard.com/
> 
> 
> Am 13.01.25 um 10:24 schrieb Naushir Patuck:
> > Hi,
> >
> > A long time coming... this series add support for Raspberry Pi 5 (PiSP) to
> > upstream libcamera. The IPA and pipeline handler code have been taken mostly
> > unchanged from the Raspberry Pi downstream libcamera tree:
> > https://github.com/raspberrypi/libcamera. Support for IMX500 and CNNs are not
> > available in this series since we have yet to attempt to upstream the kernel
> > changes.
> >
> > IMPORTANT NOTE
> > --------------
> > The Pi 5 pipeline handler in this commit is NOT COMPATIBLE with the Raspberry Pi
> > kernel drivers just yet! Instead, you must use the mainline kernel upstream
> > drivers with this pipeline handler. When futher upstreaming development for
> > embedded data is completed, RPi will backport the upstream kernel drives to our
> > tree and this pipeline handler will then begin to work with both upstream and
> > downstream kernel trees.
> >
> > Thanks,
> > Naush
> >
> > Naushir Patuck (4):
> >    meson: Add libpisp.wrap
> >    ipa: rpi: Add support for Raspberry Pi 5
> >    pipeline: rpi: Add new stream flags for PiSP
> >    pipeline: rpi: Add support for Raspberry Pi 5
> >
> >   Documentation/guides/pipeline-handler.rst     |    2 +-
> >   include/libcamera/ipa/meson.build             |    1 +
> >   include/libcamera/meson.build                 |    1 +
> >   meson.build                                   |    1 +
> >   meson_options.txt                             |    4 +-
> >   src/ipa/rpi/pisp/data/imx219.json             | 1187 +++++++++
> >   src/ipa/rpi/pisp/data/imx219_noir.json        | 1112 ++++++++
> >   src/ipa/rpi/pisp/data/imx290.json             |  341 +++
> >   src/ipa/rpi/pisp/data/imx296.json             | 1194 +++++++++
> >   src/ipa/rpi/pisp/data/imx296_16mm.json        | 1247 +++++++++
> >   src/ipa/rpi/pisp/data/imx296_6mm.json         | 1247 +++++++++
> >   src/ipa/rpi/pisp/data/imx296_mono.json        |  960 +++++++
> >   src/ipa/rpi/pisp/data/imx378.json             |  634 +++++
> >   src/ipa/rpi/pisp/data/imx415.json             | 1159 ++++++++
> >   src/ipa/rpi/pisp/data/imx462.json             |  342 +++
> >   src/ipa/rpi/pisp/data/imx477.json             | 1186 +++++++++
> >   src/ipa/rpi/pisp/data/imx477_16mm.json        | 1240 +++++++++
> >   src/ipa/rpi/pisp/data/imx477_6mm.json         | 1240 +++++++++
> >   src/ipa/rpi/pisp/data/imx477_noir.json        | 1148 ++++++++
> >   src/ipa/rpi/pisp/data/imx477_scientific.json  |  546 ++++
> >   src/ipa/rpi/pisp/data/imx519.json             |  634 +++++
> >   src/ipa/rpi/pisp/data/imx708.json             | 1270 +++++++++
> >   src/ipa/rpi/pisp/data/imx708_noir.json        | 1233 +++++++++
> >   src/ipa/rpi/pisp/data/imx708_wide.json        | 1293 +++++++++
> >   src/ipa/rpi/pisp/data/imx708_wide_noir.json   | 1148 ++++++++
> >   src/ipa/rpi/pisp/data/meson.build             |   29 +
> >   src/ipa/rpi/pisp/data/ov5647.json             | 1186 +++++++++
> >   src/ipa/rpi/pisp/data/ov5647_noir.json        | 1121 ++++++++
> >   src/ipa/rpi/pisp/data/ov64a40.json            | 1133 ++++++++
> >   src/ipa/rpi/pisp/data/ov9281_mono.json        |  215 ++
> >   src/ipa/rpi/pisp/data/se327m12.json           |  639 +++++
> >   src/ipa/rpi/pisp/data/uncalibrated.json       |  135 +
> >   src/ipa/rpi/pisp/meson.build                  |   49 +
> >   src/ipa/rpi/pisp/pisp.cpp                     | 1068 ++++++++
> >   src/libcamera/control_ids_rpi.yaml            |   13 +
> >   .../pipeline/rpi/common/rpi_stream.h          |   10 +
> >   .../pipeline/rpi/pisp/data/example.yaml       |   45 +
> >   .../pipeline/rpi/pisp/data/meson.build        |    8 +
> >   src/libcamera/pipeline/rpi/pisp/meson.build   |   12 +
> >   src/libcamera/pipeline/rpi/pisp/pisp.cpp      | 2372 +++++++++++++++++
> >   subprojects/.gitignore                        |    1 +
> >   subprojects/libpisp.wrap                      |    6 +
> >   42 files changed, 28410 insertions(+), 2 deletions(-)
> >   create mode 100644 src/ipa/rpi/pisp/data/imx219.json
> >   create mode 100644 src/ipa/rpi/pisp/data/imx219_noir.json
> >   create mode 100644 src/ipa/rpi/pisp/data/imx290.json
> >   create mode 100644 src/ipa/rpi/pisp/data/imx296.json
> >   create mode 100644 src/ipa/rpi/pisp/data/imx296_16mm.json
> >   create mode 100644 src/ipa/rpi/pisp/data/imx296_6mm.json
> >   create mode 100644 src/ipa/rpi/pisp/data/imx296_mono.json
> >   create mode 100644 src/ipa/rpi/pisp/data/imx378.json
> >   create mode 100755 src/ipa/rpi/pisp/data/imx415.json
> >   create mode 100644 src/ipa/rpi/pisp/data/imx462.json
> >   create mode 100644 src/ipa/rpi/pisp/data/imx477.json
> >   create mode 100644 src/ipa/rpi/pisp/data/imx477_16mm.json
> >   create mode 100644 src/ipa/rpi/pisp/data/imx477_6mm.json
> >   create mode 100644 src/ipa/rpi/pisp/data/imx477_noir.json
> >   create mode 100644 src/ipa/rpi/pisp/data/imx477_scientific.json
> >   create mode 100644 src/ipa/rpi/pisp/data/imx519.json
> >   create mode 100644 src/ipa/rpi/pisp/data/imx708.json
> >   create mode 100644 src/ipa/rpi/pisp/data/imx708_noir.json
> >   create mode 100644 src/ipa/rpi/pisp/data/imx708_wide.json
> >   create mode 100644 src/ipa/rpi/pisp/data/imx708_wide_noir.json
> >   create mode 100644 src/ipa/rpi/pisp/data/meson.build
> >   create mode 100644 src/ipa/rpi/pisp/data/ov5647.json
> >   create mode 100644 src/ipa/rpi/pisp/data/ov5647_noir.json
> >   create mode 100755 src/ipa/rpi/pisp/data/ov64a40.json
> >   create mode 100644 src/ipa/rpi/pisp/data/ov9281_mono.json
> >   create mode 100644 src/ipa/rpi/pisp/data/se327m12.json
> >   create mode 100644 src/ipa/rpi/pisp/data/uncalibrated.json
> >   create mode 100644 src/ipa/rpi/pisp/meson.build
> >   create mode 100644 src/ipa/rpi/pisp/pisp.cpp
> >   create mode 100644 src/libcamera/pipeline/rpi/pisp/data/example.yaml
> >   create mode 100644 src/libcamera/pipeline/rpi/pisp/data/meson.build
> >   create mode 100644 src/libcamera/pipeline/rpi/pisp/meson.build
> >   create mode 100644 src/libcamera/pipeline/rpi/pisp/pisp.cpp
> >   create mode 100644 subprojects/libpisp.wrap
> >
>
Kieran Bingham March 20, 2025, 11:28 a.m. UTC | #9
Hi Naush,

Quoting Kieran Bingham (2025-01-13 12:12:48)
> Hi Naush,
> 
> Quoting Naushir Patuck (2025-01-13 09:24:42)
> > Hi,
> > 
> > A long time coming... this series add support for Raspberry Pi 5 (PiSP) to
> > upstream libcamera. The IPA and pipeline handler code have been taken mostly
> > unchanged from the Raspberry Pi downstream libcamera tree:
> > https://github.com/raspberrypi/libcamera. Support for IMX500 and CNNs are not
> > available in this series since we have yet to attempt to upstream the kernel
> > changes.
> > 
> > IMPORTANT NOTE
> > --------------
> > The Pi 5 pipeline handler in this commit is NOT COMPATIBLE with the Raspberry Pi
> > kernel drivers just yet! Instead, you must use the mainline kernel upstream
> > drivers with this pipeline handler. When futher upstreaming development for
> > embedded data is completed, RPi will backport the upstream kernel drives to our
> > tree and this pipeline handler will then begin to work with both upstream and
> > downstream kernel trees.
> 
> Thanks for posting this!
> 
> The first issue we face is the dependency in libpisp in the CI loops it
> seems:
> 
> https://gitlab.freedesktop.org/camera/libcamera/-/pipelines/1344547
> 
> has many failed jobs, which I believe are all going to be more or less
> instances of:
> 
> https://gitlab.freedesktop.org/camera/libcamera/-/jobs/69247972
> 
>  src/libcamera/pipeline/rpi/pisp/meson.build:8:14: ERROR: Dependency 'libpisp' is required but not found.
> 

All of this is now resolved, and these patches are successfully run
through CI:

https://gitlab.freedesktop.org/camera/libcamera/-/pipelines/1386009

A few linter issues but I wouldn't dwell on those:

https://gitlab.freedesktop.org/camera/libcamera/-/jobs/73051446


I'm keen to see these patches merged!


Naush - it's been some time since you posted these. Are there any
updates or changes you require to these before merge?

Due to the size - if you have any updates, please feel free to send me a
PR/branch rather than hitting the list/patchwork with the large content
of the tuning files again in this instance.

--
Kieran
Naushir Patuck March 20, 2025, 11:43 a.m. UTC | #10
Hi Kieran,

On Thu, 20 Mar 2025 at 11:28, Kieran Bingham
<kieran.bingham@ideasonboard.com> wrote:
>
> Hi Naush,
>
> Quoting Kieran Bingham (2025-01-13 12:12:48)
> > Hi Naush,
> >
> > Quoting Naushir Patuck (2025-01-13 09:24:42)
> > > Hi,
> > >
> > > A long time coming... this series add support for Raspberry Pi 5 (PiSP) to
> > > upstream libcamera. The IPA and pipeline handler code have been taken mostly
> > > unchanged from the Raspberry Pi downstream libcamera tree:
> > > https://github.com/raspberrypi/libcamera. Support for IMX500 and CNNs are not
> > > available in this series since we have yet to attempt to upstream the kernel
> > > changes.
> > >
> > > IMPORTANT NOTE
> > > --------------
> > > The Pi 5 pipeline handler in this commit is NOT COMPATIBLE with the Raspberry Pi
> > > kernel drivers just yet! Instead, you must use the mainline kernel upstream
> > > drivers with this pipeline handler. When futher upstreaming development for
> > > embedded data is completed, RPi will backport the upstream kernel drives to our
> > > tree and this pipeline handler will then begin to work with both upstream and
> > > downstream kernel trees.
> >
> > Thanks for posting this!
> >
> > The first issue we face is the dependency in libpisp in the CI loops it
> > seems:
> >
> > https://gitlab.freedesktop.org/camera/libcamera/-/pipelines/1344547
> >
> > has many failed jobs, which I believe are all going to be more or less
> > instances of:
> >
> > https://gitlab.freedesktop.org/camera/libcamera/-/jobs/69247972
> >
> >  src/libcamera/pipeline/rpi/pisp/meson.build:8:14: ERROR: Dependency 'libpisp' is required but not found.
> >
>
> All of this is now resolved, and these patches are successfully run
> through CI:
>
> https://gitlab.freedesktop.org/camera/libcamera/-/pipelines/1386009
>
> A few linter issues but I wouldn't dwell on those:
>
> https://gitlab.freedesktop.org/camera/libcamera/-/jobs/73051446
>
>
> I'm keen to see these patches merged!
>
>
> Naush - it's been some time since you posted these. Are there any
> updates or changes you require to these before merge?

The only update would be the libpisp.wrap file change, which I've just
posted.  Apart from that, I don't think any updates are needed before
merging.  Exciting!!!

Regards,
Naush

>
> Due to the size - if you have any updates, please feel free to send me a
> PR/branch rather than hitting the list/patchwork with the large content
> of the tuning files again in this instance.
>
> --
> Kieran