-   antiX / MX Linux (
-   -   How to make openchrome driver work with Antix-19 (

hazel 11-22-2019 10:32 AM

How to make openchrome driver work with Antix-19
I have a laptop with Via electronics and a Via Chrome graphics chip. It used the openchrome driver in AntiX-17 and -18 without problems. When installing AntiX-19, I had to use safe mode to get the installation medium to boot to a graphical screen. During the installation, I noticed some ghost images on the screen. The installed version has ghosts too, a lot of them, especially when the cpu is busy. It uses the vesa driver, which seems not to work very well on this video chip.

I have tried to configure it for openchrome without success. The openchrome driver loads but can't open the framebuffer.

[    68.651] (--) CHROME(0): Mapping the frame buffer at address 0xF0000000 with size 131072 KB.
[    68.651] (EE) CHROME(0): Unable to map the frame buffer.
Error: Invalid argument (22)
[    68.651] (II) CHROME(0): Exiting viaMapMMIO.
[    68.651] (II) CHROME(0): VIAFreeRec
[    68.651] (II) CHROME(0): VIAFreeScreen
[    68.651] (II) CHROME(0): VIAFreeRec
[    68.651] (II) UnloadModule: "openchrome"

I then tried the modesetting driver, but got a different error:

[  885.581] (II) modesetting: Driver for Modesetting Kernel Drivers: kms
[  885.581] (II) VESA: driver for VESA chipsets: vesa
[  885.581] (EE) open /dev/dri/card0: No such file or directory
[  885.581] (WW) Falling back to old probe method for modesetting
[  885.581] (EE) open /dev/dri/card0: No such file or directory
[  885.581] (EE) Screen 0 deleted because of no matching config section.
[  885.581] (II) UnloadModule: "modesetting"

What configuration options do I need to use to get one of these to work? Having to use vesa is very tiring for my eyes.

mrmazda 11-22-2019 04:35 PM

I have a vague recollection either iomem=relaxed or one of the iommu parameters is needed for openchrome to work in recent kernels. I suspect openchrome is not in the modesetting DDX support list.

hazel 11-23-2019 06:52 AM

"iomem=relaxed" rings a bell. I think now that this must have happened before, although I had no memory of it before reading your post. I'll try it anyway. Thanks.

hazel 11-23-2019 11:03 AM

You'll laugh! Adding iomem=relaxed makes the vesa driver work almost perfectly. No more tearing and no ghost cursors. Nice sharp background too. The only thing wrong with it is the aspect ratio. According to xrandr, it's using 1280x768. 768 is the height of a standard monitor and I need something lower.

I have edited the option into /etc/grub/defaults and updated grub, so it should boot like that from now on. I have also put an openchrome file into /etc/X11/xorg.conf.d to see if that works now and if it solves the aspect ratio problem.

Thank you very much.

mrmazda 11-23-2019 11:39 AM

What else does xrandr report?

inxi -GxxS

hazel 11-23-2019 11:56 AM

Using openchrome solves the aspect ratio problem

$ xrandr
Screen 0: minimum 320 x 200, current 1280 x 800, maximum 2044 x 2048
VGA-1 disconnected primary (normal left inverted right x axis y axis)
FP-1 connected 1280x800+0+0 (normal left inverted right x axis y axis) 0mm x 0mm
  1280x800      59.81*+
$ inxi -GxxS
  Host: littleboy Kernel: 4.9.193-antix.1-amd64-smp x86_64 bits: 64
  compiler: gcc v: 8.3.0 Desktop: IceWM 1.5.5+git20190610 dm: SLiM
  Distro: antiX-19_x64-base Marielle Franco 16 October 2019
  base: Debian GNU/Linux 10 (buster)
  Device-1: VIA VX800/VX820 Chrome 9 HC3 Integrated Graphics
  vendor: Samsung Co driver: N/A bus ID: 00:01.0 chip ID: 1106:1122
  Display: x11 server: X.Org 1.20.4 driver: openchrome unloaded: vesa
  resolution: 1280x800~60Hz
  OpenGL: renderer: llvmpipe (LLVM 7.0 128 bits) v: 3.3 Mesa 18.3.6
  compat-v: 3.1 direct render: Yes

mrmazda 11-23-2019 04:19 PM

I was expecting the cmdline option to cause automagic to pick up the propriety of the openchrome driver over fbdev or vesa. What did you have to put in /xorg.conf.d/? With this thread as a search result, the seeker probably would like to know. Was iomem=relaxed what you stuck with? What did you change in /etc/default/grub?

hazel 11-24-2019 03:52 AM

Vesa is the driver named in xorg.conf. I didn't want to edit that file because I'm a bit nervous about video configuration, so I just put a little file for openchrome into xorg.conf.d. I can't remember exactly what I put into it but it was something like

Section "Device"
  Identifier "Videocard0"
  Driver    "Openchrome"
  VendorName "Via"

It looks from the Xorg log as if openchrome loads first, then unloads and gives way to vesa. But I don't much care about that as long as everything works. It seems that having openchrome load first solves the aspect ratio problem. You can see that Xrandr now shows 1280x800 compared with 1280x768 for vesa only, and my panel now appears properly at the bottom of the screen without needing to scroll down.

Was iomem=relaxed what you stuck with? What did you change in /etc/default/grub?
Yes, iomem=relaxed was all that was necessary. I just added it to the command line options in /etc/default/grub and then updated grub.

mrmazda 11-24-2019 05:44 AM

I think you are misinterpreting the loading & unloading you see in the log. Try grep -i load /var/log/Xorg.0.log and you should see it tries loading the highest competence drivers before the lower, then unloads in reverse order all but the one selected for use. In yours that means first to load, and thus be utilized, is openchrome, as confirmed by inxi.

anticapitalista 11-25-2019 08:57 AM

@hazel - I'd like to put the fix in our tipsntriks section over at antiX forums.
Could you outline the steps you followed to fix it (again), please - thanks

hazel 11-25-2019 09:57 AM

Some old video drivers do not work easily with modern kernels. The openchrome driver, used for Via Chrome graphics is one that does not. The problem is the kernel flag CONFIG_IO_STRICT_DEVMEM which, for security reasons, prevents userspace programs from accessing hardware registers. This prevents these drivers from mapping the framebuffer unless special steps are taken.
The installation disc may fail to start X unless a safe mode boot is selected. In the installed system, the vesa driver is used instead of the chip-specific driver, but it gives very poor results with tearing and ghost cursors, especially when there is a load on the cpu.
1. Use the kernel command line parameter "iomem=relaxed". This allows proper framebuffer mapping. For a one-off boot in this mode, simply press "e" when you see the GRUB menu, to enter edit mode. Scroll down to the kernel command line and add the required parameter.

2. To make the change permanent, you need to edit (as root) the /etc/default/grub file. There is a line in the file for the kernel command line. Simply add the "iomem=relaxed" parameter to this line. Then run update-grub. Every subsequent update of GRUB will include the new parameter.

3. This change alone makes the vesa driver work much better. The image is sharper, there is no tearing and no ghosts. However there may still be problems with the video mode, causing a mismatch between the picture size and the screen. This disappears when you use the card-specific driver. But because this driver was not in use during installation, you must either edit it into /etc/X11/xorg.conf in place of the vesa driver or add an extra configuration file in /etc/X11/xorg.conf.d, for example:

Section "Device"
  Identifier "Videocard0"
  Driver    "Openchrome"
  VendorName "Via"

anticapitalista 11-25-2019 10:16 AM

Thanks hazel :

All times are GMT -5. The time now is 11:00 PM.