code:
==============
What is udlfb?
==============

This is a driver for DisplayLink USB 2.0 era graphics chips.

DisplayLink chips provide simple hline/blit operations with some compression,
pairing that with a hardware framebuffer (16MB) on the other end of the
USB wire.  That hardware framebuffer is able to drive the VGA, DVI, or HDMI
monitor with no CPU involvement until a pixel has to change.

The CPU or other local resource does all the rendering; optionally compares the
result with a local shadow of the remote hardware framebuffer to identify
the minimal set of pixels that have changed; and compresses and sends those
pixels line-by-line via USB bulk transfers.

Because of the efficiency of bulk transfers and a protocol on top that
does not require any acks - the effect is very low latency that
can support surprisingly high resolutions with good performance for
non-gaming and non-video applications.

Mode setting, EDID read, etc are other bulk or control transfers. Mode
setting is very flexible - able to set nearly arbitrary modes from any timing.

Advantages of USB graphics in general:

 * Ability to add a nearly arbitrary number of displays to any USB 2.0
   capable system. On Linux, number of displays is limited by fbdev interface
   (FB_MAX is currently 32). Of course, all USB devices on the same
   host controller share the same 480Mbs USB 2.0 interface.

Advantages of supporting DisplayLink chips with kernel framebuffer interface:

 * The actual hardware functionality of DisplayLink chips matches nearly
   one-to-one with the fbdev interface, making the driver quite small and
   tight relative to the functionality it provides.
 * X servers and other applications can use the standard fbdev interface
   from user mode to talk to the device, without needing to know anything
   about USB or DisplayLink's protocol at all. A "displaylink" X driver
   and a slightly modified "fbdev" X driver are among those that already do.

Disadvantages:

 * Fbdev's mmap interface assumes a real hardware framebuffer is mapped.
   In the case of USB graphics, it is just an allocated (virtual) buffer.
   Writes need to be detected and encoded into USB bulk transfers by the CPU.
   Accurate damage/changed area notifications work around this problem.
   In the future, hopefully fbdev will be enhanced with an small standard
   interface to allow mmap clients to report damage, for the benefit
   of virtual or remote framebuffers.
 * Fbdev does not arbitrate client ownership of the framebuffer well.
 * Fbcon assumes the first framebuffer it finds should be consumed for console.
 * It's not clear what the future of fbdev is, given the rise of KMS/DRM.

How to use it?
==============

Udlfb, when loaded as a module, will match against all USB 2.0 generation
DisplayLink chips (Alex and Ollie family). It will then attempt to read the EDID
of the monitor, and set the best common mode between the DisplayLink device
and the monitor's capabilities.

If the DisplayLink device is successful, it will paint a "green screen" which
means that from a hardware and fbdev software perspective, everything is good.

At that point, a /dev/fb? interface will be present for user-mode applications
to open and begin writing to the framebuffer of the DisplayLink device using
standard fbdev calls.  Note that if mmap() is used, by default the user mode
application must send down damage notifications to trigger repaints of the
changed regions.  Alternatively, udlfb can be recompiled with experimental
defio support enabled, to support a page-fault based detection mechanism
that can work without explicit notification.

The most common client of udlfb is xf86-video-displaylink or a modified
xf86-video-fbdev X server. These servers have no real DisplayLink specific
code. They write to the standard framebuffer interface and rely on udlfb
to do its thing.  The one extra feature they have is the ability to report
rectangles from the X DAMAGE protocol extension down to udlfb via udlfb's
damage interface (which will hopefully be standardized for all virtual
framebuffers that need damage info). These damage notifications allow
udlfb to efficiently process the changed pixels.

Module Options
==============

Special configuration for udlfb is usually unnecessary. There are a few
options, however.

From the command line, pass options to modprobe::

  modprobe udlfb fb_defio=0 console=1 shadow=1

Or change options on the fly by editing
/sys/module/udlfb/parameters/PARAMETER_NAME ::

  cd /sys/module/udlfb/parameters
  ls # to see a list of parameter names
  sudo nano PARAMETER_NAME
  # change the parameter in place, and save the file.

Unplug/replug USB device to apply with new settings.

Or to apply options permanently, create a modprobe configuration file
like /etc/modprobe.d/udlfb.conf with text::

  options udlfb fb_defio=0 console=1 shadow=1

Accepted boolean options:

=============== ================================================================
fb_defio	Make use of the fb_defio (CONFIG_FB_DEFERRED_IO) kernel
		module to track changed areas of the framebuffer by page faults.
		Standard fbdev applications that use mmap but that do not
		report damage, should be able to work with this enabled.
		Disable when running with X server that supports reporting
		changed regions via ioctl, as this method is simpler,
		more stable, and higher performance.
		default: fb_defio=1

console		Allow fbcon to attach to udlfb provided framebuffers.
		Can be disabled if fbcon and other clients
		(e.g. X with --shared-vt) are in conflict.
		default: console=1

shadow		Allocate a 2nd framebuffer to shadow what's currently across
		the USB bus in device memory. If any pixels are unchanged,
		do not transmit. Spends host memory to save USB transfers.
		Enabled by default. Only disable on very low memory systems.
		default: shadow=1
=============== ================================================================

Sysfs Attributes
================

Udlfb creates several files in /sys/class/graphics/fb?
Where ? is the sequential framebuffer id of the particular DisplayLink device

======================== ========================================================
edid			 If a valid EDID blob is written to this file (typically
			 by a udev rule), then udlfb will use this EDID as a
			 backup in case reading the actual EDID of the monitor
			 attached to the DisplayLink device fails. This is
			 especially useful for fixed panels, etc. that cannot
			 communicate their capabilities via EDID. Reading
			 this file returns the current EDID of the attached
			 monitor (or last backup value written). This is
			 useful to get the EDID of the attached monitor,
			 which can be passed to utilities like parse-edid.

metrics_bytes_rendered	 32-bit count of pixel bytes rendered

metrics_bytes_identical  32-bit count of how many of those bytes were found to be
			 unchanged, based on a shadow framebuffer check

metrics_bytes_sent	 32-bit count of how many bytes were transferred over
			 USB to communicate the resulting changed pixels to the
			 hardware. Includes compression and protocol overhead

metrics_cpu_kcycles_used 32-bit count of CPU cycles used in processing the
			 above pixels (in thousands of cycles).

metrics_reset		 Write-only. Any write to this file resets all metrics
			 above to zero.  Note that the 32-bit counters above
			 roll over very quickly. To get reliable results, design
			 performance tests to start and finish in a very short
			 period of time (one minute or less is safe).
======================== ========================================================

Bernie Thompson <bernie@plugable.com>


code:
==========================================================
uvesafb - A Generic Driver for VBE2+ compliant video cards
==========================================================

1. Requirements
---------------

uvesafb should work with any video card that has a Video BIOS compliant
with the VBE 2.0 standard.

Unlike other drivers, uvesafb makes use of a userspace helper called
v86d.  v86d is used to run the x86 Video BIOS code in a simulated and
controlled environment.  This allows uvesafb to function on arches other
than x86.  Check the v86d documentation for a list of currently supported
arches.

v86d source code can be downloaded from the following website:

  https://github.com/mjanusz/v86d

Please refer to the v86d documentation for detailed configuration and
installation instructions.

Note that the v86d userspace helper has to be available at all times in
order for uvesafb to work properly.  If you want to use uvesafb during
early boot, you will have to include v86d into an initramfs image, and
either compile it into the kernel or use it as an initrd.

2. Caveats and limitations
--------------------------

uvesafb is a _generic_ driver which supports a wide variety of video
cards, but which is ultimately limited by the Video BIOS interface.
The most important limitations are:

- Lack of any type of acceleration.
- A strict and limited set of supported video modes.  Often the native
  or most optimal resolution/refresh rate for your setup will not work
  with uvesafb, simply because the Video BIOS doesn't support the
  video mode you want to use.  This can be especially painful with
  widescreen panels, where native video modes don't have the 4:3 aspect
  ratio, which is what most BIOS-es are limited to.
- Adjusting the refresh rate is only possible with a VBE 3.0 compliant
  Video BIOS.  Note that many nVidia Video BIOS-es claim to be VBE 3.0
  compliant, while they simply ignore any refresh rate settings.

3. Configuration
----------------

uvesafb can be compiled either as a module, or directly into the kernel.
In both cases it supports the same set of configuration options, which
are either given on the kernel command line or as module parameters, e.g.::

 video=uvesafb:1024x768-32,mtrr:3,ywrap (compiled into the kernel)

 # modprobe uvesafb mode_option=1024x768-32 mtrr=3 scroll=ywrap  (module)

Accepted options:

======= =========================================================
ypan    Enable display panning using the VESA protected mode
	interface.  The visible screen is just a window of the
	video memory, console scrolling is done by changing the
	start of the window.  This option is available on x86
	only and is the default option on that architecture.

ywrap   Same as ypan, but assumes your gfx board can wrap-around
	the video memory (i.e. starts reading from top if it
	reaches the end of video memory).  Faster than ypan.
	Available on x86 only.

redraw  Scroll by redrawing the affected part of the screen, this
	is the default on non-x86.
======= =========================================================

(If you're using uvesafb as a module, the above three options are
used a parameter of the scroll option, e.g. scroll=ypan.)

=========== ====================================================================
vgapal      Use the standard VGA registers for palette changes.

pmipal      Use the protected mode interface for palette changes.
            This is the default if the protected mode interface is
            available.  Available on x86 only.

mtrr:n      Setup memory type range registers for the framebuffer
            where n:

                - 0 - disabled (equivalent to nomtrr)
                - 3 - write-combining (default)

            Values other than 0 and 3 will result in a warning and will be
            treated just like 3.

nomtrr      Do not use memory type range registers.

vremap:n
            Remap 'n' MiB of video RAM.  If 0 or not specified, remap memory
            according to video mode.

vtotal:n    If the video BIOS of your card incorrectly determines the total
            amount of video RAM, use this option to override the BIOS (in MiB).

<mode>      The mode you want to set, in the standard modedb format.  Refer to
            modedb.txt for a detailed description.  When uvesafb is compiled as
            a module, the mode string should be provided as a value of the
            'mode_option' option.

vbemode:x   Force the use of VBE mode x.  The mode will only be set if it's
            found in the VBE-provided list of supported modes.
            NOTE: The mode number 'x' should be specified in VESA mode number
            notation, not the Linux kernel one (eg. 257 instead of 769).
            HINT: If you use this option because normal <mode> parameter does
            not work for you and you use a X server, you'll probably want to
            set the 'nocrtc' option to ensure that the video mode is properly
            restored after console <-> X switches.

nocrtc      Do not use CRTC timings while setting the video mode.  This option
            has any effect only if the Video BIOS is VBE 3.0 compliant.  Use it
            if you have problems with modes set the standard way.  Note that
            using this option implies that any refresh rate adjustments will
            be ignored and the refresh rate will stay at your BIOS default
            (60 Hz).

noedid      Do not try to fetch and use EDID-provided modes.

noblank     Disable hardware blanking.

v86d:path   Set path to the v86d executable. This option is only available as
            a module parameter, and not as a part of the video= string.  If you
            need to use it and have uvesafb built into the kernel, use
            uvesafb.v86d="path".
=========== ====================================================================

Additionally, the following parameters may be provided.  They all override the
EDID-provided values and BIOS defaults.  Refer to your monitor's specs to get
the correct values for maxhf, maxvf and maxclk for your hardware.

=========== ======================================
maxhf:n     Maximum horizontal frequency (in kHz).
maxvf:n     Maximum vertical frequency (in Hz).
maxclk:n    Maximum pixel clock (in MHz).
=========== ======================================

4. The sysfs interface
----------------------

uvesafb provides several sysfs nodes for configurable parameters and
additional information.

Driver attributes:

/sys/bus/platform/drivers/uvesafb
  v86d
    (default: /sbin/v86d)

    Path to the v86d executable. v86d is started by uvesafb
    if an instance of the daemon isn't already running.

Device attributes:

/sys/bus/platform/drivers/uvesafb/uvesafb.0
  nocrtc
    Use the default refresh rate (60 Hz) if set to 1.

  oem_product_name, oem_product_rev, oem_string, oem_vendor
    Information about the card and its maker.

  vbe_modes
    A list of video modes supported by the Video BIOS along with their
    VBE mode numbers in hex.

  vbe_version
    A BCD value indicating the implemented VBE standard.

5. Miscellaneous
----------------

Uvesafb will set a video mode with the default refresh rate and timings
from the Video BIOS if you set pixclock to 0 in fb_var_screeninfo.

 Michal Januszewski <spock@gentoo.org>

 Last updated: 2017-10-10

 Documentation of the uvesafb options is loosely based on vesafb.txt.

repo_name: angery/linux


code:
===============
What is vesafb?
===============

This is a generic driver for a graphic framebuffer on intel boxes.

The idea is simple:  Turn on graphics mode at boot time with the help
of the BIOS, and use this as framebuffer device /dev/fb0, like the m68k
(and other) ports do.

This means we decide at boot time whenever we want to run in text or
graphics mode.  Switching mode later on (in protected mode) is
impossible; BIOS calls work in real mode only.  VESA BIOS Extensions
Version 2.0 are required, because we need a linear frame buffer.

Advantages:

 * It provides a nice large console (128 cols + 48 lines with 1024x768)
   without using tiny, unreadable fonts.
 * You can run XF68_FBDev on top of /dev/fb0 (=> non-accelerated X11
   support for every VBE 2.0 compliant graphics board).
 * Most important: boot logo :-)

Disadvantages:

 * graphic mode is slower than text mode...

How to use it?
==============

Switching modes is done using the vga=... boot parameter.  Read
Documentation/admin-guide/svga.rst for details.

You should compile in both vgacon (for text mode) and vesafb (for
graphics mode). Which of them takes over the console depends on
whenever the specified mode is text or graphics.

The graphic modes are NOT in the list which you get if you boot with
vga=ask and hit return. The mode you wish to use is derived from the
VESA mode number. Here are those VESA mode numbers:

====== =======  =======  ======== =========
colors 640x480  800x600  1024x768 1280x1024
====== =======  =======  ======== =========
256    0x101    0x103    0x105    0x107
32k    0x110    0x113    0x116    0x119
64k    0x111    0x114    0x117    0x11A
16M    0x112    0x115    0x118    0x11B
====== =======  =======  ======== =========

The video mode number of the Linux kernel is the VESA mode number plus
0x200:

 Linux_kernel_mode_number = VESA_mode_number + 0x200

So the table for the Kernel mode numbers are:

====== =======  =======  ======== =========
colors 640x480  800x600  1024x768 1280x1024
====== =======  =======  ======== =========
256    0x301    0x303    0x305    0x307
32k    0x310    0x313    0x316    0x319
64k    0x311    0x314    0x317    0x31A
16M    0x312    0x315    0x318    0x31B
====== =======  =======  ======== =========

To enable one of those modes you have to specify "vga=ask" in the
lilo.conf file and rerun LILO. Then you can type in the desired
mode at the "vga=ask" prompt. For example if you like to use
1024x768x256 colors you have to say "305" at this prompt.

If this does not work, this might be because your BIOS does not support
linear framebuffers or because it does not support this mode at all.
Even if your board does, it might be the BIOS which does not.  VESA BIOS
Extensions v2.0 are required, 1.2 is NOT sufficient.  You will get a
"bad mode number" message if something goes wrong.

1. Note: LILO cannot handle hex, for booting directly with
   "vga=mode-number" you have to transform the numbers to decimal.
2. Note: Some newer versions of LILO appear to work with those hex values,
   if you set the 0x in front of the numbers.

X11
===

XF68_FBDev should work just fine, but it is non-accelerated.  Running
another (accelerated) X-Server like XF86_SVGA might or might not work.
It depends on X-Server and graphics board.

The X-Server must restore the video mode correctly, else you end up
with a broken console (and vesafb cannot do anything about this).

Refresh rates
=============

There is no way to change the vesafb video mode and/or timings after
booting linux.  If you are not happy with the 60 Hz refresh rate, you
have these options:

 * configure and load the DOS-Tools for the graphics board (if
   available) and boot linux with loadlin.
 * use a native driver (matroxfb/atyfb) instead if vesafb.  If none
   is available, write a new one!
 * VBE 3.0 might work too.  I have neither a gfx board with VBE 3.0
   support nor the specs, so I have not checked this yet.

Configuration
=============

The VESA BIOS provides protected mode interface for changing
some parameters.  vesafb can use it for palette changes and
to pan the display.  It is turned off by default because it
seems not to work with some BIOS versions, but there are options
to turn it on.

You can pass options to vesafb using "video=vesafb:option" on
the kernel command line.  Multiple options should be separated
by comma, like this: "video=vesafb:ypan,inverse"

Accepted options:

inverse	use inverse color map

========= ======================================================================
ypan	  enable display panning using the VESA protected mode
          interface.  The visible screen is just a window of the
          video memory, console scrolling is done by changing the
          start of the window.

          pro:

                * scrolling (fullscreen) is fast, because there is
		  no need to copy around data.

          kontra:

		* scrolling only parts of the screen causes some
		  ugly flicker effects (boot logo flickers for
		  example).

ywrap	  Same as ypan, but assumes your gfx board can wrap-around
          the video memory (i.e. starts reading from top if it
          reaches the end of video memory).  Faster than ypan.

redraw	  Scroll by redrawing the affected part of the screen, this
          is the safe (and slow) default.

vgapal	  Use the standard vga registers for palette changes.
          This is the default.
pmipal    Use the protected mode interface for palette changes.

mtrr:n	  Setup memory type range registers for the vesafb framebuffer
          where n:

              - 0 - disabled (equivalent to nomtrr) (default)
              - 1 - uncachable
              - 2 - write-back
              - 3 - write-combining
              - 4 - write-through

          If you see the following in dmesg, choose the type that matches the
          old one. In this example, use "mtrr:2".
...
mtrr:     type mismatch for e0000000,8000000 old: write-back new:
	  write-combining
...

nomtrr    disable mtrr

vremap:n
          Remap 'n' MiB of video RAM. If 0 or not specified, remap memory
          according to video mode. (2.5.66 patch/idea by Antonino Daplas
          reversed to give override possibility (allocate more fb memory
          than the kernel would) to 2.4 by tmb@iki.fi)

vtotal:n  If the video BIOS of your card incorrectly determines the total
          amount of video RAM, use this option to override the BIOS (in MiB).
========= ======================================================================

Have fun!

Gerd Knorr <kraxel@goldbach.in-berlin.de>

Minor (mostly typo) changes
by Nico Schmoigl <schmoigl@rumms.uni-mannheim.de>


code:
#
#
#   These data are based on the CRTC parameters in
#
#       VIA Integration Graphics Chip
#       (C) 2004 VIA Technologies Inc.
#

#
#   640x480, 60 Hz, Non-Interlaced (25.175 MHz dotclock)
#
#               Horizontal  Vertical
#   Resolution      640     480
#   Scan Frequency      31.469 kHz  59.94 Hz
#   Sync Width      3.813 us    0.064 ms
#               12 chars    2 lines
#   Front Porch     0.636 us    0.318  ms
#               2 chars     10 lines
#   Back Porch      1.907 us    1.048  ms
#               6 chars     33 lines
#   Active Time     25.422 us   15.253 ms
#               80 chars    480 lines
#   Blank Time      6.356 us    1.430 ms
#               20 chars    45 lines
#   Polarity        negative    negative
#

mode "640x480-60"
# D: 25.175 MHz, H: 31.469 kHz, V: 59.94 Hz
    geometry 640 480 640 480 32
    timings 39722 48 16 33 10 96 2 endmode mode "480x640-60"
# D: 24.823 MHz, H: 39.780 kHz, V: 60.00 Hz
    geometry 480 640 480 640 32 timings 39722 72 24 19 1 48 3 endmode
#
#   640x480, 75 Hz, Non-Interlaced (31.50 MHz dotclock)
#
#               Horizontal  Vertical
#   Resolution      640     480
#   Scan Frequency      37.500 kHz  75.00 Hz
#   Sync Width      2.032 us    0.080 ms
#               8 chars     3 lines
#   Front Porch     0.508 us    0.027 ms
#               2 chars     1 lines
#   Back Porch      3.810 us    0.427 ms
#               15 chars    16 lines
#   Active Time     20.317 us   12.800 ms
#               80 chars    480 lines
#   Blank Time      6.349 us    0.533 ms
#               25 chars    20 lines
#   Polarity        negative    negative
#
    mode "640x480-75"
# D: 31.50 MHz, H: 37.500 kHz, V: 75.00 Hz
    geometry 640 480 640 480 32 timings 31747 120 16 16 1 64 3 endmode
#
#   640x480, 85 Hz, Non-Interlaced (36.000 MHz dotclock)
#
#               Horizontal  Vertical
#   Resolution      640     480
#   Scan Frequency  43.269 kHz  85.00 Hz
#   Sync Width      1.556 us    0.069 ms
#               7 chars     3 lines
#   Front Porch     1.556 us    0.023 ms
#               7 chars     1 lines
#   Back Porch      2.222 us    0.578 ms
#               10 chars    25 lines
#   Active Time     17.778 us   11.093 ms
#               80 chars    480 lines
#   Blank Time      5.333 us    0.670 ms
#               24 chars    29 lines
#   Polarity        negative    negative
#
    mode "640x480-85"
# D: 36.000 MHz, H: 43.269 kHz, V: 85.00 Hz
    geometry 640 480 640 480 32 timings 27777 80 56 25 1 56 3 endmode
#
#   640x480, 100 Hz, Non-Interlaced (43.163 MHz dotclock)
#
#               Horizontal  Vertical
#   Resolution      640     480
#   Scan Frequency      50.900 kHz  100.00 Hz
#   Sync Width      1.483 us    0.058 ms
#               8 chars     3 lines
#   Front Porch     0.927 us    0.019 ms
#               5 chars     1 lines
#   Back Porch      2.409 us    0.475 ms
#               13 chars    25 lines
#   Active Time     14.827 us   9.430 ms
#               80 chars    480 lines
#   Blank Time      4.819 us    0.570 ms
#               26 chars    29 lines
#   Polarity        positive    positive
#
    mode "640x480-100"
# D: 43.163 MHz, H: 50.900 kHz, V: 100.00 Hz
    geometry 640 480 640 480 32 timings 23168 104 40 25 1 64 3 endmode
#
#   640x480, 120 Hz, Non-Interlaced (52.406 MHz dotclock)
#
#               Horizontal  Vertical
#   Resolution      640     480
#   Scan Frequency      61.800 kHz  120.00 Hz
#   Sync Width      1.221 us    0.048 ms
#               8 chars         3 lines
#   Front Porch     0.763 us    0.016 ms
#               5 chars     1 lines
#   Back Porch      1.984 us    0.496 ms
#               13 chars    31 lines
#   Active Time     12.212 us   7.767 ms
#               80 chars    480 lines
#   Blank Time      3.969 us    0.566 ms
#               26 chars    35 lines
#   Polarity        positive    positive
#
    mode "640x480-120"
# D: 52.406 MHz, H: 61.800 kHz, V: 120.00 Hz
    geometry 640 480 640 480 32 timings 19081 104 40 31 1 64 3 endmode
#
#   720x480, 60 Hz, Non-Interlaced (26.880 MHz dotclock)
#
#               Horizontal  Vertical
#   Resolution      720     480
#   Scan Frequency      30.000 kHz  60.241 Hz
#   Sync Width      2.679 us    0.099 ms
#               9 chars     3 lines
#   Front Porch     0.595 us    0.033 ms
#               2 chars     1 lines
#   Back Porch      3.274 us    0.462 ms
#               11 chars    14 lines
#   Active Time     26.786 us   16.000 ms
#               90 chars    480 lines
#   Blank Time      6.548 us    0.600 ms
#               22 chars    18 lines
#   Polarity        positive    positive
#
    mode "720x480-60"
# D: 26.880 MHz, H: 30.000 kHz, V: 60.24 Hz
    geometry 720 480 720 480 32 timings 37202 88 16 14 1 72 3 endmode
#
#   800x480, 60 Hz, Non-Interlaced (29.581 MHz dotclock)
#
#               Horizontal    Vertical
#   Resolution      800         480
#   Scan Frequency  29.892 kHz  60.00 Hz
#   Sync Width      2.704 us    100.604 us
#                   10 chars    3 lines
#   Front Porch     0.541 us    33.535 us
#                   2 chars     1 lines
#   Back Porch      3.245 us    435.949 us
#                   12 chars    13 lines
#   Active Time     27.044 us   16.097 ms
#                   100 chars   480 lines
#   Blank Time      6.491 us    0.570 ms
#                   24 chars    17 lines
#   Polarity        positive    positive
#
    mode "800x480-60"
# D: 29.500 MHz, H: 29.738 kHz, V: 60.00 Hz
    geometry 800 480 800 480 32 timings 33805 96 24 10 3 72 7 endmode
#
#   720x576, 60 Hz, Non-Interlaced (32.668 MHz dotclock)
#
#               Horizontal  Vertical
#   Resolution      720     576
#   Scan Frequency      35.820 kHz  60.00 Hz
#   Sync Width      2.204 us    0.083 ms
#               9 chars     3 lines
#   Front Porch     0.735 us    0.027 ms
#               3 chars     1 lines
#   Back Porch      2.939 us    0.459 ms
#               12 chars    17 lines
#   Active Time     22.040 us   16.080 ms
#               90 chars    476 lines
#   Blank Time      5.877 us    0.586 ms
#               24 chars    21 lines
#   Polarity        positive    positive
#
    mode "720x576-60"
# D: 32.668 MHz, H: 35.820 kHz, V: 60.00 Hz
    geometry 720 576 720 576 32 timings 30611 96 24 17 1 72 3 endmode
#
#   800x600, 60 Hz, Non-Interlaced (40.00 MHz dotclock)
#
#               Horizontal  Vertical
#   Resolution      800     600
#   Scan Frequency      37.879 kHz  60.32 Hz
#   Sync Width      3.200 us    0.106 ms
#               16 chars    4 lines
#   Front Porch     1.000 us    0.026 ms
#               5 chars     1 lines
#   Back Porch      2.200 us    0.607 ms
#               11 chars    23 lines
#   Active Time     20.000 us   15.840 ms
#               100 chars   600 lines
#   Blank Time      6.400 us    0.739 ms
#               32 chars    28 lines
#   Polarity        positive    positive
#
    mode "800x600-60"
# D: 40.00 MHz, H: 37.879 kHz, V: 60.32 Hz
    geometry 800 600 800 600 32
    timings 25000 88 40 23 1 128 4 hsync high vsync high endmode
#
#   800x600, 75 Hz, Non-Interlaced (49.50 MHz dotclock)
#
#               Horizontal  Vertical
#   Resolution      800     600
#   Scan Frequency      46.875 kHz  75.00 Hz
#   Sync Width      1.616 us    0.064 ms
#               10 chars    3 lines
#   Front Porch     0.323 us    0.021 ms
#               2 chars     1 lines
#   Back Porch      3.232 us    0.448 ms
#               20 chars    21 lines
#   Active Time     16.162 us   12.800 ms
#               100 chars   600 lines
#   Blank Time      5.172 us    0.533 ms
#               32 chars    25 lines
#   Polarity        positive    positive
#
    mode "800x600-75"
# D: 49.50 MHz, H: 46.875 kHz, V: 75.00 Hz
    geometry 800 600 800 600 32
    timings 20203 160 16 21 1 80 3 hsync high vsync high endmode
#
#   800x600, 85 Hz, Non-Interlaced (56.25 MHz dotclock)
#
#               Horizontal  Vertical
#   Resolution      800     600
#   Scan Frequency      53.674 kHz  85.061 Hz
#   Sync Width      1.138 us    0.056 ms
#               8 chars     3 lines
#   Front Porch     0.569 us    0.019 ms
#               4 chars     1 lines
#   Back Porch      2.702 us    0.503 ms
#               19 chars    27 lines
#   Active Time     14.222 us   11.179 ms
#               100 chars   600 lines
#   Blank Time      4.409 us    0.578 ms
#               31 chars    31 lines
#   Polarity        positive    positive
#
    mode "800x600-85"
# D: 56.25 MHz, H: 53.674 kHz, V: 85.061 Hz
    geometry 800 600 800 600 32
    timings 17777 152 32 27 1 64 3 hsync high vsync high endmode
#
#   800x600, 100 Hz, Non-Interlaced (67.50 MHz dotclock)
#
#               Horizontal  Vertical
#   Resolution      800     600
#   Scan Frequency      62.500 kHz  100.00 Hz
#   Sync Width      0.948 us    0.064 ms
#               8 chars     4 lines
#   Front Porch     0.000 us    0.112 ms
#               0 chars     7 lines
#   Back Porch      3.200 us    0.224 ms
#               27 chars    14 lines
#   Active Time     11.852 us   9.600 ms
#               100 chars   600 lines
#   Blank Time      4.148 us    0.400 ms
#               35 chars    25 lines
#   Polarity        positive    positive
#
    mode "800x600-100"
# D: 67.50 MHz, H: 62.500 kHz, V: 100.00 Hz
    geometry 800 600 800 600 32
    timings 14667 216 0 14 7 64 4 hsync high vsync high endmode
#
#   800x600, 120 Hz, Non-Interlaced (83.950 MHz dotclock)
#
#               Horizontal  Vertical
#   Resolution      800     600
#   Scan Frequency  77.160 kHz  120.00 Hz
#   Sync Width      1.048 us    0.039 ms
#               11 chars    3 lines
#   Front Porch     0.667 us    0.013 ms
#               7 chars     1 lines
#   Back Porch      1.715 us    0.507 ms
#               18 chars    39 lines
#   Active Time     9.529 us    7.776 ms
#               100 chars   600 lines
#   Blank Time      3.431 us    0.557 ms
#               36 chars    43 lines
#   Polarity        positive    positive
#
    mode "800x600-120"
# D: 83.950 MHz, H: 77.160 kHz, V: 120.00 Hz
    geometry 800 600 800 600 32
    timings 11912 144 56 39 1 88 3 hsync high vsync high endmode
#
#   848x480, 60 Hz, Non-Interlaced (31.490 MHz dotclock)
#
#               Horizontal  Vertical
#   Resolution      848     480
#   Scan Frequency  29.820 kHz  60.00 Hz
#   Sync Width      2.795 us    0.099 ms
#               11 chars    3 lines
#   Front Porch     0.508 us    0.033 ms
#               2 chars     1 lines
#   Back Porch      3.303 us    0.429 ms
#               13 chars    13 lines
#   Active Time     26.929 us   16.097 ms
#               106 chars   480 lines
#   Blank Time      6.605 us    0.570 ms
#               26 chars    17 lines
#   Polarity        positive    positive
#
    mode "848x480-60"
# D: 31.500 MHz, H: 29.830 kHz, V: 60.00 Hz
    geometry 848 480 848 480 32
    timings 31746 104 24 12 3 80 5 hsync high vsync high endmode
#
#   856x480, 60 Hz, Non-Interlaced (31.728 MHz dotclock)
#
#               Horizontal  Vertical
#   Resolution      856     480
#   Scan Frequency  29.820 kHz  60.00 Hz
#   Sync Width      2.774 us    0.099 ms
#               11 chars    3 lines
#   Front Porch     0.504 us    0.033 ms
#               2 chars     1 lines
#   Back Porch      3.728 us    0.429 ms
#               13 chars    13 lines
#   Active Time     26.979 us   16.097 ms
#               107 chars   480 lines
#   Blank Time      6.556 us    0.570 ms
#               26 chars    17 lines
#   Polarity        positive    positive
#
    mode "856x480-60"
# D: 31.728 MHz, H: 29.820 kHz, V: 60.00 Hz
    geometry 856 480 856 480 32
    timings 31518 104 16 13 1 88 3
    hsync high vsync high endmode mode "960x600-60"
# D: 45.250 MHz, H: 37.212 kHz, V: 60.00 Hz
    geometry 960 600 960 600 32 timings 22099 128 32 15 3 96 6 endmode
#
#   1000x600, 60 Hz, Non-Interlaced (48.068 MHz dotclock)
#
#               Horizontal  Vertical
#   Resolution      1000     600
#   Scan Frequency  37.320 kHz  60.00 Hz
#   Sync Width      2.164 us    0.080 ms
#               13 chars    3 lines
#   Front Porch     0.832 us    0.027 ms
#               5 chars     1 lines
#   Back Porch      2.996 us    0.483 ms
#               18 chars    18 lines
#   Active Time     20.804 us   16.077 ms
#               125 chars   600 lines
#   Blank Time      5.991 us    0.589 ms
#               36 chars    22 lines
#   Polarity        negative    positive
#
    mode "1000x600-60"
# D: 48.068 MHz, H: 37.320 kHz, V: 60.00 Hz
    geometry 1000 600 1000 600 32
    timings 20834 144 40 18 1 104 3 endmode mode "1024x576-60"
# D: 46.996 MHz, H: 35.820 kHz, V: 60.00 Hz
    geometry 1024 576 1024 576 32
    timings 21278 144 40 17 1 104 3 endmode mode "1024x600-60"
# D: 48.964 MHz, H: 37.320 kHz, V: 60.00 Hz
    geometry 1024 600 1024 600 32
    timings 20461 144 40 18 1 104 3 endmode mode "1088x612-60"
# D: 52.952 MHz, H: 38.040 kHz, V: 60.00 Hz
    geometry 1088 612 1088 612 32 timings 18877 152 48 16 3 104 5 endmode
#
#   1024x512, 60 Hz, Non-Interlaced (41.291 MHz dotclock)
#
#               Horizontal  Vertical
#   Resolution      1024    512
#   Scan Frequency  31.860 kHz  60.00 Hz
#   Sync Width      2.519 us    0.094 ms
#               13 chars    3 lines
#   Front Porch     0.775 us    0.031 ms
#               4 chars     1 lines
#   Back Porch      3.294 us    0.465 ms
#               17 chars    15 lines
#   Active Time     24.800 us   16.070 ms
#               128 chars   512 lines
#   Blank Time      6.587 us    0.596 ms
#               34 chars    19 lines
#   Polarity        positive    positive
#
    mode "1024x512-60"
# D: 41.291 MHz, H: 31.860 kHz, V: 60.00 Hz
    geometry 1024 512 1024 512 32
    timings 24218 126 32 15 1 104 3 hsync high vsync high endmode
#
#   1024x600, 60 Hz, Non-Interlaced (48.875 MHz dotclock)
#
#                     Horizontal  Vertical
#   Resolution          1024        768
#   Scan Frequency      37.252 kHz  60.00 Hz
#   Sync Width          2.128 us    80.532us
#                       13 chars    3 lines
#   Front Porch        0.818 us     26.844 us
#                       5 chars     1 lines
#   Back Porch          2.946 us    483.192 us
#                       18 chars    18 lines
#   Active Time         20.951 us   16.697 ms
#                       128 chars   622 lines
#   Blank Time          5.893 us    0.591 ms
#                       36 chars    22 lines
#   Polarity            negative    positive
#
#mode "1024x600-60"
#     # D: 48.875 MHz, H: 37.252 kHz, V: 60.00 Hz
#     geometry 1024 600 1024 600 32
#    timings 20460  144 40 18 1 104  3
# endmode
#
#   1024x768, 60 Hz, Non-Interlaced (65.00 MHz dotclock)
#
#               Horizontal  Vertical
#   Resolution      1024        768
#   Scan Frequency      48.363 kHz  60.00 Hz
#   Sync Width      2.092 us    0.124 ms
#               17 chars    6 lines
#   Front Porch     0.369 us    0.062 ms
#               3 chars     3 lines
#   Back Porch      2.462 us    0.601 ms
#               20 chars    29 lines
#   Active Time     15.754 us   15.880 ms
#               128 chars   768 lines
#   Blank Time      4.923 us    0.786 ms
#               40 chars    38 lines
#   Polarity        negative    negative
#
    mode "1024x768-60"
# D: 65.00 MHz, H: 48.363 kHz, V: 60.00 Hz
    geometry 1024 768 1024 768 32 timings 15385 160 24 29 3 136 6 endmode
#
#   1024x768, 75 Hz, Non-Interlaced (78.75 MHz dotclock)
#
#               Horizontal  Vertical
#   Resolution      1024        768
#   Scan Frequency      60.023 kHz  75.03 Hz
#   Sync Width      1.219 us    0.050 ms
#               12 chars    3 lines
#   Front Porch     0.203 us    0.017 ms
#               2 chars     1 lines
#   Back Porch      2.235 us    0.466 ms
#               22 chars    28 lines
#   Active Time     13.003 us   12.795 ms
#               128 chars   768 lines
#   Blank Time      3.657 us    0.533 ms
#               36 chars    32 lines
#   Polarity        positive    positive
#
    mode "1024x768-75"
# D: 78.75 MHz, H: 60.023 kHz, V: 75.03 Hz
    geometry 1024 768 1024 768 32
    timings 12699 176 16 28 1 96 3 hsync high vsync high endmode
#
#   1024x768, 85 Hz, Non-Interlaced (94.50 MHz dotclock)
#
#               Horizontal  Vertical
#   Resolution      1024        768
#   Scan Frequency  68.677 kHz  85.00 Hz
#   Sync Width      1.016 us    0.044 ms
#               12 chars    3 lines
#   Front Porch     0.508 us    0.015 ms
#               6 chars     1 lines
#   Back Porch      2.201 us    0.524 ms
#               26 chars    36 lines
#   Active Time     10.836 us   11.183 ms
#               128 chars   768 lines
#   Blank Time      3.725 us    0.582 ms
#               44 chars    40 lines
#   Polarity        positive    positive
#
    mode "1024x768-85"
# D: 94.50 MHz, H: 68.677 kHz, V: 85.00 Hz
    geometry 1024 768 1024 768 32
    timings 10582 208 48 36 1 96 3 hsync high vsync high endmode
#
#   1024x768, 100 Hz, Non-Interlaced (110.0 MHz dotclock)
#
#               Horizontal  Vertical
#   Resolution      1024        768
#   Scan Frequency      79.023 kHz  99.78 Hz
#   Sync Width      0.800 us    0.101 ms
#               11 chars    8 lines
#   Front Porch     0.000 us    0.000 ms
#               0 chars     0 lines
#   Back Porch      2.545 us    0.202 ms
#               35 chars    16 lines
#   Active Time     9.309 us    9.719 ms
#               128 chars   768 lines
#   Blank Time      3.345 us    0.304 ms
#               46 chars    24 lines
#   Polarity        negative    negative
#
    mode "1024x768-100"
# D: 113.3 MHz, H: 79.023 kHz, V: 99.78 Hz
    geometry 1024 768 1024 768 32
    timings 8825 280 0 16 0 88 8 endmode mode "1152x720-60"
# D: 66.750 MHz, H: 44.859 kHz, V: 60.00 Hz
    geometry 1152 720 1152 720 32 timings 14981 168 56 19 3 112 6 endmode
#
#   1152x864, 75 Hz, Non-Interlaced (110.0 MHz dotclock)
#
#               Horizontal  Vertical
#   Resolution      1152        864
#   Scan Frequency      75.137 kHz  74.99 Hz
#   Sync Width      1.309 us    0.106 ms
#               18 chars    8 lines
#   Front Porch     0.245 us    0.599 ms
#               3 chars     45 lines
#   Back Porch      1.282 us    1.132 ms
#               18 chars    85 lines
#   Active Time     10.473 us   11.499 ms
#               144 chars   864 lines
#   Blank Time      2.836 us    1.837 ms
#               39 chars    138 lines
#   Polarity        positive    positive
#
    mode "1152x864-75"
# D: 110.0 MHz, H: 75.137 kHz, V: 74.99 Hz
    geometry 1152 864 1152 864 32
    timings 9259 144 24 85 45 144 8
    hsync high vsync high endmode mode "1200x720-60"
# D: 70.184 MHz, H: 44.760 kHz, V: 60.00 Hz
    geometry 1200 720 1200 720 32
    timings 14253 184 28 22 1 128 3 endmode mode "1280x600-60"
# D: 61.503 MHz, H: 37.320 kHz, V: 60.00 Hz
    geometry 1280 600 1280 600 32
    timings 16260 184 28 18 1 128 3 endmode mode "1280x720-50"
# D: 60.466 MHz, H: 37.050 kHz, V: 50.00 Hz
    geometry 1280 720 1280 720 32
    timings 16538 176 48 17 1 128 3 endmode mode "1280x768-50"
# D: 65.178 MHz, H: 39.550 kHz, V: 50.00 Hz
    geometry 1280 768 1280 768 32 timings 15342 184 28 19 1 128 3 endmode
#
#   1280x768, 60 Hz, Non-Interlaced (80.136 MHz dotclock)
#
#               Horizontal  Vertical
#   Resolution      1280    768
#   Scan Frequency  47.700 kHz  60.00 Hz
#   Sync Width      1.697 us    0.063 ms
#               17 chars    3 lines
#   Front Porch     0.799 us    0.021 ms
#               8 chars     1 lines
#   Back Porch      2.496 us    0.483 ms
#               25 chars    23 lines
#   Active Time     15.973 us   16.101 ms
#               160 chars   768 lines
#   Blank Time      4.992 us    0.566 ms
#               50 chars    27 lines
#   Polarity        positive    positive
#
    mode "1280x768-60"
# D: 80.13 MHz, H: 47.700 kHz, V: 60.00 Hz
    geometry 1280 768 1280 768 32
    timings 12480 200 48 23 1 126 3 hsync high vsync high endmode
#
#   1280x800, 60 Hz, Non-Interlaced (83.375 MHz dotclock)
#
#               Horizontal  Vertical
#   Resolution      1280    800
#   Scan Frequency  49.628 kHz  60.00 Hz
#   Sync Width      1.631 us    60.450 us
#                   17 chars    3 lines
#   Front Porch     0.768 us    20.15 us
#                   8 chars     1 lines
#   Back Porch      2.399 us    0.483 ms
#                   25 chars    24 lines
#   Active Time     15.352 us   16.120 ms
#                   160 chars   800 lines
#   Blank Time      4.798 us    0.564 ms
#                   50 chars    28 lines
#   Polarity        negative    positive
#
    mode "1280x800-60"
# D: 83.500 MHz, H: 49.702 kHz, V: 60.00 Hz
    geometry 1280 800 1280 800 32 timings 11994 200 72 22 3 128 6 endmode
#
#   1280x960, 60 Hz, Non-Interlaced (108.00 MHz dotclock)
#
#               Horizontal  Vertical
#   Resolution      1280    960
#   Scan Frequency  60.000 kHz  60.00 Hz
#   Sync Width      1.037 us    0.050 ms
#               14 chars    3 lines
#   Front Porch     0.889 us    0.017 ms
#               12 chars    1 lines
#   Back Porch      2.889 us    0.600 ms
#               39 chars    36 lines
#   Active Time     11.852 us   16.000 ms
#               160 chars   960 lines
#   Blank Time      4.815 us    0.667 ms
#               65 chars    40 lines
#   Polarity        positive    positive
#
    mode "1280x960-60"
# D: 108.00 MHz, H: 60.000 kHz, V: 60.00 Hz
    geometry 1280 960 1280 960 32
    timings 9259 312 96 36 1 112 3 hsync high vsync high endmode
#
#   1280x1024, 60 Hz, Non-Interlaced (108.00 MHz dotclock)
#
#               Horizontal  Vertical
#   Resolution      1280        1024
#   Scan Frequency      63.981 kHz  60.02 Hz
#   Sync Width      1.037 us    0.047 ms
#               14 chars    3 lines
#   Front Porch     0.444 us    0.015 ms
#               6 chars     1 lines
#   Back Porch      2.297 us    0.594 ms
#               31 chars    38 lines
#   Active Time     11.852 us   16.005 ms
#               160 chars   1024 lines
#   Blank Time      3.778 us    0.656 ms
#               51 chars    42 lines
#   Polarity        positive    positive
#
    mode "1280x1024-60"
# D: 108.00 MHz, H: 63.981 kHz, V: 60.02 Hz
    geometry 1280 1024 1280 1024 32
    timings 9260 248 48 38 1 112 3 hsync high vsync high endmode
#
#   1280x1024, 75 Hz, Non-Interlaced (135.00 MHz dotclock)
#
#               Horizontal  Vertical
#   Resolution      1280        1024
#   Scan Frequency      79.976 kHz  75.02 Hz
#   Sync Width      1.067 us    0.038 ms
#               18 chars    3 lines
#   Front Porch     0.119 us    0.012 ms
#               2 chars     1 lines
#   Back Porch      1.837 us    0.475 ms
#               31 chars    38 lines
#   Active Time     9.481 us    12.804 ms
#               160 chars   1024 lines
#   Blank Time      3.022 us    0.525 ms
#               51 chars    42 lines
#   Polarity        positive    positive
#
    mode "1280x1024-75"
# D: 135.00 MHz, H: 79.976 kHz, V: 75.02 Hz
    geometry 1280 1024 1280 1024 32
    timings 7408 248 16 38 1 144 3 hsync high vsync high endmode
#
#   1280x1024, 85 Hz, Non-Interlaced (157.50 MHz dotclock)
#
#               Horizontal  Vertical
#   Resolution      1280        1024
#   Scan Frequency  91.146 kHz  85.02 Hz
#   Sync Width      1.016 us    0.033 ms
#               20 chars    3 lines
#   Front Porch     0.406 us    0.011 ms
#               8 chars     1 lines
#   Back Porch      1.422 us    0.483 ms
#               28 chars    44 lines
#   Active Time     8.127 us    11.235 ms
#               160 chars   1024 lines
#   Blank Time      2.844 us    0.527 ms
#               56 chars    48 lines
#   Polarity        positive    positive
#
    mode "1280x1024-85"
# D: 157.50 MHz, H: 91.146 kHz, V: 85.02 Hz
    geometry 1280 1024 1280 1024 32
    timings 6349 224 64 44 1 160 3
    hsync high vsync high endmode mode "1440x900-60"
# D: 106.500 MHz, H: 55.935 kHz, V: 60.00 Hz
    geometry 1440 900 1440 900 32
    timings 9390 232 80 25 3 152 6
    hsync high vsync high endmode mode "1440x900-75"
# D: 136.750 MHz, H: 70.635 kHz, V: 75.00 Hz
    geometry 1440 900 1440 900 32
    timings 7315 248 96 33 3 152 6 hsync high vsync high endmode
#
#   1440x1050, 60 Hz, Non-Interlaced (125.10 MHz dotclock)
#
#               Horizontal  Vertical
#   Resolution      1440        1050
#   Scan Frequency      65.220 kHz  60.00 Hz
#   Sync Width      1.204 us    0.046 ms
#               19 chars    3 lines
#   Front Porch     0.760 us    0.015 ms
#               12 chars    1 lines
#   Back Porch      1.964 us    0.495 ms
#               31 chars    33 lines
#   Active Time     11.405 us   16.099 ms
#               180 chars   1050 lines
#   Blank Time      3.928 us    0.567 ms
#               62 chars    37 lines
#   Polarity        positive    positive
#
    mode "1440x1050-60"
# D: 125.10 MHz, H: 65.220 kHz, V: 60.00 Hz
    geometry 1440 1050 1440 1050 32
    timings 7993 248 96 33 1 152 3
    hsync high vsync high endmode mode "1600x900-60"
# D: 118.250 MHz, H: 55.990 kHz, V: 60.00 Hz
    geometry 1600 900 1600 900 32
    timings 8415 256 88 26 3 168 5 endmode mode "1600x1024-60"
# D: 136.358 MHz, H: 63.600 kHz, V: 60.00 Hz
    geometry 1600 1024 1600 1024 32 timings 7315 272 104 32 1 168 3 endmode
#
#   1600x1200, 60 Hz, Non-Interlaced (156.00 MHz dotclock)
#
#               Horizontal  Vertical
#   Resolution      1600        1200
#   Scan Frequency      76.200 kHz  60.00 Hz
#   Sync Width      1.026 us    0.105 ms
#               20 chars    8 lines
#   Front Porch     0.205 us    0.131 ms
#               4 chars     10 lines
#   Back Porch      1.636 us    0.682 ms
#               32 chars    52 lines
#   Active Time     10.256 us   15.748 ms
#               200 chars   1200 lines
#   Blank Time      2.872 us    0.866 ms
#               56 chars    66 lines
#   Polarity        negative    negative
#
    mode "1600x1200-60"
# D: 156.00 MHz, H: 76.200 kHz, V: 60.00 Hz
    geometry 1600 1200 1600 1200 32 timings 6172 256 32 52 10 160 8 endmode
#
#   1600x1200, 75 Hz, Non-Interlaced (202.50 MHz dotclock)
#
#               Horizontal  Vertical
#   Resolution      1600        1200
#   Scan Frequency  93.750 kHz  75.00 Hz
#   Sync Width      0.948 us    0.032 ms
#               24 chars    3 lines
#   Front Porch     0.316 us    0.011 ms
#               8 chars     1 lines
#   Back Porch      1.501 us    0.491 ms
#               38 chars    46 lines
#   Active Time     7.901 us    12.800 ms
#               200 chars   1200 lines
#   Blank Time      2.765 us    0.533 ms
#               70 chars    50 lines
#   Polarity    positive    positive
#
    mode "1600x1200-75"
# D: 202.50 MHz, H: 93.750 kHz, V: 75.00 Hz
    geometry 1600 1200 1600 1200 32
    timings 4938 304 64 46 1 192 3
    hsync high vsync high endmode mode "1680x1050-60"
# D: 146.250 MHz, H: 65.290 kHz, V: 59.954 Hz
    geometry 1680 1050 1680 1050 32
    timings 6814 280 104 30 3 176 6
    hsync high vsync high endmode mode "1680x1050-75"
# D: 187.000 MHz, H: 82.306 kHz, V: 74.892 Hz
    geometry 1680 1050 1680 1050 32
    timings 5348 296 120 40 3 176 6
    hsync high vsync high endmode mode "1792x1344-60"
# D: 202.975 MHz, H: 83.460 kHz, V: 60.00 Hz
    geometry 1792 1344 1792 1344 32
    timings 4902 320 128 43 1 192 3
    hsync high vsync high endmode mode "1856x1392-60"
# D: 218.571 MHz, H: 86.460 kHz, V: 60.00 Hz
    geometry 1856 1392 1856 1392 32
    timings 4577 336 136 45 1 200 3
    hsync high vsync high endmode mode "1920x1200-60"
# D: 193.250 MHz, H: 74.556 kHz, V: 60.00 Hz
    geometry 1920 1200 1920 1200 32
    timings 5173 336 136 36 3 200 6
    hsync high vsync high endmode mode "1920x1440-60"
# D: 234.000 MHz, H:90.000 kHz, V: 60.00 Hz
    geometry 1920 1440 1920 1440 32
    timings 4274 344 128 56 1 208 3
    hsync high vsync high endmode mode "1920x1440-75"
# D: 297.000 MHz, H:112.500 kHz, V: 75.00 Hz
    geometry 1920 1440 1920 1440 32
    timings 3367 352 144 56 1 224 3
    hsync high vsync high endmode mode "2048x1536-60"
# D: 267.250 MHz, H: 95.446 kHz, V: 60.00 Hz
    geometry 2048 1536 2048 1536 32
    timings 3742 376 152 49 3 224 4 hsync high vsync high endmode
#
#   1280x720, 60 Hz, Non-Interlaced (74.481 MHz dotclock)
#
#               Horizontal  Vertical
#   Resolution      1280        720
#   Scan Frequency      44.760 kHz  60.00 Hz
#   Sync Width      1.826 us    67.024 ms
#               17 chars    3 lines
#   Front Porch     0.752 us    22.341 ms
#               7 chars     1 lines
#   Back Porch      2.578 us    491.510 ms
#               24 chars    22 lines
#   Active Time     17.186 us   16.086 ms
#               160 chars   720 lines
#   Blank Time      5.156 us    0.581 ms
#               48 chars    26 lines
#   Polarity        negative    negative
#
    mode "1280x720-60"
# D: 74.481 MHz, H: 44.760 kHz, V: 60.00 Hz
    geometry 1280 720 1280 720 32 timings 13426 192 64 22 1 136 3 endmode
#
#   1920x1080, 60 Hz, Non-Interlaced (172.798 MHz dotclock)
#
#               Horizontal  Vertical
#   Resolution      1920        1080
#   Scan Frequency      67.080 kHz  60.00 Hz
#   Sync Width      1.204 us    44.723 ms
#               26 chars    3 lines
#   Front Porch     0.694 us    14.908 ms
#               15 chars     1 lines
#   Back Porch      1.898 us    506.857 ms
#               41 chars    34 lines
#   Active Time     11.111 us   16.100 ms
#               240 chars   1080 lines
#   Blank Time      3.796 us    0.566 ms
#               82 chars    38 lines
#   Polarity        negative    negative
#
    mode "1920x1080-60"
# D: 74.481 MHz, H: 67.080 kHz, V: 60.00 Hz
    geometry 1920 1080 1920 1080 32 timings 5787 328 120 34 1 208 3 endmode
#
#   1400x1050, 60 Hz, Non-Interlaced (122.61 MHz dotclock)
#
#               Horizontal  Vertical
#   Resolution      1400        1050
#   Scan Frequency      65.218 kHz  59.99 Hz
#   Sync Width      1.037 us    0.047 ms
#               19 chars    3 lines
#   Front Porch     0.444 us    0.015 ms
#               11 chars     1 lines
#   Back Porch      1.185 us    0.188 ms
#               30 chars    33 lines
#   Active Time     12.963 us   16.411 ms
#               175 chars   1050 lines
#   Blank Time      2.667 us    0.250 ms
#               60 chars    37 lines
#   Polarity        negative    positive
#
    mode "1400x1050-60"
# D: 122.750 MHz, H: 65.317 kHz, V: 59.99 Hz
    geometry 1400 1050 1408 1050 32
    timings 8214 232 88 32 3 144 4 endmode mode "1400x1050-75"
# D: 156.000 MHz, H: 82.278 kHz, V: 74.867 Hz
    geometry 1400 1050 1408 1050 32 timings 6410 248 104 42 3 144 4 endmode
#
#   1366x768, 60 Hz, Non-Interlaced (85.86 MHz dotclock)
#
#               Horizontal  Vertical
#   Resolution      1366        768
#   Scan Frequency      47.700 kHz  60.00 Hz
#   Sync Width      1.677 us    0.063 ms
#               18 chars    3 lines
#   Front Porch     0.839 us    0.021 ms
#               9 chars     1 lines
#   Back Porch      2.516 us    0.482 ms
#               27 chars    23 lines
#   Active Time     15.933 us   16.101 ms
#               171 chars   768 lines
#   Blank Time      5.031 us    0.566 ms
#               54 chars    27 lines
#   Polarity        negative    positive
#
    mode "1360x768-60"
# D: 84.750 MHz, H: 47.720 kHz, V: 60.00 Hz
    geometry 1360 768 1360 768 32
    timings 11799 208 72 22 3 136 5 endmode mode "1366x768-60"
# D: 85.86 MHz, H: 47.700 kHz, V: 60.00 Hz
    geometry 1366 768 1366 768 32
    timings 11647 216 72 23 1 144 3 endmode mode "1366x768-50"
# D: 69,924 MHz, H: 39.550 kHz, V: 50.00 Hz
    geometry 1366 768 1366 768 32 timings 14301 200 56 19 1 144 3 endmode


code:
=======================================================
VIA Integration Graphic Chip Console Framebuffer Driver
=======================================================

Platform
--------
    The console framebuffer driver is for graphics chips of
    VIA UniChrome Family
    (CLE266, PM800 / CN400 / CN300,
    P4M800CE / P4M800Pro / CN700 / VN800,
    CX700 / VX700, K8M890, P4M890,
    CN896 / P4M900, VX800, VX855)

Driver features
---------------
    Device: CRT, LCD, DVI

    Support viafb_mode::

	CRT:
	    640x480(60, 75, 85, 100, 120 Hz), 720x480(60 Hz),
	    720x576(60 Hz), 800x600(60, 75, 85, 100, 120 Hz),
	    848x480(60 Hz), 856x480(60 Hz), 1024x512(60 Hz),
	    1024x768(60, 75, 85, 100 Hz), 1152x864(75 Hz),
	    1280x768(60 Hz), 1280x960(60 Hz), 1280x1024(60, 75, 85 Hz),
	    1440x1050(60 Hz), 1600x1200(60, 75 Hz), 1280x720(60 Hz),
	    1920x1080(60 Hz), 1400x1050(60 Hz), 800x480(60 Hz)

    color depth: 8 bpp, 16 bpp, 32 bpp supports.

    Support 2D hardware accelerator.

Using the viafb module
----------------------
    Start viafb with default settings::

	#modprobe viafb

    Start viafb with user options::

	#modprobe viafb viafb_mode=800x600 viafb_bpp=16 viafb_refresh=60
		  viafb_active_dev=CRT+DVI viafb_dvi_port=DVP1
		  viafb_mode1=1024x768 viafb_bpp=16 viafb_refresh1=60
		  viafb_SAMM_ON=1

    viafb_mode:
	- 640x480 (default)
	- 720x480
	- 800x600
	- 1024x768

    viafb_bpp:
	- 8, 16, 32 (default:32)

    viafb_refresh:
	- 60, 75, 85, 100, 120 (default:60)

    viafb_lcd_dsp_method:
	- 0 : expansion (default)
	- 1 : centering

    viafb_lcd_mode:
	0 : LCD panel with LSB data format input (default)
	1 : LCD panel with MSB data format input

    viafb_lcd_panel_id:
	- 0 : Resolution: 640x480, Channel: single, Dithering: Enable
	- 1 : Resolution: 800x600, Channel: single, Dithering: Enable
	- 2 : Resolution: 1024x768, Channel: single, Dithering: Enable (default)
	- 3 : Resolution: 1280x768, Channel: single, Dithering: Enable
	- 4 : Resolution: 1280x1024, Channel: dual, Dithering: Enable
	- 5 : Resolution: 1400x1050, Channel: dual, Dithering: Enable
	- 6 : Resolution: 1600x1200, Channel: dual, Dithering: Enable

	- 8 : Resolution: 800x480, Channel: single, Dithering: Enable
	- 9 : Resolution: 1024x768, Channel: dual, Dithering: Enable
	- 10: Resolution: 1024x768, Channel: single, Dithering: Disable
	- 11: Resolution: 1024x768, Channel: dual, Dithering: Disable
	- 12: Resolution: 1280x768, Channel: single, Dithering: Disable
	- 13: Resolution: 1280x1024, Channel: dual, Dithering: Disable
	- 14: Resolution: 1400x1050, Channel: dual, Dithering: Disable
	- 15: Resolution: 1600x1200, Channel: dual, Dithering: Disable
	- 16: Resolution: 1366x768, Channel: single, Dithering: Disable
	- 17: Resolution: 1024x600, Channel: single, Dithering: Enable
	- 18: Resolution: 1280x768, Channel: dual, Dithering: Enable
	- 19: Resolution: 1280x800, Channel: single, Dithering: Enable

    viafb_accel:
	- 0 : No 2D Hardware Acceleration
	- 1 : 2D Hardware Acceleration (default)

    viafb_SAMM_ON:
	- 0 : viafb_SAMM_ON disable (default)
	- 1 : viafb_SAMM_ON enable

    viafb_mode1: (secondary display device)
	- 640x480 (default)
	- 720x480
	- 800x600
	- 1024x768

    viafb_bpp1: (secondary display device)
	- 8, 16, 32 (default:32)

    viafb_refresh1: (secondary display device)
	- 60, 75, 85, 100, 120 (default:60)

    viafb_active_dev:
	This option is used to specify active devices.(CRT, DVI, CRT+LCD...)
	DVI stands for DVI or HDMI, E.g., If you want to enable HDMI,
	set viafb_active_dev=DVI. In SAMM case, the previous of
	viafb_active_dev is primary device, and the following is
	secondary device.

	For example:

	To enable one device, such as DVI only, we can use::

	    modprobe viafb viafb_active_dev=DVI

	To enable two devices, such as CRT+DVI::

	    modprobe viafb viafb_active_dev=CRT+DVI;

	For DuoView case, we can use::

	    modprobe viafb viafb_active_dev=CRT+DVI

	OR::

	    modprobe viafb viafb_active_dev=DVI+CRT...

	For SAMM case:

	If CRT is primary and DVI is secondary, we should use::

	    modprobe viafb viafb_active_dev=CRT+DVI viafb_SAMM_ON=1...

	If DVI is primary and CRT is secondary, we should use::

	    modprobe viafb viafb_active_dev=DVI+CRT viafb_SAMM_ON=1...

    viafb_display_hardware_layout:
	This option is used to specify display hardware layout for CX700 chip.

	- 1 : LCD only
	- 2 : DVI only
	- 3 : LCD+DVI (default)
	- 4 : LCD1+LCD2 (internal + internal)
	- 16: LCD1+ExternalLCD2 (internal + external)

    viafb_second_size:
	This option is used to set second device memory size(MB) in SAMM case.
	The minimal size is 16.

    viafb_platform_epia_dvi:
	This option is used to enable DVI on EPIA - M

	- 0 : No DVI on EPIA - M (default)
	- 1 : DVI on EPIA - M

    viafb_bus_width:
	When using 24 - Bit Bus Width Digital Interface,
	this option should be set.

	- 12: 12-Bit LVDS or 12-Bit TMDS (default)
	- 24: 24-Bit LVDS or 24-Bit TMDS

    viafb_device_lcd_dualedge:
	When using Dual Edge Panel, this option should be set.

	- 0 : No Dual Edge Panel (default)
	- 1 : Dual Edge Panel

    viafb_lcd_port:
	This option is used to specify LCD output port,
	available values are "DVP0" "DVP1" "DFP_HIGHLOW" "DFP_HIGH" "DFP_LOW".

	for external LCD + external DVI on CX700(External LCD is on DVP0),
	we should use::

	    modprobe viafb viafb_lcd_port=DVP0...

Notes:
    1. CRT may not display properly for DuoView CRT & DVI display at
       the "640x480" PAL mode with DVI overscan enabled.
    2. SAMM stands for single adapter multi monitors. It is different from
       multi-head since SAMM support multi monitor at driver layers, thus fbcon
       layer doesn't even know about it; SAMM's second screen doesn't have a
       device node file, thus a user mode application can't access it directly.
       When SAMM is enabled, viafb_mode and viafb_mode1, viafb_bpp and
       viafb_bpp1, viafb_refresh and viafb_refresh1 can be different.
    3. When console is depending on viafbinfo1, dynamically change resolution
       and bpp, need to call VIAFB specified ioctl interface VIAFB_SET_DEVICE
       instead of calling common ioctl function FBIOPUT_VSCREENINFO since
       viafb doesn't support multi-head well, or it will cause screen crush.

Configure viafb with "fbset" tool
---------------------------------

    "fbset" is an inbox utility of Linux.

    1. Inquire current viafb information, type::

	   # fbset -i

    2. Set various resolutions and viafb_refresh rates::

	   # fbset <resolution-vertical_sync>

       example::

	   # fbset "1024x768-75"

       or::

	   # fbset -g 1024 768 1024 768 32

       Check the file "/etc/fb.modes" to find display modes available.

    3. Set the color depth::

	   # fbset -depth <value>

       example::

	   # fbset -depth 16

Configure viafb via /proc
-------------------------
    The following files exist in /proc/viafb

    supported_output_devices
	This read-only file contains a full ',' separated list containing all
	output devices that could be available on your platform. It is likely
	that not all of those have a connector on your hardware but it should
	provide a good starting point to figure out which of those names match
	a real connector.

	Example::

		# cat /proc/viafb/supported_output_devices

    iga1/output_devices, iga2/output_devices
	These two files are readable and writable. iga1 and iga2 are the two
	independent units that produce the screen image. Those images can be
	forwarded to one or more output devices. Reading those files is a way
	to query which output devices are currently used by an iga.

	Example::

		# cat /proc/viafb/iga1/output_devices

	If there are no output devices printed the output of this iga is lost.
	This can happen for example if only one (the other) iga is used.
	Writing to these files allows adjusting the output devices during
	runtime. One can add new devices, remove existing ones or switch
	between igas. Essentially you can write a ',' separated list of device
	names (or a single one) in the same format as the output to those
	files. You can add a '+' or '-' as a prefix allowing simple addition
	and removal of devices. So a prefix '+' adds the devices from your list
	to the already existing ones, '-' removes the listed devices from the
	existing ones and if no prefix is given it replaces all existing ones
	with the listed ones. If you remove devices they are expected to turn
	off. If you add devices that are already part of the other iga they are
	removed there and added to the new one.

	Examples:

	Add CRT as output device to iga1::

		# echo +CRT > /proc/viafb/iga1/output_devices

	Remove (turn off) DVP1 and LVDS1 as output devices of iga2::

		# echo -DVP1,LVDS1 > /proc/viafb/iga2/output_devices

	Replace all iga1 output devices by CRT::

		# echo CRT > /proc/viafb/iga1/output_devices

Bootup with viafb
-----------------

Add the following line to your grub.conf::

    append = "video=viafb:viafb_mode=1024x768,viafb_bpp=32,viafb_refresh=85"

VIA Framebuffer modes
=====================

.. include:: viafb.modes
   :literal:


code:
===============================================================
vt8623fb - fbdev driver for graphics core in VIA VT8623 chipset
===============================================================

Supported Hardware
==================

VIA VT8623 [CLE266] chipset and	its graphics core
(known as CastleRock or Unichrome)

I tested vt8623fb on VIA EPIA ML-6000

Supported Features
==================

	*  4 bpp pseudocolor modes (with 18bit palette, two variants)
	*  8 bpp pseudocolor mode (with 18bit palette)
	* 16 bpp truecolor mode (RGB 565)
	* 32 bpp truecolor mode (RGB 888)
	* text mode (activated by bpp = 0)
	* doublescan mode variant (not available in text mode)
	* panning in both directions
	* suspend/resume support
	* DPMS support

Text mode is supported even in higher resolutions, but there is limitation to
lower pixclocks (maximum about 100 MHz). This limitation is not enforced by
driver. Text mode supports 8bit wide fonts only (hardware limitation) and
16bit tall fonts (driver limitation).

There are two 4 bpp modes. First mode (selected if nonstd == 0) is mode with
packed pixels, high nibble first. Second mode (selected if nonstd == 1) is mode
with interleaved planes (1 byte interleave), MSB first. Both modes support
8bit wide fonts only (driver limitation).

Suspend/resume works on systems that initialize video card during resume and
if device is active (for example used by fbcon).

Missing Features
================
(alias TODO list)

	* secondary (not initialized by BIOS) device support
	* MMIO support
	* interlaced mode variant
	* support for fontwidths != 8 in 4 bpp modes
	* support for fontheight != 16 in text mode
	* hardware cursor
	* video overlay support
	* vsync synchronization
	* acceleration support (8514-like 2D, busmaster transfers)

Known bugs
==========

	* cursor disable in text mode doesn't work

--
Ondrej Zajicek <santiago@crfreenet.org>


code:
For generic kernel features that need architecture support, the
arch-support.txt file in each feature directory shows the arch
support matrix, for all upstream Linux architectures.

The meaning of entries in the tables is:

    | ok |  # feature supported by the architecture
    |TODO|  # feature not yet supported by the architecture
    | .. |  # feature cannot be supported by the hardware
    | N/A|  # feature doesn't apply to the architecture


code:
#
# Feature name:          cBPF-JIT
#         Kconfig:       HAVE_CBPF_JIT
#         description:   arch supports cBPF JIT optimizations
#
    -----------------------
    |         arch |status|
    -----------------------
    |       alpha: | TODO |
    |         arc: | TODO |
    |         arm: | TODO |
    |       arm64: | TODO |
    |        csky: | TODO |
    |     hexagon: | TODO |
    |        ia64: | TODO |
    |   loongarch: | TODO |
    |        m68k: | TODO |
    |  microblaze: | TODO |
    |        mips: |  ok  |
    |       nios2: | TODO |
    |    openrisc: | TODO |
    |      parisc: | TODO |
    |     powerpc: |  ok  |
    |       riscv: | TODO |
    |        s390: | TODO |
    |          sh: | TODO |
    |       sparc: |  ok  |
    |          um: | TODO |
    |         x86: | TODO |
    |      xtensa: | TODO |
    -----------------------


code:
#
# Feature name:          eBPF-JIT
#         Kconfig:       HAVE_EBPF_JIT
#         description:   arch supports eBPF JIT optimizations
#
    -----------------------
    |         arch |status|
    -----------------------
    |       alpha: | TODO |
    |         arc: | TODO |
    |         arm: |  ok  |
    |       arm64: |  ok  |
    |        csky: | TODO |
    |     hexagon: | TODO |
    |        ia64: | TODO |
    |   loongarch: |  ok  |
    |        m68k: | TODO |
    |  microblaze: | TODO |
    |        mips: |  ok  |
    |       nios2: | TODO |
    |    openrisc: | TODO |
    |      parisc: | TODO |
    |     powerpc: |  ok  |
    |       riscv: |  ok  |
    |        s390: |  ok  |
    |          sh: | TODO |
    |       sparc: |  ok  |
    |          um: | TODO |
    |         x86: |  ok  |
    |      xtensa: | TODO |
    -----------------------


code:
#
# Feature name:          generic-idle-thread
#         Kconfig:       GENERIC_SMP_IDLE_THREAD
#         description:   arch makes use of the generic SMP idle thread facility
#
    -----------------------
    |         arch |status|
    -----------------------
    |       alpha: |  ok  |
    |         arc: |  ok  |
    |         arm: |  ok  |
    |       arm64: |  ok  |
    |        csky: |  ok  |
    |     hexagon: |  ok  |
    |        ia64: |  ok  |
    |   loongarch: |  ok  |
    |        m68k: | TODO |
    |  microblaze: | TODO |
    |        mips: |  ok  |
    |       nios2: | TODO |
    |    openrisc: |  ok  |
    |      parisc: |  ok  |
    |     powerpc: |  ok  |
    |       riscv: |  ok  |
    |        s390: |  ok  |
    |          sh: |  ok  |
    |       sparc: |  ok  |
    |          um: | TODO |
    |         x86: |  ok  |
    |      xtensa: |  ok  |
    -----------------------


code:
#
# Feature name:          jump-labels
#         Kconfig:       HAVE_ARCH_JUMP_LABEL
#         description:   arch supports live patched, high efficiency branches
#
    -----------------------
    |         arch |status|
    -----------------------
    |       alpha: | TODO |
    |         arc: |  ok  |
    |         arm: |  ok  |
    |       arm64: |  ok  |
    |        csky: |  ok  |
    |     hexagon: | TODO |
    |        ia64: | TODO |
    |   loongarch: | TODO |
    |        m68k: | TODO |
    |  microblaze: | TODO |
    |        mips: |  ok  |
    |       nios2: | TODO |
    |    openrisc: | TODO |
    |      parisc: |  ok  |
    |     powerpc: |  ok  |
    |       riscv: |  ok  |
    |        s390: |  ok  |
    |          sh: | TODO |
    |       sparc: |  ok  |
    |          um: | TODO |
    |         x86: |  ok  |
    |      xtensa: |  ok  |
    -----------------------


code:
#
# Feature name:          thread-info-in-task
#         Kconfig:       THREAD_INFO_IN_TASK
#         description:   arch makes use of the core kernel facility to embedd thread_info in task_struct
#
    -----------------------
    |         arch |status|
    -----------------------
    |       alpha: | TODO |
    |         arc: | TODO |
    |         arm: |  ok  |
    |       arm64: |  ok  |
    |        csky: | TODO |
    |     hexagon: | TODO |
    |        ia64: | TODO |
    |   loongarch: | TODO |
    |        m68k: | TODO |
    |  microblaze: | TODO |
    |        mips: | TODO |
    |       nios2: | TODO |
    |    openrisc: | TODO |
    |      parisc: |  ok  |
    |     powerpc: |  ok  |
    |       riscv: |  ok  |
    |        s390: |  ok  |
    |          sh: | TODO |
    |       sparc: | TODO |
    |          um: | TODO |
    |         x86: |  ok  |
    |      xtensa: | TODO |
    -----------------------


code:
#
# Feature name:          tracehook
#         Kconfig:       HAVE_ARCH_TRACEHOOK
#         description:   arch supports tracehook (ptrace) register handling APIs
#
    -----------------------
    |         arch |status|
    -----------------------
    |       alpha: | TODO |
    |         arc: |  ok  |
    |         arm: |  ok  |
    |       arm64: |  ok  |
    |        csky: |  ok  |
    |     hexagon: |  ok  |
    |        ia64: |  ok  |
    |   loongarch: |  ok  |
    |        m68k: | TODO |
    |  microblaze: | TODO |
    |        mips: |  ok  |
    |       nios2: |  ok  |
    |    openrisc: |  ok  |
    |      parisc: |  ok  |
    |     powerpc: |  ok  |
    |       riscv: |  ok  |
    |        s390: |  ok  |
    |          sh: |  ok  |
    |       sparc: |  ok  |
    |          um: | TODO |
    |         x86: |  ok  |
    |      xtensa: |  ok  |
    -----------------------


code:
#
# Feature name:          KASAN
#         Kconfig:       HAVE_ARCH_KASAN
#         description:   arch supports the KASAN runtime memory checker
#
    -----------------------
    |         arch |status|
    -----------------------
    |       alpha: | TODO |
    |         arc: | TODO |
    |         arm: |  ok  |
    |       arm64: |  ok  |
    |        csky: | TODO |
    |     hexagon: | TODO |
    |        ia64: | TODO |
    |   loongarch: | TODO |
    |        m68k: | TODO |
    |  microblaze: | TODO |
    |        mips: | TODO |
    |       nios2: | TODO |
    |    openrisc: | TODO |
    |      parisc: | TODO |
    |     powerpc: |  ok  |
    |       riscv: |  ok  |
    |        s390: |  ok  |
    |          sh: | TODO |
    |       sparc: | TODO |
    |          um: |  ok  |
    |         x86: |  ok  |
    |      xtensa: |  ok  |
    -----------------------


code:
#
# Feature name:          debug-vm-pgtable
#         Kconfig:       ARCH_HAS_DEBUG_VM_PGTABLE
#         description:   arch supports pgtable tests for semantics compliance
#
    -----------------------
    |         arch |status|
    -----------------------
    |       alpha: | TODO |
    |         arc: |  ok  |
    |         arm: | TODO |
    |       arm64: |  ok  |
    |        csky: | TODO |
    |     hexagon: | TODO |
    |        ia64: | TODO |
    |   loongarch: | TODO |
    |        m68k: | TODO |
    |  microblaze: | TODO |
    |        mips: | TODO |
    |       nios2: | TODO |
    |    openrisc: | TODO |
    |      parisc: |  ok  |
    |     powerpc: |  ok  |
    |       riscv: |  ok  |
    |        s390: |  ok  |
    |          sh: | TODO |
    |       sparc: | TODO |
    |          um: | TODO |
    |         x86: |  ok  |
    |      xtensa: |  ok  |
    -----------------------


code:
#
# Feature name:          gcov-profile-all
#         Kconfig:       ARCH_HAS_GCOV_PROFILE_ALL
#         description:   arch supports whole-kernel GCOV code coverage profiling
#
    -----------------------
    |         arch |status|
    -----------------------
    |       alpha: | TODO |
    |         arc: | TODO |
    |         arm: |  ok  |
    |       arm64: |  ok  |
    |        csky: |  ok  |
    |     hexagon: | TODO |
    |        ia64: | TODO |
    |   loongarch: | TODO |
    |        m68k: | TODO |
    |  microblaze: |  ok  |
    |        mips: |  ok  |
    |       nios2: | TODO |
    |    openrisc: | TODO |
    |      parisc: | TODO |
    |     powerpc: |  ok  |
    |       riscv: |  ok  |
    |        s390: |  ok  |
    |          sh: |  ok  |
    |       sparc: | TODO |
    |          um: |  ok  |
    |         x86: |  ok  |
    |      xtensa: |  ok  |
    -----------------------


code:
#
# Feature name:          kcov
#         Kconfig:       ARCH_HAS_KCOV
#         description:   arch supports kcov for coverage-guided fuzzing
#
    -----------------------
    |         arch |status|
    -----------------------
    |       alpha: | TODO |
    |         arc: | TODO |
    |         arm: |  ok  |
    |       arm64: |  ok  |
    |        csky: | TODO |
    |     hexagon: | TODO |
    |        ia64: | TODO |
    |   loongarch: | TODO |
    |        m68k: | TODO |
    |  microblaze: | TODO |
    |        mips: |  ok  |
    |       nios2: | TODO |
    |    openrisc: | TODO |
    |      parisc: | TODO |
    |     powerpc: |  ok  |
    |       riscv: |  ok  |
    |        s390: |  ok  |
    |          sh: | TODO |
    |       sparc: | TODO |
    |          um: |  ok  |
    |         x86: |  ok  |
    |      xtensa: |  ok  |
    -----------------------


code:
#
# Feature name:          kgdb
#         Kconfig:       HAVE_ARCH_KGDB
#         description:   arch supports the kGDB kernel debugger
#
    -----------------------
    |         arch |status|
    -----------------------
    |       alpha: | TODO |
    |         arc: |  ok  |
    |         arm: |  ok  |
    |       arm64: |  ok  |
    |        csky: | TODO |
    |     hexagon: |  ok  |
    |        ia64: | TODO |
    |   loongarch: | TODO |
    |        m68k: | TODO |
    |  microblaze: |  ok  |
    |        mips: |  ok  |
    |       nios2: |  ok  |
    |    openrisc: | TODO |
    |      parisc: |  ok  |
    |     powerpc: |  ok  |
    |       riscv: |  ok  |
    |        s390: | TODO |
    |          sh: |  ok  |
    |       sparc: |  ok  |
    |          um: | TODO |
    |         x86: |  ok  |
    |      xtensa: | TODO |
    -----------------------


code:
#
# Feature name:          kmemleak
#         Kconfig:       HAVE_DEBUG_KMEMLEAK
#         description:   arch supports the kernel memory leak detector
#
    -----------------------
    |         arch |status|
    -----------------------
    |       alpha: | TODO |
    |         arc: |  ok  |
    |         arm: |  ok  |
    |       arm64: |  ok  |
    |        csky: |  ok  |
    |     hexagon: | TODO |
    |        ia64: | TODO |
    |   loongarch: | TODO |
    |        m68k: | TODO |
    |  microblaze: |  ok  |
    |        mips: |  ok  |
    |       nios2: | TODO |
    |    openrisc: | TODO |
    |      parisc: | TODO |
    |     powerpc: |  ok  |
    |       riscv: |  ok  |
    |        s390: |  ok  |
    |          sh: |  ok  |
    |       sparc: |  ok  |
    |          um: |  ok  |
    |         x86: |  ok  |
    |      xtensa: |  ok  |
    -----------------------


code:
#
# Feature name:          kprobes-on-ftrace
#         Kconfig:       HAVE_KPROBES_ON_FTRACE
#         description:   arch supports combined kprobes and ftrace live patching
#
    -----------------------
    |         arch |status|
    -----------------------
    |       alpha: | TODO |
    |         arc: | TODO |
    |         arm: | TODO |
    |       arm64: | TODO |
    |        csky: |  ok  |
    |     hexagon: | TODO |
    |        ia64: | TODO |
    |   loongarch: | TODO |
    |        m68k: | TODO |
    |  microblaze: | TODO |
    |        mips: | TODO |
    |       nios2: | TODO |
    |    openrisc: | TODO |
    |      parisc: |  ok  |
    |     powerpc: |  ok  |
    |       riscv: |  ok  |
    |        s390: |  ok  |
    |          sh: | TODO |
    |       sparc: | TODO |
    |          um: | TODO |
    |         x86: |  ok  |
    |      xtensa: | TODO |
    -----------------------


code:
#
# Feature name:          kprobes
#         Kconfig:       HAVE_KPROBES
#         description:   arch supports live patched kernel probe
#
    -----------------------
    |         arch |status|
    -----------------------
    |       alpha: | TODO |
    |         arc: |  ok  |
    |         arm: |  ok  |
    |       arm64: |  ok  |
    |        csky: |  ok  |
    |     hexagon: | TODO |
    |        ia64: |  ok  |
    |   loongarch: | TODO |
    |        m68k: | TODO |
    |  microblaze: | TODO |
    |        mips: |  ok  |
    |       nios2: | TODO |
    |    openrisc: | TODO |
    |      parisc: |  ok  |
    |     powerpc: |  ok  |
    |       riscv: |  ok  |
    |        s390: |  ok  |
    |          sh: |  ok  |
    |       sparc: |  ok  |
    |          um: | TODO |
    |         x86: |  ok  |
    |      xtensa: | TODO |
    -----------------------


code:
#
# Feature name:          kretprobes
#         Kconfig:       HAVE_KRETPROBES
#         description:   arch supports kernel function-return probes
#
    -----------------------
    |         arch |status|
    -----------------------
    |       alpha: | TODO |
    |         arc: |  ok  |
    |         arm: |  ok  |
    |       arm64: |  ok  |
    |        csky: |  ok  |
    |     hexagon: | TODO |
    |        ia64: |  ok  |
    |   loongarch: | TODO |
    |        m68k: | TODO |
    |  microblaze: | TODO |
    |        mips: |  ok  |
    |       nios2: | TODO |
    |    openrisc: | TODO |
    |      parisc: |  ok  |
    |     powerpc: |  ok  |
    |       riscv: |  ok  |
    |        s390: |  ok  |
    |          sh: |  ok  |
    |       sparc: |  ok  |
    |          um: | TODO |
    |         x86: |  ok  |
    |      xtensa: | TODO |
    -----------------------


code:
#
# Feature name:          optprobes
#         Kconfig:       HAVE_OPTPROBES
#         description:   arch supports live patched optprobes
#
    -----------------------
    |         arch |status|
    -----------------------
    |       alpha: | TODO |
    |         arc: | TODO |
    |         arm: |  ok  |
    |       arm64: | TODO |
    |        csky: | TODO |
    |     hexagon: | TODO |
    |        ia64: | TODO |
    |   loongarch: | TODO |
    |        m68k: | TODO |
    |  microblaze: | TODO |
    |        mips: | TODO |
    |       nios2: | TODO |
    |    openrisc: | TODO |
    |      parisc: | TODO |
    |     powerpc: |  ok  |
    |       riscv: | TODO |
    |        s390: | TODO |
    |          sh: | TODO |
    |       sparc: | TODO |
    |          um: | TODO |
    |         x86: |  ok  |
    |      xtensa: | TODO |
    -----------------------


code:
#
# Feature name:          stackprotector
#         Kconfig:       HAVE_STACKPROTECTOR
#         description:   arch supports compiler driven stack overflow protection
#
    -----------------------
    |         arch |status|
    -----------------------
    |       alpha: | TODO |
    |         arc: | TODO |
    |         arm: |  ok  |
    |       arm64: |  ok  |
    |        csky: |  ok  |
    |     hexagon: | TODO |
    |        ia64: | TODO |
    |   loongarch: | TODO |
    |        m68k: | TODO |
    |  microblaze: | TODO |
    |        mips: |  ok  |
    |       nios2: | TODO |
    |    openrisc: | TODO |
    |      parisc: | TODO |
    |     powerpc: |  ok  |
    |       riscv: |  ok  |
    |        s390: | TODO |
    |          sh: |  ok  |
    |       sparc: | TODO |
    |          um: | TODO |
    |         x86: |  ok  |
    |      xtensa: |  ok  |
    -----------------------


code:
#
# Feature name:          uprobes
#         Kconfig:       ARCH_SUPPORTS_UPROBES
#         description:   arch supports live patched user probes
#
    -----------------------
    |         arch |status|
    -----------------------
    |       alpha: | TODO |
    |         arc: | TODO |
    |         arm: |  ok  |
    |       arm64: |  ok  |
    |        csky: |  ok  |
    |     hexagon: | TODO |
    |        ia64: | TODO |
    |   loongarch: | TODO |
    |        m68k: | TODO |
    |  microblaze: | TODO |
    |        mips: |  ok  |
    |       nios2: | TODO |
    |    openrisc: | TODO |
    |      parisc: | TODO |
    |     powerpc: |  ok  |
    |       riscv: |  ok  |
    |        s390: |  ok  |
    |          sh: | TODO |
    |       sparc: |  ok  |
    |          um: | TODO |
    |         x86: |  ok  |
    |      xtensa: | TODO |
    -----------------------


code:
#
# Feature name:          user-ret-profiler
#         Kconfig:       HAVE_USER_RETURN_NOTIFIER
#         description:   arch supports user-space return from system call profiler
#
    -----------------------
    |         arch |status|
    -----------------------
    |       alpha: | TODO |
    |         arc: | TODO |
    |         arm: | TODO |
    |       arm64: | TODO |
    |        csky: | TODO |
    |     hexagon: | TODO |
    |        ia64: | TODO |
    |   loongarch: | TODO |
    |        m68k: | TODO |
    |  microblaze: | TODO |
    |        mips: | TODO |
    |       nios2: | TODO |
    |    openrisc: | TODO |
    |      parisc: | TODO |
    |     powerpc: | TODO |
    |       riscv: | TODO |
    |        s390: | TODO |
    |          sh: | TODO |
    |       sparc: | TODO |
    |          um: | TODO |
    |         x86: |  ok  |
    |      xtensa: | TODO |
    -----------------------


code:
#
# Feature name:          dma-contiguous
#         Kconfig:       HAVE_DMA_CONTIGUOUS
#         description:   arch supports the DMA CMA (continuous memory allocator)
#
    -----------------------
    |         arch |status|
    -----------------------
    |       alpha: | TODO |
    |         arc: | TODO |
    |         arm: |  ok  |
    |       arm64: |  ok  |
    |        csky: |  ok  |
    |     hexagon: | TODO |
    |        ia64: | TODO |
    |   loongarch: |  ok  |
    |        m68k: | TODO |
    |  microblaze: |  ok  |
    |        mips: |  ok  |
    |       nios2: | TODO |
    |    openrisc: | TODO |
    |      parisc: | TODO |
    |     powerpc: | TODO |
    |       riscv: |  ok  |
    |        s390: |  ok  |
    |          sh: | TODO |
    |       sparc: | TODO |
    |          um: | TODO |
    |         x86: |  ok  |
    |      xtensa: |  ok  |
    -----------------------


code:
# SPDX-License-Identifier: GPL-2.0
#
# Small script that visualizes the kernel feature support status
# of an architecture.
#
# (If no arguments are given then it will print the host architecture's status.)
#

ARCH=${1:-$(uname -m | sed 's/x86_64/x86/' | sed 's/i386/x86/')}

$(dirname $0)/../../scripts/get_feat.pl list --arch $ARCH


code:
#
# Feature name:          cmpxchg-local
#         Kconfig:       HAVE_CMPXCHG_LOCAL
#         description:   arch supports the this_cpu_cmpxchg() API
#
    -----------------------
    |         arch |status|
    -----------------------
    |       alpha: | TODO |
    |         arc: | TODO |
    |         arm: | TODO |
    |       arm64: |  ok  |
    |        csky: | TODO |
    |     hexagon: | TODO |
    |        ia64: | TODO |
    |   loongarch: | TODO |
    |        m68k: | TODO |
    |  microblaze: | TODO |
    |        mips: | TODO |
    |       nios2: | TODO |
    |    openrisc: | TODO |
    |      parisc: | TODO |
    |     powerpc: | TODO |
    |       riscv: | TODO |
    |        s390: |  ok  |
    |          sh: | TODO |
    |       sparc: | TODO |
    |          um: | TODO |
    |         x86: |  ok  |
    |      xtensa: | TODO |
    -----------------------


code:
#
# Feature name:          lockdep
#         Kconfig:       LOCKDEP_SUPPORT
#         description:   arch supports the runtime locking correctness debug facility
#
    -----------------------
    |         arch |status|
    -----------------------
    |       alpha: | TODO |
    |         arc: |  ok  |
    |         arm: |  ok  |
    |       arm64: |  ok  |
    |        csky: |  ok  |
    |     hexagon: |  ok  |
    |        ia64: | TODO |
    |   loongarch: |  ok  |
    |        m68k: | TODO |
    |  microblaze: |  ok  |
    |        mips: |  ok  |
    |       nios2: | TODO |
    |    openrisc: |  ok  |
    |      parisc: | TODO |
    |     powerpc: |  ok  |
    |       riscv: |  ok  |
    |        s390: |  ok  |
    |          sh: |  ok  |
    |       sparc: |  ok  |
    |          um: |  ok  |
    |         x86: |  ok  |
    |      xtensa: |  ok  |
    -----------------------


code:
#
# Feature name:          queued-rwlocks
#         Kconfig:       ARCH_USE_QUEUED_RWLOCKS
#         description:   arch supports queued rwlocks
#
    -----------------------
    |         arch |status|
    -----------------------
    |       alpha: | TODO |
    |         arc: | TODO |
    |         arm: | TODO |
    |       arm64: |  ok  |
    |        csky: |  ok  |
    |     hexagon: | TODO |
    |        ia64: | TODO |
    |   loongarch: |  ok  |
    |        m68k: | TODO |
    |  microblaze: | TODO |
    |        mips: |  ok  |
    |       nios2: | TODO |
    |    openrisc: |  ok  |
    |      parisc: | TODO |
    |     powerpc: |  ok  |
    |       riscv: |  ok  |
    |        s390: | TODO |
    |          sh: | TODO |
    |       sparc: |  ok  |
    |          um: | TODO |
    |         x86: |  ok  |
    |      xtensa: |  ok  |
    -----------------------


code:
#
# Feature name:          queued-spinlocks
#         Kconfig:       ARCH_USE_QUEUED_SPINLOCKS
#         description:   arch supports queued spinlocks
#
    -----------------------
    |         arch |status|
    -----------------------
    |       alpha: | TODO |
    |         arc: | TODO |
    |         arm: | TODO |
    |       arm64: |  ok  |
    |        csky: |  ok  |
    |     hexagon: | TODO |
    |        ia64: | TODO |
    |   loongarch: |  ok  |
    |        m68k: | TODO |
    |  microblaze: | TODO |
    |        mips: |  ok  |
    |       nios2: | TODO |
    |    openrisc: |  ok  |
    |      parisc: | TODO |
    |     powerpc: |  ok  |
    |       riscv: | TODO |
    |        s390: | TODO |
    |          sh: | TODO |
    |       sparc: |  ok  |
    |          um: | TODO |
    |         x86: |  ok  |
    |      xtensa: |  ok  |
    -----------------------


code:
#
# Feature name:          kprobes-event
#         Kconfig:       HAVE_REGS_AND_STACK_ACCESS_API
#         description:   arch supports kprobes with perf events
#
    -----------------------
    |         arch |status|
    -----------------------
    |       alpha: | TODO |
    |         arc: |  ok  |
    |         arm: |  ok  |
    |       arm64: |  ok  |
    |        csky: |  ok  |
    |     hexagon: |  ok  |
    |        ia64: | TODO |
    |   loongarch: |  ok  |
    |        m68k: | TODO |
    |  microblaze: | TODO |
    |        mips: |  ok  |
    |       nios2: | TODO |
    |    openrisc: | TODO |
    |      parisc: |  ok  |
    |     powerpc: |  ok  |
    |       riscv: |  ok  |
    |        s390: |  ok  |
    |          sh: |  ok  |
    |       sparc: |  ok  |
    |          um: | TODO |
    |         x86: |  ok  |
    |      xtensa: | TODO |
    -----------------------


code:
#
# Feature name:          perf-regs
#         Kconfig:       HAVE_PERF_REGS
#         description:   arch supports perf events register access
#
    -----------------------
    |         arch |status|
    -----------------------
    |       alpha: | TODO |
    |         arc: | TODO |
    |         arm: |  ok  |
    |       arm64: |  ok  |
    |        csky: |  ok  |
    |     hexagon: | TODO |
    |        ia64: | TODO |
    |   loongarch: |  ok  |
    |        m68k: | TODO |
    |  microblaze: | TODO |
    |        mips: |  ok  |
    |       nios2: | TODO |
    |    openrisc: | TODO |
    |      parisc: | TODO |
    |     powerpc: |  ok  |
    |       riscv: |  ok  |
    |        s390: |  ok  |
    |          sh: | TODO |
    |       sparc: | TODO |
    |          um: | TODO |
    |         x86: |  ok  |
    |      xtensa: | TODO |
    -----------------------


code:
#
# Feature name:          perf-stackdump
#         Kconfig:       HAVE_PERF_USER_STACK_DUMP
#         description:   arch supports perf events stack dumps
#
    -----------------------
    |         arch |status|
    -----------------------
    |       alpha: | TODO |
    |         arc: | TODO |
    |         arm: |  ok  |
    |       arm64: |  ok  |
    |        csky: |  ok  |
    |     hexagon: | TODO |
    |        ia64: | TODO |
    |   loongarch: |  ok  |
    |        m68k: | TODO |
    |  microblaze: | TODO |
    |        mips: |  ok  |
    |       nios2: | TODO |
    |    openrisc: | TODO |
    |      parisc: | TODO |
    |     powerpc: |  ok  |
    |       riscv: |  ok  |
    |        s390: |  ok  |
    |          sh: | TODO |
    |       sparc: | TODO |
    |          um: | TODO |
    |         x86: |  ok  |
    |      xtensa: | TODO |
    -----------------------


code:
#
# Feature name:          membarrier-sync-core
#         Kconfig:       ARCH_HAS_MEMBARRIER_SYNC_CORE
#         description:   arch supports core serializing membarrier
#
# Architecture requirements
#
# * arm/arm64/powerpc
#
# Rely on implicit context synchronization as a result of exception return
# when returning from IPI handler, and when returning to user-space.
#
# * x86
#
# x86-32 uses IRET as return from interrupt, which takes care of the IPI.
# However, it uses both IRET and SYSEXIT to go back to user-space. The IRET
# instruction is core serializing, but not SYSEXIT.
#
# x86-64 uses IRET as return from interrupt, which takes care of the IPI.
# However, it can return to user-space through either SYSRETL (compat code),
# SYSRETQ, or IRET.
#
# Given that neither SYSRET{L,Q}, nor SYSEXIT, are core serializing, we rely
# instead on write_cr3() performed by switch_mm() to provide core serialization
# after changing the current mm, and deal with the special case of kthread ->
# uthread (temporarily keeping current mm into active_mm) by issuing a
# sync_core_before_usermode() in that specific case.
#
    -----------------------
    |         arch |status|
    -----------------------
    |       alpha: | TODO |
    |         arc: | TODO |
    |         arm: |  ok  |
    |       arm64: |  ok  |
    |        csky: | TODO |
    |     hexagon: | TODO |
    |        ia64: | TODO |
    |   loongarch: | TODO |
    |        m68k: | TODO |
    |  microblaze: | TODO |
    |        mips: | TODO |
    |       nios2: | TODO |
    |    openrisc: | TODO |
    |      parisc: | TODO |
    |     powerpc: |  ok  |
    |       riscv: | TODO |
    |        s390: | TODO |
    |          sh: | TODO |
    |       sparc: | TODO |
    |          um: | TODO |
    |         x86: |  ok  |
    |      xtensa: | TODO |
    -----------------------


code:
#
# Feature name:          numa-balancing
#         Kconfig:       ARCH_SUPPORTS_NUMA_BALANCING
#         description:   arch supports NUMA balancing
#
    -----------------------
    |         arch |status|
    -----------------------
    |       alpha: | TODO |
    |         arc: |  ..  |
    |         arm: |  ..  |
    |       arm64: |  ok  |
    |        csky: |  ..  |
    |     hexagon: |  ..  |
    |        ia64: | TODO |
    |   loongarch: |  ok  |
    |        m68k: |  ..  |
    |  microblaze: |  ..  |
    |        mips: | TODO |
    |       nios2: |  ..  |
    |    openrisc: |  ..  |
    |      parisc: |  ..  |
    |     powerpc: |  ok  |
    |       riscv: |  ok  |
    |        s390: |  ok  |
    |          sh: |  ..  |
    |       sparc: | TODO |
    |          um: |  ..  |
    |         x86: |  ok  |
    |      xtensa: |  ..  |
    -----------------------


code:
#
# Small script that refreshes the kernel feature support status in place.
#

for F_FILE in Documentation/features/*/*/arch-support.txt; do
	F=$(grep "^#         Kconfig:" "$F_FILE" | cut -c26-)

	#
	# Each feature F is identified by a pair (O, K), where 'O' can
	# be either the empty string (for 'nop') or "not" (the logical
	# negation operator '!'); other operators are not supported.
	#
	O=""
	K=$F
	if [[ "$F" == !* ]]; then
		O="not"
		K=$(echo $F | sed -e 's/^!//g')
	fi

	#
	# F := (O, K) is 'valid' iff there is a Kconfig file (for some
	# arch) which contains K.
	#
	# Notice that this definition entails an 'asymmetry' between
	# the case 'O = ""' and the case 'O = "not"'. E.g., F may be
	# _invalid_ if:
	#
	# [case 'O = ""']
	#   1) no arch provides support for F,
	#   2) K does not exist (e.g., it was renamed/mis-typed);
	#
	# [case 'O = "not"']
	#   3) all archs provide support for F,
	#   4) as in (2).
	#
	# The rationale for adopting this definition (and, thus, for
	# keeping the asymmetry) is:
	#
	#       We want to be able to 'detect' (2) (or (4)).
	#
	# (1) and (3) may further warn the developers about the fact
	# that K can be removed.
	#
	F_VALID="false"
	for ARCH_DIR in arch/*/; do
		K_FILES=$(find $ARCH_DIR -name "Kconfig*")
		K_GREP=$(grep "$K" $K_FILES)
		if [ ! -z "$K_GREP" ]; then
			F_VALID="true"
			break
		fi
	done
	if [ "$F_VALID" = "false" ]; then
		printf "WARNING: '%s' is not a valid Kconfig\n" "$F"
	fi

	T_FILE="$F_FILE.tmp"
	grep "^#" $F_FILE > $T_FILE
	echo "    -----------------------" >> $T_FILE
	echo "    |         arch |status|" >> $T_FILE
	echo "    -----------------------" >> $T_FILE
	for ARCH_DIR in arch/*/; do
		ARCH=$(echo $ARCH_DIR | sed -e 's/^arch//g' | sed -e 's/\///g')
		K_FILES=$(find $ARCH_DIR -name "Kconfig*")
		K_GREP=$(grep "$K" $K_FILES)
		#
		# Arch support status values for (O, K) are updated according
		# to the following rules.
		#
		#   - ("", K) is 'supported by a given arch', if there is a
		#     Kconfig file for that arch which contains K;
		#
		#   - ("not", K) is 'supported by a given arch', if there is
		#     no Kconfig file for that arch which contains K;
		#
		#   - otherwise: preserve the previous status value (if any),
		#                default to 'not yet supported'.
		#
		# Notice that, according these rules, invalid features may be
		# updated/modified.
		#
		if [ "$O" = "" ] && [ ! -z "$K_GREP" ]; then
			printf "    |%12s: |  ok  |\n" "$ARCH" >> $T_FILE
		elif [ "$O" = "not" ] && [ -z "$K_GREP" ]; then
			printf "    |%12s: |  ok  |\n" "$ARCH" >> $T_FILE
		else
			S=$(grep -v "^#" "$F_FILE" | grep " $ARCH:")
			if [ ! -z "$S" ]; then
				echo "$S" >> $T_FILE
			else
				printf "    |%12s: | TODO |\n" "$ARCH" \
					>> $T_FILE
			fi
		fi
	done
	echo "    -----------------------" >> $T_FILE
	mv $T_FILE $F_FILE
done


code:
#
# Feature name:          seccomp-filter
#         Kconfig:       HAVE_ARCH_SECCOMP_FILTER
#         description:   arch supports seccomp filters
#
    -----------------------
    |         arch |status|
    -----------------------
    |       alpha: | TODO |
    |         arc: | TODO |
    |         arm: |  ok  |
    |       arm64: |  ok  |
    |        csky: |  ok  |
    |     hexagon: | TODO |
    |        ia64: | TODO |
    |   loongarch: |  ok  |
    |        m68k: | TODO |
    |  microblaze: | TODO |
    |        mips: |  ok  |
    |       nios2: | TODO |
    |    openrisc: | TODO |
    |      parisc: |  ok  |
    |     powerpc: |  ok  |
    |       riscv: |  ok  |
    |        s390: |  ok  |
    |          sh: |  ok  |
    |       sparc: | TODO |
    |          um: |  ok  |
    |         x86: |  ok  |
    |      xtensa: |  ok  |
    -----------------------


code:
#
# Feature name:          arch-tick-broadcast
#         Kconfig:       ARCH_HAS_TICK_BROADCAST
#         description:   arch provides tick_broadcast()
#
    -----------------------
    |         arch |status|
    -----------------------
    |       alpha: | TODO |
    |         arc: | TODO |
    |         arm: |  ok  |
    |       arm64: |  ok  |
    |        csky: | TODO |
    |     hexagon: | TODO |
    |        ia64: | TODO |
    |   loongarch: |  ok  |
    |        m68k: | TODO |
    |  microblaze: | TODO |
    |        mips: |  ok  |
    |       nios2: | TODO |
    |    openrisc: | TODO |
    |      parisc: | TODO |
    |     powerpc: |  ok  |
    |       riscv: |  ok  |
    |        s390: | TODO |
    |          sh: |  ok  |
    |       sparc: | TODO |
    |          um: | TODO |
    |         x86: | TODO |
    |      xtensa: | TODO |
    -----------------------


code:
#
# Feature name:          clockevents
#         Kconfig:       !LEGACY_TIMER_TICK
#         description:   arch support generic clock events
#
    -----------------------
    |         arch |status|
    -----------------------
    |       alpha: |  ok  |
    |         arc: |  ok  |
    |         arm: | TODO |
    |       arm64: |  ok  |
    |        csky: |  ok  |
    |     hexagon: |  ok  |
    |        ia64: | TODO |
    |   loongarch: |  ok  |
    |        m68k: | TODO |
    |  microblaze: |  ok  |
    |        mips: |  ok  |
    |       nios2: |  ok  |
    |    openrisc: |  ok  |
    |      parisc: | TODO |
    |     powerpc: |  ok  |
    |       riscv: |  ok  |
    |        s390: |  ok  |
    |          sh: |  ok  |
    |       sparc: |  ok  |
    |          um: |  ok  |
    |         x86: |  ok  |
    |      xtensa: |  ok  |
    -----------------------


code:
#
# Feature name:          user-context-tracking
#         Kconfig:       HAVE_CONTEXT_TRACKING_USER
#         description:   arch supports user context tracking for NO_HZ_FULL
#
    -----------------------
    |         arch |status|
    -----------------------
    |       alpha: | TODO |
    |         arc: | TODO |
    |         arm: |  ok  |
    |       arm64: |  ok  |
    |        csky: |  ok  |
    |     hexagon: | TODO |
    |        ia64: | TODO |
    |   loongarch: |  ok  |
    |        m68k: | TODO |
    |  microblaze: | TODO |
    |        mips: |  ok  |
    |       nios2: | TODO |
    |    openrisc: | TODO |
    |      parisc: | TODO |
    |     powerpc: |  ok  |
    |       riscv: |  ok  |
    |        s390: | TODO |
    |          sh: | TODO |
    |       sparc: |  ok  |
    |          um: | TODO |
    |         x86: |  ok  |
    |      xtensa: |  ok  |
    -----------------------


code:
#
# Feature name:          irq-time-acct
#         Kconfig:       HAVE_IRQ_TIME_ACCOUNTING
#         description:   arch supports precise IRQ time accounting
#
    -----------------------
    |         arch |status|
    -----------------------
    |       alpha: |  ..  |
    |         arc: | TODO |
    |         arm: |  ok  |
    |       arm64: |  ok  |
    |        csky: | TODO |
    |     hexagon: | TODO |
    |        ia64: |  ..  |
    |   loongarch: |  ok  |
    |        m68k: | TODO |
    |  microblaze: | TODO |
    |        mips: |  ok  |
    |       nios2: | TODO |
    |    openrisc: | TODO |
    |      parisc: |  ..  |
    |     powerpc: |  ok  |
    |       riscv: |  ok  |
    |        s390: |  ..  |
    |          sh: | TODO |
    |       sparc: |  ..  |
    |          um: | TODO |
    |         x86: |  ok  |
    |      xtensa: |  ok  |
    -----------------------