From 1fc7615b70fe5737b60ddc6877c15bf830a75862 Mon Sep 17 00:00:00 2001 From: zador-blood-stained Date: Wed, 5 Oct 2016 19:32:23 +0300 Subject: [PATCH] Fixes for desktop configuration --- chroot-buildpackages.sh | 13 +- config/mpv_sunxi.conf | 147 ++++++++++++++++++ extras-buildpkgs/04-libvdpau.conf | 1 + ...07-libass.conf => 07-libass.conf.disabled} | 0 ...09-ffmpeg.conf => 09-ffmpeg.conf.disabled} | 4 +- extras-buildpkgs/90-guvcview.conf | 2 +- extras-buildpkgs/90-libglshim.conf | 2 +- extras-buildpkgs/90-libmali-sunxi-r3p0.conf | 2 +- .../{90-mpv.conf => 90-mpv.conf.disabled} | 2 +- .../debian/libmali-sunxi-r3p0.preinst.in | 2 +- .../patches/redo-csc-calculations.patch | 33 ++-- makeboarddeb.sh | 9 +- 12 files changed, 193 insertions(+), 24 deletions(-) create mode 100644 config/mpv_sunxi.conf rename extras-buildpkgs/{07-libass.conf => 07-libass.conf.disabled} (100%) rename extras-buildpkgs/{09-ffmpeg.conf => 09-ffmpeg.conf.disabled} (95%) rename extras-buildpkgs/{90-mpv.conf => 90-mpv.conf.disabled} (90%) diff --git a/chroot-buildpackages.sh b/chroot-buildpackages.sh index 7bd395e868..d2d5ffefc7 100644 --- a/chroot-buildpackages.sh +++ b/chroot-buildpackages.sh @@ -104,11 +104,12 @@ chroot_prepare_distccd() # chroot_build_packages() { + local failed=() for release in jessie xenial; do for arch in armhf arm64; do display_alert "Starting package building process" "$release $arch" "info" - local target_dir=$DEST/buildpkg/${release}-${arch}-v4 + local target_dir=$DEST/buildpkg/${release}-${arch}-v5 local distcc_bindaddr="127.0.0.2" [[ ! -f $target_dir/root/.debootstrap-complete ]] && create_chroot "$target_dir" "$release" "$arch" @@ -212,10 +213,11 @@ chroot_build_packages() display_alert "Done building" "$package_name $release $arch" "ext" ls *.deb 2>/dev/null mv *.deb /root 2>/dev/null + exit 0 else display_alert "Failed building" "$package_name $release $arch" "err" + exit 2 fi - exit 0 EOF chmod +x $target_dir/root/build.sh @@ -225,12 +227,19 @@ chroot_build_packages() eval systemd-nspawn -a -q -D $target_dir --tmpfs=/root/build --tmpfs=/tmp --bind-ro $SRC/lib/extras-buildpkgs/:/root/overlay \ --bind-ro $SRC/sources/extra/:/root/sources /bin/bash -c "/root/build.sh" 2>&1 \ ${PROGRESS_LOG_TO_FILE:+' | tee -a $DEST/debug/buildpkg.log'} + [[ ${PIPESTATUS[0]} -eq 2 ]] && failed+=("$package_name:$release:$arch") mv $target_dir/root/*.deb $plugin_target_dir 2>/dev/null done # cleanup for distcc kill $(&2 exit 1 fi - if [ -z "$LINUXFAMILY" ] || ! ( [ "$LINUXFAMILY" = "sun4i" ] || [ "$LINUXFAMILY" = "sun7i" ] || [ "$LINUXFAMILY" = "sun8i" ] ); then + if [ -z "$LINUXFAMILY" ] || ! ( [ "$LINUXFAMILY" = "sun4i" ] || [ "$LINUXFAMILY" = "sun5i" ] || [ "$LINUXFAMILY" = "sun7i" ] || [ "$LINUXFAMILY" = "sun8i" ] ); then echo "Mali binary driver can be used only on sunxi hardware" 1>&2 exit 1 fi diff --git a/extras-buildpkgs/libvdpau-sunxi/debian/patches/redo-csc-calculations.patch b/extras-buildpkgs/libvdpau-sunxi/debian/patches/redo-csc-calculations.patch index 3b3d6bb692..271b349788 100644 --- a/extras-buildpkgs/libvdpau-sunxi/debian/patches/redo-csc-calculations.patch +++ b/extras-buildpkgs/libvdpau-sunxi/debian/patches/redo-csc-calculations.patch @@ -77,7 +77,7 @@ index 0000000..49705cc + +#endif diff --git a/sunxi_disp.c b/sunxi_disp.c -index 89a029b..3c93401 100644 +index 89a029b..6cd934f 100644 --- a/sunxi_disp.c +++ b/sunxi_disp.c @@ -21,6 +21,7 @@ @@ -88,7 +88,7 @@ index 89a029b..3c93401 100644 #include #include "kernel-headers/sunxi_disp_ioctl.h" #include "vdpau_private.h" -@@ -202,24 +203,37 @@ static int sunxi_disp_set_video_layer(struct sunxi_disp *sunxi_disp, int x, int +@@ -202,24 +203,38 @@ static int sunxi_disp_set_video_layer(struct sunxi_disp *sunxi_disp, int x, int ioctl(disp->fd, DISP_CMD_LAYER_OPEN, args); @@ -99,40 +99,47 @@ index 89a029b..3c93401 100644 - // set doing this unconditionally is costly. if (surface->csc_change) { +- ioctl(disp->fd, DISP_CMD_LAYER_ENHANCE_OFF, args); +- args[2] = 0xff * surface->brightness + 0x20; +- ioctl(disp->fd, DISP_CMD_LAYER_SET_BRIGHT, args); +- args[2] = 0x20 * surface->contrast; +- ioctl(disp->fd, DISP_CMD_LAYER_SET_CONTRAST, args); +- args[2] = 0x20 * surface->saturation; +- ioctl(disp->fd, DISP_CMD_LAYER_SET_SATURATION, args); +- // hue scale is randomly chosen, no idea how it maps exactly +- args[2] = (32 / 3.14) * surface->hue + 0x20; +- ioctl(disp->fd, DISP_CMD_LAYER_SET_HUE, args); +- ioctl(disp->fd, DISP_CMD_LAYER_ENHANCE_ON, args); + uint32_t b, c, s, h; + - ioctl(disp->fd, DISP_CMD_LAYER_ENHANCE_OFF, args); -- args[2] = 0xff * surface->brightness + 0x20; ++ /* ioctl(disp->fd, DISP_CMD_LAYER_ENHANCE_OFF, args); */ + + /* scale VDPAU: -1.0 ~ 1.0 to SUNXI: 0 ~ 100 */ + b = args[2] = ((surface->brightness + 1.0) * 50.0) + 0.5; - ioctl(disp->fd, DISP_CMD_LAYER_SET_BRIGHT, args); -- args[2] = 0x20 * surface->contrast; ++ /* ioctl(disp->fd, DISP_CMD_LAYER_SET_BRIGHT, args); */ + + /* scale VDPAU: 0.0 ~ 10.0 to SUNXI: 0 ~ 100 */ + if (surface->contrast <= 1.0) + c = args[2] = (surface->contrast * 50.0) + 0.5; + else + c = args[2] = (50.0 + (surface->contrast - 1.0) * 50.0 / 9.0) + 0.5; - ioctl(disp->fd, DISP_CMD_LAYER_SET_CONTRAST, args); -- args[2] = 0x20 * surface->saturation; ++ /* ioctl(disp->fd, DISP_CMD_LAYER_SET_CONTRAST, args); */ + + /* scale VDPAU: 0.0 ~ 10.0 to SUNXI: 0 ~ 100 */ + if (surface->saturation <= 1.0) + s = args[2] = (surface->saturation * 50.0) + 0.5; + else + s = args[2] = (50.0 + (surface->saturation - 1.0) * 50.0 / 9.0) + 0.5; - ioctl(disp->fd, DISP_CMD_LAYER_SET_SATURATION, args); -- // hue scale is randomly chosen, no idea how it maps exactly -- args[2] = (32 / 3.14) * surface->hue + 0x20; ++ /* ioctl(disp->fd, DISP_CMD_LAYER_SET_SATURATION, args); */ + + /* scale VDPAU: -PI ~ PI to SUNXI: 0 ~ 100 */ + h = args[2] = (((surface->hue / M_PI) + 1.0) * 50.0) + 0.5; - ioctl(disp->fd, DISP_CMD_LAYER_SET_HUE, args); ++ /* ioctl(disp->fd, DISP_CMD_LAYER_SET_HUE, args); */ + - ioctl(disp->fd, DISP_CMD_LAYER_ENHANCE_ON, args); ++ /* ioctl(disp->fd, DISP_CMD_LAYER_ENHANCE_ON, args); */ + VDPAU_DBG("Presentation queue csc change"); + VDPAU_DBG("display driver -> bright: %d, contrast: %d, saturation: %d, hue: %d", b, c, s, h); ++ VDPAU_DBG("Not changing display settings to workaround csc brightness bug"); surface->csc_change = 0; } diff --git a/makeboarddeb.sh b/makeboarddeb.sh index d7a2d05b20..afeeaa2eac 100644 --- a/makeboarddeb.sh +++ b/makeboarddeb.sh @@ -227,8 +227,8 @@ create_board_package() install -m 755 $SRC/lib/scripts/h3consumption $destination/usr/bin fi - if [[ $LINUXCONFIG == *sun* ]]; then - if [[ $BRANCH != next ]]; then + if [[ $LINUXFAMILY == sun*i ]]; then + if [[ $BRANCH == default ]]; then # add soc temperature app local codename=$(lsb_release -sc) if [[ -z $codename || "sid" == *"$codename"* ]]; then @@ -244,6 +244,11 @@ create_board_package() fex2bin $SRC/lib/config/fex/${i%*.fex}.fex $destination/boot/bin/${i%*.fex}.bin done + # add mpv config + cp $SRC/lib/mpv_sunxi.conf $destination/usr/share/armbian/mpv_sunxi.conf + echo "export VDPAU_OSD=1" > $destination/etc/profile.d/90-vdpau.sh + chmod 755 $destination/etc/profile.d/90-vdpau.sh + # bluetooth device enabler - for cubietruck # TODO: move to tools or sunxi-common.inc #install $SRC/lib/scripts/brcm40183 $destination/etc/default