Nothin' but Slackware

バイクとLinuxに戯れる日々

2022年08月

VirtualGL-3.0.1 for slackware64-15.0

VirtualGL-3.0.1 for slackware64-15.0

VirtualGL.SlackBuild
[code]
#!/bin/sh

# Slackware build script for VirtualGL

# Copyright 2022 JW(Shinichi Abe) <shin1.abe@nifty.com>
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
# permitted provided that the following conditions are met:
#
# 1. Redistributions of this script must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
#
#  THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
#  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
#  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO
#  EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
#  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
#  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
#  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
#  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
#  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
#  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

PRGNAM=VirtualGL
VERSION=${VERSION:-3.0.1}
BUILD=${BUILD:-1}
TAG=${TAG:-jw}

if [ -z "$ARCH" ]; then
  case "$( uname -m )" in
    i?86) ARCH=i586 ;;
    arm*) ARCH=arm ;;
       *) ARCH=$( uname -m ) ;;
  esac
fi

CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}

if [ "$ARCH" = "i586" ]; then
  SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
  SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
  SLKCFLAGS="-O2 -fPIC"
  LIBDIRSUFFIX="64"
else
  SLKCFLAGS="-O2"
  LIBDIRSUFFIX=""
fi

set -e

rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
cd $PRGNAM-$VERSION
# Apply upstream patch -- Thanks to Arch
patch -Np1 -i $CWD/46d09529563127fef0d42a4fb2681ae8d65a856b.patch


chown -R root:root .
find -L . \
 \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  -o -perm 511 \) -exec chmod 755 {} \; -o \
 \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;

mkdir -p build
cd build
  cmake \
    -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \
    -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DLIB_SUFFIX=${LIBDIRSUFFIX} \
    -DTJPEG_LIBRARY=/usr/lib${LIBDIRSUFFIX}/libturbojpeg.so \
    -DVGL_FAKEXCB=1 \
    -DCMAKE_BUILD_TYPE=Release ..
  make
  make install DESTDIR=$PKG
  mv $PKG/usr/bin/glxinfo $PKG/usr/bin/vglxinfo
  mv $PKG/usr/bin/eglinfo $PKG/usr/bin/veglinfo
cd ..

find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
  | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true

find $PKG -name perllocal.pod -o -name ".packlist" -o -name "*.bs" | xargs rm -f || true

mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a \
  *.txt doc $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild

mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc

cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-txz}

46d09529563127fef0d42a4fb2681ae8d65a856b.patch
[code]
From 46d09529563127fef0d42a4fb2681ae8d65a856b Mon Sep 17 00:00:00 2001
From: DRC <information@virtualgl.org>
Date: Thu, 7 Jul 2022 17:22:57 -0500
Subject: [PATCH] Build: Fix compilation errors with libX11 1.8.x

Fixes #205
---
 ChangeLog.md           |  2 ++
 server/CMakeLists.txt  | 10 ++++++++++
 server/FakePbuffer.cpp |  2 +-
 server/faker-sym.h     |  6 ++++++
 server/faker-x11.cpp   |  7 ++++++-
 server/faker.cpp       |  4 ++--
 6 files changed, 27 insertions(+), 4 deletions(-)

diff --git a/ChangeLog.md b/ChangeLog.md
index 292a5a94..4b9cc36f 100644
--- a/ChangeLog.md
+++ b/ChangeLog.md
@@ -8,6 +8,8 @@ module when using recent versions of nVidia's proprietary drivers.  In some
 cases, this led to incorrect device permissions for **/dev/nvidia*** after the
 display manager was restarted.
 
+2. Fixed compilation errors when building with libX11 1.8.x.
+
 
 3.0.1
 =====
diff --git a/server/CMakeLists.txt b/server/CMakeLists.txt
index 574521a0..2ce92856 100644
--- a/server/CMakeLists.txt
+++ b/server/CMakeLists.txt
@@ -91,6 +91,16 @@ add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/faker-mapfile
         > ${CMAKE_CURRENT_BINARY_DIR}/faker-mapfile
     DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/faker-mapfile.c)
 
+include(CheckPrototypeDefinition)
+set(CMAKE_REQUIRED_INCLUDES ${X11_X11_INCLUDE_PATH})
+check_prototype_definition(XkbOpenDisplay
+    "Display *XkbOpenDisplay(_Xconst char *, int *, int *, int *, int *, int *)"
+    NULL X11/XKBlib.h LIBX11_18)
+unset(CMAKE_REQUIRED_INCLUDES)
+if(LIBX11_18)
+    add_definitions(-DLIBX11_18)
+endif()
+
 set(FAKER_SOURCES
     backend.cpp
     ContextHash.cpp
diff --git a/server/FakePbuffer.cpp b/server/FakePbuffer.cpp
index bfa55279..64aab775 100644
--- a/server/FakePbuffer.cpp
+++ b/server/FakePbuffer.cpp
@@ -10,11 +10,11 @@
 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 // wxWindows Library License for more details.
 
+#include <X11/Xlibint.h>
 #include "FakePbuffer.h"
 #include "TempContextEGL.h"
 #include "BufferState.h"
 #include "ContextHashEGL.h"
-#include <X11/Xlibint.h>
 
 using namespace util;
 using namespace backend;
diff --git a/server/faker-sym.h b/server/faker-sym.h
index 0fa1e5cd..3c6f94e8 100644
--- a/server/faker-sym.h
+++ b/server/faker-sym.h
@@ -704,9 +704,15 @@ FUNCDEF2(int, XNextEvent, Display *, dpy, XEvent *, xe, XNextEvent)
 
 FUNCDEF1(Display *, XOpenDisplay, _Xconst char *, name, XOpenDisplay)
 
+#ifdef LIBX11_18
+FUNCDEF6(Display *, XkbOpenDisplay, _Xconst char *, display_name,
+    int *, event_rtrn, int *, error_rtrn, int *, major_in_out,
+    int *, minor_in_out, int *, reason_rtrn, XkbOpenDisplay)
+#else
 FUNCDEF6(Display *, XkbOpenDisplay, char *, display_name, int *, event_rtrn,
     int *, error_rtrn, int *, major_in_out, int *, minor_in_out,
     int *, reason_rtrn, XkbOpenDisplay)
+#endif
 
 FUNCDEF5(Bool, XQueryExtension, Display *, dpy, _Xconst char *, name,
     int *, major_opcode, int *, first_event, int *, first_error,
diff --git a/server/faker-x11.cpp b/server/faker-x11.cpp
index 99e8bf17..a233f3b1 100644
--- a/server/faker-x11.cpp
+++ b/server/faker-x11.cpp
@@ -1,6 +1,6 @@
 // Copyright (C)2004 Landmark Graphics Corporation
 // Copyright (C)2005, 2006 Sun Microsystems, Inc.
-// Copyright (C)2009, 2011-2016, 2018-2021 D. R. Commander
+// Copyright (C)2009, 2011-2016, 2018-2022 D. R. Commander
 //
 // This library is free software and may be redistributed and/or modified under
 // the terms of the wxWindows Library License, Version 3.1 or (at your option)
@@ -586,8 +586,13 @@ Display *XOpenDisplay(_Xconst char *name)
 // within libX11, VirtualGL cannot intercept it on some platforms.  Thus we
 // need to interpose XkbOpenDisplay().
 
+#ifdef LIBX11_18
+Display *XkbOpenDisplay(_Xconst char *display_name, int *event_rtrn,
+    int *error_rtrn, int *major_in_out, int *minor_in_out, int *reason_rtrn)
+#else
 Display *XkbOpenDisplay(char *display_name, int *event_rtrn, int *error_rtrn,
     int *major_in_out, int *minor_in_out, int *reason_rtrn)
+#endif
 {
     Display *dpy = NULL;
 
diff --git a/server/faker.cpp b/server/faker.cpp
index ec537a62..601cfa3e 100644
--- a/server/faker.cpp
+++ b/server/faker.cpp
@@ -1,6 +1,6 @@
 // Copyright (C)2004 Landmark Graphics Corporation
 // Copyright (C)2005, 2006 Sun Microsystems, Inc.
-// Copyright (C)2009, 2011, 2013-2016, 2019-2021 D. R. Commander
+// Copyright (C)2009, 2011, 2013-2016, 2019-2022 D. R. Commander
 //
 // This library is free software and may be redistributed and/or modified under
 // the terms of the wxWindows Library License, Version 3.1 or (at your option)
@@ -14,6 +14,7 @@
 
 #include <unistd.h>
 #include "Mutex.h"
+#include <X11/Xlibint.h>
 #include "ContextHash.h"
 #ifdef EGLBACKEND
 #include "ContextHashEGL.h"
@@ -27,7 +28,6 @@
 #include "fakerconfig.h"
 #include "threadlocal.h"
 #include <dlfcn.h>
-#include <X11/Xlibint.h>
 #include "faker.h"
 


slack-desc
[code]
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description.
# Line up the first '|' above the ':' following the base package name, and
# the '|' on the right side marks the last column you can put a character in.
# You must make exactly 11 lines for the formatting to be correct.  It's also
# customary to leave one space after the ':' except on otherwise blank lines.

         |-----handy-ruler------------------------------------------------------|
VirtualGL: VirtualGL (remote OpenGL rendering)
VirtualGL:
VirtualGL: VirtualGL is an open source package which gives any Unix or Linux
VirtualGL: remote display software the ability to run OpenGL applications with
VirtualGL: full 3D hardware acceleration.
VirtualGL:
VirtualGL: Homepage: https://virtualgl.org/Main/HomePage
VirtualGL:
VirtualGL:
VirtualGL:
VirtualGL:

VirtualGL.info
[code]
PRGNAM="VirtualGL"
VERSION="3.0.1"
HOMEPAGE="https://github.com/VirtualGL/virtualgl"
DOWNLOAD="https://jaist.dl.sourceforge.net/project/virtualgl/3.0.1/VirtualGL-3.0.1.tar.gz"
MD5SUM="e7ec38c7e69a2d8db10941057b753aa6"
DOWNLOAD_x86_64="direct download link(s) of application source tarball(s), x86_64 only"
MD5SUM_x86_64=""
REQUIRES="%README%"
MAINTAINER="JW(Shinichi Abe)"
EMAIL="shin1.abe@nifty.com"


< sample Log >
[code]
$ glxspheres64
Polygons in scene: 62464 (61 spheres * 1024 polys/spheres)
GLX FB config ID of window: 0xad (8/8/8/0)
Visual ID of window: 0x27
Context is Direct
OpenGL Renderer: NVIDIA GeForce GTX 1060 6GB/PCIe/SSE2
59.975655 frames/sec - 66.932831 Mpixels/sec
59.957130 frames/sec - 66.912157 Mpixels/sec
59.950381 frames/sec - 66.904625 Mpixels/sec
59.954037 frames/sec - 66.908705 Mpixels/sec
...

$ vglrun /usr/bin/glxspheres64
Polygons in scene: 62464 (61 spheres * 1024 polys/spheres)
GLX FB config ID of window: 0xad (8/8/8/0)
Visual ID of window: 0x21
Context is Direct
OpenGL Renderer: NVIDIA GeForce GTX 1060 6GB/PCIe/SSE2
534.958612 frames/sec - 597.013811 Mpixels/sec
540.546484 frames/sec - 603.249876 Mpixels/sec
527.378161 frames/sec - 588.554028 Mpixels/sec
545.998366 frames/sec - 609.334177 Mpixels/sec
547.866048 frames/sec - 611.418509 Mpixels/sec
...

screenshot of glxsphere64
glxspheres64_2022-08-25_16-06-23


---
[2022-08-25] 新規
[ ]



NVIDIA-Prime for msi GL62 6QC-041JP

NVIDIA-Linux-x86_64-515.65.01 driver is working on msi GL62 6QC-041JP

Linux kernel : 5.19.3
msi GL62 6QC-041J
GPU : GeForce 940MX

[code] working xorg.conf
----- >8 ------ >8 ----- >8 ------ >8
Section "ServerLayout"
    Identifier "layout"
    Screen 0 "nvidia"
    Inactive "intel"
EndSection

Section "Device"
    Identifier "nvidia"
    Driver "nvidia"
        VendorName     "NVIDIA Corporation"
        BoardName      "GeForce 940MX"
    BusID "PCI:1:0:0"
EndSection

Section "Screen"
    Identifier "nvidia"
    Device "nvidia"
    Option "AllowEmptyInitialConfiguration"
EndSection

Section "Device"
    Identifier "intel"
    Driver "modesetting"
EndSection

Section "Screen"
    Identifier "intel"
    Device "intel"
EndSection
----- >8 ------ >8 ----- >8 ------ >8

nvidia_20220824-001

nvidia_20220824-003b

nvidia_20220824-002




---
[2022-08-02] 新規
[ ]



RTL8812AU -- tentative workaround patch for kernel-5.19.2

An upstream driver site seems to be still working on checking PR of this issue.

Here is a tentative workaround patch to the latest git master of aircrack-ng.
referenced PR's site: https://github.com/morrownr/8821au-20210708
※ I appreciate to Pull-Request's owner "morrownr" for fixing this issue.


rtl8812au-kernel-5.19.2-Fix.patch
[code]
--- rtl8812au_kernel-5.18/os_dep/linux/ioctl_cfg80211.c    2022-06-08 04:56:04.921980223 +0900
+++ rtl8812au_kernel-5.19.2_test/os_dep/linux/ioctl_cfg80211.c    2022-08-18 14:10:05.000000000 +0900
@@ -472,7 +472,11 @@
     if (!rtw_cfg80211_allow_ch_switch_notify(adapter))
         goto exit;
 
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,19, 2))
+    cfg80211_ch_switch_notify(adapter->pnetdev, &chdef, 0);
+#else
     cfg80211_ch_switch_notify(adapter->pnetdev, &chdef);
+#endif
 
 #else
     int freq = rtw_ch2freq(ch);
@@ -1145,7 +1149,11 @@
         #endif
 
         #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0))
+        roam_info.links[0].bssid = cur_network->network.MacAddress;
+#else
         roam_info.bssid = cur_network->network.MacAddress;
+#endif
         roam_info.req_ie = pmlmepriv->assoc_req + sizeof(struct rtw_ieee80211_hdr_3addr) + 2;
         roam_info.req_ie_len = pmlmepriv->assoc_req_len - sizeof(struct rtw_ieee80211_hdr_3addr) - 2;
         roam_info.resp_ie = pmlmepriv->assoc_rsp + sizeof(struct rtw_ieee80211_hdr_3addr) + 6;
@@ -5219,7 +5227,11 @@
     return ret;
 }
 
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,19, 2))
+static int cfg80211_rtw_stop_ap(struct wiphy *wiphy, struct net_device *ndev, unsigned int link_id)
+#else
 static int cfg80211_rtw_stop_ap(struct wiphy *wiphy, struct net_device *ndev)
+#endif
 {
     _adapter *adapter = (_adapter *)rtw_netdev_priv(ndev);
 
@@ -6092,7 +6104,11 @@
     return 0;
 }
 
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,19, 2))
+static int cfg80211_rtw_get_channel(struct wiphy *wiphy, struct wireless_dev *wdev, unsigned int link_id, struct cfg80211_chan_def *chandef){
+#else
 static int cfg80211_rtw_get_channel(struct wiphy *wiphy, struct wireless_dev *wdev, struct cfg80211_chan_def *chandef){
+#endif
     _adapter *padapter= wiphy_to_adapter(wiphy);
     int channel;
     int control_freq;
@@ -10395,7 +10411,13 @@
     rtw_cfg80211_indicate_scan_done(adapter, _TRUE);
 
     #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)) || defined(COMPAT_KERNEL_RELEASE)
+    #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,19, 2))
+    if (wdev->connected) {
+    #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0))
+    if (wdev->links[0].client.current_bss) {
+    #else
     if (wdev->current_bss) {
+    #endif
         RTW_INFO(FUNC_ADPT_FMT" clear current_bss by cfg80211_disconnected\n", FUNC_ADPT_ARG(adapter));
         rtw_cfg80211_indicate_disconnect(adapter, 0, 1);
     }

How to use this patch

Step-1. retleave git source
  # git clone https://github.com/aircrack-ng/rtl8812au.git

Step-2. Apply the patch
  # cd rtl8812au
  # patch -p1 < [PATH_TO]/rtl8812au-kernel-5.19.2-Fix.patch
     patching file os_dep/linux/ioctl_cfg80211.c

Step-3. Make driver
  # make
     make ARCH=x86_64 CROSS_COMPILE= -C /lib/modules/5.19.2-jw/build M=/usr/src/888/rtl8812au  modules
     make[1]: Entering directory '/usr/src/linux-5.19.2'
       CC [M]  /usr/src/888/rtl8812au/core/rtw_cmd.o
       CC [M]  /usr/src/888/rtl8812au/core/rtw_security.o
       ...
       ...
       LD [M]  /usr/src/888/rtl8812au/88XXau.o
       MODPOST /usr/src/888/rtl8812au/Module.symvers
       CC [M]  /usr/src/888/rtl8812au/88XXau.mod.o
       LD [M]  /usr/src/888/rtl8812au/
88XXau.ko
     make[1]: Leaving directory '/usr/src/linux-5.19.2'
---------------------------------------------------------------------------
Visit https://github.com/aircrack-ng/rtl8812au for support/reporting issues
or check for newer versions (branches) of these drivers.                   
---------------------------------------------------------------------------   


Step-4. Install driver
  # make install


    
引き続き更新予定








fcitx5_mozc for slackware64-15.0 ... [update: 2022-09-06]

On Aug. 16th 2022
IME environment has been upgraded from "Fcitx' to "Fcitx5".

Thank you Patrick and Heinz Wiesinger for this update.
And also Thank you litelinux@linuxquestions_org for the tutorials of Fcitx5.

I updated my fcitx5-mozc package from 2.28.4800.102.1 to 2.28.4830.102.1.
Here is the SlackBuild of fcitx5-mozc package.
  version: 2.28.4830.102.1
  git-source: commit-be4da0c507f9bee9533d8dead5748d78fc767a11
  build requires: jdk11, bazel

fcitx5-mozc.SlackBuild
[code]
#!/bin/sh
# Slackware build script for fcitx-mozc
# Issued under The MIT License (MIT)
#
# Copyright 2016 Kuro_CODE25
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.

PRGNAM=fcitx5-mozc
VERSION=${VERSION:-2.28.4830.102.1}
BUILD=${BUILD:-1}
TAG=${TAG:-jw}

if [ -z "$ARCH" ]; then
  case "$( uname -m )" in
    i?86) ARCH=i586 ;;
    arm*) ARCH=arm ;;
       *) ARCH=$( uname -m ) ;;
  esac
fi

CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
BLDBASEDIR=$TMP/$PRGNAM-$VERSION

if [ "$ARCH" = "i586" ]; then
  SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
  SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
  SLKCFLAGS="-O2 -fPIC"
  LIBDIRSUFFIX="64"
else
  SLKCFLAGS="-O2"
  LIBDIRSUFFIX=""
fi

set -e
BLDTYPE=Release
# source rev. and version.
ZIPCODE_REL=202110
ABSEIL_CPP_REV=eb3db08cb3a4faf2aa09a2ba4a30b442457f36cf
BREAKPAD_REV=c685fe1153193853cff23e83d6d2b2c577aaa5f6
GOOGLETEST_REV=703bd9caab50b139428cea1aaff9974ebee5742e
JSONCPP_REV=42e892d96e47b1f6e29844cc705e148ec4856448
PROTOBUF_REV=b5a35bcc7e4cc4ff00eb105449b300fca3a8b0d2
GYP_REV=caa60026e223fc501e8b337fd5086ece4028b1c6
JAPANESE_USAGE_DICT_REV=e5b3425575734c323e1d947009dd74709437b684
# 2.28.4800  MOZC_REV=9eadd16fc0a4f9010be1be5ba182c6aed42eb65b
MOZC_REV=be4da0c507f9bee9533d8dead5748d78fc767a11

# Download sources
wget https://github.com/chromium/gyp/archive/${GYP_REV}/gyp-${GYP_REV}.zip
wget https://github.com/fcitx/mozc/archive/${MOZC_REV}/mozc-${MOZC_REV}.zip
wget https://github.com/hiroyuki-komatsu/japanese-usage-dictionary/archive/${JAPANESE_USAGE_DICT_REV}/japanese-usage-dictionary-${JAPANESE_USAGE_DICT_REV}.zip
wget https://github.com/protocolbuffers/protobuf/archive/${PROTOBUF_REV}/protobuf-${PROTOBUF_REV}.zip
wget https://github.com/abseil/abseil-cpp/archive/${ABSEIL_CPP_REV}/abseil-cpp-${ABSEIL_CPP_REV}.zip
wget https://chromium.googlesource.com/breakpad/breakpad/+archive/${BREAKPAD_REV}.tar.gz
wget https://github.com/google/googletest/archive/${GOOGLETEST_REV}/googletest-${GOOGLETEST_REV}.zip
wget https://github.com/open-source-parsers/jsoncpp/archive/${JSONCPP_REV}/jsoncpp-${JSONCPP_REV}.zip

wget https://osdn.net/projects/ponsfoot-aur/storage/mozc/jigyosyo-${ZIPCODE_REL}.zip
wget https://osdn.net/projects/ponsfoot-aur/storage/mozc/x-ken-all-${ZIPCODE_REL}.zip
wget https://download.fcitx-im.org/fcitx-mozc/fcitx-mozc-icon.tar.gz

rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
mkdir -p $PRGNAM-$VERSION
cd $PRGNAM-$VERSION
echo "prepare source file..."
# unzip packages
unzip $CWD/x-ken-all-$ZIPCODE_REL.zip
unzip $CWD/jigyosyo-$ZIPCODE_REL.zip
unzip $CWD/abseil-cpp-$ABSEIL_CPP_REV.zip
unzip $CWD/googletest-$GOOGLETEST_REV.zip
unzip $CWD/jsoncpp-$JSONCPP_REV.zip
unzip $CWD/mozc-$MOZC_REV.zip
unzip $CWD/japanese-usage-dictionary-$JAPANESE_USAGE_DICT_REV.zip
unzip $CWD/gyp-$GYP_REV.zip
unzip $CWD/protobuf-$PROTOBUF_REV.zip
# untar breakpad to breakpad directory
mkdir breakpad
tar xvf ${CWD}/${BREAKPAD_REV}.tar.gz -C breakpad

# extact tar file
tar -xvf ${CWD}/fcitx-mozc-icon.tar.gz

# rename directory
mv mozc-$MOZC_REV mozc
mv gyp-$GYP_REV gyp
mv japanese-usage-dictionary-$JAPANESE_USAGE_DICT_REV japanese_usage_dictionary
mv abseil-cpp-$ABSEIL_CPP_REV abseil-cpp
mv protobuf-$PROTOBUF_REV protobuf
#mv breakpad-$BREAKPAD_REV breakpad
mv googletest-$GOOGLETEST_REV googletest
mv jsoncpp-$JSONCPP_REV jsoncpp

chown -R root:root .
find -L . \
 \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  -o -perm 511 \) -exec chmod 755 {} \; -o \
 \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;

cd $BLDBASEDIR/mozc/src

# disable fcitx4 target
#rm unix/fcitx/fcitx.gyp

# disable android-ndk requirement, even if we don't need it bazel will complain
sed "/android_ndk_repository/d" -i WORKSPACE.bazel


# adjust QT_BASE_PATH
sed 's|path = QT_BASE_PATH|path = "/usr/include/qt5"|' -i WORKSPACE.bazel


cd $BLDBASEDIR/mozc
# prepare zip code dictionary
unzip -d src/data/dictionary_oss $CWD/x-ken-all-$ZIPCODE_REL.zip
unzip -d src/data/dictionary_oss $CWD/jigyosyo-$ZIPCODE_REL.zip

cd src/dictionary
# Generate zip code seed
sed -i "s/from dictionary import zip_code_util/import zip_code_util/g" gen_zip_code_seed.py

cd ../data/dictionary_oss
echo "Generating zip code seed ..."
python3 ../../dictionary/gen_zip_code_seed.py --zip_code=x-ken-all.csv --jigyosyo=JIGYOSYO.CSV >> dictionary09.txt
echo "Done."

# Copy third party deps
echo "Copy third party deps ..."
cd $BLDBASEDIR/mozc
# fix QT_BBASE_PATH QT_BIN_PATH
#patch -p1 < $CWD/01_mozc_config.bzl_qt5.diff
#
# 2022-07-07 # For Linux, Qt paths are managed by pkg_config_repository in WORKSPACE.bazel.
# So, we don't need 01_mozc_config.bzl_qt5.diff.

# fix libdir path of fcitx5-mozc.so for Slackware
patch -p1 < $CWD/02_install_fcitx5_libdir.diff


cd ..
for dep in abseil-cpp breakpad googletest jsoncpp gyp protobuf japanese_usage_dictionary
do
  cp -a $dep mozc/src/third_party/
done

# build package
echo "build package..."
CFLAGS="${CFLAGS} -fvisibility=hidden"
CXXFLAGS="${CXXFLAGS} -fvisibility=hidden"

cd $BLDBASEDIR/mozc/src
QT_BASE_PATH=/usr/include/qt5 bash ../scripts/build_fcitx5_bazel

# Build emacs_helper
echo "build emacs_helper..."

# export JAVA_HOME
export JAVA_HOME=/usr/lib64/jdk11-11.0.14
# Build
bazel build unix/emacs:mozc_emacs_helper --config oss_linux --compilation_mode opt

# Extract license part of mozc
head -n 29 server/mozc_server.cc > LICENSE

export PREFIX="$PKG/usr"
export _bldtype
bash ../scripts/install_server_bazel

install -d "$PKG/usr/share/licenses/${PRGNAM}/"
install -m 644 LICENSE data/installer/*.html "$PKG/usr/share/licenses/${PRGNAM}/"

install -d "${PREFIX}/share/fcitx5/addon"
install -d "${PREFIX}/share/fcitx5/inputmethod"
install -d "${PREFIX}/lib${LIBDIRSUFFIX}/fcitx5"
bash ../scripts/install_fcitx5_bazel

# Install emacs_helper
install -Dm644 ../LICENSE $PKG/usr/share/licenses/emacs-mozc/LICENSE
install -Dm644 data/installer/credits_en.html  $PKG/usr/share/licenses/emacs-mozc/credits_en.html
install -Dm755 bazel-bin/unix/emacs/mozc_emacs_helper $PKG/usr/bin/mozc_emacs_helper
install -Dm644 unix/emacs/mozc.el $PKG/usr/share/emacs/site-lisp/mozc.el

mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION

cp $CWD/sources.url $CWD/init.el_mozc $CWD/README.emacs $PKG/usr/doc/$PRGNAM-$VERSION/
cp $CWD/*.diff $PKG/usr/doc/$PRGNAM-$VERSION/
cp $CWD/$PRGNAM.SlackBuild $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild

mkdir -p $PKG/install
# install slack-desc
cat $CWD/slack-desc > $PKG/install/slack-desc

### clean-up work directory
echo "Clean up working directory ..."
#for dep in abseil-cpp breakpad googletest jsoncpp gyp protobuf japanese_usage_dictionary
#do
#  rm -rf $CWD/$dep
#done
rm -rf $CWD/*.zip $CWD/*.tar.gz

cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-txz}


01_mozc_config.bzl_qt5.diff
# 2022-07-07 # For Linux, Qt paths are managed by pkg_config_repository in WORKSPACE.bazel.
# So, we don't need 01_mozc_config.bzl_qt5.diff.

[code]
--- a/src/config.bzl    2022-03-21 13:54:26.000000000 +0900
+++ b/src/config.bzl    2022-03-26 15:14:04.384298439 +0900
@@ -40,8 +40,8 @@
 MACOS_MIN_OS_VER = "10.12"
 
 ## Qt paths
-QT_BASE_PATH = "/usr/include/x86_64-linux-gnu/qt5"  # For Debian
-QT_BIN_PATH = "/usr/bin/"
+QT_BASE_PATH = "/usr/include/qt5"  # For Slackware
+QT_BIN_PATH = "/usr/lib64/qt5/bin/"
 
 ## For macOS
 ## QT_BASE_PATH should be a directory compiled with -developer_build option.


02_install_fcitx5_libdir.diff
[code]
--- a/scripts/install_fcitx5_bazel    2022-03-26 17:59:59.265593030 +0900
+++ b/scripts/install_fcitx5_bazel    2022-03-26 18:00:47.135593436 +0900
@@ -1,7 +1,7 @@
 #!/bin/sh
 PREFIX="${PREFIX:-/usr}"
 
-install -D -m 755 "bazel-bin/unix/fcitx5/fcitx5-mozc.so" "${PREFIX}/lib/fcitx5/fcitx5-mozc.so"
+install -D -m 755 "bazel-bin/unix/fcitx5/fcitx5-mozc.so" "${PREFIX}/lib64/fcitx5/fcitx5-mozc.so"
 
 PREFIX="${PREFIX}" ../scripts/install_fcitx5_data
 PREFIX="${PREFIX}" ../scripts/install_fcitx5_icons


init.el_mozc
[code]
(set-language-environment "Japanese")
(require 'mozc)  ; or (load-file "/usr/share/emacs/site-lisp/emacs-mozc/mozc.el")
(setq default-input-method "japanese-mozc")
(setq mozc-candidate-style 'overlay)


README.emacs
[code]
# for emacs, create {HOME}/.emacs.d/init.el with followng lines

(require 'mozc)  ; or (load-file "/path/to/mozc.el")
(setq default-input-method "japanese-mozc")
(setq mozc-candidate-style 'overlay)


slack-desc
[code]
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description.
# Line up the first '|' above the ':' following the base package name, and
# the '|' on the right side marks the last column you can put a character in.
# You must make exactly 11 lines for the formatting to be correct.  It's also
# customary to leave one space after the ':' except on otherwise blank lines.

           |-----handy-ruler------------------------------------------------------|
fcitx5-mozc: fcitx5-mozc (Mozc engine for fcitx5)
fcitx5-mozc:
fcitx5-mozc: fcitx5-mozc is Mozc, Japanese input method editor, engine for fcitx5.
fcitx5-mozc:
fcitx5-mozc: Homepage: https://fcitx-im.org
fcitx5-mozc:
fcitx5-mozc:
fcitx5-mozc:
fcitx5-mozc:
fcitx5-mozc:
fcitx5-mozc:


引き続き更新予定








Kernel-5.19 patch for nvidia-470.xx driver source

Kernel-5.19 patch for nvidia-470.xx

Following patches were created by Joan Bruguera. Thank you Joan.
sources : https://gist.github.com/joanbm

[Step-1] At first, We need nvidia-470xx-fix-linux-5.18.patch
[code]
From 0ec02378bcc0d35d713fd93ba42c3848bc8b1077 Mon Sep 17 00:00:00 2001
From: Joan Bruguera <joanbrugueram@gmail.com>
Date: Sat, 12 Mar 2022 08:37:32 +0100
Subject: [PATCH 1/2] Buildfix NVIDIA 470.103.01 for Linux 5.18-rc1 (part 1)

---
 common/inc/nv-linux.h       | 7 +++++++
 nvidia-drm/nvidia-drm-drv.c | 4 ++++
 nvidia-drm/nvidia-drm-gem.c | 6 ++++++
 3 files changed, 17 insertions(+)

diff --git a/common/inc/nv-linux.h b/common/inc/nv-linux.h
index 82e19d6..58e66c7 100644
--- a/common/inc/nv-linux.h
+++ b/common/inc/nv-linux.h
@@ -11,6 +11,8 @@
 #ifndef _NV_LINUX_H_
 #define _NV_LINUX_H_
 
+#warning Do not buy NVIDIA for your next GPU!
+#include <linux/version.h>
 #include "nvstatus.h"
 #include "nv.h"
 #include "nv-ioctl-numa.h"
@@ -958,7 +960,12 @@ static inline pgprot_t nv_adjust_pgprot(pgprot_t vm_prot, NvU32 extra)
      * When AMD memory encryption is enabled, device memory mappings with the
      * C-bit set read as 0xFF, so ensure the bit is cleared for user mappings.
      */
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0) && defined(_ASM_X86_PGTABLE_H))
+    // Rel. commit "x86/coco: Add API to handle encryption mask" (Kirill A. Shutemov, 22 Feb 2022)
+    prot = __pgprot(__sme_clr(pgprot_val(prot)));
+#else
     prot = pgprot_decrypted(prot);
+#endif
 #endif
     return prot;
 }
diff --git a/nvidia-drm/nvidia-drm-drv.c b/nvidia-drm/nvidia-drm-drv.c
index d7067a4..f57cbc8 100644
--- a/nvidia-drm/nvidia-drm-drv.c
+++ b/nvidia-drm/nvidia-drm-drv.c
@@ -20,6 +20,7 @@
  * DEALINGS IN THE SOFTWARE.
  */
 
+#include <linux/version.h>
 #include "nvidia-drm-conftest.h" /* NV_DRM_AVAILABLE and NV_DRM_DRM_GEM_H_PRESENT */
 
 #include "nvidia-drm-priv.h"
@@ -254,7 +255,10 @@ nv_drm_init_mode_config(struct nv_drm_device *nv_dev,
 #if defined(NV_DRM_FORMAT_MODIFIERS_PRESENT)
     /* Allow clients to define framebuffer layouts using DRM format modifiers */
 
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 18, 0))
+    // Rel. commit "drm: remove allow_fb_modifiers" (Tomohito Esaki, 28 Jan 2022)
     dev->mode_config.allow_fb_modifiers = true;
+#endif
 #endif
 
     /* Initialize output polling support */
diff --git a/nvidia-drm/nvidia-drm-gem.c b/nvidia-drm/nvidia-drm-gem.c
index 82de645..8cd3f76 100644
--- a/nvidia-drm/nvidia-drm-gem.c
+++ b/nvidia-drm/nvidia-drm-gem.c
@@ -49,6 +49,12 @@
 
 #include "nv-mm.h"
 
+#include <linux/version.h>
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0))
+// Rel. commit "dma-buf-map: Rename to iosys-map" (Lucas De Marchi, 4 Feb 2022)
+#define dma_buf_map iosys_map
+#endif
+
 void nv_drm_gem_free(struct drm_gem_object *gem)
 {
     struct nv_drm_gem_object *nv_gem = to_nv_gem_object(gem);
--
2.35.1


From 6b934e829fb942d1735e2371320ddbec089c6900 Mon Sep 17 00:00:00 2001
From: Joan Bruguera <joanbrugueram@gmail.com>
Date: Mon, 4 Apr 2022 19:59:51 +0200
Subject: [PATCH 2/2] Buildfix NVIDIA 470.103.01 for Linux 5.18-rc1 (part 2)

See also: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=d56baf6efaf14e2910610216c581ca71d6940012
          https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=7968778914e53788a01c2dee2692cab157de9ac0
---
 nvidia-uvm/uvm_gpu.c    |  8 ++++----
 nvidia/linux_nvswitch.c | 18 +++++++++---------
 nvidia/nv.c             | 18 +++++++++---------
 3 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/nvidia-uvm/uvm_gpu.c b/nvidia-uvm/uvm_gpu.c
index f58c00b..c9607a8 100644
--- a/nvidia-uvm/uvm_gpu.c
+++ b/nvidia-uvm/uvm_gpu.c
@@ -3059,16 +3059,16 @@ out:
 
 NV_STATUS uvm_gpu_map_cpu_pages(uvm_gpu_t *gpu, struct page *page, size_t size, NvU64 *dma_addr_out)
 {
-    NvU64 dma_addr = pci_map_page(gpu->parent->pci_dev, page, 0, size, PCI_DMA_BIDIRECTIONAL);
+    NvU64 dma_addr = dma_map_page(&gpu->parent->pci_dev->dev, page, 0, size, DMA_BIDIRECTIONAL);
 
     UVM_ASSERT(PAGE_ALIGNED(size));
 
-    if (pci_dma_mapping_error(gpu->parent->pci_dev, dma_addr))
+    if (dma_mapping_error(&gpu->parent->pci_dev->dev, dma_addr))
         return NV_ERR_OPERATING_SYSTEM;
 
     if (dma_addr < gpu->parent->dma_addressable_start ||
         dma_addr + size - 1 > gpu->parent->dma_addressable_limit) {
-        pci_unmap_page(gpu->parent->pci_dev, dma_addr, size, PCI_DMA_BIDIRECTIONAL);
+        dma_unmap_page(&gpu->parent->pci_dev->dev, dma_addr, size, DMA_BIDIRECTIONAL);
         UVM_ERR_PRINT_RL("PCI mapped range [0x%llx, 0x%llx) not in the addressable range [0x%llx, 0x%llx), GPU %s\n",
                          dma_addr,
                          dma_addr + (NvU64)size,
@@ -3102,7 +3102,7 @@ void uvm_gpu_unmap_cpu_pages(uvm_gpu_t *gpu, NvU64 dma_address, size_t size)
     if (gpu->parent->npu)
         dma_address = nv_expand_nvlink_addr(dma_address);
     dma_address += gpu->parent->dma_addressable_start;
-    pci_unmap_page(gpu->parent->pci_dev, dma_address, size, PCI_DMA_BIDIRECTIONAL);
+    dma_unmap_page(&gpu->parent->pci_dev->dev, dma_address, size, DMA_BIDIRECTIONAL);
     atomic64_sub(size, &gpu->parent->mapped_cpu_pages_size);
 }
 
diff --git a/nvidia/linux_nvswitch.c b/nvidia/linux_nvswitch.c
index ddfc53c..714b9eb 100644
--- a/nvidia/linux_nvswitch.c
+++ b/nvidia/linux_nvswitch.c
@@ -2139,11 +2139,11 @@ _nvswitch_to_pci_dma_direction
 )
 {
     if (direction == NVSWITCH_DMA_DIR_TO_SYSMEM)
-        return PCI_DMA_FROMDEVICE;
+        return DMA_FROM_DEVICE;
     else if (direction == NVSWITCH_DMA_DIR_FROM_SYSMEM)
-        return PCI_DMA_TODEVICE;
+        return DMA_TO_DEVICE;
     else
-        return PCI_DMA_BIDIRECTIONAL;
+        return DMA_BIDIRECTIONAL;
 }
 
 NvlStatus
@@ -2164,9 +2164,9 @@ nvswitch_os_map_dma_region
 
     dma_dir = _nvswitch_to_pci_dma_direction(direction);
 
-    *dma_handle = (NvU64)pci_map_single(pdev, cpu_addr, size, dma_dir);
+    *dma_handle = (NvU64) dma_map_single(&pdev->dev, cpu_addr, size, dma_dir);
 
-    if (pci_dma_mapping_error(pdev, *dma_handle))
+    if (dma_mapping_error(&pdev->dev, *dma_handle))
     {
         pr_err("nvidia-nvswitch: unable to create PCI DMA mapping\n");
         return -NVL_ERR_GENERIC;
@@ -2193,7 +2193,7 @@ nvswitch_os_unmap_dma_region
 
     dma_dir = _nvswitch_to_pci_dma_direction(direction);
 
-    pci_unmap_single(pdev, dma_handle, size, dma_dir);
+    dma_unmap_single(&pdev->dev, dma_handle, size, dma_dir);
 
     return NVL_SUCCESS;
 }
@@ -2210,7 +2210,7 @@ nvswitch_os_set_dma_mask
     if (!pdev)
         return -NVL_BAD_ARGS;
 
-    if (pci_set_dma_mask(pdev, DMA_BIT_MASK(dma_addr_width)))
+    if (dma_set_mask(&pdev->dev, DMA_BIT_MASK(dma_addr_width)))
         return -NVL_ERR_GENERIC;
 
     return NVL_SUCCESS;
@@ -2233,7 +2233,7 @@ nvswitch_os_sync_dma_region_for_cpu
 
     dma_dir = _nvswitch_to_pci_dma_direction(direction);
 
-    pci_dma_sync_single_for_cpu(pdev, dma_handle, size, dma_dir);
+    dma_sync_single_for_cpu(&pdev->dev, dma_handle, size, dma_dir);
 
     return NVL_SUCCESS;
 }
@@ -2255,7 +2255,7 @@ nvswitch_os_sync_dma_region_for_device
 
     dma_dir = _nvswitch_to_pci_dma_direction(direction);
 
-    pci_dma_sync_single_for_device(pdev, dma_handle, size, dma_dir);
+    dma_sync_single_for_device(&pdev->dev, dma_handle, size, dma_dir);
 
     return NVL_SUCCESS;
 }
diff --git a/nvidia/nv.c b/nvidia/nv.c
index 92a7dc6..5065158 100644
--- a/nvidia/nv.c
+++ b/nvidia/nv.c
@@ -2821,13 +2821,13 @@ nv_set_dma_address_size(
      */
     if (!nvl->tce_bypass_enabled)
     {
-        pci_set_dma_mask(nvl->pci_dev, new_mask);
+        dma_set_mask(&nvl->pci_dev->dev, new_mask);
         /* Certain kernels have a bug which causes pci_set_consistent_dma_mask
          * to call GPL sme_active symbol, this bug has already been fixed in a
          * minor release update but detect the failure scenario here to prevent
          * an installation regression */
 #if !NV_IS_EXPORT_SYMBOL_GPL_sme_active
-        pci_set_consistent_dma_mask(nvl->pci_dev, new_mask);
+        dma_set_coherent_mask(&nvl->pci_dev->dev, new_mask);
 #endif
     }
 }
@@ -4524,19 +4524,19 @@ NvU64 NV_API_CALL nv_get_dma_start_address(
      * as the starting address for all DMA mappings.
      */
     saved_dma_mask = pci_dev->dma_mask;
-    if (pci_set_dma_mask(pci_dev, DMA_BIT_MASK(64)) != 0)
+    if (dma_set_mask(&pci_dev->dev, DMA_BIT_MASK(64)) != 0)
     {
         goto done;
     }
 
-    dma_addr = pci_map_single(pci_dev, NULL, 1, DMA_BIDIRECTIONAL);
-    if (pci_dma_mapping_error(pci_dev, dma_addr))
+    dma_addr = dma_map_single(&pci_dev->dev, NULL, 1, DMA_BIDIRECTIONAL);
+    if (dma_mapping_error(&pci_dev->dev, dma_addr))
     {
-        pci_set_dma_mask(pci_dev, saved_dma_mask);
+        dma_set_mask(&pci_dev->dev, saved_dma_mask);
         goto done;
     }
 
-    pci_unmap_single(pci_dev, dma_addr, 1, DMA_BIDIRECTIONAL);
+    dma_unmap_single(&pci_dev->dev, dma_addr, 1, DMA_BIDIRECTIONAL);
 
     /*
      * From IBM: "For IODA2, native DMA bypass or KVM TCE-based implementation
@@ -4568,7 +4568,7 @@ NvU64 NV_API_CALL nv_get_dma_start_address(
          */
         nv_printf(NV_DBG_WARNINGS,
             "NVRM: DMA window limited by platform\n");
-        pci_set_dma_mask(pci_dev, saved_dma_mask);
+        dma_set_mask(&pci_dev->dev, saved_dma_mask);
         goto done;
     }
     else if ((dma_addr & saved_dma_mask) != 0)
@@ -4587,7 +4587,7 @@ NvU64 NV_API_CALL nv_get_dma_start_address(
              */
             nv_printf(NV_DBG_WARNINGS,
                 "NVRM: DMA window limited by memory size\n");
-            pci_set_dma_mask(pci_dev, saved_dma_mask);
+            dma_set_mask(&pci_dev->dev, saved_dma_mask);
             goto done;
         }
     }
--
2.35.1


From 689ede6109d1b8aef914809f290e75632c338b9f Mon Sep 17 00:00:00 2001
From: Joan Bruguera <joanbrugueram@gmail.com>
Date: Sat, 9 Apr 2022 19:42:24 +0200
Subject: [PATCH] Buildfix NVIDIA 470.103.01 for Linux 5.18-rc2

acpi_bus_get_device was removed and its trivial replacement acpi_fetch_acpi_dev
is GPL-exported, so just disable ACPI support as I don't want to deal with it.
---
 nvidia/nv-acpi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/nvidia/nv-acpi.c b/nvidia/nv-acpi.c
index faf8b44..22a9152 100644
--- a/nvidia/nv-acpi.c
+++ b/nvidia/nv-acpi.c
@@ -16,7 +16,8 @@
 
 #include <linux/acpi.h>
 
-#if defined(NV_LINUX_ACPI_EVENTS_SUPPORTED)
+#include <linux/version.h>
+#if defined(NV_LINUX_ACPI_EVENTS_SUPPORTED) && (LINUX_VERSION_CODE < KERNEL_VERSION(5, 18, 0))
 static NV_STATUS   nv_acpi_extract_integer (const union acpi_object *, void *, NvU32, NvU32 *);
 static NV_STATUS   nv_acpi_extract_buffer  (const union acpi_object *, void *, NvU32, NvU32 *);
 static NV_STATUS   nv_acpi_extract_package (const union acpi_object *, void *, NvU32, NvU32 *);
--
2.35.1


[Step-2] nvidia-470xx-fix-linux-5.19.patch
[code]
From cc4acfadcd71ee07c8d1b29411620a79451780b9 Mon Sep 17 00:00:00 2001
From: Joan Bruguera <joanbrugueram@gmail.com>
Date: Wed, 13 Apr 2022 21:21:13 +0200
Subject: [PATCH] Buildfix NVIDIA 470.129.06 for Linux 5.19-rc1

---
 nvidia-drm/nvidia-dma-resv-helper.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/nvidia-drm/nvidia-dma-resv-helper.h b/nvidia-drm/nvidia-dma-resv-helper.h
index ad8800d..65ea1f8 100644
--- a/nvidia-drm/nvidia-dma-resv-helper.h
+++ b/nvidia-drm/nvidia-dma-resv-helper.h
@@ -39,6 +39,15 @@
 #include <linux/reservation.h>
 #endif
 
+#include <linux/version.h>
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0))
+// Rel. commit "dma-buf: specify usage while adding fences to dma_resv obj v7" (Christian König, 9 Nov 2021)
+static inline void dma_resv_add_excl_fence(struct dma_resv *obj, struct dma_fence *fence)
+{
+    dma_resv_add_fence(obj, fence, DMA_RESV_USAGE_WRITE);
+}
+#endif
+
 #include <nvidia-dma-fence-helper.h>
 
 #if defined(NV_LINUX_DMA_RESV_H_PRESENT)



---
[2022-08-02] 新規
[ ]



ギャラリー
  • deepl-clip.sh で簡単翻訳 [更新:2025-04-29]
  • Avidemux 2.8.2_20250323_7cf15b3
  • Avidemux 2.8.2_20250323_7cf15b3
  • Avidemux 2.8.x with Qt6 GUI
  • Avidemux 2.8.x with Qt6 GUI
  • MEGAcmd-2.0.0_Linux
  • gcolor3 with Japanese menu and LC_MESSAGES
  • avidemux2 TEST package from the latest git source (on jul.23.2024)
  • fcitx5-mozc-2.29.5135.102.1 (15jw) -- Added "merge-ut-dictionaries"