Skip to content

Commit

Permalink
Update build scripts and dependencies
Browse files Browse the repository at this point in the history
Signed-off-by: nyanmisaka <nst799610810@gmail.com>
  • Loading branch information
nyanmisaka committed Feb 11, 2024
1 parent 0230f87 commit 8886cd7
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
From a5e701025dce2036930b9e049862e5355b07a45f Mon Sep 17 00:00:00 2001
From: David Rosca <nowrep@gmail.com>
Date: Tue, 9 Jan 2024 13:38:08 +0100
Subject: [PATCH] utils/libav: Only adjust bit_shift for DRM P010 frames

Fixes mapping Vulkan P010 frames.

Closes #237
---
src/include/libplacebo/utils/libav_internal.h | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/include/libplacebo/utils/libav_internal.h b/src/include/libplacebo/utils/libav_internal.h
index 4c269e5d..992e5ca6 100644
--- a/src/include/libplacebo/utils/libav_internal.h
+++ b/src/include/libplacebo/utils/libav_internal.h
@@ -967,11 +967,6 @@ static void pl_fix_hwframe_sample_depth(struct pl_frame *out, const AVFrame *fra
struct pl_bit_encoding *bits = &out->repr.bits;

bits->sample_depth = fmt->component_depth[0];
-
- switch (hwfc->sw_format) {
- case AV_PIX_FMT_P010: bits->bit_shift = 6; break;
- default: break;
- }
}

static bool pl_map_avframe_drm(pl_gpu gpu, struct pl_frame *out,
@@ -1016,6 +1011,12 @@ static bool pl_map_avframe_drm(pl_gpu gpu, struct pl_frame *out,
}

pl_fix_hwframe_sample_depth(out, frame);
+
+ switch (hwfc->sw_format) {
+ case AV_PIX_FMT_P010: out->repr.bits.bit_shift = 6; break;
+ default: break;
+ }
+
return true;
}

2 changes: 1 addition & 1 deletion builder/scripts.d/50-ffnvcodec.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

SCRIPT_REPO="https://github.com/FFmpeg/nv-codec-headers.git"
SCRIPT_COMMIT="c5e4af74850a616c42d39ed45b9b8568b71bf8bf"
SCRIPT_COMMIT="451da99614412a7f9526ef301a5ee0c7a6f9ad76"

ffbuild_enabled() {
[[ $TARGET == *arm64 ]] && return -1
Expand Down
4 changes: 3 additions & 1 deletion builder/scripts.d/50-vulkan/60-libplacebo.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

SCRIPT_REPO="https://code.videolan.org/videolan/libplacebo.git"
SCRIPT_COMMIT="ed29e541a55acf28022738440b2a925386292551"
SCRIPT_COMMIT="64c1954570f1cd57f8570a57e51fb0249b57bb90"

ffbuild_enabled() {
return 0
Expand All @@ -12,6 +12,8 @@ ffbuild_dockerbuild() {
cd placebo
git submodule update --init --recursive

sed -i 's/DPL_EXPORT/DPL_STATIC/' src/meson.build

mkdir build && cd build

local myconf=(
Expand Down
2 changes: 1 addition & 1 deletion docker-build-win64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ EOF
popd

# FFNVCODEC
git clone -b n12.0.16.0 --depth=1 https://github.com/FFmpeg/nv-codec-headers.git
git clone -b n12.0.16.1 --depth=1 https://github.com/FFmpeg/nv-codec-headers.git
pushd nv-codec-headers
make PREFIX=${FF_DEPS_PREFIX} install
popd
Expand Down
18 changes: 14 additions & 4 deletions docker-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ prepare_extra_common() {
prepare_extra_amd64() {
# FFNVCODEC
pushd ${SOURCE_DIR}
git clone -b n12.0.16.0 --depth=1 https://github.com/FFmpeg/nv-codec-headers.git
git clone -b n12.0.16.1 --depth=1 https://github.com/FFmpeg/nv-codec-headers.git
pushd nv-codec-headers
make && make install
popd
Expand Down Expand Up @@ -300,7 +300,7 @@ prepare_extra_amd64() {
# ONEVPL-INTEL-GPU (RT only)
# Provides VPL runtime (libmfx-gen.so.1.2) for 11th Gen Tiger Lake and newer
pushd ${SOURCE_DIR}
git clone -b intel-onevpl-24.1.1 --depth=1 https://github.com/oneapi-src/oneVPL-intel-gpu.git
git clone -b intel-onevpl-24.1.3 --depth=1 https://github.com/oneapi-src/oneVPL-intel-gpu.git
pushd oneVPL-intel-gpu
mkdir build && pushd build
cmake -DCMAKE_INSTALL_PREFIX=${TARGET_DIR} \
Expand All @@ -320,7 +320,7 @@ prepare_extra_amd64() {
# Full Feature Build: ENABLE_KERNELS=ON(Default) ENABLE_NONFREE_KERNELS=ON(Default)
# Free Kernel Build: ENABLE_KERNELS=ON ENABLE_NONFREE_KERNELS=OFF
pushd ${SOURCE_DIR}
git clone -b intel-media-24.1.1 --depth=1 https://github.com/intel/media-driver.git
git clone -b intel-media-24.1.3 --depth=1 https://github.com/intel/media-driver.git
pushd media-driver
mkdir build && pushd build
cmake -DCMAKE_INSTALL_PREFIX=${TARGET_DIR} \
Expand Down Expand Up @@ -450,8 +450,18 @@ prepare_extra_amd64() {
fi

# LIBPLACEBO
pl_ver="v6.338.2"
if [[ $( lsb_release -c -s ) == "buster" ]]; then
pl_ver="v5.264.1"
fi
pushd ${SOURCE_DIR}
git clone -b v5.264.1 --recursive --depth=1 https://github.com/haasn/libplacebo.git
git clone -b ${pl_ver} --recursive --depth=1 https://github.com/haasn/libplacebo.git
if [[ $( lsb_release -c -s ) != "buster" ]]; then
pushd libplacebo
# fix p010 green screen in v6.338.2
wget -q -O - https://github.com/haasn/libplacebo/commit/a5e7010.patch | git apply
popd
fi
sed -i 's|env: python_env,||g' libplacebo/src/vulkan/meson.build
meson setup libplacebo placebo_build \
--prefix=${TARGET_DIR} \
Expand Down

0 comments on commit 8886cd7

Please sign in to comment.