Skip to content

Commit

Permalink
ipu6: update packages (#347918)
Browse files Browse the repository at this point in the history
  • Loading branch information
flokli authored Oct 12, 2024
2 parents e495f07 + f53387e commit 2afe930
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 37 deletions.
6 changes: 3 additions & 3 deletions nixos/modules/hardware/video/webcam/ipu6.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ in

config = mkIf cfg.enable {

# Module is upstream as of 6.10
boot.extraModulePackages = with config.boot.kernelPackages;
optional (kernelOlder "6.10") ipu6-drivers;
# Module is upstream as of 6.10,
# but still needs various out-of-tree i2c and the `intel-ipu6-psys` kernel driver
boot.extraModulePackages = with config.boot.kernelPackages; [ ipu6-drivers ];

hardware.firmware = with pkgs; [
ipu6-camera-bins
Expand Down
11 changes: 7 additions & 4 deletions pkgs/development/libraries/gstreamer/icamerasrc/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,18 @@
, gst_all_1
, ipu6-camera-hal
, libdrm
, libva
}:

stdenv.mkDerivation {
stdenv.mkDerivation rec {
pname = "icamerasrc-${ipu6-camera-hal.ipuVersion}";
version = "unstable-2023-10-23";
version = "unstable-2024-09-29";

src = fetchFromGitHub {
owner = "intel";
repo = "icamerasrc";
rev = "528a6f177732def4d5ebc17927220d8823bc8fdc";
hash = "sha256-Ezcm5OpF/NKvJf5sFeJyvNc2Uq0166GukC9MuNUV2Fs=";
rev = "refs/tags/20240926_1446";
hash = "sha256-BpIZxkPmSVKqPntwBJjGmCaMSYFCEZHJa4soaMAJRWE=";
};

nativeBuildInputs = [
Expand All @@ -34,8 +35,10 @@ stdenv.mkDerivation {
buildInputs = [
gst_all_1.gstreamer
gst_all_1.gst-plugins-base
gst_all_1.gst-plugins-bad
ipu6-camera-hal
libdrm
libva
];

NIX_CFLAGS_COMPILE = [
Expand Down
26 changes: 19 additions & 7 deletions pkgs/development/libraries/ipu6-camera-hal/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
, ipu6-camera-bins
, libtool
, gst_all_1
, libdrm

# Pick one of
# - ipu6 (Tiger Lake)
Expand All @@ -27,26 +28,30 @@ let
in
stdenv.mkDerivation {
pname = "${ipuVersion}-camera-hal";
version = "unstable-2023-09-25";
version = "unstable-2024-09-29";

src = fetchFromGitHub {
owner = "intel";
repo = "ipu6-camera-hal";
rev = "9fa05a90886d399ad3dda4c2ddc990642b3d20c9";
hash = "sha256-yS1D7o6dsQ4FQkjfwcisOxcP7Majb+4uQ/iW5anMb5c=";
rev = "f98f72b156563fe8373e4f8d017a9f609676bb33";
hash = "sha256-zVcgKW7/GHYd1oMvsaI77cPyj3G68dL+OXBJDz5+Td4=";
};

nativeBuildInputs = [
cmake
pkg-config
];

PKG_CONFIG_PATH = "${lib.makeLibraryPath [ ipu6-camera-bins ]}/${ipuTarget}/pkgconfig";

cmakeFlags = [
"-DIPU_VER=${ipuVersion}"
"-DTARGET_SUFFIX=-${ipuVersion}"
# missing libiacss
"-DUSE_PG_LITE_PIPE=ON"
"-DCMAKE_BUILD_TYPE=Release"
"-DCMAKE_INSTALL_PREFIX=${placeholder "out"}"
"-DCMAKE_INSTALL_SUB_PATH=${ipuTarget}"
"-DCMAKE_INSTALL_LIBDIR=lib"
];

NIX_CFLAGS_COMPILE = [
Expand All @@ -61,21 +66,28 @@ stdenv.mkDerivation {
libtool
gst_all_1.gstreamer
gst_all_1.gst-plugins-base
libdrm
];

postPatch = ''
substituteInPlace src/platformdata/PlatformData.h \
--replace '/usr/share/' "${placeholder "out"}/share/"
--replace '/usr/share/' "${placeholder "out"}/share/" \
--replace '#define CAMERA_DEFAULT_CFG_PATH "/etc/camera/"' '#define CAMERA_DEFAULT_CFG_PATH "${placeholder "out"}/etc/camera/"'
'';

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 "${lib.makeLibraryPath [ ipu6-camera-bins ]}/${ipuTarget}" $lib
patchelf --add-rpath "${ipu6-camera-bins}/lib" $lib
done
'';

passthru = {
inherit ipuVersion;
inherit ipuVersion ipuTarget;
};

meta = with lib; {
Expand Down
15 changes: 8 additions & 7 deletions pkgs/os-specific/linux/firmware/ipu6-camera-bins/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
, zlib
}:

stdenv.mkDerivation (finalAttrs: {
stdenv.mkDerivation (finalAttrs: rec {
pname = "ipu6-camera-bins";
version = "unstable-2023-10-26";
version = "unstable-2024-09-27";

src = fetchFromGitHub {
owner = "intel";
repo = "ipu6-camera-bins";
rev = "af5ba0cb4a763569ac7514635013e9d870040bcf";
hash = "sha256-y0pT5M7AKACbquQWLZPYpTPXRC5hipLNL61nhs+cst4=";
owner = "intel";
rev = "98ca6f2a54d20f171628055938619972514f7a07";
hash = "sha256-DAjAzHMqX41mrfQVpDUJLw4Zjb9pz6Uy3TJjTGIkd6o=";
};

nativeBuildInputs = [
Expand All @@ -33,13 +33,14 @@ stdenv.mkDerivation (finalAttrs: {
include \
$out/
install -m 0644 -D LICENSE $out/share/doc/LICENSE
# There is no LICENSE file in the src
# install -m 0644 -D LICENSE $out/share/doc/LICENSE
runHook postInstall
'';

postFixup = ''
for pcfile in $out/lib/*/pkgconfig/*.pc; do
for pcfile in $out/lib/pkgconfig/*.pc; do
substituteInPlace $pcfile \
--replace 'prefix=/usr' "prefix=$out"
done
Expand Down
6 changes: 3 additions & 3 deletions pkgs/os-specific/linux/firmware/ivsc-firmware/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@

stdenv.mkDerivation {
pname = "ivsc-firmware";
version = "unstable-2023-08-11";
version = "unstable-2024-06-14";

src = fetchFromGitHub {
owner = "intel";
repo = "ivsc-firmware";
rev = "10c214fea5560060d387fbd2fb8a1af329cb6232";
hash = "sha256-kEoA0yeGXuuB+jlMIhNm+SBljH+Ru7zt3PzGb+EPBPw=";
rev = "74a01d1208a352ed85d76f959c68200af4ead918";
hash = "sha256-kHYfeftMtoOsOtVN6+XoDMDHP7uTEztbvjQLpCnKCh0=";
};

dontBuild = true;
Expand Down
14 changes: 8 additions & 6 deletions pkgs/os-specific/linux/ipu6-drivers/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,19 @@
, kernel
}:

stdenv.mkDerivation {
stdenv.mkDerivation rec {
pname = "ipu6-drivers";
version = "unstable-2023-11-24";
version = "unstable-2024-10-10";

src = fetchFromGitHub {
owner = "intel";
repo = "ipu6-drivers";
rev = "07f0612eabfdc31df36f5e316a9eae115807804f";
hash = "sha256-8JRZG6IKJT0qtoqJHm8641kSQMLc4Z+DRzK6FpL9Euk=";
rev = "118952d49ec598f56add50d93fa7bc3ac4a05643";
hash = "sha256-xdMwINoKrdRHCPMpdZQn86ATi1dAXncMU39LLXS16mc=";
};

patches = [ "${src}/patches/0001-v6.10-IPU6-headers-used-by-PSYS.patch" ];

postPatch = ''
cp --no-preserve=mode --recursive --verbose \
${ivsc-driver.src}/backport-include \
Expand Down Expand Up @@ -47,7 +49,7 @@ stdenv.mkDerivation {
license = lib.licenses.gpl2Only;
maintainers = [ ];
platforms = [ "x86_64-linux" ];
# requires 6.1.7 https://github.com/intel/ipu6-drivers/pull/84
broken = kernel.kernelOlder "6.1.7";
# requires 6.10
broken = kernel.kernelOlder "6.10";
};
}
6 changes: 3 additions & 3 deletions pkgs/os-specific/linux/ivsc-driver/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@

stdenv.mkDerivation {
pname = "ivsc-driver";
version = "unstable-2023-11-09";
version = "unstable-2024-09-18";

src = fetchFromGitHub {
owner = "intel";
repo = "ivsc-driver";
rev = "73a044d9633212fac54ea96cdd882ff5ab40573e";
hash = "sha256-vE5pOtVqjiWovlUMSEoBKTk/qvs8K8T5oY2r7njh0wQ=";
rev = "10f440febe87419d5c82d8fe48580319ea135b54";
hash = "sha256-jc+8geVquRtaZeIOtadCjY9F162Rb05ptE7dk8kuof0=";
};

nativeBuildInputs = kernel.moduleBuildDependencies;
Expand Down
5 changes: 1 addition & 4 deletions pkgs/top-level/linux-kernels.nix
Original file line number Diff line number Diff line change
Expand Up @@ -367,10 +367,7 @@ in {

intel-speed-select = if lib.versionAtLeast kernel.version "5.3" then callPackage ../os-specific/linux/intel-speed-select { } else null;

ipu6-drivers =
if kernelOlder "6.10"
then callPackage ../os-specific/linux/ipu6-drivers {}
else null;
ipu6-drivers = callPackage ../os-specific/linux/ipu6-drivers {};

ivsc-driver = callPackage ../os-specific/linux/ivsc-driver {};

Expand Down

0 comments on commit 2afe930

Please sign in to comment.