-
-
Notifications
You must be signed in to change notification settings - Fork 19.8k
ipu7: init #542085
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
aoli-al
wants to merge
5
commits into
NixOS:master
Choose a base branch
from
aoli-al:ipu7-clean
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+370
−8
Open
ipu7: init #542085
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
761e39f
ipu7-camera-bins: init at 20260629_1
aoli-al e788394
ipu7-camera-hal: init at 20260629_1
aoli-al 7f27316
ipu7-drivers: init at 0-unstable-2026-06-30
aoli-al 7c1289e
gstreamer.icamerasrc: add ipu7x and ipu75xa variants
aoli-al 23c357e
nixos/hardware.ipu7: init
aoli-al File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,84 @@ | ||
| { | ||
| config, | ||
| lib, | ||
| pkgs, | ||
| ... | ||
| }: | ||
| let | ||
|
|
||
| inherit (lib) | ||
| mkDefault | ||
| mkEnableOption | ||
| mkIf | ||
| mkOption | ||
| optional | ||
| types | ||
| ; | ||
|
|
||
| cfg = config.hardware.ipu7; | ||
|
|
||
| in | ||
| { | ||
|
|
||
| options.hardware.ipu7 = { | ||
|
|
||
| enable = mkEnableOption "support for Intel IPU7/MIPI cameras"; | ||
|
|
||
| platform = mkOption { | ||
| type = types.enum [ | ||
| "ipu7x" | ||
| "ipu75xa" | ||
| ]; | ||
| description = '' | ||
| Choose the version for your hardware platform. The IPU reports which one | ||
| it is through its PCI ID, visible as the Multimedia controller in lspci. | ||
|
|
||
| - ipu7x (Lunar Lake, PCI 8086:645d) | ||
| Sensor list: https://github.com/intel/ipu7-camera-hal/tree/main/config/linux/ipu7x/sensors | ||
| - ipu75xa (Panther Lake, PCI 8086:b05d) | ||
| Sensor list: https://github.com/intel/ipu7-camera-hal/tree/main/config/linux/ipu75xa/sensors | ||
| ''; | ||
| }; | ||
|
|
||
| }; | ||
|
|
||
| config = mkIf cfg.enable { | ||
|
|
||
| # Kernels >= 6.17 ship an IPU7 core and ISys in drivers/staging/media/ipu7, | ||
| # but no PSys, so they cannot drive the hardware ISP that the camera HAL | ||
| # needs. ipu7-drivers supplies just the PSys module (intel-ipu7-psys), which | ||
| # has no in-tree counterpart, and links it against the in-tree core and ISys | ||
| # that already enumerate the sensor. | ||
| boot.extraModulePackages = with config.boot.kernelPackages; [ | ||
| ipu7-drivers | ||
| ]; | ||
|
|
||
| hardware.firmware = with pkgs; [ | ||
| ipu7-camera-bins | ||
| ivsc-firmware | ||
| ]; | ||
|
|
||
| services.udev.extraRules = '' | ||
| SUBSYSTEM=="intel-ipu7-psys", MODE="0660", GROUP="video" | ||
| ''; | ||
|
|
||
| services.v4l2-relayd.instances.ipu7 = { | ||
| enable = mkDefault true; | ||
|
|
||
| cardLabel = mkDefault "Intel MIPI Camera"; | ||
|
|
||
| extraPackages = | ||
| with pkgs.gst_all_1; | ||
| [ ] | ||
| ++ optional (cfg.platform == "ipu7x") icamerasrc-ipu7x | ||
| ++ optional (cfg.platform == "ipu75xa") icamerasrc-ipu75xa; | ||
|
|
||
| input = { | ||
| pipeline = "icamerasrc"; | ||
| # REVIEW from https://edc.intel.com/content/www/us/en/secure/design/confidential/products/platforms/details/lunar-lake-mx/core-ultra-200v-series-processors-datasheet-volume-1-of-2/camera-integrated-isp/ | ||
| # Output Formats - NV12, NV16, I420, M420, YUY2, YUYV, P010, P016 | ||
| format = "NV12"; | ||
| }; | ||
| }; | ||
| }; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| { | ||
| lib, | ||
| stdenv, | ||
| fetchFromGitHub, | ||
| autoPatchelfHook, | ||
| expat, | ||
| zlib, | ||
| }: | ||
|
|
||
| stdenv.mkDerivation (finalAttrs: { | ||
| pname = "ipu7-camera-bins"; | ||
| version = "20260629_1"; | ||
|
|
||
| src = fetchFromGitHub { | ||
| repo = "ipu7-camera-bins"; | ||
| owner = "intel"; | ||
| rev = finalAttrs.version; | ||
| hash = "sha256-LjiqxlQKDLArgK2puxlyTpLPtL6QN6P/xWO2asPTLig="; | ||
| }; | ||
|
|
||
| __structuredAttrs = true; | ||
| strictDeps = true; | ||
|
|
||
| nativeBuildInputs = [ | ||
| autoPatchelfHook | ||
| ]; | ||
|
|
||
| buildInputs = [ | ||
| (lib.getLib stdenv.cc.cc) | ||
| expat | ||
| zlib | ||
| ]; | ||
|
|
||
| installPhase = '' | ||
| runHook preInstall | ||
|
|
||
| mkdir -p $out | ||
| cp --no-preserve=mode --recursive \ | ||
| lib \ | ||
| include \ | ||
| $out/ | ||
|
|
||
| # REVIEW file exists now | ||
| # There is no LICENSE file in the src | ||
| # install -m 0644 -D LICENSE $out/share/doc/LICENSE | ||
|
|
||
| runHook postInstall | ||
| ''; | ||
|
|
||
| postFixup = '' | ||
| for lib in $out/lib/lib*.so.*; do \ | ||
| lib=''${lib##*/}; \ | ||
| target=$out/lib/''${lib%.*}; \ | ||
| if [ ! -e "$target" ]; then \ | ||
| ln -s "$lib" "$target"; \ | ||
| fi \ | ||
| done | ||
|
|
||
| for pcfile in $out/lib/pkgconfig/*.pc; do | ||
| substituteInPlace $pcfile \ | ||
| --replace 'prefix=/usr' "prefix=$out" | ||
| done | ||
| ''; | ||
|
|
||
| meta = with lib; { | ||
| description = "IPU firmware and proprietary image processing libraries"; | ||
| homepage = "https://github.com/intel/ipu7-camera-bins"; | ||
| license = licenses.issl; | ||
| sourceProvenance = with sourceTypes; [ | ||
| binaryFirmware | ||
| ]; | ||
| maintainers = [ | ||
| lib.maintainers.aoli-al | ||
| lib.maintainers.pseudocc | ||
| ]; | ||
| platforms = [ "x86_64-linux" ]; | ||
| }; | ||
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,110 @@ | ||
| { | ||
| lib, | ||
| stdenv, | ||
| fetchFromGitHub, | ||
|
|
||
| # build | ||
| cmake, | ||
| pkg-config, | ||
|
|
||
| # runtime | ||
| expat, | ||
| ipu7-camera-bins, | ||
| jsoncpp, | ||
| libtool, | ||
| gst_all_1, | ||
| libdrm, | ||
|
|
||
| # Pick one of | ||
| # - ipu7x (Lunar Lake) | ||
| # - ipu75xa (Lunar Lake) | ||
| ipuVersion ? "ipu7x", | ||
| }: | ||
| let | ||
| ipuTarget = | ||
| { | ||
| "ipu7x" = "ipu_lnl"; | ||
| "ipu75xa" = "ipu_lnl"; | ||
| } | ||
| .${ipuVersion}; | ||
| in | ||
| stdenv.mkDerivation (finalAttrs: { | ||
| pname = "${ipuVersion}-camera-hal"; | ||
| version = "20260629_1"; | ||
|
|
||
| src = fetchFromGitHub { | ||
| owner = "intel"; | ||
| repo = "ipu7-camera-hal"; | ||
| rev = finalAttrs.version; | ||
| hash = "sha256-uiVPQBMHUBP9ZFzX0QMimIpgbmvm7JLTkD588V07iGw="; | ||
| }; | ||
|
|
||
| __structuredAttrs = true; | ||
| strictDeps = true; | ||
|
|
||
| nativeBuildInputs = [ | ||
| cmake | ||
| pkg-config | ||
| ]; | ||
|
|
||
| cmakeFlags = [ | ||
| "-DCMAKE_BUILD_TYPE=Release" | ||
| "-DCMAKE_INSTALL_PREFIX=${placeholder "out"}" | ||
| "-DCMAKE_INSTALL_LIBDIR=lib" | ||
| "-DCMAKE_INSTALL_INCLUDEDIR=include" | ||
| "-DCMAKE_POLICY_VERSION_MINIMUM=3.5" | ||
| "-DBUILD_CAMHAL_ADAPTOR=ON" | ||
| "-DBUILD_CAMHAL_PLUGIN=ON" | ||
| "-DIPU_VERSIONS=${ipuVersion}" | ||
| "-DUSE_STATIC_GRAPH=ON" | ||
| "-DUSE_STATIC_GRAPH_AUTOGEN=ON" | ||
| ]; | ||
|
|
||
| env.NIX_CFLAGS_COMPILE = "-Wno-error"; | ||
|
|
||
| enableParallelBuilding = true; | ||
|
|
||
| buildInputs = [ | ||
| expat | ||
| ipu7-camera-bins | ||
| jsoncpp | ||
| libtool | ||
| gst_all_1.gstreamer | ||
| gst_all_1.gst-plugins-base | ||
| libdrm | ||
| ]; | ||
|
|
||
| postPatch = '' | ||
| substituteInPlace CMakeLists.txt \ | ||
| --replace-fail 'set (CMAKE_CXX_STANDARD 11)' \ | ||
| 'set (CMAKE_CXX_STANDARD 17)' | ||
| substituteInPlace src/platformdata/JsonParserBase.h \ | ||
| --replace-fail '<jsoncpp/json/json.h>' '<json/json.h>' | ||
| ''; | ||
|
|
||
| postInstall = '' | ||
| mkdir -p $out/include/${ipuTarget}/ | ||
| cp -r $src/include $out/include/${ipuTarget}/libcamhal | ||
| ''; | ||
|
|
||
| postFixup = '' | ||
| for lib in $out/lib/*.so; do | ||
| patchelf --add-rpath "${ipu7-camera-bins}/lib" $lib | ||
| done | ||
| ''; | ||
|
|
||
| passthru = { | ||
| inherit ipuVersion ipuTarget; | ||
| }; | ||
|
|
||
| meta = with lib; { | ||
| description = "HAL for processing of images in userspace"; | ||
| homepage = "https://github.com/intel/ipu7-camera-hal"; | ||
| license = licenses.asl20; | ||
| maintainers = [ | ||
| lib.maintainers.aoli-al | ||
| lib.maintainers.pseudocc | ||
| ]; | ||
| platforms = [ "x86_64-linux" ]; | ||
| }; | ||
| }) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.