Linux set vga mode

XRandR: настройка режимов работы с дисплеями (мониторами) в GNU/Linux

Дата добавления: 31 марта 2012

Возможные названия интерфейсов:

  • LVDS1 — экран ноутбука;
  • VGA1 — экран, подключаемый через VGA;
  • DVI1 — экран, подключаемый через DVI;

Названия интерфейсов могут отличаться в зависимости от используемой видеокарты. Для последующей работы с конкретным интерфейсом, необходимо запомнить его название (например, VGA1 если мы работам на видео от Intel и подключаем монитор по VGA, который и хотим настроить через XRandR).

Изменение разрешения
Лучше всего рассмотреть пример:

Режимы работы с несколькими мониторами
Отключение дисплея
Отключить не нужный в данный момент дисплей можно с помощью опции —off:

После этого у вас будет виртуальное разрешение 1280×720 при 1024×600 физическом.

Поворот
Используйте следующие опции применительно к нужному интерфейсу:

  • —rotate normal
  • —rotate left
  • —rotate right
  • —rotate inverted (поворот на 180°)

Сохранение настроек
Для активации необходимых настроек при старте, создайте файл

/ указывает на расположение в домашней директории) и внесите в него необходимые строки команд xrandr.

Статья частично основана по материалам англоязычной документации.

Автор: Alex, дата: 13 августа 2013 , время: 20:02:58 (MSK).
Добрый день. Вот что мек выдает xrandr:
«Screen 0: minimum 320 x 200, current 3280 x 1200, maximum 3120 x 3120
DFP1 disconnected (normal left inverted right x axis y axis)
DFP2 disconnected (normal left inverted right x axis y axis)
DFP3 disconnected (normal left inverted right x axis y axis)
DFP4 disconnected (normal left inverted right x axis y axis)
DFP5 disconnected (normal left inverted right x axis y axis)
DFP6 disconnected (normal left inverted right x axis y axis)
DFP7 disconnected (normal left inverted right x axis y axis)
DFP8 disconnected (normal left inverted right x axis y axis)
DFP9 connected 1680×1050+0+0 (normal left inverted right x axis y axis) 473mm x 296mm
1680×1050 60.0*+
1400×1050 60.0
1280×1024 75.0 60.0
1440×900 75.0 59.9
1280×960 60.0
1280×800 60.0
1152×864 60.0 75.0
1280×768 60.0
1280×720 60.0
1024×768 75.0 70.1 60.0
800×600 72.2 75.0 60.3 56.2
640×480 75.0 72.8 67.0 59.9
DFP10 disconnected (normal left inverted right x axis y axis)
CRT1 connected 1600×1200+1680+0 (normal left inverted right x axis y axis) 0mm x 0mm
1600×1200 60.0*+
1400×1050 60.0
1600×900 60.0
1280×1024 60.0
1440×900 59.9
1280×960 60.0
1366×768 59.8
1360×768 60.0
1280×800 59.8
1152×864 60.0
1280×768 59.9
1280×720 60.0
1024×768 60.0
800×600 60.3
720×480 60.0
640×480 59.9″

что и как мне надо изменить, чтобы CRT1 работал в резолюции 1920х1080. В данный момент 1600 — это максимальная резолюция.

/.xprofile должен быть исполняемым. В англоязычной версии это описано. Я, как новичок, этого не сделал. И, как следствие, при запуске системы разрешение не устанавливается на нужное автоматически. А таких новичков много в сети.

/.xprofile (можно использовать редактор nano).

Автор: Margo, дата: 05 января 2016 , время: 20:54:07 (MSK).
Спасибо за быстрый ответ,
в консоль перешла, но у меня такого файла нет.
Где еще оно может быть закопано?

Сходила логическим путем: если у вас «Отключить не нужный в данный момент дисплей можно с помощью опции —off:
xrandr —output LVDS1 —off»
— то включить решила с помощью «всё то же самое —on». Ан нет, размечталась, не так просто.

xrandr вообще отвечает Can’t open display.

А вот как xrandr выглядит в другой системе (зашла со спас.диска):

$ xrandr
Screen 0: minimum 320 x 200, current 1024 x 768, maximum 4096 x 4096
VGA-1 connected 1024×768+0+0 (normal left inverted right x axis y axis) 350mm x 260mm
1600×1200 60.0 60.0
1280×1024 75.0 59.9
1024×768 85.0 75.1 60.0*
800×600 100.0 85.1 75.0 60.3
640×480 85.0 60.0
720×400 70.1
DVI-I-1 disconnected (normal left inverted right x axis y axis)
TV-1 connected 1024×768+0+0 (normal left inverted right x axis y axis) 0mm x 0mm
720×576 50.0 +
1024×768 50.0*
800×600 50.0
720×480 50.0
640×480 50.0
400×300 100.0
320×240 100.0
320×200 100.0

Читайте также:  Unzip tar gz windows

Я так понимаю, VGA-1 это и есть тот монитор, который я убила в своей основной системе? черт побери, один случайный клик мышкой. 🙁

/.xprofile с командой xrandr —output VGA-1 —mode 1600×1200 и перезагрузить.

Автор: Margo, дата: 06 января 2016 , время: 03:14:50 (MSK).
Вроде выкрутилась.

Первый способ:
в начале загрузки выбрать recovery mode,
в recovery mode выбрать resume normal boot,
выйдет предупреждение, что это типа Safe mode и не все графические драйверы могут работать,
кликнула ОК, загрузка продолжилась, пришла куда хотела, всё работает как всегда.
Правда, при перезагрузке та же засада, монитор отключается, т.е. recovery mode теперь пожизненно, если не переписать config файл (но КАКОЙ именно. ).
Ну и ладно, всё равно новую ставить пора, сейчас у меня Минт14 Надя, если кому интересно.

Второй способ:
дождаться конца загрузки, перейти в терминал Ctrl+Alt+F2 (у меня F1 тоже годится, да и остальные, наверно, просто не проверяла),
залогиниться, зайти под рутом, скомандовать startx
(если не под рутом, то монитор опять выключится),
далее имею первозданное окно Линукс Минт как только что с диска, т.е. без моих гламурных настроек и почему-то. без мозиллы! Все остальное, установленное за последний год, на месте (включая игры), и всё работает штатно. Исчезла только мозилла, а она-то самое главное, сотни закладок и паролей. Не исключаю, впрочем, что получила бы свою мозиллу со всеми закладками, если б попробовала ее заново установить через синаптик или Оперу — через recovery mode она же загружается! значит, она где-то тут — просто уже не было времени на эксперименты.

Теперь спокойненько, с кофе и булочкой, бэкапнула закладки и попробую создать файл по вашему совету. 🙂
Спасибо, что поддержали!

$ xrandr
Screen 0: minimum 8 x 8, current 1024 x 768, maximum 32767 x 32767
DP1 disconnected (normal left inverted right x axis y axis)
HDMI1 disconnected (normal left inverted right x axis y axis)
VGA1 disconnected (normal left inverted right x axis y axis)
VIRTUAL1 disconnected (normal left inverted right x axis y axis)
user@ubuntu:

$ xrandr -s 1600×900
Size 1600×900 not found in available modes
user@ubuntu:

Источник

Video Mode Selection Support 2.13В¶

IntroВ¶

This small document describes the “Video Mode Selection” feature which allows the use of various special video modes supported by the video BIOS. Due to usage of the BIOS, the selection is limited to boot time (before the kernel decompression starts) and works only on 80X86 machines that are booted through BIOS firmware (as opposed to through UEFI, kexec, etc.).

Short intro for the impatient: Just use vga=ask for the first time, enter scan on the video mode prompt, pick the mode you want to use, remember its mode ID (the four-digit hexadecimal number) and then set the vga parameter to this number (converted to decimal first).

The video mode to be used is selected by a kernel parameter which can be specified in the kernel Makefile (the SVGA_MODE=… line) or by the “vga=…” option of LILO (or some other boot loader you use) or by the “xrandr” utility (present in standard Linux utility packages). You can use the following values of this parameter:

The ASK_VGA mode causes the kernel to offer a video mode menu upon bootup. It displays a “Press to see video modes available, to continue or wait 30 secs” message. If you press , you enter the menu, if you press or wait 30 seconds, the kernel will boot up in the standard 80×25 mode.

The menu looks like:

tells what video adapter did Linux detect – it’s either a generic adapter name (MDA, CGA, HGC, EGA, VGA, VESA VGA [a VGA with VESA-compliant BIOS]) or a chipset name (e.g., Trident). Direct detection of chipsets is turned off by default as it’s inherently unreliable due to absolutely insane PC design.

Читайте также:  Huawei e3531 drivers windows 10

“0 0F00 80×25” means that the first menu item (the menu items are numbered from “0” to “9” and from “a” to “z”) is a 80×25 mode with (see the next section for a description of mode IDs).

encourages you to enter the item number or mode ID you wish to set and press . If the computer complains something about “Unknown mode ID”, it is trying to tell you that it isn’t possible to set such a mode. It’s also possible to press only which leaves the current mode.

The mode list usually contains a few basic modes and some VESA modes. In case your chipset has been detected, some chipset-specific modes are shown as well (some of these might be missing or unusable on your machine as different BIOSes are often shipped with the same card and the mode numbers depend purely on the VGA BIOS).

The modes displayed on the menu are partially sorted: The list starts with the standard modes (80×25 and 80×50) followed by “special” modes (80×28 and 80×43), local modes (if the local modes feature is enabled), VESA modes and finally SVGA modes for the auto-detected adapter.

If you are not happy with the mode list offered (e.g., if you think your card is able to do more), you can enter “scan” instead of item number / mode ID. The program will try to ask the BIOS for all possible video mode numbers and test what happens then. The screen will be probably flashing wildly for some time and strange noises will be heard from inside the monitor and so on and then, really all consistent video modes supported by your BIOS will appear (plus maybe some ghost modes ). If you are afraid this could damage your monitor, don’t use this function.

After scanning, the mode ordering is a bit different: the auto-detected SVGA modes are not listed at all and the modes revealed by scan are shown before all VESA modes.

Mode IDsВ¶

Because of the complexity of all the video stuff, the video mode IDs used here are also a bit complex. A video mode ID is a 16-bit number usually expressed in a hexadecimal notation (starting with “0x”). You can set a mode by entering its mode directly if you know it even if it isn’t shown on the menu.

The ID numbers can be divided to those regions:

If you add 0x8000 to the mode ID, the program will try to recalculate vertical display timing according to mode parameters, which can be used to eliminate some annoying bugs of certain VGA BIOSes (usually those used for cards with S3 chipsets and old Cirrus Logic BIOSes) – mainly extra lines at the end of the display.

OptionsВ¶

Build options for arch/x86/boot/* are selected by the kernel kconfig utility and the kernel .config file.

VIDEO_GFX_HACK — includes special hack for setting of graphics modes to be used later by special drivers. Allows to set _any_ BIOS mode including graphic ones and forcing specific text screen resolution instead of peeking it from BIOS variables. Don’t use unless you think you know what you’re doing. To activate this setup, use mode number 0x0f08 (see the Mode IDs section above).

Still doesn’t work?¶

When the mode detection doesn’t work (e.g., the mode list is incorrect or the machine hangs instead of displaying the menu), try to switch off some of the configuration options listed under “Options”. If it fails, you can still use your kernel with the video mode set directly via the kernel parameter.

Читайте также:  Залипает панель задач windows 10

In either case, please send me a bug report containing what _exactly_ happens and how do the configuration switches affect the behaviour of the bug.

If you start Linux from M$-DOS, you might also use some DOS tools for video mode setting. In this case, you must specify the 0x0f04 mode (“leave current settings”) to Linux, because if you don’t and you use any non-standard mode, Linux will switch to 80×25 automatically.

If you set some extended mode and there’s one or more extra lines on the bottom of the display containing already scrolled-out text, your VGA BIOS contains the most common video BIOS bug called “incorrect vertical display end setting”. Adding 0x8000 to the mode ID might fix the problem. Unfortunately, this must be done manually – no autodetection mechanisms are available.

HistoryВ¶

First version supporting all adapters supported by the old setup.S + Cirrus Logic 54XX. Present in some 1.3.4? kernels and then removed due to instability on some machines.

Rewritten from scratch. Cirrus Logic 64XX support added, almost everything is configurable, the VESA support should be much more stable, explicit mode numbering allowed, “scan” implemented etc.

VESA modes moved to 0x200-0x3ff. Mode selection by resolution supported. Few bugs fixed. VESA modes are listed prior to modes supplied by SVGA autodetection as they are more reliable. CLGD autodetect works better. Doesn’t depend on 80×25 being active when started. Scanning fixed. 80×43 (any VGA) added. Code cleaned up.

EGA 80×43 fixed. VESA extended to 0x200-0x4ff (non-standard 02XX VESA modes work now). Display end bug workaround supported. Special modes renumbered to allow adding of the “recalculate” flag, 0xffff and 0xfffe became aliases instead of real IDs. Screen contents retained during mode changes.

Changed to work with 1.3.74 kernel.

Added patches by Hans Lermen fixing a memory overwrite problem with some boot loaders. Memory management rewritten to reflect these changes. Unfortunately, screen contents retaining works only with some loaders now. Added a Tseng 132×60 mode.

Fixed a VESA mode scanning bug introduced in 2.4.

Some VESA BIOS errors not reported – it fixes error reports on several cards with broken VESA code (e.g., ATI VGA).

Accepted all VESA modes in range 0x100 to 0x7ff, because some cards use very strange mode numbers.

Added Realtek VGA modes (thanks to Gonzalo Tornaria).

Hardware testing order slightly changed, tests based on ROM contents done as first.

Added support for special Video7 mode switching functions (thanks to Tom Vander Aa).

Added 480-scanline modes (especially useful for notebooks, original version written by hhanemaa @ cs . ruu . nl, patched by Jeff Chua, rewritten by me).

Screen store/restore fixed.

Previous release was not compilable without CONFIG_VIDEO_SVGA.

Better recognition of text modes during mode scan.

Ignored VESA modes 0x80 — 0xff (more VESA BIOS bugs!)

The whole thing made optional.

Added the CONFIG_VIDEO_400_HACK switch.

Added the CONFIG_VIDEO_GFX_HACK switch.

Yet another cleanup, now including also the documentation.

Direct testing of SVGA adapters turned off by default, scan offered explicitly on the prompt line.

Removed the doc section describing adding of new probing functions as I try to get rid of _all_ hardware probing here.

Added support for VESA frame buffer graphics.

Minor documentation fixes.

© Copyright The kernel development community.

Источник

Оцените статью