You are not logged in.

#1 2019-11-29 16:06:13

damachine
Member
From: Frankfurt, Germany
Registered: 2018-04-06
Posts: 20

prime synchronization breaks with kernel 5.4

hallo had test the new 5.4 kernel and see that xrandr --prop show my that prime synchronization is 0 on my eDP-1-1 output.
i dont test it with 5.4.1 any had experience

Last edited by damachine (2019-11-29 16:08:21)

Offline

#2 2019-11-29 16:37:46

dglt
Member
Registered: 2019-08-14
Posts: 82

Re: prime synchronization breaks with kernel 5.4

i can confirm this, both the 5.4 mainline and another machine with manjaro 5.4 kernel breaks prime sync. it's been this way from the start with 5.4

EDIT: seems every 5.4 kernel i've tested has this problem with prime sync. arch 5.4, zen 5.4, manjaro's 5.4

Last edited by dglt (2019-12-04 16:07:41)

Offline

#3 2019-12-05 14:36:08

qifei9
Member
Registered: 2013-09-02
Posts: 4

Re: prime synchronization breaks with kernel 5.4

I meet the same problem. Then I switch to PRIME_Render_Offload, by installing https://aur.archlinux.org/packages/prime/ and editing xorg conf.

Now the tearing disappear while

xrandr --verbose|grep PRIME

output nothing.

Offline

#4 2019-12-05 22:29:56

damachine
Member
From: Frankfurt, Germany
Registered: 2018-04-06
Posts: 20

Re: prime synchronization breaks with kernel 5.4

qifei9 wrote:

I meet the same problem. Then I switch to PRIME_Render_Offload, by installing https://aur.archlinux.org/packages/prime/ and editing xorg conf.

Now the tearing disappear while

xrandr --verbose|grep PRIME

output nothing.

hallo is multihead working for you. or is it possible you can test it and give me a little report. thanks

Offline

#5 2019-12-05 22:32:44

dglt
Member
Registered: 2019-08-14
Posts: 82

Re: prime synchronization breaks with kernel 5.4

damachine wrote:

hallo is multihead working for you. or is it possible you can test it and give me a little report. thanks

render-offload does not support external displays unless that external port is wired directly to the intel gpu and in most cases they are not.

Offline

#6 2019-12-06 08:10:58

qifei9
Member
Registered: 2013-09-02
Posts: 4

Re: prime synchronization breaks with kernel 5.4

damachine wrote:
qifei9 wrote:

I meet the same problem. Then I switch to PRIME_Render_Offload, by installing https://aur.archlinux.org/packages/prime/ and editing xorg conf.

Now the tearing disappear while

xrandr --verbose|grep PRIME

output nothing.

hallo is multihead working for you. or is it possible you can test it and give me a little report. thanks

I use my laptop and another Monitor connected to the laptop by HDMI. Currently, the laptop monitor and the external monitor work fine together.

Last edited by qifei9 (2019-12-06 08:11:30)

Offline

#7 2019-12-06 10:05:30

Garzet
Member
From: Radoboj, Croatia
Registered: 2018-08-17
Posts: 8

Re: prime synchronization breaks with kernel 5.4

I have the same problem. Did not manage to fix tearing on Xorg. On the other hand, wayland (sway) works with proprietary drivers and there is no tearing.

Last edited by Garzet (2019-12-06 10:08:30)

Offline

#8 2019-12-08 12:47:41

Halikular
Member
From: Sweden
Registered: 2018-10-19
Posts: 38

Re: prime synchronization breaks with kernel 5.4

Is there going to be a fix for this, should it be reported to the linux kernel devs?

Offline

#9 2019-12-08 17:05:06

dglt
Member
Registered: 2019-08-14
Posts: 82

Re: prime synchronization breaks with kernel 5.4

not sure if it's reported to kernel devs but i just reported it to nvidia which i thought i already did weeks ago but i guess not.

https://devtalk.nvidia.com/default/topi … nization-/

Offline

#10 2019-12-08 19:48:08

dglt
Member
Registered: 2019-08-14
Posts: 82

Re: prime synchronization breaks with kernel 5.4

maybe someone could make sense of this but im told support for prime sync has been dropped upstream for 5.4 kernel

https://www.collabora.com/news-and-blog … l-5.4.html
https://forum.manjaro.org/t/issues-with … /15?u=dglt

Last edited by dglt (2019-12-08 19:48:26)

Offline

#11 2019-12-08 21:39:31

cfrank
Member
Registered: 2019-12-08
Posts: 1

Re: prime synchronization breaks with kernel 5.4

So can we assume that PRIME enabled laptops will be plagued by tearing on all kernels >= 5.4? It seems rather odd that such a large feature would get dropped like this without some sort of remedy.

Offline

#12 2019-12-08 21:45:25

dglt
Member
Registered: 2019-08-14
Posts: 82

Re: prime synchronization breaks with kernel 5.4

cfrank wrote:

It seems rather odd that such a large feature would get dropped like this without some sort of remedy.

thats just it, in some twisted way they must think render offload is actually a suitable replacement and it's not. not even close.

Offline

#13 2019-12-08 22:32:03

loqs
Member
Registered: 2014-03-06
Posts: 17,192

Re: prime synchronization breaks with kernel 5.4

@dglt I think you are inferring from the removal of gem_prime_res_obj hook that prime was dropped rather than just that function.
I do not believe that to be the case see https://git.kernel.org/pub/scm/linux/ke … e.c?h=v5.4
Edit:
You could also check 5.5-rc1 / drm-tip or bisect between 5.3 and 5.4

Last edited by loqs (2019-12-08 23:32:03)

Offline

#14 2019-12-09 00:28:42

dglt
Member
Registered: 2019-08-14
Posts: 82

Re: prime synchronization breaks with kernel 5.4

loqs wrote:

@dglt I think you are inferring from the removal of gem_prime_res_obj hook that prime was dropped rather than just that function.
I do not believe that to be the case see https://git.kernel.org/pub/scm/linux/ke … e.c?h=v5.4
Edit:
You could also check 5.5-rc1 / drm-tip or bisect between 5.3 and 5.4

i hope i was informed incorrectly by @philm (manjaro) and that your right, unfortunately i'm not proficient enough in kernel to make sense of those links you provided. sad prime is the only reliable setup for optimus laptops, it can work without prime sync but it certainly works better with it. thanks for the response

Offline

#15 2019-12-10 17:06:45

Caspian
Member
Registered: 2007-05-22
Posts: 263

Re: prime synchronization breaks with kernel 5.4

I can confirm terrible tearing with kernel 5.4 and proprietary Nvidia driver. Not only this, but the whole performance is terrible, even the movement of mouse cursor is noticeably slower and jittery. However, I'm only experiencing this while using external monitor together with the laptop monitor. When using only laptop monitor everything runs smoothly.

Offline

#16 2019-12-10 17:35:56

loqs
Member
Registered: 2014-03-06
Posts: 17,192

Re: prime synchronization breaks with kernel 5.4

You could try bisecting between 5.3 and 5.4 to find the causal commit.

The following assumes the base-devel group and git are installed and I recomend enabling Makepkg#Parallel_compilation to reduce build times

$ git clone git://git.archlinux.org/svntogit/packages.git --single-branch --branch "packages/linux"
$ cd packages/trunk
$ git checkout aa1b1a59ce1cb67d95021c26b24739d1e648a553 #5.3.31.arch1-1
$ cd ../..
$ cp -r packages/trunk linux-git
$ rm -rf packages
$ cd linux-git
# Edit replace the PKGBUILD with the one below
$ makepkg -rsi #This is to confirm 5.3 as built on your system does not have the issue.

There should be one config change for USB_RIO500 which was dropped in 5.3.7 select the default.
This build may take a very long time.
Update bootloader for new kernel if needed

$ cd linux-git/src/linux
$ git checkout v5.4
$ cd ../..
$ makepkg -ersi #This is to confirm 5.4 as built on your system does have the issue select the default option for all prompted options

Start bisection

$ cd linux-git/src/linux/
$ git bisect start
$ git bisect good v5.3
$ git bisect bad v5.4
$ cd ../..
$ makepkg -ersif

Bisection loop

$ cd linux-git/src/linux/
$ git bisect $result #Substitue good or bad here
$ cd ../..
$ makepkg -ersif #Repeat these four lines and test the generated kernel until git has found the bad commit

PKGBUILD

# Maintainer: Boohbah <boohbah at gmail.com>
# Contributor: Tobias Powalowski <tpowa@archlinux.org>
# Contributor: Thomas Baechler <thomas@archlinux.org>
# Contributor: Jonathan Chan <jyc@fastmail.fm>
# Contributor: misc <tastky@gmail.com>
# Contributor: NextHendrix <cjones12 at sheffield.ac.uk>

pkgbase=linux-git
_srcname=linux
pkgver=5.3.r0.g4d856f72c10e
pkgrel=1
arch=('x86_64')
url="https://www.kernel.org/"
license=('GPL2')
makedepends=('kmod' 'inetutils' 'bc' 'libelf' 'git')
options=('!strip')
source=('git+https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git#tag=v5.3'
        #'git+https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git#tag=vX.X.Y'
        'config'   # the main kernel config file
)

sha256sums=('SKIP'
            '10ee7800902b1d82f9c184b367c9d904f4dc48f6d9ce3277327e825d7ab690d1')

_kernelname=${pkgbase#linux}

pkgver() {
  cd $_srcname

  git describe --long | sed -E 's/^v//;s/([^-]*-g)/r\1/;s/-/./g;s/\.rc/rc/'
}

prepare() {
  cd ${_srcname}

  cp -Tf ../config .config

  # set localversion to git commit
  sed -i "s|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"${_kernelname}\"|g" ./.config
  sed -i "s|^.*CONFIG_LOCALVERSION_AUTO.*|CONFIG_LOCALVERSION_AUTO=y|" ./.config


  # get kernel version
  make prepare

  # load configuration
  # Configure the kernel. Replace the line below with one of your choice.
  #make menuconfig # CLI menu for configuration
  #make nconfig # new CLI menu for configuration
  #make xconfig # X-based configuration
  #make oldconfig # using old config from previous kernel version
  #make olddefconfig # old config from previous kernel, defaults for new options
  # ... or manually edit .config
}

build() {
  cd $_srcname

  make LOCALVERSION= bzImage modules
}

_package() {
  pkgdesc="The Linux kernel and modules (git version)"
  depends=('coreutils' 'linux-firmware' 'kmod' 'initramfs')
  optdepends=('crda: to set the correct wireless channels of your country')

  cd ${_srcname}

  # get kernel version
  _kernver="$(make LOCALVERSION= kernelrelease)"
  _basekernel=${_kernver%%-*}
  _basekernel=${_basekernel%.*}
  local _modulesdir="$pkgdir/usr/lib/modules/$_kernver"

  install -Dm644 "$(make -s image_name)" "$_modulesdir/vmlinuz"

  # Used by mkinitcpio to name the kernel
  echo "$pkgbase" | install -Dm644 /dev/stdin "$_modulesdir/pkgbase"

  make LOCALVERSION= INSTALL_MOD_PATH="${pkgdir}/usr" modules_install

  # make room for external modules
  local _extramodules="extramodules-${_basekernel}${_kernelname:--ARCH}"
  ln -s "../${_extramodules}" "${pkgdir}/usr/lib/modules/${_kernver}/extramodules"

  # add real version for building modules and running depmod from hook
  echo "${_kernver}" |
    install -Dm644 /dev/stdin "${pkgdir}/usr/lib/modules/${_extramodules}/version"

  # remove build and source links
  rm "${pkgdir}"/usr/lib/modules/${_kernver}/{source,build}
}

_package-headers() {
  pkgdesc="Header files and scripts for building modules for Linux kernel (git version)"

  cd $_srcname
  local _builddir="${pkgdir}/usr/lib/modules/${_kernver}/build"

  install -Dt "$_builddir" -m644 .config Makefile Module.symvers
  install -Dt "$_builddir/kernel" -m644 kernel/Makefile
  install -Dt "$_builddir/arch/x86" -m644 arch/x86/Makefile
  cp -t "$_builddir" -a scripts

  # add objtool for external module building and enabled VALIDATION_STACK option
  install -Dt "$_builddir/tools/objtool" tools/objtool/objtool

  # add xfs and shmem for aufs building
  mkdir -p "$_builddir"/{fs/xfs,mm}

  cp -t "$_builddir" -a include
  cp -t "$_builddir/arch/x86" -a arch/x86/include
  install -Dt "$_builddir/arch/x86/kernel" -m644 arch/x86/kernel/asm-offsets.s


  install -Dt "$_builddir/drivers/md" -m644 drivers/md/*.h
  install -Dt "$_builddir/net/mac80211" -m644 net/mac80211/*.h

  # http://bugs.archlinux.org/task/13146
  install -Dt "$_builddir/drivers/media/i2c" -m644 drivers/media/i2c/msp3400-driver.h

  # http://bugs.archlinux.org/task/20402
  install -Dt "$_builddir/drivers/media/usb/dvb-usb" -m644 drivers/media/usb/dvb-usb/*.h
  install -Dt "$_builddir/drivers/media/dvb-frontends" -m644 drivers/media/dvb-frontends/*.h
  install -Dt "$_builddir/drivers/media/tuners" -m644 drivers/media/tuners/*.h

  # copy in Kconfig files
  find . -name 'Kconfig*' -exec install -Dm644 {} "$_builddir/{}" \;

  # remove unneeded architectures
  local _arch
  for _arch in "$_builddir"/arch/*/; do
    [[ ${_arch} == */x86/ ]] && continue
    echo "Removing $(basename "$_arch")"
    rm -r "$_arch"
  done

  # remove files already in linux-docs package
  rm -r "$_builddir/Documentation"

  echo "Removing broken symlinks..."
  find -L "$_builddir" -type l -printf 'Removing %P\n' -delete

  # strip scripts directory
  local _binary _strip
  while read -rd '' _binary; do
    case "$(file -bi "$_binary")" in
      *application/x-sharedlib*)  _strip="$STRIP_SHARED"   ;; # Libraries (.so)
      *application/x-archive*)    _strip="$STRIP_STATIC"   ;; # Libraries (.a)
      *application/x-executable*) _strip="$STRIP_BINARIES" ;; # Binaries
      *) continue ;;
    esac
    /usr/bin/strip $_strip "$_binary"
  done < <(find "$_builddir/scripts" -type f -perm -u+w -print0 2>/dev/null)

  # Fix permissions
  chmod -R u=rwX,go=rX "${_builddir}"
}

pkgname=("$pkgbase" "$pkgbase-headers")
for _p in ${pkgname[@]}; do
  eval "package_$_p() {
    $(declare -f "_package${_p#$pkgbase}")
    _package${_p#$pkgbase}
  }"
done

# vim:set ts=8 sts=2 sw=2 et:# Maintainer: Boohbah <boohbah at gmail.com>
# Contributor: Tobias Powalowski <tpowa@archlinux.org>
# Contributor: Thomas Baechler <thomas@archlinux.org>
# Contributor: Jonathan Chan <jyc@fastmail.fm>
# Contributor: misc <tastky@gmail.com>
# Contributor: NextHendrix <cjones12 at sheffield.ac.uk>

pkgbase=linux-git
_srcname=linux
pkgver=5.3.r0.g4d856f72c10e
pkgrel=1
arch=('x86_64')
url="https://www.kernel.org/"
license=('GPL2')
makedepends=('kmod' 'inetutils' 'bc' 'libelf' 'git')
options=('!strip')
source=('git+https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git#tag=v5.3'
        #'git+https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git#tag=vX.X.Y'
        'config'   # the main kernel config file
)


_kernelname=${pkgbase#linux}

pkgver() {
  cd $_srcname

  git describe --long | sed -E 's/^v//;s/([^-]*-g)/r\1/;s/-/./g;s/\.rc/rc/'
}

prepare() {
  cd ${_srcname}

  cp -Tf ../config .config

  # set localversion to git commit
  sed -i "s|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"${_kernelname}\"|g" ./.config
  sed -i "s|^.*CONFIG_LOCALVERSION_AUTO.*|CONFIG_LOCALVERSION_AUTO=y|" ./.config


  # get kernel version
  make prepare

  # load configuration
  # Configure the kernel. Replace the line below with one of your choice.
  #make menuconfig # CLI menu for configuration
  #make nconfig # new CLI menu for configuration
  #make xconfig # X-based configuration
  #make oldconfig # using old config from previous kernel version
  #make olddefconfig # old config from previous kernel, defaults for new options
  # ... or manually edit .config
}

build() {
  cd $_srcname

  make LOCALVERSION= bzImage modules
}

_package() {
  pkgdesc="The Linux kernel and modules (git version)"
  depends=('coreutils' 'linux-firmware' 'kmod' 'initramfs')
  optdepends=('crda: to set the correct wireless channels of your country')

  cd ${_srcname}

  # get kernel version
  _kernver="$(make LOCALVERSION= kernelrelease)"
  _basekernel=${_kernver%%-*}
  _basekernel=${_basekernel%.*}
  local _modulesdir="$pkgdir/usr/lib/modules/$_kernver"

  install -Dm644 "$(make -s image_name)" "$_modulesdir/vmlinuz"

  # Used by mkinitcpio to name the kernel
  echo "$pkgbase" | install -Dm644 /dev/stdin "$_modulesdir/pkgbase"

  make LOCALVERSION= INSTALL_MOD_PATH="${pkgdir}/usr" modules_install

  # make room for external modules
  local _extramodules="extramodules-${_basekernel}${_kernelname:--ARCH}"
  ln -s "../${_extramodules}" "${pkgdir}/usr/lib/modules/${_kernver}/extramodules"

  # add real version for building modules and running depmod from hook
  echo "${_kernver}" |
    install -Dm644 /dev/stdin "${pkgdir}/usr/lib/modules/${_extramodules}/version"

  # remove build and source links
  rm "${pkgdir}"/usr/lib/modules/${_kernver}/{source,build}
}

_package-headers() {
  pkgdesc="Header files and scripts for building modules for Linux kernel (git version)"

  cd $_srcname
  local _builddir="${pkgdir}/usr/lib/modules/${_kernver}/build"

  install -Dt "$_builddir" -m644 .config Makefile Module.symvers
  install -Dt "$_builddir/kernel" -m644 kernel/Makefile
  install -Dt "$_builddir/arch/x86" -m644 arch/x86/Makefile
  cp -t "$_builddir" -a scripts

  # add objtool for external module building and enabled VALIDATION_STACK option
  install -Dt "$_builddir/tools/objtool" tools/objtool/objtool

  # add xfs and shmem for aufs building
  mkdir -p "$_builddir"/{fs/xfs,mm}

  cp -t "$_builddir" -a include
  cp -t "$_builddir/arch/x86" -a arch/x86/include
  install -Dt "$_builddir/arch/x86/kernel" -m644 arch/x86/kernel/asm-offsets.s


  install -Dt "$_builddir/drivers/md" -m644 drivers/md/*.h
  install -Dt "$_builddir/net/mac80211" -m644 net/mac80211/*.h

  # http://bugs.archlinux.org/task/13146
  install -Dt "$_builddir/drivers/media/i2c" -m644 drivers/media/i2c/msp3400-driver.h

  # http://bugs.archlinux.org/task/20402
  install -Dt "$_builddir/drivers/media/usb/dvb-usb" -m644 drivers/media/usb/dvb-usb/*.h
  install -Dt "$_builddir/drivers/media/dvb-frontends" -m644 drivers/media/dvb-frontends/*.h
  install -Dt "$_builddir/drivers/media/tuners" -m644 drivers/media/tuners/*.h

  # copy in Kconfig files
  find . -name 'Kconfig*' -exec install -Dm644 {} "$_builddir/{}" \;

  # remove unneeded architectures
  local _arch
  for _arch in "$_builddir"/arch/*/; do
    [[ ${_arch} == */x86/ ]] && continue
    echo "Removing $(basename "$_arch")"
    rm -r "$_arch"
  done

  # remove files already in linux-docs package
  rm -r "$_builddir/Documentation"

  echo "Removing broken symlinks..."
  find -L "$_builddir" -type l -printf 'Removing %P\n' -delete

  # strip scripts directory
  local _binary _strip
  while read -rd '' _binary; do
    case "$(file -bi "$_binary")" in
      *application/x-sharedlib*)  _strip="$STRIP_SHARED"   ;; # Libraries (.so)
      *application/x-archive*)    _strip="$STRIP_STATIC"   ;; # Libraries (.a)
      *application/x-executable*) _strip="$STRIP_BINARIES" ;; # Binaries
      *) continue ;;
    esac
    /usr/bin/strip $_strip "$_binary"
  done < <(find "$_builddir/scripts" -type f -perm -u+w -print0 2>/dev/null)

  # Fix permissions
  chmod -R u=rwX,go=rX "${_builddir}"
}

pkgname=("$pkgbase" "$pkgbase-headers")
for _p in ${pkgname[@]}; do
  eval "package_$_p() {
    $(declare -f "_package${_p#$pkgbase}")
    _package${_p#$pkgbase}
  }"
done

# vim:set ts=8 sts=2 sw=2 et:

Offline

#17 2019-12-12 03:09:28

dglt
Member
Registered: 2019-08-14
Posts: 82

Re: prime synchronization breaks with kernel 5.4

5.3 is done, as expected everything works. working on 5.4 now.

@loqs , thanks for the bisect instructions, i've never done it before but so far so good.

update: 

built 5.3 works fine, built 5.4 does not. 5.4 breaks prime sync, iwlwifi, touchpad (5.4 is the first kernel that's ever broken wifi/touchpad on this device)

the first bisect done according to the commands you provided produced a kernel that would not boot, many errors then locks up. no tty.

im on bisect loop part now and thats building, one thing im uncertain about is should i be seeing a 5.4 kernel being built or a 5.3 kernel being built?

if i understand correctly it's building the 5.3 kernel with 5.4 commits to find the problem commit? this was from the latest bisect thats currently building

~/.../src/linux >>> git bisect bad                                                                                                                                                                 ±[v5.4-rc1~110]
Bisecting: 3920 revisions left to test after this (roughly 12 steps)
[fe38bd6862074c0a2b9be7f31f043aaa70b2af5f] Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm

Last edited by dglt (2019-12-12 16:34:56)

Offline

#18 2019-12-13 20:48:36

dglt
Member
Registered: 2019-08-14
Posts: 82

Re: prime synchronization breaks with kernel 5.4

loqs wrote:

You could try bisecting between 5.3 and 5.4 to find the causal commit.

well i at least have a better appreciation for prebuilt kernels. i finished the bisect but im not sure if i did it right or not, if the kernel failed to boot or if prime sync was broken i would

git bisect bad

and start the loop again. the only "bad" results i had to report were from failure to boot, on every kernel that would boot i had working prime sync.

i documented the best i could on each build and i put the results at the bottom. it's not very clean documentation but i wasnt sure what was needed and im not sure the results help in any way but then again this is new territory for me.

https://pastebin.com/WzW54cm4

edit: pastebin was incorrect, fixed.

Last edited by dglt (2019-12-13 21:06:19)

Offline

#19 2019-12-13 21:25:00

loqs
Member
Registered: 2014-03-06
Posts: 17,192

Re: prime synchronization breaks with kernel 5.4

The second kernel you built should have a 5.4 version number the rest of the kernels should be either 5.3 or a 5.4rc.
Do the touchpad and WiFi work in the 5.4 arch kernel packages?

5.3.0-git-07593-ge6bc9de71497
 
NO WIFI***
PRIME SYNC WORKING
TOUCHPAD WORKING
 
#//////////
~/.../src/linux >>> git bisect good                                                                                                                                                                ±[v5.4-rc1~121
Bisecting: 119 revisions left to test after this (roughly 7 steps)
[7e3d2c8210e67ebff472a0b371bb0efb4236ef52] Merge tag '5.4-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6
#^^^ KERNEL WILL NOT BOOT ^^^
 
#///////////
~/.../src/linux >>> git bisect bad
 
Bisecting: 61 revisions left to test after this (roughly 6 steps)

I think the bisection went wrong on this none booting kernel.
I should have included extra instructions for a such a situation as well as marking a commit good or bad there is `git skip` which asks git to pick another commit to test.
Edit:
You can use git bisect replay logfile where logfiles contains the following (output from git bisect log with the commit after the none booting commit removed)

git bisect start
# bad: [219d54332a09e8d8741c1e1982f5eae56099de85] Linux 5.4
git bisect bad 219d54332a09e8d8741c1e1982f5eae56099de85
# good: [4d856f72c10ecb060868ed10ff1b1453943fc6c8] Linux 5.3
git bisect good 4d856f72c10ecb060868ed10ff1b1453943fc6c8
# good: [4d856f72c10ecb060868ed10ff1b1453943fc6c8] Linux 5.3
git bisect good 4d856f72c10ecb060868ed10ff1b1453943fc6c8
# bad: [a9f8b38a071b468276a243ea3ea5a0636e848cf2] Merge tag 'for-linus-5.4-1' of git://github.com/cminyard/linux-ipmi
git bisect bad a9f8b38a071b468276a243ea3ea5a0636e848cf2
# good: [fe38bd6862074c0a2b9be7f31f043aaa70b2af5f] Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm
git bisect good fe38bd6862074c0a2b9be7f31f043aaa70b2af5f
# good: [069841ef8293697e951c34f9a45601b77fb541d7] Merge branch '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue
git bisect good 069841ef8293697e951c34f9a45601b77fb541d7
# good: [6cfae0c26b21dce323fe8799b66cf4bc996e3565] Merge tag 'char-misc-5.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc
git bisect good 6cfae0c26b21dce323fe8799b66cf4bc996e3565
# good: [81160dda9a7aad13c04e78bb2cfd3c4630e3afab] Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next
git bisect good 81160dda9a7aad13c04e78bb2cfd3c4630e3afab
# good: [e6bc9de714972cac34daa1dc1567ee48a47a9342] Merge tag 'vfs-5.4-merge-1' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux
git bisect good e6bc9de714972cac34daa1dc1567ee48a47a9342

I would suggest b2ad978fd00467e8109918849a817018aaaeed19 this is the parent of https://github.com/torvalds/linux/commi … 1fd59eff3a
If this is good and 51c98747113e93b6229f12d1a744a51fd59eff3a then removing gem_prime_res_obj did break the nvidia drivers use of prime.

git bisect skip b2ad978fd00467e8109918849a817018aaaeed19

Looking through the nvidia drivers source it does check for that function.
Will look more into what it does without the function.
Edit:
Simplest fix until Nvidia update the driver is to revert 51c98747113e93b6229f12d1a744a51fd59eff3a

diff --git a/Documentation/gpu/todo.rst b/Documentation/gpu/todo.rst
index 32787acff0a8..b81cc007acb8 100644
--- a/Documentation/gpu/todo.rst
+++ b/Documentation/gpu/todo.rst
@@ -196,6 +196,15 @@ Might be good to also have some igt testcases for this.
 
 Contact: Daniel Vetter, Noralf Tronnes
 
+Remove the ->gem_prime_res_obj callback
+--------------------------------------------
+
+The ->gem_prime_res_obj callback can be removed from drivers by using the
+reservation_object in the drm_gem_object. It may also be possible to use the
+generic drm_gem_reservation_object_wait helper for waiting for a bo.
+
+Contact: Daniel Vetter
+
 idr_init_base()
 ---------------
 
diff --git a/drivers/gpu/drm/drm_prime.c b/drivers/gpu/drm/drm_prime.c
index 0a2316e0e812..eca484106cc2 100644
--- a/drivers/gpu/drm/drm_prime.c
+++ b/drivers/gpu/drm/drm_prime.c
@@ -836,6 +836,9 @@ struct dma_buf *drm_gem_prime_export(struct drm_gem_object *obj,
 		.resv = obj->resv,
 	};
 
+	if (dev->driver->gem_prime_res_obj)
+		exp_info.resv = dev->driver->gem_prime_res_obj(obj);
+
 	return drm_gem_dmabuf_export(dev, &exp_info);
 }
 EXPORT_SYMBOL(drm_gem_prime_export);
diff --git a/include/drm/drm_drv.h b/include/drm/drm_drv.h
index 8976afe48c1c..b33f2cee2099 100644
--- a/include/drm/drm_drv.h
+++ b/include/drm/drm_drv.h
@@ -615,6 +615,18 @@ struct drm_driver {
 	 */
 	struct sg_table *(*gem_prime_get_sg_table)(struct drm_gem_object *obj);
 
+	/**
+	 * @gem_prime_res_obj:
+	 *
+	 * Optional hook to look up the &reservation_object for an buffer when
+	 * exporting it.
+	 *
+	 * FIXME: This hook is deprecated. Users of this hook should be replaced
+	 * by setting &drm_gem_object.resv instead.
+	 */
+	struct reservation_object * (*gem_prime_res_obj)(
+				struct drm_gem_object *obj);
+
 	/**
 	 * @gem_prime_import_sg_table:
 	 *

Last edited by loqs (2019-12-14 00:05:32)

Offline

#20 2019-12-14 00:31:59

dglt
Member
Registered: 2019-08-14
Posts: 82

Re: prime synchronization breaks with kernel 5.4

loqs wrote:

The second kernel you built should have a 5.4 version number the rest of the kernels should be either 5.3 or a 5.4rc.
Do the touchpad and WiFi work in the 5.4 arch kernel packages?

i didnt start taking notes until after the second bisect but iirc that all presented as 5.3.

since the earliest 5.4rc, prime sync never worked but wifi and touchpad did though im not sure at what point that changed since i stuck with linux and linux-zen until they updated to 5.4 and the iwlwifi and touchpad issues began. im installing both linux and linux-zen now to confirm and i'll update this post after i check.

I think the bisection went wrong on this none booting kernel.
I should have included extra instructions for a such a situation as well as marking a commit good or bad there is `git skip` which asks git to pick another commit to test.

your instructions were great, my experience in this area not so much but was still a good learning experience either way. i think i see what your saying though, since the first bisect failed to boot i reported "git bisect bad" instead of "git bisect skip" and that threw off the rest of the bisect.

git bisect skip b2ad978fd00467e8109918849a817018aaaeed19

Looking through the nvidia drivers source it does check for that function.
Will look more into what it does without the function.
Edit:
Simplest fix until Nvidia update the driver is to revert 51c98747113e93b6229f12d1a744a51fd59eff3a

thanks, i'll look into how i go about applying it and report back.

edit: https://pastebin.com/raw/2y9JGYnF (git bisect log)
edit2: confirmed linux and linux-zen 5.4, no wifi, no touchpad.

Last edited by dglt (2019-12-14 00:41:52)

Offline

#21 2019-12-14 00:37:43

loqs
Member
Registered: 2014-03-06
Posts: 17,192

Re: prime synchronization breaks with kernel 5.4

Using the bisect kernel you from the linux directory you could use the following

git checkout v5.4
git revert -n 51c98747113e93b6229f12d1a744a51fd59eff3a

For for the PKGBUILD arch uses either add the patch file to the list of sources or

prepare() {
  cd $_srcname

  msg2 "Setting version..."
  scripts/setlocalversion --save-scmversion
  echo "-$pkgrel" > localversion.10-pkgrel
  echo "${pkgbase#linux}" > localversion.20-pkgname

Add the line here so it becomes

prepare() {
  cd $_srcname

  msg2 "Setting version..."
  scripts/setlocalversion --save-scmversion
  echo "-$pkgrel" > localversion.10-pkgrel
  echo "${pkgbase#linux}" > localversion.20-pkgname
  git revert -n 51c98747113e93b6229f12d1a744a51fd59eff3a

Offline

#22 2019-12-14 00:50:35

dglt
Member
Registered: 2019-08-14
Posts: 82

Re: prime synchronization breaks with kernel 5.4

loqs wrote:

For for the PKGBUILD arch uses either add the patch file to the list of sources or

loqs wrote:

Add the line here so it becomes

prepare() {
  cd $_srcname

  msg2 "Setting version..."
  scripts/setlocalversion --save-scmversion
  echo "-$pkgrel" > localversion.10-pkgrel
  echo "${pkgbase#linux}" > localversion.20-pkgname
  git revert -n 51c98747113e93b6229f12d1a744a51fd59eff3a

i grabbed the latest kernel PKGBUILD for 5.4.3.arch1,  put it in a clean directory, edited it and added the git revert as shown above and ran  'makepkg -sri' but it fails halfway through . i must be doing something wrong.

PKGBUILD im using (after editing)
https://pastebin.com/JcJVWDdZ

edit: error shown using above method

==> ERROR: config was not found in the build directory and is not a URL.

Last edited by dglt (2019-12-14 15:46:28)

Offline

#23 2019-12-16 16:38:08

loqs
Member
Registered: 2014-03-06
Posts: 17,192

Re: prime synchronization breaks with kernel 5.4

@dglt what is the output from the executing the following in the build directory

makepkg --verifysource

Offline

#24 2019-12-17 03:14:36

dglt
Member
Registered: 2019-08-14
Posts: 82

Re: prime synchronization breaks with kernel 5.4

~/.../tmp/linux54.3-git >>> makepkg --verifysource                                                      
==> Making package: linux 5.4.3.arch1-1 (Mon 16 Dec 2019 10:09:33 PM EST)
==> Retrieving sources...
  -> Updating archlinux-linux git repo...
Fetching origin
==> ERROR: config was not found in the build directory and is not a URL.

tree of the working directory
https://pastebin.com/dEjefbWz

Offline

#25 2019-12-17 06:06:32

getjump
Member
Registered: 2019-12-17
Posts: 1

Re: prime synchronization breaks with kernel 5.4

@dglt you need to create config file also, you can do it like so:

zcat /proc/config.gz > config

Also, not only commit with hash 51c98747113e93b6229f12d1a744a51fd59eff3a should be reverted, but also reservation_object with dma_resv at include/drm/drm_drv.h need to be replaced.
In PKGBUILD you can add something like:

sed -i 's/reservation_object/dma_resv/g' include/drm/drm_drv.h

This way 5.4.3 compiles, but still somewhere some pointer assigned with NULL and we get kernel panic

Offline

Board footer

Powered by FluxBB