Wayland如何设置自定义分辨率
旧标题 – “使用xrandr将分辨率更改为1280×1024给出:X请求失败的错误:BadValue(整数参数超出操作范围)”
我已经安装了一个新的Ubuntu 17.10并且有一个5:4分辨率的显示器。 设置的分辨率不高于1024×768。 但我需要1280×1024(5:4)的分辨率。 我使用默认的主板显卡:
# lspci|grep VGA 00:02.0 VGA compatible controller: Intel Corporation 4 Series Chipset Integrated Graphics Controller (rev 03)
xrandr还提供以下内容:
$ xrandr Screen 0: minimum 320 x 200, current 1024 x 768, maximum 8192 x 8192 XWAYLAND0 connected 1024x768+0+0 (normal left inverted right x axis y axis) 0mm x 0mm 1024x768 59.92*+
我尝试使用xrandr添加1280×1024分辨率。 所以首先使用gtf创建分辨率信息:
$ gtf 1280 1024 60 # 1280x1024 @ 60.00 Hz (GTF) hsync: 63.60 kHz; pclk: 108.88 MHz Modeline "1280x1024_60.00" 108.88 1280 1360 1496 1712 1024 1025 1028 1060 -HSync +Vsync
然后添加到决议:
xrandr --newmode "1280x1024_60.00" 108.88 1280 1360 1496 1712 1024 1025 1028 1060 -HSync +Vsync
然后再次执行命令: xrandr --addmode XWAYLAND0 1280x1024_60.00
然后没有改变。 当我尝试使用xrandr --output XWAYLAND0 --mode 1280x1024_60.00 --rate 60
更改它时xrandr --output XWAYLAND0 --mode 1280x1024_60.00 --rate 60
但是发生了错误:
$ xrandr --output XWAYLAND0 --mode 1280x1024 --rate 60 X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 7 (RRSetScreenSize) Value in failed request: 0x0 Serial number of failed request: 21 Current serial number in output stream: 22
我不知道我做错了什么。 或者如何将分辨率更改为正确的分辨率:1280×1024
您可以尝试使用wayland设置自定义分辨率,但需要付出一些努力和混合结果。
您应该首先提交一份错误报告,包括您的图形卡和显示器,以及Wayland
如何报告错误?
https://help.ubuntu.com/community/ReportingBugs
添加自定义分辨率
xrandr
不会与Wayland合作!
您可以尝试使用类似于xrandr的modline添加自定义分辨率,但需要执行一些额外步骤。
首先,我不确定这是否适用于安全启动,因此我建议您从禁用安全启动开始
来自https://ask.fedoraproject.org/en/question/99867/how-to-add-a-custom-resolution-to-weyland-fedora-25/和https://wiki.archlinux.org/index。 PHP / Kernel_mode_setting#Forcing_modes_and_EDID
首先,您需要克隆edid-generator 。 然后你可以传递你的模式线(使用你给xrandr --newmode
相同的参数xrandr --newmode
来自https://github.com/akatrevorjay/edid-generator
安装要求
sudo apt install zsh edid-decode automake dos2unix
下载并解压缩
wget https://github.com/akatrevorjay/edid-generator/archive/master.zip unzip master.zip cd edid-generator-master
二进制文件在〜/ edid-generator-master中作为modeline2edid
使用你的modline运行modeline2edid
,使用askfedora链接中的示例,
./modeline2edid - <<< 'Modeline "3840x2160" 533.6 3840 3982 4027 4064 2160 2170 2180 2190 +hsync +vsync' Searching for runaway unicorns in '/dev/stdin' -- Found naughty unicorn: Modeline "3840x2160" 533.6 3840 3982 4027 4064 2160 2170 2180 2190 +hsync +vsync Wrote 3840x2160.S
将该命令修改为所需的分辨率。
请参阅如何设置自定义分辨率? 详情(如果需要)
然后使用make生成edid二进制文件
make #output not posted
在这种情况下,您现在将拥有新的.bin, 3840x2160.bin
。
现在,来自The Arch wiki的定制resoulution
sudo mkdir /usr/lib/firmware/edid sudo cp 3840x2160.bin /usr/lib/firmware/edid
将3840x2160.bin
更改为您的自定义分辨率。
注意:已经包含了一些自定义.bin,你可以用ls *.bin
看到它们我不确定你是否可以不使用make而使用它们。
通过重新启动进行测试
重新启动时,在grub中编辑内核行,添加
drm_kms_helper.edid_firmware=edid/3840x2160.bin
请参阅如何添加内核引导参数? 和https://wiki.ubuntu.com/Kernel/KernelBootParameters
下到以linux
开头的行,并在ro quiet splash
后添加drm_kms_helper.edid_firmware=edid/3840x2160.bin
假设一切正常,请将其永久化
sudo nano /etc/default/grub
添加自定义resolutoin
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash drm_kms_helper.edid_firmware=edid/3840x2160.bin"
保存编辑Ctrl + x
更新grub
sudo update-grub
重新启动并享受您的自定义分辨率