-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Stop using the intel driver #3500
Open
dnschneid
wants to merge
5
commits into
master
Choose a base branch
from
nointeldrv
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
8970eb6
Disable the Intel driver.
dnschneid 9befc9c
Force trusty to use -lts-xenial and remove kernel 3.4 hacks
dnschneid fc5f9b2
Use backports in xiwi
dnschneid 727b002
Unhold dummy if backports are enabled
dnschneid 3546f6c
Improve migration to backports by forcing xserver-xorg-core
dnschneid File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,10 @@ REQUIRES='audio' | |
PROVIDES='x11' | ||
DESCRIPTION='X.Org X11 backend. Enables GPU acceleration on supported platforms.' | ||
CHROOTBIN='croutoncycle croutontriggerd croutonxinitrc-wrapper setres xinit' | ||
CHROOTETC='xbindkeysrc.scm xorg-intel-sna.conf xserverrc xserverrc-xorg xserverrc-local.example' | ||
CHROOTETC='xbindkeysrc.scm xserverrc xserverrc-xorg xserverrc-local.example' | ||
if [ -z "$TARGETNOINSTALL" -a -f "/sys/class/tty/tty0/active" ]; then | ||
error 99 "xorg target is only supported on Freon-based systems." | ||
fi | ||
. "${TARGETSDIR:="$PWD"}/common" | ||
|
||
### Append to prepare.sh: | ||
|
@@ -18,53 +21,28 @@ rm -f '/etc/crouton/xserverrc-x11' | |
|
||
# Figure out what we need on this system | ||
|
||
# Freon? | ||
freon='' | ||
if [ ! -f "/sys/class/tty/tty0/active" ]; then | ||
freon='y' | ||
fi | ||
|
||
# Pull in backported Xorg when possible on precise to support newer hardware | ||
backport='' | ||
if release -eq precise; then | ||
if [ "${ARCH#arm}" = "$ARCH" ]; then | ||
# Note: lts-trusty mesa requires kernel version >=3.6 | ||
if ! uname -r | grep -q "^3.4."; then | ||
backport='-lts-trusty' | ||
fi | ||
backport='-lts-trusty' | ||
else | ||
# ARM only offers quantal backport at the moment | ||
backport='-lts-quantal' | ||
fi | ||
elif release -eq trusty; then | ||
backport='-lts-xenial' | ||
fi | ||
|
||
# Avoid issues when jumping backports | ||
if [ "${DISTROAKA:-"$DISTRO"}" = 'debian' -a -n "$backport" ]; then | ||
apt-mark unhold xserver-xorg-video-dummy || true 2>/dev/null | ||
fi | ||
|
||
# Intel? | ||
inteldriver='' | ||
intelhasfbc='' | ||
pinmesa='' | ||
intelfbcsupport='y' | ||
if [ "${ARCH#arm}" = "$ARCH" ]; then | ||
inteldriver="xserver-xorg-video-intel$backport" | ||
|
||
# If the system has an Intel FBC-capable video card but has too old a driver | ||
# to support the chipset, we'll need to disable hardware acceleration. | ||
if grep -q 1 '/sys/module/i915/parameters/i915_enable_fbc' 2>/dev/null; then | ||
intelhasfbc=y | ||
if release -le wheezy -le sana; then | ||
intelfbcsupport='' | ||
fi | ||
fi | ||
|
||
# On saucy onwards, if kernel version is 3.4, manually pin down old mesa | ||
# libraries, as new ones require version >=3.6 (see issue #704). | ||
# This is only required on non-Atom Intel chipsets (Atom uses i915 dri driver) | ||
if release -ge saucy && uname -r | grep -q "^3.4." && | ||
! grep -q 0xa0 /sys/class/graphics/fb0/device/device; then | ||
pinmesa='y' | ||
fi | ||
|
||
# Unhold xserver-xorg-video-intel, modification will be reapplied later. | ||
apt-mark unhold "$inteldriver" 2>/dev/null || true | ||
fi | ||
|
||
# Catalog relevant and irrelevant video drivers | ||
|
@@ -77,95 +55,18 @@ else | |
modesetting='' | ||
fi | ||
|
||
installvideodrivers='' | ||
removevideodrivers='' | ||
if [ -n "$freon" ]; then | ||
installvideodrivers="$modesetting" | ||
removevideodrivers="$fbdev" | ||
else | ||
installvideodrivers="$fbdev" | ||
fi | ||
if [ -n "$inteldriver" ]; then | ||
# If we need SNA (for fbc) but don't have it, don't install intel | ||
if [ -z "$intelhasfbc" -o -n "$intelfbcsupport" ]; then | ||
installvideodrivers="$installvideodrivers $inteldriver" | ||
else | ||
removevideodrivers="$removevideodrivers $inteldriver" | ||
fi | ||
fi | ||
installvideodrivers="$modesetting" | ||
removevideodrivers="$fbdev $inteldriver" | ||
|
||
|
||
# On Freon, we need crazy xorg hacks | ||
if [ -n "$freon" ]; then | ||
compile freon '-ldl -ldrm -I/usr/include/libdrm' so libdrm-dev | ||
fi | ||
# Compile crazy xorg hacks | ||
compile freon '-ldl -ldrm -I/usr/include/libdrm' so libdrm-dev | ||
|
||
# Pin precise's version of mesa if necessary | ||
# No systems use kernel 3.4 anymore, so remove the mesa hack | ||
pinfile='/etc/apt/preferences.d/precise-mesa-pin' | ||
pinlist='/etc/apt/sources.list.d/precise.list' | ||
pindummypkg='libwayland-egl1-dummy' | ||
if [ -n "$pinmesa" ]; then | ||
# Create a dummy libwayland-egl1 package, to satisfy dependencies | ||
# (the libraries are actually provided by libegl1-mesa-drivers in precise) | ||
install --minimal --asdeps equivs | ||
|
||
DEBTMP="`mktemp -d crouton.XXXXXX --tmpdir=/tmp`" | ||
addtrap "rm -rf --one-file-system '$DEBTMP'" | ||
|
||
( cd "$DEBTMP"; equivs-build - ) <<END | ||
Section: misc | ||
Priority: optional | ||
Standards-Version: 3.9.2 | ||
|
||
Package: $pindummypkg | ||
Version: 8.0.4 | ||
Depends: libegl1-mesa-drivers | ||
Provides: libwayland-egl1 | ||
Description: Dummy package providing libwayland-egl1 | ||
END | ||
|
||
# Add precise package sources | ||
mirror="`detect_mirror`" | ||
|
||
cat > "$pinlist" <<END | ||
deb $mirror precise main | ||
deb $mirror precise-updates main | ||
deb $mirror precise-security main | ||
END | ||
|
||
cat > "$pinfile" <<END | ||
# Do not install any packages from precise by default | ||
Package: * | ||
Pin: release n=precise | ||
Pin-Priority: -10 | ||
|
||
# Install mesa packages and their dependencies from precise | ||
Package: libegl1-mesa:* libegl1-mesa-dbg:* libegl1-mesa-dev:* \ | ||
libegl1-mesa-drivers:* libegl1-mesa-drivers-dbg:* \ | ||
libgl1-mesa-dev:* libgl1-mesa-dri:* libgl1-mesa-dri-dbg:* \ | ||
libgl1-mesa-glx:* libgl1-mesa-glx-dbg:* \ | ||
libglapi-mesa:* libglapi-mesa-dbg:* \ | ||
libgles1-mesa:* libgles1-mesa-dbg:* libgles1-mesa-dev:* \ | ||
libgles2-mesa:* libgles2-mesa-dbg:* libgles2-mesa-dev:* \ | ||
libdrm-nouveau1a:* libllvm3.0:* libudev0:* | ||
Pin: release n=precise | ||
Pin-Priority: 1100 | ||
END | ||
|
||
# Fetch new package sources | ||
apt-get update || true | ||
|
||
# Forcibly replace libwayland-egl1-mesa by libwayland-egl1-dummy | ||
# (dpkg -r does not fail if package does not exist) | ||
dpkg -r --force-depends libwayland-egl1-mesa libwayland-egl1-mesa:i386 | ||
dpkg -i --force-depends "$DEBTMP"/libwayland-egl1-dummy_*_all.deb | ||
|
||
# Downgrade packages, -f is needed as dependencies are broken | ||
# This happens to install python2.7-minimal as well, pulled in by a wrong | ||
# dependency of ubuntu-minimal-1.267 (precise), which we did not install. | ||
# Looks like an apt bug, I guess we can live with that. | ||
apt-get -y --force-yes --no-install-recommends dist-upgrade -f | ||
elif [ -f "$pinfile" -o -f "$pinlist" ]; then | ||
if [ -f "$pinfile" -o -f "$pinlist" ]; then | ||
# No longer need the pin; remove it | ||
rm -f "$pinfile" "$pinlist" | ||
apt-get update || true | ||
|
@@ -176,7 +77,8 @@ fi | |
# Install backported xorg instead of the default one | ||
if [ -n "$backport" ]; then | ||
# We still install xorg later to pull in its dependencies | ||
install --minimal "xserver-xorg$backport" "libgl1-mesa-glx$backport" \ | ||
install --minimal "xserver-xorg$backport" "xserver-xorg-core$backport" \ | ||
"libgl1-mesa-glx$backport" \ | ||
"libegl1-mesa$backport" "libgles2-mesa$backport" \ | ||
"xserver-xorg-input-synaptics$backport" $installvideodrivers | ||
fi | ||
|
@@ -207,35 +109,12 @@ if [ -n "$removevideodrivers" ]; then | |
remove $removevideodrivers | ||
fi | ||
|
||
# If this is a system with framebuffer compression, we need SNA+tearfree | ||
xorgconf='/usr/share/X11/xorg.conf.d/20-crouton-intel-sna.conf' | ||
if [ -n "$intelhasfbc" -a -n "$intelfbcsupport" ]; then | ||
mkdir -p "${xorgconf%/*}" | ||
ln -sfT /etc/crouton/xorg-intel-sna.conf "$xorgconf" | ||
else | ||
# In case this got moved to a different system, delete the config | ||
rm -f "$xorgconf" | ||
fi | ||
# Remove old Intel SNA workaround | ||
rm -f '/usr/share/X11/xorg.conf.d/20-crouton-intel-sna.conf' | ||
|
||
# Fix launching X11 from inside crosh (user doesn't own a TTY) | ||
echo 'allowed_users=anybody' > '/etc/X11/Xwrapper.config' | ||
|
||
inteldrv='/usr/lib/xorg/modules/drivers/intel_drv.so' | ||
if [ -n "$freon" -a -e "$inteldrv" ]; then | ||
# Modify the Intel driver to call getuid0 (provided by croutonfreon.so) | ||
# instead of geteuid, to force DRM master setting/dropping. | ||
offset="`grep -F -m 1 -boa 'geteuid' "$inteldrv" 2>/dev/null || true`" | ||
if [ -n "$offset" ]; then | ||
echo -n 'getuid0' | dd seek="${offset%:*}" bs=1 of="$inteldrv" \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove getuid0 from freon.c? |
||
conv=notrunc,nocreat 2>/dev/null | ||
fi | ||
|
||
if grep -F -q -a 'getuid0' "$inteldrv" 2>/dev/null; then | ||
# Hold xserver-xorg-video-intel to make sure that the modification | ||
# (which may have been made in a previous update) does not get erased. | ||
apt-mark hold "$inteldriver" | ||
fi | ||
fi | ||
|
||
TIPS="$TIPS | ||
You can flip through your running chroot desktops and Chromium OS by hitting | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are there any replacements for this workaround? It seems like bionic needs this workaround on my system (CBPro) with gnome/kde to fix #3988 / #3933