# Suspend/Resume on R400, display does not come back on



## eldaemon (Sep 15, 2020)

Testing with 12.2-BETA1, `acpiconf -s 3` does not come back with any video. I was not using X, it's just the regular, non-framebuffer console. Thinkpad R400.

Any ideas on what I should try? Should I open a bug report?


----------



## Mjölnir (Sep 15, 2020)

You should have a framebuffer console...  Are you using the old syscons(4) (`kern.vty="sc"` in loader.conf(5))?
Please post the ouput of `pciconf -vl | grep -B3 display`
Very likely you did not install & configure graphics/drm-kmod, which gives you a framebuffer console if you use the standard vt(4) console driver
For the Intel KMS kernel module, you may want these in loader.conf(5):


```
# INTEL DRM WITH graphics/drm-kmod PACKAGE (NEW)
compat.linuxkpi.fastboot="1" # SKIP UNNECESSARY MODE SETS AT BOOT TIME
compat.linuxkpi.enable_rc6="7" # ENABLE POWER SAVING RENDER C-STATE 6
compat.linuxkpi.enable_dc="2" # ENABLE POWER SAVING DISPLAY C-STATES
compat.linuxkpi.enable_fbc="1" # ENABLE FRAME BUFFER COMPRESSION FOR POWER SAVINGS
compat.linuxkpi.semaphores="1" # USE SEMAPHORES FOR INTER RING SYNC
```
Very likely you already know my _Standard disclaimer_ (apply all setting requested by the `pkg message`)


----------



## eldaemon (Sep 15, 2020)

Hi,

Thanks for your reply.

This was out of-the-box, basically.


```
root@twelevedot2:~ # grep vty /boot/loader.conf
root@twelevedot2:~ # sysctl kern.vty
kern.vty: vt
```


```
vgapci0@pci0:0:2:0:    class=0x030000 card=0x20e417aa chip=0x2a428086 rev=0x07 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = 'Mobile 4 Series Chipset Integrated Graphics Controller'
    class      = display
--
vgapci1@pci0:0:2:1:    class=0x038000 card=0x20e417aa chip=0x2a438086 rev=0x07 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = 'Mobile 4 Series Chipset Integrated Graphics Controller'
    class      = display
```

I did not see that message when installing. This is what I got.


```
[3/3] Installing drm-kmod-g20190710...
=====
Message from drm-fbsd12.0-kmod-4.16.g20200221:

--
The drm-fbsd12.0-kmod port can be enabled for amdgpu (for AMD GPUs starting
with the HD7000 series / Tahiti) or i915kms (for Intel APUs starting with
HD3000 / Sandy Bridge) through kld_list in /etc/rc.conf. radeonkms for older
AMD GPUs can be loaded and there are some positive reports if EFI boot is NOT
enabled (similar to amdgpu).

For amdgpu: kld_list="amdgpu"
For Intel: kld_list="/boot/modules/i915kms.ko"
For radeonkms: kld_list="/boot/modules/radeonkms.ko"

Please ensure that all users requiring graphics are members of the
"video" group.

Older generations are supported by the legacy kms modules (radeonkms /
i915kms) in base or by installing graphics/drm-legacy-kmod.
```

I've installed drm-kmod as per your request, have added `kld_list="/boot/modules/i915kms.ko"` to /etc/rc.conf. I've added the linuxkpi lines you gave to /boot/loader.conf.

I've rebooted the laptop.

i915kms is loaded now.

Same effect, `acpiconf -s 3` suspends the laptop but when it comes back the screen is blank. I am able to SSH into it, however.

I have a number of these laptops. A T400, R400, X200, and R500. Generally not had much luck with suspend on them.


----------



## Mjölnir (Sep 15, 2020)

Is `sysctl hw.pci.do_power_suspend=1`?  You can try `sysctl hw.acpi.reset_video=1`.  Both can be put into sysctl.conf(5).  EDIT: Your R400 is not listed in the wiki, but the X200 is reported to suspend/resume.


----------



## eldaemon (Sep 15, 2020)

`hw.pci.do_power_suspend` is set to 1, had to set `hw.acpi.reset_video` to 1.

With `hw.acpi.reset_video` set to 1, it's even worse. It won't come out of sleep at all. Can't ping it, etc, the sleep icon stays lit on the laptop. So nothing resumes, I have to kill it holding down the power button.

I also installed X and with `startx` the display is glitchy (you can tell there's mouse movement). No text is readable, it's in some strange mode.


----------



## kpedersen (Sep 15, 2020)

Suspending from X seems to be doing better.

Have you tried alternating between different VTs after resume? i.e ctrl-alt-F1, ctrl-alt-F2 and then back again. I have one specific Thinkpad that needs that. If it solves it we can automate it by adding a small command in /etc/rc.resume.


----------



## eldaemon (Sep 15, 2020)

I did not try that.

I did have luck, however. Once booted if I `kldload i915kms`, it clearly goes into a framebuffer mode (text gets much smaller, can hold more characters on screen -- native resolution). If I suspend then, video does not come back. If I `startx` while the screen is blank, X comes up and works fine. Suspending from X and coming back works. If I quit the window manager/X and go back to the TTY, it also works after suspend.t.

I am wondering if the kld_list setting in /etc/rc.conf was not working quite right.

Glad to have this working, though.

(This is unrelated.)

I am getting lots of `SEND_FPDMA_QUEUED DATA SET MANAGEMENT` timeouts, though. Not sure if it's the hardware or not. It happens quite frequently but ZFS isn't complaining yet.


----------



## Mjölnir (Sep 16, 2020)

Remove the `hw.acpi.reset_video=1` from any start scripts {loader,rc,sysctl}.conf if it clearly makes things worse.
You can set the boot menu's size with e.g. `efi_max_resolution="720p"` in loader.conf(5).
If the console font is too small, you can choose the _gallant_ or _terminus_ font in rc.conf(5):

```
font8x8="gallant"
font8x14="gallant"
font8x16="gallant"
allscreens_flags="-f ${font8x16}"
```

Update the BIOS.  Read this if you don't have a floppy or CD/DVD drive.
Consider to file in a bug report (@top of this forum) if your system does not resume from the console with the DRM_KMS kernel module loaded.  Maybe some simple tweak related to your BIOS version can solve the issue, since you wrote the screen comes back when you start X11 "blindly" after resume.
Optionally update the wiki.


----------

