X11 Window System

X is an application that is used to manage input devices, like a mouse and a keyboard, and the output devices like displays connected to a system. Any user application can communicate with the display graphics interfaces using different service routines.
Official documentation is at:
In the context of running graphic applications on top of X, in previous releases you could either have X running by default on the Ubuntu root filesystem started by the lightdm or gdm3 service, or start it manually. In this release, lightdm or gdm3 is not enabled by default. You must start X server manually.

Manually Starting X Server

To start the X server
The display configuration may be defined in xorg.conf before starting the server. After the server starts, use xrandr to set runtime configurations. For more information, see the Using xrandr for Runtime Configuration.
Execute the following command:
sudo -b X -ac -noreset -nolisten tcp
The command line arguments may vary depending on platform.
To kill the X server
To get the pid of the X server, use:
ps aux | grep “X”
Then execute:
sudo kill <X server pid>

Runtime Configuration

Xorg provides several mechanisms that provide configuration and run-time parameters:
Command line options
Environment variables
xorg.conf and xorg.conf.d configuration files
Fallback defaults
The SDK provides utilities for changing the configuration and run-time parameters:
xrandr utility—changes runtime parameters
nvidia-xconfig helper utility (tool)—assist in configuring xorg.conf
Customers who support hot plugging of an HDMI display must implement an X11 client that reconfigures the HDMI display upon receipt of an RRScreenChangeNotify X11 event. Typically, a gnome-settings-daemon is used for that purpose.
This solution is required to work around the X11 response to a hot-plugged HDMI display. During that response, X11 registers the HDMI output as connected but does not perform an automatic mode-set.

Using xrandr for Runtime Configuration

The NVIDIA Tegra Driver supports the XRandR 1.2 (X11 Rotate and Resize) extension. This extension allows dynamic enabling, resizing, positioning, and orienting of displays. With the xrandr command line utility, you can control XRandR. That utility is included in the x11-xserver-utils package. The drive-setup.sh installation script installs that package.

Querying Supported Monitors and Screen Resolutions

You can use xrandr to get information about supported monitors and screen resolutions.
To query attached displays and detect available modes
With the X server running, enter the following command in a terminal window:
Output is similar to the following:
Screen 0: minimum 8 x 8, current 2560 x 1600, maximum 16384 x 16384
DP-0 connected primary 2560x1600+0+0 (normal left inverted right x axis y axis) 220mm x 140mm
2560x1600 60.0*+
HDMI-0 disconnected (normal left inverted right x axis y axis)

Obtaining Additional Help

The xrandr utility provides a help menu that lists all supported options and provides guidance on their use.
To get further help and view all available options
In a terminal window, enter:
xrandr --help

Modifying the Static Configuration (Optional)

The minimal xorg.conf is installed on the target in the following location:
Additionally, directories of *.conf fragment files are also located in the following locations:
By default, xorg.conf contains no specific settings for the screen resolution, virtual desktop size, bit depth, and display select, but instead query's the driver for the optimum settings based on displays enabled. It is the goal of the Tegra driver for the default settings along with runtime xrandr commands and X command-line arguments to be sufficient for most needs. In cases where defaults are not sufficient, appropriate settings for screen resolution, bit depth, and monitor enablement can be configured to create custom defaults. xrandr may still be used for runtime manipulation.
It is recommended that you use the nvidia-xconfig configuration tool to edit the xorg.conf file, rather than editing by hand. However, there may be circumstances where hand-editing is required.

Using nvidia-xconfig to Configure xorg.conf

The NVIDIA X configuration tool, nvidia-xconfig, simplifies the task of modifying your xong.conf file. That tool parses the xorg.conf file, saves a backup, and then performs modifications to the configuration based on your choice of command-line options.

Getting Help on nvidia-xconfig

The nvidia-xconfig tool provides basic and advanced help.
To get basic help for nvidia-xconfig
In a terminal window, enter:
nvidia-xconfig --help
To get options for modifying xorg.conf
In a terminal window, enter:
nvidia-xconfig --advanced-help

nvidia-xconfig Usage Examples

The nvidia-xconfig tool provides many options. This section provides instructions on a small subset of the supported options.

Specifying a Custom EDID for the Monitor

If X11 does not recognize the mode list of a particular model of monitor, you may find that the monitor has an invalid extended display identification data (EDID). When that happens, the X driver cannot accurately determine the capabilities of the monitor.
To specify a custom EDID for the monitor
In a terminal window, enter:
nvidia-xconfig --custom-edid=HDMI-0:<path>
Where <path> is the complete path to edid.bin.

Setting Color Bit-Depth

You can use the nvidia-xconfig tool to set color bit-depth in the xorg.conf file.
To start X11 with a particular color bit-depth
In a terminal window, enter:
nvidia-xconfig --depth=<depth>
Where <depth> is one of the following supported color bit-depth values: 8, 15, 16, 24, and 30. For example:
nvidia-xconfig --depth=16

Specifying Modes

You can use the nvidia-xconfig tool to set display mode (resolution) in the xorg.conf file.
To add a mode to the mode list
In a terminal window, enter:
nvidia-xconfig --mode=<mode>
Where <mode> is the display mode expressed as X and Y pixels. For example:
nvidia-xconfig --mode="1024x768"

Enabling Debug Mode

You can use the nvidia-xconfig tool to specify a debug mode in the xorg.conf file. When debug mode is enabled, the X driver logs verbose details about mode validation. The driver logs these details in the X log file. You can use that information to troubleshoot mode database issues.
To enable debugging
In a terminal window, enter:
nvidia-xconfig --mode-debug
To disable debugging
In a terminal window, enter:
nvidia-xconfig --no-mode-debug

Multi-Display X Server Layout

For single-display systems, the default server layout is sufficient. However, for multi-display systems you must specify how the monitors are related to one another in the virtual space of the X11 desktop. Multi-Display is currently only supported with a single X screen at this time.
Enabling the One X Screen Layout
In the one X Screen configuration, multiple monitors will work together by displaying portions of the same X Screen, which is like a virtual desktop space. This is the default mode. Both mirroring and spanning layouts can be specified using one X Screen. The size of the X Screen is determined by the smallest rectangle that covers the extents of all the enabled displays in the chosen layout.
To enable one X Screen (default for span)
In a terminal window, enter:
nvidia-xconfig --only-one-x-screen
Here is a graphical depiction of a one X Screen side-by-side layout:
Screen is 3200x1080
(0,0) (1920,0)
| | |
| HDMI-0 | DP-0 |
| (1920x1080) | (1280x1024 |
| | |
| |________________|
|___________________|_ _ _ _ _ _ _ _ |
The xrandr command that produces the above settings is:
xrandr --output HDMI-0 --mode 1920x1080 --output DP-0 --mode 1280x1024 --right-of HDMI-0
To enable screen mirroring
In a terminal window, enter:
nvidia-xconfig --metamode-orientation=clone
To enable screen spanning
In a terminal window, enter:
nvidia-xconfig --metamode-orientation=<value>
Where <value> can be:
RightOf (the default)

Modifying xorg.conf

This section describes xorg.conf changes that require you to make manual modifications, such as for enabling screen saver features, EDID polling, blending, and video overlays.

Enabling Screen Saver Features

By default, X11 features for screen blanking, suspending, and disabling display are all disabled. However, you can enable those features.
To re-enable any of these screen saver related features
Modify or remove the following file:

Enabling EDID Polling and Native Resolution

Instead of statically setting the resolution used in the configuration file, the EDID modes can be polled by the driver and the native resolution of the display will be used. EDID polling is always enabled in the Tegra driver. The information in the Specifying Modes subtopic can still be used to manually add specific modes. Remove these modes to only use EDID modes.

Enabling Blending and Video Overlays

TegraOverlayPriority is a 32-bit integer that is used to control overlay stacking order. The overlay with the lowest depth is in front of all others. This value has meaning only when multiple overlays are present on a display. This value can range between 0 and 255 (both values inclusive), where the default is 255.
TegraOverlayBlendmode determines how the X overlay is combined with the overlay behind it during scanout. Available modes are:
Opaque (default)
This value has meaning only when an external process has created a display that is behind the X server.
To set these overlay attributes
In the “Device” section, add the following line (with desired values):
Option "MetaModes" "nvidia-auto-select { TegraOverlayBlendmode = PremultSourceAlphaBlend, TegraOverlayPriority = 0 }"
Here nvidia-auto-select is the default mode name and can be replaced with the desired mode name.
These properties are per-output and can also be queried/modified during run-time via xrandr.
To query the current values
Execute the following command:
xrandr --prop
To modify these properties
Execute the following commands:
xrandr --output HDMI-0 --set TegraOverlayPriority 0
xrandr --output HDMI-0 --set TegraOverlayBlendmode PremultSourceAlphaBlend
X does not have a notion of alpha blending, so all alpha blending on the enabled display must go through OpenGL ES rendering. Alpha blending for natively rendered pixels is undefined.

Fixing Intermittent or No Output to an HDMI Monitor

Certain HDMI monitors show no output or intermittent output from a startx & command. This condition occurs because the DRIVE PX and monitor are set to different pixel clock rates, even though they are set to the same refresh rate.
The P2363 FPDLink III-to-DVI adapter box used to connect to displays has a maximum pixel clock of 170 MHz. Therefore, to correct this problem, you must set the DRIVE PX to a display mode that uses a pixel clock of less than 170 MHz. For example, enter the following command to see the supported resolutions and pixel clocks:
xrandr -d :0 --verbose
Set the resolution of the monitor using the identifier from the previous command with the following command for the HDMI-0 port:
xrandr --output HDMI-0 --mode 0x18f