Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve compile errors for Linux Kernel 6.6 #436

Merged
merged 1 commit into from
Nov 15, 2023

Conversation

Bidski
Copy link
Contributor

@Bidski Bidski commented Nov 9, 2023

I am getting compile errors for Linux Kernel 6.6. See #433 and NixOS/nixpkgs Issue 265868. This PR applies fixes that I think are correct based on the changes made to Linux Kernel 6.6.

Specifically, the changes made in this patch are

  1. drm_gem_prime_fd_to_handle and drm_gem_prime_handle_to_fd are no longer exported as these are the defaults (if I understand correctly), so .prime_fd_to_handle and .prime_handle_to_fd no longer need to be set.
  2. FBINFO_DEFAULT is no longer defined as it was defined as 0 and this is the default value (assuming the info struct is zero initialised)

I have done limited testing on my system and it seems to work and the CI build against Linux Kernel 6.6 passes.

@Segaja
Copy link

Segaja commented Nov 11, 2023

Any idea when this will be merged? Kernel 6.6 has landed on Archlinux and without this fix people can't upgrade to it while using displaylink and evdi

aaronrancsik added a commit to aaronrancsik/evdi-compat that referenced this pull request Nov 12, 2023
@dominikzogg
Copy link

Tested with Fedora 39 (6.6.1-300.fc39.x86_64), seems to work fine so far.

@armistace
Copy link

armistace commented Nov 14, 2023

@Segaja


pkgname='evdi-git'
pkgver=bidski_evdi_14
_pkgver="${pkgver%%.r*}"
pkgrel=1
pkgdesc='kernel module that enables management of multiple screens, primarily for DisplayLink USB VGA DVI HDMI DisplayPort video'
arch=('i686' 'x86_64')
url='https://github.com/DisplayLink/evdi'
license=('GPL')
depends=('dkms')
makedepends=('git' 'libdrm')
makedepends+=('linux-headers')
provides=("evdi=${_pkgver}")
conflicts=('evdi')
_srcdir="${pkgname%-git}"
source=(
  'git+https://github.com/Bidski/evdi'
)
source[0]+='#branch=devel'
md5sums=('SKIP')
sha256sums=('SKIP')

pkgver() {
  cd "${_srcdir}"
  local _modver _rev
  #_modver="$(awk -F '=' '/MODVER=/ {print $2}' module/Makefile)"
  _rev="bidski_evdi_14"
  if [ -z "${_modver:-}" ]; then
    printf '%s\n' "${_rev}"
  else
    printf '%s.r%s\n' "${_modver}" "${_rev##*.r}"
  fi
}

prepare() {
  cd "${_srcdir}"
  local _src
  for _src in "${source[@]%%::*}"; do
    _src="${_src##*/}"
    if [[ "${_src}" = *.patch ]]; then
      msg2 "Patch ${_src}"
      patch -Np1 -i "../${_src}"
    fi
  done

  #sed -e 's:-Werror::g' -i 'Makefile'
}

build() {
  cd "${_srcdir}"
  CFLAGS="${CFLAGS/-fno-plt/}"
  CFLAGS="${CFLAGS/-fexceptions/}"
  # DKMS builds are hard to debug. We can build it here to debug the errors.
  #make -j1 -C 'module'
  make -j1 -C 'library'
}

package() {
  cd "${_srcdir}"
  make -C 'library' -j1 install DESTDIR="${pkgdir}" PREFIX='/usr'

if ! :; then
  pushd "${pkgdir}/usr/lib/" > /dev/null
  local _libase
  local _libs=(*.so.*)
  if [ "${#_libs[@]}" -eq 2 ]; then
    _libs="${_libs[1]}"
    for _libase in *.so*; do
      if [ "${_libase}" != "${_libs}" ]; then
        ln -sf "${_libs}" "${_libase}"
      fi
    done
  elif [ "${#_libs[@]}" -eq 1 ]; then
    _libs="${_libs[0]}"
    _libase="${_libs%.so*}.so"
    ln -sf "${_libs}" "${_libase}"
    ln -sf "${_libs}" "${_libase}.0" # bad soname
  else
    echo 'Unhandled libs'
    false
  fi
  popd > /dev/null
fi

  local _DKMS="${pkgdir}/usr/src/${pkgname%-git}-${_pkgver}"
  install -Dpm644 module/* -t "${_DKMS}/"
  make -j1 -C "${_DKMS}" clean
  rm -f "${_DKMS}/evdi.mod"
}

I fiddled with the evdi-git pkg build to pull from bidski's repo if you're after an interim fix seems to largely work

@Segaja
Copy link

Segaja commented Nov 14, 2023

That looks like a creative PKGBUILD file. I don't even see where you reference the patch. ;)

Do we have any kind of ETA when this fix will be merged?

@synaptics-lspintzyk
Copy link
Contributor

This is good, please squash all 3 commits to one and remove following comment that you can put in git commit message:
// KERNEL_VERSION(6, 6, 0) has removed FBINFO_DEFAULT as it is equal to 0, which is the default value

Specifically, the changes made are:
  - drm_gem_prime_fd_to_handle and drm_gem_prime_handle_to_fd are no longer exported as these are the defaults, so .prime_fd_to_handle and .prime_handle_to_fd no longer need to be set.
  - FBINFO_DEFAULT is no longer defined as it was defined as 0 and this is the default value (assuming the info struct is zero initialised)
@Bidski
Copy link
Contributor Author

Bidski commented Nov 14, 2023

@lspintzyk this has now been squashed

@displaylink-emajewsk displaylink-emajewsk merged commit 495e8cf into DisplayLink:devel Nov 15, 2023
@displaylink-emajewsk
Copy link
Contributor

@Bidski Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants