This instructs Xorg >= 1.16 to try loading the radeon driver for devices
managed by the radeon kernel driver, even if the ati wrapper driver
isn't available.
Copied from the amdgpu driver.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
If .../share/X11/xorg.conf.d/10-amdgpu.conf doesn't exist, but the ati
wrapper is loaded, it will otherwise try to use the radeon driver even
for GPUs driven by the amdgpu kernel driver. This can only fail,
potentially in bad ways.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com>
(ported from amdgpu commit ea558e645786b08d75307716036045170e97b43e)
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
[ Second attempt, let's see if there's any fallout this time... ]
udev_monitor_receive_device() will block and wait for the event of udev
use select() to ensure that this will not block.
Signed-off-by: JimQu <Jim.Qu@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
(Cherry picked from amdgpu commit 732cf4d3a248b288532ad0f3443da49e08dc7507)
This commit replaces the inline assembler code (for x86 platforms) and
loop (for non-x86 platforms) in RADEONLog2 with a one-liner version
based on clz (count leading zeroes).
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
The wrong order meant that the clipping region wasn't actually applied,
so it always copied the full contents from the other scanout pixmap.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Fixes incorrect screen updates with TearFree enabled on PRIME slave
outputs which are not located at (0, 0).
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Fixes various potential issues with TearFree enabled, e.g. outputs
freezing after display configuration changes.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
This will hopefully decrease the chance of accidentally breaking the
build against xserver < 1.13 in the future.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
same procedure every few patches.....
Fixes: 13c6bc5e38 ("Don't install Flush/EventCallback for GPU screens")
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
drmmode->fb_id isn't what we need in the TearFree case. Fixes TearFree
freezing with
(WW) RADEON(0): flip queue failed in radeon_scanout_flip: No such file or directory
in the log file.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98834
Fixes: 1106b2f773 ("Use DRM_MODE_PAGE_FLIP_TARGET_ABSOLUTE/RELATIVE flags when available")
Their purpose is to flush GPU rendering commands corresponding to damage
events, but there can be no damage events corresponding to GPU screen
rendering operations.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
glamor should now perform at least as well as EXA in general, and this
allows DRI3 to be enabled by default for >= R600.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Fixes warning about misleading indentation from recent versions of gcc:
../../src/radeon_dri2.c: In function ‘radeon_dri2_create_buffer2’:
../../src/radeon_dri2.c:224:2: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
if (flags & RADEON_CREATE_PIXMAP_TILING_MACRO)
^~
../../src/radeon_dri2.c:227:6: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘if’
if (aligned_width == front_width)
^~
No functional change intended.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
This means that all possible paths can be handled as intended, no matter
which Xorg version the driver happened to be compiled against.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
1.10.0 was released in February 2011.
We've been accidentally requiring 1.10 or newer since 121a6de72d ("Keep
track of damage event related flushes per-client v2").
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
We get multiple udev events for actions like docking a laptop into its
station or plugging a monitor to the station. By consuming as many
events as we can, we reduce the number of output re-evalutions.
It depends on the timing how many events can be consumed at once.
(Inspired by xserver commit 363f4273dd4aec3e26cc57ecb6c20f27e6c813d8)
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
When a card has import capability it can be an offload _sink_, not a
source and vice versa for export capability.
This went unnoticed sofar because most gpus have both import and export
capability.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
(Ported from xserver commit 94a1c77259ce39ba59ad87615df39b570ffab435)
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Otherwise, we may leak screen->pixmap_dirty_list entries if
drmmode_set_scanout_pixmap is called repatedly with ppix != NULL, which
can happen from RRReplaceScanoutPixmap.
(Inspired by xserver commit b773a9c8126222e5fed2904d012fbf917a9f22fd)
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
RRReplaceScanoutPixmap may set randr_crtc->scanout_pixmap = NULL before
we get here.
(Inspired by xserver commit f4c37eeee7953df1fe0e3196eda452acf0078e61)
v2: Always return TRUE in the if (!ppix) block.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com> (v1)
If --enable-maintainer-mode got lost from config.status for any reason,
builds would fail in mysterious ways after changing between different
Git commits.
There are more reasons for dropping it in the automake manual:
https://www.gnu.org/software/automake/manual/html_node/maintainer_002dmode.html
I'm not aware of any reason why --disable-maintainer-mode would ever be
useful with this project.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Instead of lexically. This makes it more likely for similar generations
to be close to each other in the list of unique chipsets.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Supported since Xorg 1.18.99.2, but buggy until 1.18.99.901.
(Ported from amdgpu commit 7cc04035c55788261cda89a915c433c2add6cad9)
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
We were always passing the hotspot position in the X screen coordinate
space, but drmModeSetCursor2 needs it in the CRTC coordinate space. The
wrong hotspot position would cause the kernel driver to adjust the
HW cursor position incorrectly when the hotspot position changed.
(Ported from amdgpu commit d42773eb45baff5933730e26878a0b45fcf07b65)
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
This makes TearFree work with arbitrary transforms, and makes transforms
work better even without TearFree, with xserver >= 1.12.
(Ported from amdgpu commit bf000ea7ef91f5ecb59fc3c1ab8ed9eddcc0841d)
Not used by any supported version of xserver.
(Ported from amdgpu commits 1091f28e1fa239ee1a973d84a8376fa4a95d7247
and 5a4d3267ac3823fe58b51b0b9075b82375d7180c)
Fixes issues when mixing rotation and page flipping with current xserver
Git master.
(Ported from amdgpu commit decabd574f90d3df397c80ec931b3fde8a4afb49)
Fixes issues when mixing rotation and page flipping with current xserver
Git master.
(Ported from amdgpu commit 3ed28ce7cd26f89969617ba901ff253091d0d469)
We failed to do this when going back to scanning out directly from the
screen pixmap.
As a bonus, since we now destroy drmmode_crtc->scanout[] after setting
the new scanout buffer, we may avoid the CRTC turning off intermittently
in this case.
(Ported from amdgpu commit 9c3324715fd395fd486ea341654d78f4f298b97f)
If we're doing reverse-prime; or doing rotation the main fb is not used,
and there is no reason to add it in this case.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
(Ported from xserver commit 4313122dea0df9affc280ee698e929489061ccc6)
(Ported from amdgpu commit a3ca1500703837cbb8d49c554199a25dea7d5e1e)