RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1854674 - Bug in xf86-video-intel (xorg-x11-drv-intel) prevents iris driver from working properly when DRI2 and intel DDX driver are in use
Summary: Bug in xf86-video-intel (xorg-x11-drv-intel) prevents iris driver from workin...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: xorg-x11-drv-intel
Version: 7.8
Hardware: x86_64
OS: Linux
unspecified
urgent
Target Milestone: rc
: ---
Assignee: Adam Jackson
QA Contact: Desktop QE
URL:
Whiteboard:
Depends On:
Blocks: 1856737 1856738
TreeView+ depends on / blocked
 
Reported: 2020-07-08 00:37 UTC by Tomasz Tomasik
Modified: 2021-11-10 19:18 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1856737 1856738 (view as bug list)
Environment:
Last Closed: 2021-11-10 14:49:18 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Upstream patch for xf86-video-intel (xorg-x11-drv-intel) (1.66 KB, patch)
2020-07-08 00:39 UTC, Tomasz Tomasik
no flags Details | Diff
X.Org configuration (277 bytes, text/plain)
2020-07-08 00:39 UTC, Tomasz Tomasik
no flags Details
RPM SPEC for EL7 (16.95 KB, text/x-rpm-spec)
2020-07-08 00:41 UTC, Tomasz Tomasik
no flags Details
dmesg log (137 bytes, text/plain)
2020-07-08 00:41 UTC, Tomasz Tomasik
no flags Details
gdb log (3.24 KB, text/plain)
2020-07-08 00:41 UTC, Tomasz Tomasik
no flags Details
SRPM for EL6 (1.48 MB, application/x-rpm)
2020-07-08 00:42 UTC, Tomasz Tomasik
no flags Details
SRPM for EL7 (2.57 MB, application/x-rpm)
2020-07-08 00:42 UTC, Tomasz Tomasik
no flags Details
SRPM for EL8 (2.58 MB, application/x-rpm)
2020-07-08 00:43 UTC, Tomasz Tomasik
no flags Details
SRPM for FC30-FC31 (1.20 MB, application/x-rpm)
2020-07-08 00:43 UTC, Tomasz Tomasik
no flags Details
SRPM for FC32-FC33 (1.20 MB, application/x-rpm)
2020-07-08 00:44 UTC, Tomasz Tomasik
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Github flatpak flatpak issues 3673 0 None open Possible incompatibility between Freedesktop's Mesa libraries and Mesa libraries or kernel driver on the host 2021-01-13 20:12:25 UTC
Github widelands widelands issues 3937 0 None open Widelands does not start on EL 7 with Mesa 20 and Intel GPU 2021-01-13 20:12:25 UTC
Gitlab freedesktop-sdk freedesktop-sdk issues 1071 0 None None None 2020-07-08 00:45:33 UTC
Red Hat Bugzilla 1854672 0 unspecified CLOSED Bug in xf86-video-intel (xorg-x11-drv-intel) prevents iris driver from working properly when DRI2 and intel DDX driver a... 2021-05-25 17:11:30 UTC
freedesktop.org Gitlab mesa mesa issues 3188#note_552650 0 None None None 2020-07-08 00:45:33 UTC

Internal Links: 1854672

Description Tomasz Tomasik 2020-07-08 00:37:41 UTC
Description of problem:
Even the simplest SDL2 applications are not able to work with the iris DRI driver, if DRI2 and the intel DDX driver is in use instead of modesetting.

Version-Release number of selected component (if applicable):
EL up to version 8
Fedora up to version 33 (Rawhide)
Basically, everything up to xorg-x11-drv-intel-2.99.917-45.20200205.fc33 is affected.
https://gitlab.com/freedesktop-sdk/freedesktop-sdk/-/issues/1071#note_374809227

Steps to reproduce:
1. Configure X.Org to use DRI2 and the intel DDX driver.
2. Reboot system.
3. Log-in in any desktop environment that uses X.Org (GNOME on X.Org, GNOME Classic, MATE, etc.).
4. Run Widelands from Flathub. When it comes to Fedora, you can use the native package instead. For EL, please use the flatpak package.

X.Org configuration:
```
# cat /etc/X11/xorg.conf.d/20-intel.conf 
Section "Device"
        Identifier  "Intel"
        #Driver     "modesetting"
        Driver      "intel"
        ###
        Option      "TearFree"              "True"
        #Option     "DRI"                   "3"
        Option      "DRI"                   "2"
EndSection
```

Widelands packages:
https://flathub.org/apps/details/org.widelands.Widelands
https://github.com/scx/widelands-flatpak
https://koji.fedoraproject.org/koji/packageinfo?packageID=4332
https://copr.fedorainfracloud.org/coprs/scx/widelands

Expected results:
Run the application.

Actual results:
Crash the application.

Additional info:
https://github.com/widelands/widelands/issues/3937
https://github.com/flatpak/flatpak/issues/3673
https://gitlab.com/freedesktop-sdk/freedesktop-sdk/-/issues/1071
https://gitlab.freedesktop.org/mesa/mesa/-/issues/3188

dmesg log:
```
[  399.377617] widelands[5462]: segfault at 24 ip 00007f7d795db1dc sp 00007ffe6c3f8d30 error 6 in libgallium_dri.so[7f7d78bd6000+cfd000]
```

gdb log:
```
$ flatpak run -d --command=sh org.widelands.Widelands
[📦 org.widelands.Widelands ~]$ gdb
GNU gdb (GDB) 8.3.1
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word".
(gdb) file widelands
Reading symbols from widelands...
(No debugging symbols found in widelands)
(gdb) run
Starting program: /app/bin/widelands 
warning: File "/usr/lib/x86_64-linux-gnu/libthread_db-1.0.so" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load".
To enable execution of this file add
	add-auto-load-safe-path /usr/lib/x86_64-linux-gnu/libthread_db-1.0.so
line to your configuration file "/home/scx/.gdbinit".
To completely disable this security protection add
	set auto-load safe-path /
line to your configuration file "/home/scx/.gdbinit".
For more information about this security protection see the
"Auto-loading safe path" section in the GDB manual.  E.g., run from the shell:
	info "(gdb)Auto-loading safe path"
warning: Unable to find libthread_db matching inferior's thread library, thread debugging will not be available.
This is Widelands Version build-20 (Release)
Set home directory: /home/scx/.widelands
Adding directory: /app/share/widelands
selected language: (system language)
using locale en_US.UTF-8
[New LWP 9]
[New LWP 10]
[New LWP 11]
[New LWP 12]
Graphics: Try to set Videomode 800x600
Graphics: OpenGL: Version "4.6 (Compatibility Profile) Mesa 20.0.5"
Graphics: SDL_GL_RED_SIZE is 8
Graphics: SDL_GL_GREEN_SIZE is 8
Graphics: SDL_GL_BLUE_SIZE is 8
Graphics: SDL_GL_ALPHA_SIZE is 0
Graphics: SDL_GL_BUFFER_SIZE is 24
Graphics: SDL_GL_DOUBLEBUFFER is 1
Graphics: SDL_GL_DEPTH_SIZE is 24
Graphics: SDL_GL_STENCIL_SIZE is 8
Graphics: SDL_GL_ACCUM_RED_SIZE is 0
Graphics: SDL_GL_ACCUM_GREEN_SIZE is 0
Graphics: SDL_GL_ACCUM_BLUE_SIZE is 0
Graphics: SDL_GL_ACCUM_ALPHA_SIZE is 0
Graphics: SDL_GL_STEREO is 0
Graphics: SDL_GL_MULTISAMPLEBUFFERS is 0
Graphics: SDL_GL_MULTISAMPLESAMPLES is 0
Graphics: SDL_GL_ACCELERATED_VISUAL is 1
Graphics: SDL_GL_CONTEXT_MAJOR_VERSION is 2
Graphics: SDL_GL_CONTEXT_MINOR_VERSION is 1
Graphics: SDL_GL_CONTEXT_FLAGS is 0
Graphics: SDL_GL_CONTEXT_PROFILE_MASK is 2
Graphics: SDL_GL_SHARE_WITH_CURRENT_CONTEXT is 0
Graphics: SDL_GL_FRAMEBUFFER_SRGB_CAPABLE is 0
Graphics: OpenGL: Double buffering enabled
Graphics: OpenGL: Max texture size: 16384
Graphics: OpenGL: ShadingLanguage: "4.60"

Thread 1 "widelands" received signal SIGSEGV, Segmentation fault.
0x00007ffff3fb71dc in ?? ()
   from /usr/lib/x86_64-linux-gnu/GL/default/lib/dri/iris_dri.so
(gdb) quit
A debugging session is active.

	Inferior 1 [process 5] will be killed.

Quit anyway? (y or n) y
[📦 org.widelands.Widelands ~]$ exit
exit
```

The reason of using DRI2 and the intel DDX driver instead of modesetting:
https://github.com/flatpak/flatpak/issues/3673#issuecomment-650287489

In my opinion, it is the iris driver breaking ABI, but it seems that Intel is not interested into fixing it in Mesa. Instead, they provided fix in xf86-video-intel.
https://gitlab.freedesktop.org/xorg/driver/xf86-video-intel/-/commit/f2a54e256dd7539633c476a379db2b1e60eec811

Related issues:
https://gitlab.freedesktop.org/xorg/driver/xf86-video-intel/-/issues/193
https://gitlab.freedesktop.org/mesa/mesa/-/issues/2845
https://gitlab.freedesktop.org/mesa/mesa/-/issues/2858
https://gitlab.freedesktop.org/mesa/mesa/-/issues/3188

Currently, almost all Linux distributions are affected, including Fedora Rawhide and openSUSE Tumbleweed. When it comes to major Linux distributions, only Arch or Gentoo are not affected, because they tend to use the latest commit.
Although CentOS 7 doesn't provide the iris driver, it is affected as well, because Freedesktop 19.08 uses Mesa 20.x, in which iris is the default driver. This means that all current flatpak packages from Flathub are affected.

The solution is to patch xf86-video-intel in all current Linux distributions.
I've created the xorg-x11-drv-intel repo for EL 6-8 and Fedora 30-33:
https://copr.fedorainfracloud.org/coprs/scx/xorg-x11-drv-intel/

I've already tested it in RHEL 7 and Fedora 32. I can confirm it works.

SRC RPM:
https://copr-be.cloud.fedoraproject.org/results/scx/xorg-x11-drv-intel/epel-7-x86_64/01523758-xorg-x11-drv-intel/xorg-x11-drv-intel-2.99.917-29.20180530.el7.src.rpm

Full RPM SPEC:
https://copr-be.cloud.fedoraproject.org/results/scx/xorg-x11-drv-intel/epel-7-x86_64/01523758-xorg-x11-drv-intel/xorg-x11-drv-intel.spec

Patch ("0002-dri2-Interpret-DRI2ATTACH_FORMAT-as-depth-not-bpp.patch"):
https://gitlab.freedesktop.org/xorg/driver/xf86-video-intel/-/commit/f2a54e256dd7539633c476a379db2b1e60eec811.patch

Comment 2 Tomasz Tomasik 2020-07-08 00:39:20 UTC
Created attachment 1700230 [details]
Upstream patch for xf86-video-intel (xorg-x11-drv-intel)

In mesa i915/i965 pass the bpp to use when creating the surface, but the gallium state tracker passed the depth. As it happens that BitsPerPixel(format) will do the right thing for both, use that.

Comment 3 Tomasz Tomasik 2020-07-08 00:39:50 UTC
Created attachment 1700231 [details]
X.Org configuration

X.Org configuration with DRI2 and the intel DDX driver instead of modesetting

Comment 4 Tomasz Tomasik 2020-07-08 00:41:04 UTC
Created attachment 1700232 [details]
RPM SPEC for EL7

RPM SPEC for EL7 with "0002-dri2-Interpret-DRI2ATTACH_FORMAT-as-depth-not-bpp.patch"

Comment 5 Tomasz Tomasik 2020-07-08 00:41:30 UTC
Created attachment 1700233 [details]
dmesg log

Error in libgallium_dri.so

Comment 6 Tomasz Tomasik 2020-07-08 00:41:51 UTC
Created attachment 1700235 [details]
gdb log

Error in /usr/lib/x86_64-linux-gnu/GL/default/lib/dri/iris_dri.so

Comment 7 Tomasz Tomasik 2020-07-08 00:42:31 UTC
Created attachment 1700236 [details]
SRPM for EL6

SRPM for EL6 with "0002-dri2-Interpret-DRI2ATTACH_FORMAT-as-depth-not-bpp.patch"

Comment 8 Tomasz Tomasik 2020-07-08 00:42:54 UTC
Created attachment 1700237 [details]
SRPM for EL7

SRPM for EL7 with "0002-dri2-Interpret-DRI2ATTACH_FORMAT-as-depth-not-bpp.patch"

Comment 9 Tomasz Tomasik 2020-07-08 00:43:26 UTC
Created attachment 1700238 [details]
SRPM for EL8

SRPM for EL8 with "0002-dri2-Interpret-DRI2ATTACH_FORMAT-as-depth-not-bpp.patch"

Comment 10 Tomasz Tomasik 2020-07-08 00:43:52 UTC
Created attachment 1700239 [details]
SRPM for FC30-FC31

SRPM for FC30-FC31 with "0002-dri2-Interpret-DRI2ATTACH_FORMAT-as-depth-not-bpp.patch"

Comment 11 Tomasz Tomasik 2020-07-08 00:44:10 UTC
Created attachment 1700240 [details]
SRPM for FC32-FC33

SRPM for FC32-FC33 with "0002-dri2-Interpret-DRI2ATTACH_FORMAT-as-depth-not-bpp.patch"


Note You need to log in before you can comment on or make changes to this bug.