Not doing so might result in intermittently scanning out stale contents
of the screen pixmap.
(Ported from radeon commit 9a951a3e551db58ba50e7a594521ceac54d90615)
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
To make sure the screen pixmap contents are up to date when it starts
being scanned out.
(Ported from radeon commit 244d4bc7f8c8f6bc90f49556c0b9344c8aa40295)
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Fixes display intermittently blanking when a modeset is used for unflip.
(Ported from radeon commit 3ff29e5a14451916bc66b4e0028e9a317f0723f8)
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
We were leaking drmmode_crtc->scanout_damage, which caused trouble on
server reset. Fixes server reset with active separate scanout pixmaps.
(Cherry picked from radeon commit 0c29deb5a97d9a57e994cc0053c49ddf7aca6ecb)
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
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>
Cleanup in preparation for following change, no functional change
intended.
(Ported from radeon commit 305e2cbf335837a2ab6a24e9ff65815afe038296)
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Cleanup in preparation for the following change, no functional change
intended.
(Ported from radeon commit 649644a88347a6d03de68f8c41db03a82deeb23b)
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
It would probably result in a black screen.
(Ported from radeon commit 1351e48efe7a2c28eab447e16f36a00fbd02ae48)
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
We cannot use the HW cursor in that case, but in turn we get more
efficient and less teary updates of rotated outputs.
(Ported from radeon commit f2bc882f1c1082bed9f496cfab6c8f07a76bc122)
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Not used anywhere else anymore.
(Ported from radeon commit ae921a3150f69c38b5b3c88a9e37d54fdf0d5093)
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Calling drmmode_crtc_scanout_allocate in drmmode_crtc_shadow_allocate
resulted in drmmode_crtc_scanout_create called from
drmmode_crtc_shadow_create passing an uninitialized pitch value to
drmmode_create_bo_pixmap.
Fixes issues such as failure to allocate the scanout pixmap or visual
corruption and GPUVM faults when attempting to use rotation with Xorg
<1.19.
Bugzilla: https://bugs.freedesktop.org/99916
Fixes: 5f71238088 ("Pass pitch from drmmode_crtc_scanout_allocate to
drmmode_create_bo_pixmap")
(Ported from radeon commit 987a34adb319923ad36e2b47a26837248f187c3e)
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Mostly to align with radeon commit
ea30d856ba5e7274c8ea499293b8b0e721b8e082, but also gets rid of a
gbm_bo_get_stride call.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@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>
Fixes leaking the corresponding struct amdgpu_drm_queue list entry in
that case.
(Ported from radeon commit e2942449171fe628a7726e59bcaab65e27d88563)
Reviewed-by: Alex Deucher <alexander.deucher@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.
(Ported from radeon commit 14c3f59f5157885ad8f941f0bad6c0c5e3db12f8)
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).
(Ported from radeon commit a995f5830916a0fee5126263d1bfe48632be3a15)
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Fixes various potential issues with TearFree enabled, e.g. outputs
freezing after display configuration changes.
(Ported from radeon commit e543ef3a2fb304cbe3a965fb780632af2e4186f4)
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.
(Ported from radeon commit f130b10e63f7526360b41aa0918b4940f63f662a)
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
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.
(Ported from radeon commits 13c6bc5e382765fe567091e1c616c0a26eec04ca and
487aa62a2a23b86e4ea4714fdfd465c9e513141f)
v2: Squash in radeon fix for build against xserver < 1.13
Reviewed-by: Alex Deucher <alexander.deucher@amd.com> (v1)
(Ported from radeon commits 1106b2f773ad0611c729b27f4c192a26b43ef1e7
and 5fea5ef2f07eee4a0f94baab427010b936f1d4b4)
v2:
* Squash in radeon fix for TearFree regression
* Remove preprocessor guards for compatibility with libdrm < 2.4.72
(Emil Velikov)
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Use libdrm_amdgpu's amdgpu_get_marketing_name for the chipset name, or
"Unknown AMD Radeon GPU" as a fallback.
v2: Require libdrm_amdgpu >= 2.4.72 for amdgpu_get_marketing_name
Reviewed-by: Alex Deucher <alexander.deucher@amd.com> (v1)
Preparation for the next change, no functional change intended.
(Cherry picked from radeon commit 35bec4937d89b48a79acfcb4f814b7370cb631b2)
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.
(Ported from radeon commit 350a2645a1b127227ff294c0b62d20000d0fd48a)
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 c7d27c94cb ("Keep
track of damage event related flushes per-client").
(Ported from radeon commit 5df36de39952c3a26cb2fbc125f298139a9dd5bc)
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
The kernel driver doesn't handle flipping between buffers with
different tiling parameters correctly.
Fixes display corruption with fullscreen apps using different tiling
modes (e.g. due to R600_DEBUG=notiling or R600_DEBUG=no2d) via DRI3.
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)
(Ported from radeon commit 22b5ce9548393ba2ff73ee234ecd82eeaf0ef6c4)
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)
(Ported from radeon commit 82d3c8f5500d2a6fb1495e217a0b79c396f1534c)
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)
(Ported from radeon commit 6c940446ddadf418ee4959e46fa552b6c1cf6704)
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.
(Cherry picked from radeon commit 61df12e2377cbb19a19ca9d5624df8959822da9f)
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
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>
(Cherry picked from radeon commit 49cf3b5032a7ce40afe514b7092440e3e19e05aa)
Instead of lexically. This makes it more likely for similar generations
to be close to each other in the list of unique chipsets.
(Ported from radeon commit 1ce1b1656acc6211deb2091ff7f28d51b6daf86b,
plus change $numunique++ => ++$numunique to fix OLAND getting listed
twice)
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.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>