Bug 269606 - black screen after monitor wake up with intel X11 driver and uxa or blt accel method
Summary: black screen after monitor wake up with intel X11 driver and uxa or blt accel...
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: misc (show other bugs)
Version: Unspecified
Hardware: amd64 Any
: --- Affects Only Me
Assignee: freebsd-x11 (Nobody)
URL:
Keywords: needs-qa
Depends on:
Blocks:
 
Reported: 2023-02-17 00:13 UTC by Paul Dufresne
Modified: 2023-04-14 13:00 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Dufresne 2023-02-17 00:13:11 UTC
Using XFCE4 with:
vgapci0@pci0:0:2:0:	class=0x030000 rev=0x00 hdr=0x00 vendor=0x8086 device=0x3e91 subvendor=0x1043 subdevice=0x8694
    vendor     = 'Intel Corporation'
    device     = 'CoffeeLake-S GT2 [UHD Graphics 630]'
    class      = display
    subclass   = VGA
No graphic card connected.

When leaving the computer alone, after a while, monitor led goes yellow (rather than green) to indicate it is sleeping.

Pressing a key resume computer, led goes green, but the screen stay black with cursor in upper left flashing.

I have to Alt-F3 (or similar) to go to text mode and then screen reappears.

After that, returning to graphical tty (Alt-F8 I think), returns to XFCE windows.

Using intel driver:
kldstat shows:
 4    1 0xffffffff83010000   17f8b8 i915kms.ko

paul@dufresnep:/usr/home/paul $ freebsd-version ; uname -a
13.2-PRERELEASE
FreeBSD dufresnep.ca 13.2-PRERELEASE FreeBSD 13.2-PRERELEASE #0 stable/13-n254363-d07eb716f35d: Sat Feb  4 19:16:12 UTC 2023     root@releng3.nyi.freebsd.org:/usr/obj/usr/src/amd64.amd64/sys/GENERIC amd64
Comment 1 Paul Dufresne 2023-02-17 00:20:10 UTC
Unusual message in dmesg:
vgapci0: child drmn0 requested pci_enable_io
vgapci0: child drmn0 requested pci_enable_io
[drm] Unable to create a private tmpfs mount, hugepage support will be disabled(-19).
[drm] Got stolen memory base rxc4000000, size 0x4000000

paul@dufresnep:/usr/home/paul $ dmesg | grep -i vga
vgapci0: <VGA-compatible display> port 0xf000-0xf03f mem 0xf6000000-0xf6ffffff,0xe0000000-0xefffffff irq 16 at device 2.0 on pci0
vgapci0: Boot video device
drmn0: <drmn> on vgapci0
vgapci0: child drmn0 requested pci_enable_io
vgapci0: child drmn0 requested pci_enable_io
paul@dufresnep:/usr/home/paul $ 

paul@dufresnep:/usr/home/paul $ dmesg | grep -i drm
drmn0: <drmn> on vgapci0
vgapci0: child drmn0 requested pci_enable_io
vgapci0: child drmn0 requested pci_enable_io
[drm] Unable to create a private tmpfs mount, hugepage support will be disabled(-19).
[drm] Got stolen memory base rxc4000000, size 0x4000000
lkpi_iic0: <LinuxKPI I2C> on drmn0
lkpi_iic1: <LinuxKPI I2C> on drmn0
lkpi_iic2: <LinuxKPI I2C> on drmn0
drmn0: successfully loaded firmware image 'i915/kbl_dmc_ver1_04.bin'
drmn0: [drm] Finished loading DMC firmware i915/kbl_dmc_ver1_04.bin (v1.4)
lkpi_iic3: <LinuxKPI I2C> on drm2
[drm] Initialized i915 1.6.0 20200917 for drmn0 on minor 0
name=drmn0 flags=0x0 stride=5120 bpp=32
paul@dufresnep:/usr/home/paul $
Comment 2 Paul Dufresne 2023-02-17 00:38:42 UTC
This is not the "text cursor" that appears on black screen.

This is the mouse cursor. It moves (and sometime change form) as I move the mouse. Rest of screeen is black.

In Settings/Power-Manager, display tab, it seems that after "Blank after" only a few seconds after that, my monitor led goes yellow and pass in economy mode.

If I move mouse in that period it restore normal windows.

But if instead I wait for "Put to sleep after" delay, then the screen will return black on moving the mouse, except for the mouse cursor that show on the screen.
Comment 3 Paul Dufresne 2023-02-17 00:59:14 UTC
I have first try to change:
paul@dufresnep:/usr/home/paul $ cat /usr/local/etc/X11/xorg.conf.d/20-intel.conf 
Section "Device"
    Identifier "Card"
    Driver "vesa"
EndSection
paul@dufresnep:/usr/home/paul $
was intel before...

but then, when I startx, I had this bug window, but in upper screen, all the lower part was black... and the window was corrupted (appearing like 2 columns)... not really responding.

So I also commented out in /etc/rc.conf:
# kld_list="i915kms"

And now, after reboot... the bug is gone.

I will return to Driver "intel" leaving commented the loading of i915kms.
Comment 4 Paul Dufresne 2023-02-17 01:44:34 UTC
The problem still happens with Driver "intel"...
but also, i915kms seems to be automatically loaded by "startx"
...
I have tried to pkg remove the drm packages, but after that startx was not starting with intel driver.

So I change to using scfb driver... but now it does not seems to put the screen to sleep anymore.

I don't know if there exist a way to use intel driver without using DRM.
Comment 5 Paul Dufresne 2023-02-17 03:56:00 UTC
I switched back to using vesa driver, because it seems scfb was 1024x768 only.
Comment 6 Paul Dufresne 2023-02-17 22:34:09 UTC
I just switched to:
paul@dufresnep:/usr/home/paul $ cat /usr/local/etc/X11/xorg.conf.d/20-intel.conf 
Section "Device"
    Identifier "Card"
    #Driver "vesa"
    #Driver "intel"
    #Driver "scfb"
    # does not exist: Driver "glamor"
    Driver "modesetting"
EndSection
paul@dufresnep:/usr/home/paul $

And that works fine!
with modesetting, after display sleep, moving the mouse return the full windows.

And I believe this is more stable than the intel driver... I did not report yet, but I had some small line of pixel corruption here and there with intel driver.

So I intend to keep that one.

So the bug seems to be with the X11 intel driver.
Comment 7 aryeh.friedman 2023-02-17 23:06:57 UTC
I can confirm it also does not work on nVidia cards either.... the
only fix I have found is rm -rf ~/.config/xfce4 but that has the
obvious downside of having to reconfig it which is 5 to 10 mins.

Note this only started happening in the last few weeks after a pkg upgrade
Comment 8 Graham Perrin freebsd_committer freebsd_triage 2023-02-18 11:13:47 UTC
(In reply to Paul Dufresne from comment #1)

Which version of graphics/drm-510-kmod, exactly? 

<https://dev.freshports.org/graphics/drm-510-kmod/#history>
Comment 9 Paul Dufresne 2023-02-18 13:11:12 UTC
paul@dufresnep:/usr/home/paul $ pkg info drm-kmod
drm-kmod-20220907_1
Name           : drm-kmod
Version        : 20220907_1
Installed on   : Fri Feb 17 15:14:27 2023 EST
Origin         : graphics/drm-kmod
Architecture   : FreeBSD:13:*
Prefix         : /usr/local

I am kind of confused now about this... not like the versions you posted.
Comment 10 Paul Dufresne 2023-02-18 13:14:18 UTC
paul@dufresnep:/usr/home/paul $ pkg info|grep drm
drm-510-kmod-5.10.163          DRM drivers modules
drm-kmod-20220907_1            Metaport of DRM modules for the linuxkpi-based KMS components
gpu-firmware-kmod-20221207_1,1 Firmware modules for the drm-kmod drivers
libdrm-2.4.114,1               Userspace interface to kernel Direct Rendering Module services
paul@dufresnep:/usr/home/paul $ 

paul@dufresnep:/usr/home/paul $ pkg info drm-510-kmod
drm-510-kmod-5.10.163
Name           : drm-510-kmod
Version        : 5.10.163
Installed on   : Fri Feb 17 15:14:21 2023 EST
Origin         : graphics/drm-510-kmod
Architecture   : FreeBSD:13:amd64
Prefix         : /usr/local
Categories     : kld graphics
Licenses       : MIT and GPLv2 and BSD2CLAUSE
Maintainer     : x11@FreeBSD.org
WWW            : https://github.com/freebsd/drm-kmod/
Comment        : DRM drivers modules
Annotations    :
	FreeBSD_version: 1301000
	repo_type      : binary
	repository     : FreeBSD
Comment 11 Paul Dufresne 2023-02-24 00:42:45 UTC
Not tested much, but I first glance, this bug would happen with uxa acceleration, and not in sna acceleration.

The file I use to test:
paul@dufresnep:/usr/home/paul $ cat /usr/local/etc/X11/xorg.conf.d/20-intel.conf 
Section "Device"
    Identifier "Card"
    #Driver "vesa"
    Driver "intel"
    #Driver "scfb"
    # does not exist: Driver "glamor"
    #Driver "modesetting"
    #Option "AccelMethod" "sna"
    Option "AccelMethod" "uxa"
EndSection
paul@dufresnep:/usr/home/paul $
Comment 12 Paul Dufresne 2023-02-24 00:44:49 UTC
paul@dufresnep:/usr/home/paul $ freebsd-version
13.2-BETA2
paul@dufresnep:/usr/home/paul $ uname -v
FreeBSD 13.2-BETA2 releng/13.2-fbb102b2c GENERIC
Comment 13 Paul Dufresne 2023-02-24 23:22:30 UTC
The problem also happened with "AccelMethod" "blt"... but did not happened
with "AccelMethod" "off".
Comment 14 Paul Dufresne 2023-02-25 13:48:54 UTC
I have installed 13.2 BETA3 on an older computer (845 chipset I think):
root@Simbad:/var/log # pciconf -lebv
hostb0@pci0:0:0:0:	class=0x060000 rev=0x03 hdr=0x00 vendor=0x8086 device=0x2e10 subvendor=0x103c subdevice=0x3048
    vendor     = 'Intel Corporation'
    device     = '4 Series Chipset DRAM Controller'
    class      = bridge
    subclass   = HOST-PCI
    PCI errors = Received Master-Abort
vgapci0@pci0:0:2:0:	class=0x030000 rev=0x03 hdr=0x00 vendor=0x8086 device=0x2e12 subvendor=0x103c subdevice=0x3048
    vendor     = 'Intel Corporation'
    device     = '4 Series Chipset Integrated Graphics Controller'
    class      = display
    subclass   = VGA
    bar   [10] = type Memory, range 64, base rxf0000000, size 4194304, enabled
    bar   [18] = type Prefetchable Memory, range 64, base rxe0000000, size 268435456, enabled

It is affected by this problem too.
Comment 15 Paul Dufresne 2023-02-25 13:50:49 UTC
(In reply to Paul Dufresne from comment #14)
root@Simbad:/var/log # uname -v
FreeBSD 13.2-BETA3 releng/13.2-n254537-d0e8ce556627 GENERIC
Comment 16 Zbigniew Radosz 2023-04-14 13:00:36 UTC
I'm observing the same issue. Also using XFCE. My graphics card:

vgapci0@pci0:0:2:0:	class=0x030000 rev=0x09 hdr=0x00 vendor=0x8086 device=0x0162 subvendor=0x1462 subdevice=0x2111
    vendor     = 'Intel Corporation'
    device     = 'IvyBridge GT2 [HD Graphics 4000]'
    class      = display
    subclass   = VGA
    bar   [10] = type Memory, range 64, base rxf7800000, size 4194304, enabled
    bar   [18] = type Prefetchable Memory, range 64, base rxe0000000, size 268435456, enabled
    bar   [20] = type I/O Port, range 32, base rxf000, size 64, enabled

I'm running stable version of FreeBSD:

FreeBSD 13.2-RELEASE releng/13.2-n254617-525ecfdad597 GENERIC amd64