Suspend/resume with graphics/drm-510-kmod on a Lenovo ThinkPad T450 minor issue

From: Maurizio Vairani <maurizio1018_at_gmail.com>
Date: Sat, 07 May 2022 08:29:23 UTC
Hi all,
replacing the graphics/drm-fbsd13-kmod port with the
graphics/drm-510-kmod-5.10.0, compiled from ports, the suspend/resume cycle
works on a Lenovo ThinkPad T450. I have found only a minor issue. Running
mpv and vlc before and after the suspend/resume cycle I obtain some error
messages on the console after resuming the laptop.
Before suspending the laptop:
> mpv Real\ 4K\ HDR\ 60fps\ -\ LG\ Jazz\ HDR\ UHD\ \(Chromecast\ Ultra\)\
only\ video\ 1920x1080.webm
 (+) Video --vid=1 (*) (vp9 1920x1080 59.940fps)
VO: [gpu] 1920x1080 yuv420p
V: 00:00:10 / 00:02:38 (7%) Dropped: 20

Exiting... (Quit)
> vlc Real\ 4K\ HDR\ 60fps\ -\ LG\ Jazz\ HDR\ UHD\ \(Chromecast\ Ultra\)\
only\ video\ 1920x1080.webm
VLC media player 3.0.17.4 Vetinari (revision 3.0.13-8-g41878ff4f2)
[0000000800c5c060] main libvlc: Running vlc with the default interface. Use
'cvlc' to use vlc without interface.
libva info: VA-API version 1.14.0
libva info: Trying to open /usr/local/lib/dri/iHD_drv_video.so
libva info: va_openDriver() returns -1
libva info: Trying to open /usr/local/lib/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_1_14
libva info: va_openDriver() returns 0
[000000080fc8f060] avcodec decoder: Using Intel i965 driver for Intel(R)
Broadwell - 2.4.1 for hardware decoding
[vp9 @ 0x80fc41e00] get_buffer() failed
[vp9 @ 0x80fc41e00] thread_get_buffer() failed
[vp9 @ 0x80fc42300] get_buffer() failed
[vp9 @ 0x80fc42300] thread_get_buffer() failed
QObject::~QObject: Timers cannot be stopped from another thread

After the resume:
> mpv Real\ 4K\ HDR\ 60fps\ -\ LG\ Jazz\ HDR\ UHD\ \(Chromecast\ Ultra\)\
only\ video\ 1920x1080.webm
 09:56:08
 (+) Video --vid=1 (*) (vp9 1920x1080 59.940fps)
libEGL warning: DRI2: failed to authenticate
[vo/gpu/opengl] Suspected software renderer or indirect context.
[vo/gpu] VT_GETMODE failed: Inappropriate ioctl for device
[vo/gpu/opengl] Failed to set up VT switcher. Terminal switching will be
unavailable.
WARNING: Kernel has no file descriptor comparison support: No such file or
directory
VO: [gpu] 1920x1080 yuv420p
V: 00:00:06 / 00:02:38 (4%)

> vlc Real\ 4K\ HDR\ 60fps\ -\ LG\ Jazz\ HDR\ UHD\ \(Chromecast\ Ultra\)\
only\ video\ 1920x1080.webm
 09:56:19
VLC media player 3.0.17.4 Vetinari (revision 3.0.13-8-g41878ff4f2)
[0000000800c5c060] main libvlc: Running vlc with the default interface. Use
'cvlc' to use vlc without interface.
libGL error: failed to authenticate magic 1
libGL error: failed to load driver: iris
libEGL warning: DRI2: failed to authenticate
libGL error: failed to authenticate magic 1
libGL error: failed to load driver: iris
Failed to open VDPAU backend Shared object "libvdpau_va_gl.so" not found,
required by "vlc"
libEGL warning: DRI2: failed to authenticate
[vp9 @ 0x82022ce00] get_buffer() failed
[vp9 @ 0x82022ce00] thread_get_buffer() failed

Note: after resuming the laptop mpv works only in full screen.
--
Maurizio