![显示器不会保持关闭状态](https://linux22.com/image/226797/%E6%98%BE%E7%A4%BA%E5%99%A8%E4%B8%8D%E4%BC%9A%E4%BF%9D%E6%8C%81%E5%85%B3%E9%97%AD%E7%8A%B6%E6%80%81.png)
我有一台既作为服务器运行又作为工作站运行的计算机,这意味着它不应该休眠,但也应启用图形桌面。
为了实现这一点,我在中设置了以下值/etc/gdm3/greeter.dconf-defaults
sleep-inactive-ac-timeout=5
# - What to do after sleep-inactive-ac-timeout
# 'blank', 'suspend', 'shutdown', 'hibernate', 'interactive' or 'nothing'
sleep-inactive-ac-type='blank'
我还shutdown:sleep:idle:handle-power-key:handle-suspend-key:handle-hibernate-key:handle-lid-switch
使用 systemd 添加了抑制剂。
这似乎几乎可以工作,但问题是计算机的屏幕保持打开状态,并且没有进入省电模式。省电激活后,立即再次打开。请看下面的视频:
https://i.imgur.com/LvuI26V.gifv
为了调试这种情况,还禁用了 wayland /etc/gdm3/daemon.conf
,然后运行
sleep 3; xset dpms force off
具有相同的行为。
如何解决显示器不关闭的问题?
显示驱动程序是
$ lspci -k | grep -EA3 'VGA|3D|Display'
00:02.0 VGA compatible controller: Intel Corporation AlderLake-S GT1 (rev 0c)
DeviceName: Onboard IGD
Subsystem: ASUSTeK Computer Inc. AlderLake-S GT1
Kernel driver in use: i915
对于i915
内核驱动程序,我有:
$ sudo modinfo -p i915
modeset:Use kernel modesetting [KMS] (0=disable, 1=on, -1=force vga console preference [default]) (int)
enable_dc:Enable power-saving display C-states. (-1=auto [default]; 0=disable; 1=up to DC5; 2=up to DC6; 3=up to DC5 with DC3CO; 4=up to DC6 with DC3CO) (int)
enable_fbc:Enable frame buffer compression for power savings (default: -1 (use per-chip default)) (int)
lvds_channel_mode:Specify LVDS channel mode (0=probe BIOS [default], 1=single-channel, 2=dual-channel) (int)
panel_use_ssc:Use Spread Spectrum Clock with panels [LVDS/eDP] (default: auto from VBT) (int)
vbt_sdvo_panel_type:Override/Ignore selection of SDVO panel mode in the VBT (-2=ignore, -1=auto [default], index in VBT BIOS table) (int)
reset:Attempt GPU resets (0=disabled, 1=full gpu reset, 2=engine reset [default]) (uint)
vbt_firmware:Load VBT from specified file under /lib/firmware (charp)
error_capture:Record the GPU state following a hang. This information in /sys/class/drm/card<N>/error is vital for triaging and debugging hangs. (bool)
enable_hangcheck:Periodically check GPU activity for detecting hangs. WARNING: Disabling this can cause system wide hangs. (default: true) (bool)
enable_psr:Enable PSR (0=disabled, 1=enable up to PSR1, 2=enable up to PSR2) Default: -1 (use per-chip default) (int)
psr_safest_params:Replace PSR VBT parameters by the safest and not optimal ones. This is helpful to detect if PSR issues are related to bad values set in VBT. (0=use VBT parameters, 1=use safest parameters) (bool)
enable_psr2_sel_fetch:Enable PSR2 selective fetch (0=disabled, 1=enabled) Default: 0 (bool)
force_probe:Force probe options for specified supported devices. See CONFIG_DRM_I915_FORCE_PROBE for details. (charp)
disable_power_well:Disable display power wells when possible (-1=auto [default], 0=power wells always on, 1=power wells disabled when possible) (int)
enable_ips:Enable IPS (default: true) (int)
fastboot:Try to skip unnecessary mode sets at boot time (0=disabled, 1=enabled) Default: -1 (use per-chip default) (int)
load_detect_test:Force-enable the VGA load detect code for testing (default:false). For developers only. (bool)
force_reset_modeset_test:Force a modeset during gpu reset for testing (default:false). For developers only. (bool)
invert_brightness:Invert backlight brightness (-1 force normal, 0 machine defaults, 1 force inversion), please report PCI device ID, subsystem vendor and subsystem device ID to [email protected], if your machine needs it. It will then be included in an upcoming module version. (int)
disable_display:Disable display (default: false) (bool)
memtest:Perform a read/write test of all device memory on module load (default: off) (bool)
mmio_debug:Enable the MMIO debug code for the first N failures (default: off). This may negatively affect performance. (int)
verbose_state_checks:Enable verbose logs (ie. WARN_ON()) in case of unexpected hw state conditions. (bool)
nuclear_pageflip:Force enable atomic functionality on platforms that don't have full support yet. (bool)
edp_vswing:Ignore/Override vswing pre-emph table selection from VBT (0=use value from vbt [default], 1=low power swing(200mV),2=default swing(400mV)) (int)
enable_guc:Enable GuC load for GuC submission and/or HuC load. Required functionality can be selected using bitmask values. (-1=auto [default], 0=disable, 1=GuC submission, 2=HuC load) (int)
guc_log_level:GuC firmware logging level. Requires GuC to be loaded. (-1=auto [default], 0=disable, 1..4=enable with verbosity min..max) (int)
guc_firmware_path:GuC firmware path to use instead of the default one (charp)
huc_firmware_path:HuC firmware path to use instead of the default one (charp)
dmc_firmware_path:DMC firmware path to use instead of the default one (charp)
enable_dp_mst:Enable multi-stream transport (MST) for new DisplayPort sinks. (default: true) (bool)
enable_dpcd_backlight:Enable support for DPCD backlight control(-1=use per-VBT LFP backlight type setting [default], 0=disabled, 1=enable, 2=force VESA interface, 3=force Intel interface) (int)
enable_gvt:Enable support for Intel GVT-g graphics virtualization host support(default:false) (bool)
request_timeout_ms:Default request/fence/batch buffer expiration timeout. (uint)
lmem_size:Set the lmem size(in MiB) for each region. (default: 0, all memory) (uint)
lmem_bar_size:Set the lmem bar size(in MiB). (uint)
mitigations:Selectively enable security mitigations for all Intel® GPUs in the system.
auto -- enables all mitigations required for the platform [default]
off -- disables all mitigations
Individual mitigations can be enabled by passing a comma-separated string,
e.g. mitigations=residuals to enable only clearing residuals or
mitigations=auto,noresiduals to disable only the clear residual mitigation.
Either '!' or 'no' may be used to switch from enabling the mitigation to
disabling it.
Active mitigations for Ivybridge, Baytrail, Haswell:
residuals -- clear all thread-local registers between contexts
答案1
事实证明,问题的解决方案是显示器本身,与操作系统或驱动程序无关:
由于显示器有两个 HDMI 输入端口,当进入省电模式时,会触发扫描,然后再次打开。
当我仅手动选择 HDMI-1 端口并禁用自动扫描时,显示器开始正常进入省电模式。
不确定这是否是特定监视器中的错误或堆栈中其他位置的错误,但此解决方案目前似乎有效。
答案2
我必须调整显示器本身的设置,例如按下显示器上的按钮,直到进入“选择输出”并将其从“自动”更改为“HDMI 1”,保存并退出。解决了 Wayland 未关闭显示器的问题,因为显示器进入自动扫描模式,从而触发了唤醒。