IceWalkers.com - Linux Software downloads and news
Name : Password :
Linux SoftwareLinux RPMLinux HowtosLink UsAboutAdvertise

Framebuffer HOWTO

Search Howtos :Match :
Next Previous Contents

18. How do I convert XFree86 mode-lines into framebuffer device timings?

If you have XFree86 (X11) installed on your machine, and you can use it successfully, it is a simple matter to convert the mode-lines in your XF86Config to the required timings needed by the framebuffer devices.

The framebuffer device requires the following fields

  • pixclock - pixel clock in pico seconds
  • left_margin - time fron sync to picture
  • right_margin - time from picture to sync
  • upper_margin - time from sync to picture
  • lower_margin - time from picture to sync
  • hsync_len - length of horizontal sync
  • vsync_len - length of vertical sync

An XFree86 mode line has the following fields

Modeline  "1280x1024" DCF HR SH1 SH2 HFL VR SV1 SV2 VFL

It is necessary to do some simple calculations to translate the XF86 mode-lines into a set of framebuffer device timings. As an example, we shall examine how to convert a mode-line taken from my XF86Config file.

Modeline  "1280x1024" 110.00 1280 1328 1512 1712 1024 1025 1028 1054

First, calculate the required pixclock rate. XFree86 uses megahertz whilst framebuffer devices uses picoseconds (Why, I don't know). Divide one million by DCF. For example, 1,000,000 / 110.0 = 9090.9091

Now we need to calculate the horizontal timings.

  • left_margin = HFL - SH2
  • right_margin = SH1 - HR
  • hsync_len = SH2 - SH1

In our example, this would be:

  • left_margin = 1712 - 1512 = 200
  • right_margin = 1328 - 1280 = 48
  • hsync_len = 1512 - 1328 = 184

And now we need to calculate the vertical timings.

  • upper_margin = VFL - SV2
  • lower_margin = SV1 - VR
  • vsync_len = SV2 - SV1

For our example, this would be:

  • upper_margin = 1054 - 1028 = 26
  • lower_margin = 1025 - 1024 = 1
  • vsync_len = 1028 - 1025 = 3

Now we can use this information to set up the framebuffer for the desired mode. For example, for the matroxfb framebuffer, it requires:

video=matrox:xres:<>,yres:<>,depth:<>,left:<>,right:<>,hslen:<>,upper:<>,lower:<>,vslen:<>

I put in my /etc/lilo.conf the following line:

append = "video=matrox:xres:1280,yres:1024,depth:32,left:200,right:48,hslen:184,upper:26,lower:0,vslen:3"

Note that in this case the pixclock isn't used. It's only necessary if you don't like the default pixclock rates. You can supply this as a parameter as well. Setting the pixclock is documented in other parts of this HOWTO.


Next Previous Contents
Search Howtos :Match :
PhpMyAdmin 3.1.2 rc1
Php front-end to MySQL administration
Xine 1.1.6
Free video player
Glade 3.5.5
User interface builder for GTK+ and Gnome
Evolution 2.25.4
GNOME mailer, calendar, contact manager and communications tool
GEdit 2.25.4
Small but powerful text editor
Mutt 1.5.19
Small but very powerful text-based mail client.
Galculator 1.3.2
GTK 2 based scientific calculator
GTK2 2.14.7
GUI Toolkit
WebGUI 7.5.38
A fully featured content management system.
Brasero 0.9.0
Application to burn CD/DVD
Free IT Magazines, White Papers, eBooks, and more !
Dr. Dobb's Journal

Dr. Dobb's Journal enables programmers to write the most efficient and sophisticated programs and help in daily programming quandaries.

The 7 Things that IT Security Professionals MUST KNOW!

Gain key insight into security problem and find the safest means to protect your technological assets.

Database Trends and Applications

Provides timely coverage of the technology, intelligence and insight needed to plan, implement and manage information-rich projects.

Linux Software Map
Find Linux RPM
Best Rated Linux Software
Most Rated Linux Software
Linux Distributions
Linux Howtos
Quick Survey

Please take our survey and help us improve our website to serve you better.

Thank you.
Linux Software
Linux / IT Resources
Site Resources
Google
Privacy Policy
Contact Us
Submit Software
Advertising info