You are not logged in.

#1 2011-05-11 05:24:09

vadmium
Member
Registered: 2010-11-02
Posts: 63

Changing virtual console video mode timings

I’ve been trying to figure out how to tweak the video timing for virtual consoles (Ctrl-Alt-F1 to F6). I’m pretty sure KMS (kernel mode-setting) is running; the VCs are at 1280 × 1024 resolution and the Nouveau kernel module is running.

My motivation is that I have an LCD where the default timings (that apparently come from EDID information from the monitor itself!) aren’t handled perfectly by the monitor. In X, I am reducing the “front porch” by 8 dots using xrandr and this gives a correct image, at least while I am using X:

O=DVI-I-1
# Horiz. values from EDID: 1280 1328 1440 1688
xrandr --newmode metho 108 1280 1320 1432 1680 1024 1025 1028 1066
xrandr --addmode "$O" metho
xrandr --output "$O" --mode metho

I am looking for a way to do the equivalent to the other virtual text consoles. I’ve read about a video kernel parameter for setting the resolution, but I haven’t tried it because I haven’t seen any indication you can set the timing with it. I have tried playing with the “fbset” command which mentions some timing settings, but they don’t seem to have any effect.

I’ve also tried making a simple C program to call some libdrm routines like below, but I’m really just stabbing in the dark. This program kind of did what I wanted, but when I switch to another virtual console, the video mode is reverted; even when I switch back to the original console my changes remain undone until I rerun my program.

#include <xf86drmMode.h>
/* . . . */
drmModeCrtcPtr crtc = drmModeGetCrtc(drm, crtc_id);
drmModeModeInfo mode = crtc->mode;
mode.hsync_start -= 8;
mode.hsync_end -= 8;
mode.htotal -= 8;
int ret = drmModeSetCrtc(drm, crtc->crtc_id, crtc->buffer_id,
    crtc->x, crtc->y, &conn_id, 1, &mode);
drmModeFreeCrtc(crtc);

I fear I am stepping into rather specialised territory, but any clues might be helpful. Even a way to hack or fake the EDID information might make me happy.

Offline

Board footer

Powered by FluxBB