Commit Graph

28 Commits

Author SHA1 Message Date
Mario Limonciello
afb09b6d9e Add support for the meson build system 2025-12-15 14:45:07 +01:00
Joseph Crowell
d65f27c385 change project name from Xorg to Xlibre
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-05 22:21:25 +10:00
Alan Coopersmith
78a39e1b7a Improve man page formatting
More closely follow common style as described on
https://man7.org/linux/man-pages/man7/man-pages.7.html
and fix warnings raised by `mandoc -T lint` and `groff -rCHECKSTYLE=10`

Also hardcode man page section numbers now that all supported OS'es
use the same set of numbers.
2025-07-07 12:41:03 +02:00
Hamza Mahfooz
31a092ae71 Enable TearFree if it's set to auto and VariableRefresh is enabled
As of kernel commit 1ca67aba8d11 ("drm/amd/display: only accept async
flips for fast updates"), we reject async flips that used to be silently
degraded to vsync. However, this causes issues for VRR if TearFree isn't
enabled, in particular we have seen that VRR fails to engage on a
handful of tested applications and in one case we even observed an
application soft hang. So, if TearFree is set to auto we should enable
it if VariableRefresh is enabled and we should warn users if they try to
enable VariableRefresh while TearFree is disabled.

Signed-off-by: Hamza Mahfooz <hamza.mahfooz@amd.com>
2023-09-25 19:50:21 +02:00
Alan Coopersmith
89b3eb9fff Update URLs to reflect gitlab migration
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-02-22 07:57:01 -08:00
Mario Kleiner
65c127366a Add option for non-vsynced flips for "secondary" outputs.
This is a straightforward port of a patch with the same name
"modesetting: Add option for non-vsynced flips for "secondary"
outputs." from X-Server master / X-Server 21.1. See server MR 742.
The description below is therefore identical to that X-Server commit:

Whenever an unredirected fullscreen window uses pageflipping for a
DRI3/Present PresentPixmap() operation and the X-Screen has more than
one active output, multiple crtc's need to execute pageflips. Only
after the last flip has completed can the PresentPixmap operation
as a whole complete.

If a sync_flip is requested for the present, then the current
implementation will synchronize each pageflip to the vblank of
its associated crtc. This provides tear-free image presentation
across all outputs, but introduces a different artifact, if not
all outputs run at the same refresh rate with perfect synchrony:
The slowest output throttles the presentation rate, and present
completion is delayed to flip completion of the "latest" output
to complete. This means degraded performance, e.g., a dual-display
setup with a 144 Hz monitor and a 60 Hz monitor will always be
throttled to at most 60 fps. It also means non-constant present
rate if refresh cycles drift against each other, creating complex
"beat patterns", tremors, stutters and periodic slowdowns - quite
irritating!

Such a scenario will be especially annoying if one uses multiple
outputs in "mirror mode" aka "clone mode". One output will usually
be the "production output" with the highest quality and fastest
display attached, whereas a secondary mirror output just has a
cheaper display for monitoring attached. Users care about perfect
and perfectly timed tear-free presentation on the "production output",
but cares less about quality on the secondary "mirror output". They
are willing to trade quality on secondary outputs away in exchange
for better presentation timing on the "production output".

One example use case for such production + monitoring displays are
neuroscience / medical science applications where one high quality
display device is used to present visual animations to test subjects
or patients in a fMRI scanner room (production display), whereas
an operator monitors the same visual animations from a control room
on a lower quality display. Presentation timing needs to be perfect,
and animations high-speed and tear-free for the production display,
whereas quality and timing don't matter for the monitoring display.

This commit gives users the option to choose such a trade-off as
opt-in:

It adds a new boolean option "AsyncFlipSecondaries" to the device section
of xorg.conf. If this option is specified as true, then DRI3 pageflip
behaviour changes as follows:

1. The "reference crtc" for a windows PresentPixmap operation does a
   vblank synced flip, or a DRM_MODE_PAGE_FLIP_ASYNC non-synchronized
   flip, as requested by the caller, just as in the past. Typically
   flips will be requested to be vblank synchronized for tear-free
   presentation. The "reference crtc" is the one chosen by the caller
   to drive presentation timing (as specified by PresentPixmap()'s
   "target_msc", "divisor", "remainder" parameters and implemented by
   vblank events) and to deliver Present completion timestamps (msc
   and ust) extracted from its pageflip completion event.

2. All other crtc's, which also page-flip in a multi-display configuration,
   will try to flip with DRM_MODE_PAGE_FLIP_ASYNC, ie. immediately and
   not synchronized to vblank. This allows the PresentPixmap operation
   to complete with little delay compared to a single-display present,
   especially if the different crtc's run at different video refresh
   rates or their refresh cycles are not perfectly synchronized, but
   drift against each other. The downside is potential tearing artifacts
   on all outputs apart from the one of the "reference crtc".

Successfully tested on a AMD gpu with single-display and dual-display
setups, and with single-X-Screen as well as dual-X-Screen "ZaphodHeads"
configurations.

Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
2022-01-25 03:59:15 +01:00
Michel Dänzer
0d1d479ecc Fix build against ABI_VIDEODRV_VERSION 25.2
Use primary/secondary instead of master/slave where applicable.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2020-07-10 11:13:21 +02:00
Nicholas Kazlauskas
b11ee02c45 Support CRTC variable refresh for windows using Present flips
This patch adds support for setting the CRTC variable refresh property
for suitable windows flipping via the Present extension.

The "VariableRefresh" Option is added to AMDGPU in this patch. This
option defaults to false, and must be set to "true" in an X conf
file for variable refresh support in the driver.

In order for a window to be suitable for variable refresh it must have
the _VARIABLE_REFRESH property with a 32-bit CARDINAL value of 1.

Then the window must pass the checks required to be suitable for
Present extension flips - it must cover the entire X screen and no
other window may already be flipping.

With these conditions met every CRTC for the X screen will have their
variable refresh property set to true.

Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
2018-11-30 15:40:34 +00:00
Michel Dänzer
1cb338253a man: This driver supports colour depths 8, 15 and 16
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2018-10-29 11:04:55 +01:00
Hawking Zhang
6aee5770fb Add 30bit RGB color format support
Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com>

[ Michel Dänzer:
* Require Xorg >= 1.19.99.1 for depth 30, otherwise it can't work with glamor
* Update manpage, per radeon commit
  574bfab4bf1fcd95163a8f33cea2889189429d30 ]
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2018-02-14 17:05:51 +01:00
Darren Salt
2f72be038d Clarify when TearFree is automatically enabled.
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2017-10-05 11:15:43 +02:00
Michel Dänzer
2692508ae8 Always allow DRI2 page flipping with TearFree
Even if TearFree is enabled for the CRTC we're synchronizing to.

(Ported from radeon commit d314cbfb228bb4b8762714f98d0c114a8ee3f061)
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-08-22 18:34:32 +09:00
Michel Dänzer
9caa9dd9cc Allow DRI page flipping when some CRTCs use separate scanout buffers
As long as the CRTC we're synchronizing to doesn't.

(Ported from radeon commit 5309bde0c4e28adf2b167191c6d7011a19e31eed)
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-08-03 17:11:39 +09:00
Michel Dänzer
000e5eaeb2 Update URLs
* Point to the amd-gfx mailing list
* Specify the component in all bugzilla URLs
* Use https:// for all HTML URLs

(Ported from radeon commit d80d01a73c2eaba2e3649b7bc0a3541b3ff782f6)
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-05-24 10:12:55 +09:00
Michel Dänzer
165b514476 manpage: Don't put "'" at the beginning of a line
It caused the whole line to be dropped.

Fixes: af0b24c1ac ("Allow toggling TearFree at runtime via output
                      property")
Reported-by: Andy Furniss <adf.lists@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-03-23 18:04:11 +09:00
Michel Dänzer
af0b24c1ac Allow toggling TearFree at runtime via output property
Option "TearFree" now sets the default value of the output property.
See the manpage update for details.

TearFree is now enabled by default for outputs using rotation or other
RandR transforms, and for RandR 1.4 slave outputs.

(Ported from radeon commit 58cd1600057e41aade0106d4acf78e23eac6e44f)
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-03-03 16:12:26 +09:00
Michel Dänzer
a446b3af9b manpage updates for the 1.2.0 release
Option "TearFree" is now effective for arbitrary transforms as well.

Point to the amd-gfx mailing list instead of xorg-driver-ati.
2016-11-17 15:13:59 +09:00
Michel Dänzer
1352a1d2f7 Check Xorg version at runtime instead of build time in two places
This means that all possible paths can be handled as intended, no matter
which Xorg version the driver happened to be compiled against.

(Ported from radeon commit 350a2645a1b127227ff294c0b62d20000d0fd48a)
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-11-02 12:35:55 +09:00
Ronie Salgado
2eb5d77b84 Add SI PCI IDs
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2016-08-22 15:06:53 +02:00
Michel Dänzer
861da1d5c2 Enable DRI3 by default when building for Xorg >= 1.18.3
Seems to work well enough in general now.

(Ported from radeon commit 1181b9c582f10b6c523e4b2988e2ce87ecf3d367)

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-05-12 16:34:30 +09:00
Michel Dänzer
faf9d720b7 Update manpage entry for Option "TearFree"
It's now effective for rotation as well.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-04-04 14:57:30 +09:00
Michel Dänzer
560b7fe6dc Rename Option "NoAccel" to "Accel"
Removes the need for a double negation when forcing acceleration on.

Note that this change is backwards compatible, as the option parser
automagically handles the 'No' prefix.

(ported from radeon commit cc615d06db0332fc6e673b55632bcc7bf957b44b)

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2015-11-19 17:17:15 +09:00
Darren Powell
0a6ba4bf50 Add Option "TearFree" to manpage
This was missed in commit c57da33308.

Signed-off-by: Darren Powell <darren.powell@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2015-10-21 16:06:42 +09:00
Mario Kleiner
ebe2c020fb Make selection between DRI2 and DRI3 consistent with other drivers. (v2)
Add Option "DRI" to allow selection of maximum DRI level.

This allows the user to select the maximum level of DRI
implementation to use, DRI2 or DRI3. It replaces the old
option "DRI3" which had exactly the same purpose, but
differs from the method used in both intel ddx and nouveau ddx.
Make this consistent before a new stable driver is released.

v2: Retain handling of old Option "DRI3" for backwards
    compatibility, but Option "DRI" will take precedence
    over "DRI3" if both are provided.

Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2015-08-11 10:04:50 +09:00
Michel Dänzer
e5dfb6c266 glamor: Add Option "ShadowPrimary"
When this option is enabled, most pixmaps (including the screen pixmap)
are allocated in system RAM and mostly accessed by the CPU. Changed areas
of the screen pixmap are copied to dedicated per-CRTC scanout pixmaps
regularly, triggered by the vblank interrupt.

(Cherry picked from radeon commits ae92d1765fa370a8d94c2856ad6c45d273ec3c69
and 1af044d7eee211fd4b248c236280274a68334da5)

[ Michel Dänzer: Additional adjustements for the amdgpu driver ]

Signed-off-by: Darren Powell <darren.powell@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2015-06-15 17:23:14 +09:00
Michel Dänzer
edfff6b1a3 Add DRI3 support
Must be enabled with

	Option	"DRI3"

in xorg.conf.

(Cherry picked from radeon commits 64e1e4dbdd3caee6f5d8f6b6c094b4533fa94953,
694e04720b886060fe3eefdce59741f218c8269f,
f940fd741b15f03393037c5bb904cd74f012de9d,
fcd37f65f485291084c174666bd605e215bf1398,
4b0997e56dec0053cb2cb793e0f4ae35055ff7e6,
f68d9b5ba0c91a725b5eec9386c61bea8824c299 and
98fb4199e63fedd4607cddee64bf602d6398df81)

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2015-06-08 17:59:55 +09:00
Michel Dänzer
fa4aed6cf5 Document Option "AccelMethod" in the manpage
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2015-04-24 09:54:34 +09:00
Alex Deucher
ff62bf6e9d amdgpu: add the xf86-video-amdgpu driver
This adds the new xf86-video-amdgpu driver for
newer AMD GPUs.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-04-20 11:57:52 -04:00