Set crtc->driverIsPerformingTransform for any case we can handle before
calling xf86CrtcRotate. We already clear it afterwards when the latter
clears crtc->transform_in_use.
This should allow our separate scanout buffer mechanism to be used in
more cases.
(Cherry picked from amdgpu commit 8e544b4a0de6717feb4abf00052d57c5b726b5ce)
Acked-by: Alex Deucher <alexander.deucher@amd.com>
It means we are not using our own scanout buffers.
Fixes crash when TearFree is supposed to be enabled, but
drmmode_handle_transform doesn't set crtc->driverIsPerformingTransform.
Bugzilla: https://bugs.freedesktop.org/105736
(Ported from amdgpu commit 463477661c88cab3a87746499e5838c5b9f9a13b)
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Use our own BoxRec for the extents, and RegionEmpty for clearing the
scanout damage region.
(Ported from amdgpu commit 72c3e9c7308fbcdf85708b72f9be14a5f2f8e7b5)
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Without this, RandR would report the CRTC and its outputs as enabled,
even though they were actually off due to the failure.
(Cherry picked from amdgpu commit 4dcda0b48d62944c841cd9540f4ad4c7ac8dee47)
Acked-by: Alex Deucher <alexander.deucher@amd.com>
We don't need to wait for a non-TearFree scanout update before scanning
out from the screen pixmap or before flipping, as the scanout update
won't be visible anyway. Instead, just abort it.
(Ported from amdgpu commit 36d01989cd842588f12fdae5b2cba5fdcf9c91dd)
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Preparation for next change, no behaviour change intended.
(Ported from amdgpu commit 04a5c5f7cfacad8d9ccffe81e388cc3da2036cb5)
Acked-by: Alex Deucher <alexander.deucher@amd.com>
This allows a following change to be slightly simpler.
(Ported from amdgpu commit 8fcc3a9b43d3907052a83a96e5a2423afab5ad3f)
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Unused externally and should not be exported.
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
(Ported from amdgpu commit 7fb8b49895e225b3908c8bd186539de23afe91d1)
Acked-by: Alex Deucher <alexander.deucher@amd.com>
There is a case that when set screen from reverse to normal, the old
scanout damage is freed in modesetting before scanout update handler,
so it causes segment fault issue.
Signed-off-by: Jim Qu <Jim.Qu@amd.com>
[ Michel Dänzer: Only call drmmode_crtc_wait_pending_event before
drmmode_crtc_scanout_free is actually called, slightly tweak commit
message ]
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
(Ported from amdgpu commit 9f6a8905611b5b1d8fcd31bebbc9af7ca1355cc3)
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Instead of only the BOs.
This matches what amdgpu does, and fixes issues with DRI2 page flipping.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Inspired by amdgpu, preparation for the following change. For now, this
is mostly a wrapper around struct radeon_bo, no functional change
intended.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Throttling should be handled by the client-side drivers.
Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com>
(Ported from amdgpu commit 8a34a8149860ac15e83ccdbd8d9a527d8d3e5997)
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
radeon_scanout_extents_intersect could leave the scanout damage region
in an invalid state, triggering debugging checks in pixman:
*** BUG ***
In pixman_region_append_non_o: The expression r->x1 < r->x2 was false
Set a breakpoint on '_pixman_log_error' to debug
(Ported from amdgpu commit 8af989546907ad9fb491d940e1936d3bfc89276b)
We were clobbering entries in mi's global miSpritePointerFuncs struct,
which cannot work correctly with multiple primary screens. Instead,
assign a pointer to our own wrapper struct to PointPriv->spriteFuncs.
Fixes crashes with multiple primary screens.
Fixes: 1fe8ca7597 ("Keep track of how many SW cursors are visible on
each screen")
Reported-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Since xf86CursorCloseScreen runs after RADEONCloseScreen_KMS,
PointPriv->spriteFuncs doesn't point to the same struct in the latter as
in RADEONCursorInit_KMS. So we were restoring info->Set/MoveCursor to
the wrong struct. Then in the next server generation,
info->Set/MoveCursor would end up pointing to
drmmode_sprite_set/move_cursor, resulting in an infinite loop if one of
them was called.
To avoid this, only change the Set/MoveCursor hooks if their values
match our expectations, otherwise leave them as is. This is kind of a
hack, but the alternative would be invasive and thus risky changes to
the way we're wrapping CloseScreen, and it's not even clear that can
work without changing xserver code.
Fixes: 1fe8ca7597 ("Keep track of how many SW cursors are visible on
each screen")
Acked-by: Alex Deucher <alexander.deucher@amd.com>
We were updating the link-status property when a uevent came in, but
we also want to update the non-desktop property, and potentially
others as well. We also want to check at detect time in case we don't
get a hotplug event.
This patch updates every property provided by the kernel, sending
changes to DIX so it can track things as well.
Signed-off-by: Keith Packard <keithp@keithp.com>
(Ported from amdgpu commit 374cb8fef4fdbb648af089ee80803ec78321f1b2)
If drmModeGetConnector() fails in drmmode_output_detect(), we have to
reset the output_id to -1 too.
Yet another spot leading to a potential NULL dereference when handling
the mode_output member as output_id was != -1. Though, this case should
be very hard to hit.
Signed-off-by: Daniel Martin <consume.noise@gmail.com>
(Ported from amdgpu commit 10054b6c3d9a755b30abb43020121b9631fa296d)
Replace the various loops to lookup drmModeProperty(Blob)s by
introducing helper functions.
Signed-off-by: Daniel Martin <consume.noise@gmail.com>
(Ported from amdgpu commit fb58e06acd6c6bd59de2dbdadbca27eb1dd0025b)
This might avoid modeset failures in some cases where a CRTC which isn't
used by Xorg was enabled before.
(Ported from amdgpu commit e3aae7a24296f640c0153d1459f3e0820485468a)
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
xorg-server.h defines _XSERVER64 which is used in X.h to choose the
correct definition of XID
this prevents a failure in the present.h configure test that disables
DRI3 on X.Org 1.20
Reviewed-and-Tested-by: Michel Dänzer <michel.daenzer@amd.com>
If we fail to find or set the mode for a CRTC, keep trying for the
remaining CRTCs, and only return FALSE if we failed for all CRTCs that
should be on.
(Ported from amdgpu commit f5ac5f385f41d1547cfd7ccc8bb35a537a8fffeb)
Instead of not starting up at all.
Corresponding to amdgpu commit 37c7260bdef3a53b0f0295a531f33938e9aad8cf.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
If the latter fails, Xorg will call RADEONFreeScreen_KMS, which calls
the former.
(Ported from amdgpu commit 103b7285845b786929fb509083c57e074c48f9be)
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
It crashes if info == NULL.
(Ported from amdgpu commits fb8444e731765588c0ff1e9053c1c7b73f5f0907 &
cfccf4c4e7e5c73fe4040fabeb1b43283cf29b33)
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
DRI clients can use depth 32 pixmaps while the screen is depth 24, in
which case page flipping would fail.
Reported-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Reviewed-and-Tested-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Missing this apparently didn't cause any ill side effects, only a bit of
confusion when looking at xtrace's of DRI2 clients.
Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Linux 3.16's radeon-kms introduced 10 bpc fb support.
Currently, as of X-Server 1.19, this works with exa accel,
but not yet when using glamor acceleration.
v2: Style fixes, check for glamor first, as suggested
by Michel.
Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Tested by Mario on a Radeon HD 4000 series for the r600
exa path, and on Radeon HD 5770 for the evergreen exa
path.
Signed-off-by: Fredrik Höglund <fredrik@kde.org>
Reviewed-and-Tested-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
The hardware gamma luts get bypassed at color
depth 30 anyway, so skip their setup.
v2: Also don't hook up drmmode_crtc_gamma_set()
to .gamma_set for a screen with depth 30,
so the server can spare itself the effort of
updating and setting unused cluts.
Suggested by Michel.
Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
This allows to en-/disable some functions depending on individual screen
settings.
Prep work for more efficient depth 30 support.
Suggested-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
And use this to determine when we cannot use page flipping for DRI
clients. We previously did this based on whether the HW cursor cannot
be used on at least one CRTC, which had at least two issues:
* Even while the HW cursor cannot be used, no SW cursor may actually be
visible (e.g. because all cursors are disabled), in which case we can
use page flipping for DRI clients anyway
* Even while the HW cursor can be used, there may be SW cursors visible
from non-core pointer devices, in which case we cannot use page
flipping for DRI clients anyway
(Ported from amdgpu commit 69e20839bfeb3ee0b0a732d72de0a32d6c5435fc)
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
And bail if xf86_cursors_init fails.
(Ported from amdgpu commit dfccaa7043ccb157a1f8be7313123792bb7e7001)
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Allows tidying up radeon_dirty_src_equals and redisplay_dirty slightly.
(Cherry picked from amdgpu commit 1d65ac395971571094df21ca0408d5972c6b56ec)
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Non GLAMOR builds needs pRADEONEnt so move the USE_GLAMOR define
down to make pRADEONEnt defined in this case.
Signed-off-by: Joakim Tjernlund <joakim.tjernlund@infinera.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>