Set "horizontal frequency" for VGA output

I have T20 + Iris 2.0 (very old product but still alive)

I have to change “horizontal frequency” for VGA (DVI output on Iris)

My kernel is very OLD git://git.toradex.com/linux-toradex.git

commit f195d3bc9cfb38159f8a3a299222396e0005aa91
Author: Wojciech Bieganski wbieganski@antmicro.com
Date: Thu Mar 6 12:32:34 2014 +0100

solved low framerate issue with analog cameras

trying to understand how it works

  • In u-boot I have environment variable vidargs video=tegrafb0:800x480-32@60
  • but don’t have any resolution and video settings in board-colibri_t20-panel.c

In very very old kernel I have

static struct tegra_dc_mode colibri_t20_panel_modes[] = {
#ifdef TEGRA_FB_VGA
	{

		/* 800x480@60 (e.g. EDT ET070080DH6) */
		.pclk		= 32460000,
		.h_ref_to_sync	= 1,
		.v_ref_to_sync	= 1,
		.h_sync_width	= 64,
		.v_sync_width	= 3,
		.h_back_porch	= 128,
		.v_back_porch	= 22,
		.h_active	= 800,
		.v_active	= 480,
		.h_front_porch	= 64,
		.v_front_porch	= 20,

why did these settings disappear in the new kernel version?

How to set “horizontal frequency” for VGA output ?

Hi, I’m the Toradex AI Assistant. I’m in early beta, and I would appreciate your feedback.
The Toradex Support team will follow up with you shortly!

Did you like my answer?

:+1: :-1:


To adjust the “horizontal frequency” for VGA output on your T20 module with the Iris 2.0 carrier board, you’ll need to understand how the display timings work and how they are defined in the Linux kernel for your device. The “horizontal frequency” is determined by the horizontal timing parameters, including the horizontal sync width, back porch, front porch, and the resolution’s width. These parameters collectively define the time it takes to display one line, hence affecting the horizontal frequency.

Given the context of your very old kernel version and the snippet provided, it seems you are looking at the right place in the kernel source code for adjusting the display timings. The disappearance of these settings in newer kernel versions could be due to a restructuring or an update in the display driver architecture, aiming for a more dynamic or configurable approach, possibly moving towards using device tree overlays or a different method for specifying display settings.

To set or adjust the “horizontal frequency” for VGA output, you would modify the horizontal timing parameters (h_sync_width, h_back_porch, h_front_porch, and h_active) in the colibri_t20_panel_modes[] array within the board-colibri_t20-panel.c file. The calculation for the horizontal frequency (in kHz) can be approximated by:

[ Horizontal\ Frequency = \frac{Pixel\ Clock}{Total\ Horizontal\ Pixels} ]

Where:

  • Pixel Clock is the pclk value in Hz.
  • Total Horizontal Pixels is the sum of h_active + h_front_porch + h_sync_width + h_back_porch.

After adjusting these values to achieve the desired horizontal frequency, you would need to recompile the kernel and deploy it to your device. Ensure that the vidargs environment variable in U-Boot matches the resolution and color depth you’ve configured.

Keep in mind that changing display timings can affect the compatibility and stability of the display output. It’s crucial to ensure that the timings are supported by both the display and the Tegra 2 SoC on your T20 module. If you’re not seeing the expected changes, double-check the kernel configuration and make sure the display driver is using the modified panel configuration.

Remember, altering kernel source code requires a good understanding of the Linux kernel, display technologies, and the specific hardware you’re working with. Testing any changes thoroughly before deploying them in a production environment is essential.

Best regards,
Toradex AI Assistant

Please, also check if these links can help you solve your problem:

Display Output, Resolution and Timings (Linux) | Toradex Developer Center.

@ToradexAI Thank you for your answer, can you provide a method to read current the VGA timing parameters from Linux console ? Is it possible to read these parameters from some file /dev/* /proc/* ?

Hello @MariusM,

I don’t have a specific background on the underlying changes, but I believe that it could be because the way this was configured has changed in newer kernels.


You can do this using the fbset command:

root@colibri-t20:~# fbset

mode "800x480-59"
    # D: 32.460 MHz, H: 30.739 kHz, V: 58.550 Hz
    geometry 800 480 800 960 16
    timings 30807 128 64 22 20 64 3
    hsync high
    vsync high
    rgba 5/11,6/5,5/0,0/0
endmode

I would like to understand what you are trying to achieve by setting a specific “horizontal frequency”. Do you have an issue with your display or do you need to adjust the refresh rate of the display?

Also, which version of the Toradex BSP is your image based on?

Best Regards,
Bruno

@bruno.tx Thank you for your answer !

My VGA display supplier has changed something in its design and the image is flashing(problem with synchronization).
The manufacturer doesn’t want to fix it.
I wanted to change the parameters slightly and maybe it will save the order.

fbset after boot

mode "800x480-59"
    # D: 32.460 MHz, H: 30.739 kHz, V: 58.550 Hz
    geometry 800 480 800 960 32
    timings 30807 128 64 22 20 64 3
    hsync high
    vsync high
    rgba 8/0,8/8,8/16,8/24
endmode

I’m experimenting with the command
fbset --geometry 800 480 800 960 32 –timings 30807 128 64 22 20 64 3
I change the parameters and observe the image
Unfortunately, I was unable to stabilize the image

Hello @MariusM,

If the whole screen is flashing, maybe the issue is actually with the vertical synchronization.

Is the new screen functional using another video source such as a PC?
If so, it may be a good idea to check what resolution and timings are auto-negotiated with the PC via DDC and try to replicate those on the T20 module.

Best Regards,
Bruno