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>
We used the destination pixmap's screen for flushing drawing commands.
But when we are the master screen, the destination pixmap is from the
slave screen.
Fixes crash when the slave screen isn't using the same acceleration
architecture as us.
Bugzilla: https://bugs.freedesktop.org/103613
Fixes: 01b040b4a8 ("Adapt to PixmapDirtyUpdateRec::src being a
DrawablePtr")
(Ported from amdgpu commit 3a4f7422913093ed9e26b73ecd7f9e773478cb1e)
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
No need to lookup the link-status property if we don't have a crtc.
Signed-off-by: Daniel Martin <consume.noise@gmail.com>
(Ported from xserver commit 8d7f7e24261e68459e6f0a865e243473f65fe7ad)
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Outputs may have NULL mode_output (connector) pointers if the
connector disappears while the server is running. Skip these when
resetting outputs with BAD link status.
(Ported from xserver commit 37f4e7651a2fd51efa613a08a1e705553be33e76)
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
We were not doing so in all cases, leaking memory allocated by the
latter.
(Cherry picked from amdgpu commit f6b39bcd45cb06976ba8a3600df77fc471c63995)
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
We were leaking the memory allocated by TimerSet.
(Ported from amdgpu commit 84aad09f18fed6b52b0c073f0bbd675a6de07807)
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Not doing so resulted in DRI2 page flips not actually changing the FB
being scanned out, showing intermittent flicker of the "back" buffer
rendering.
Bugzilla: https://bugs.freedesktop.org/102643
Fixes: 55e513b978 "Use reference counting for tracking KMS framebuffer
lifetimes"
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
If we hit a problem while setting up ShadowFB, just carrying on trying
to set up HW acceleration instead is unlikely to work.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
We were trying to call acceleration specific functions from LeaveVT.
Instead, memset the scanout buffer to all 0 in LeaveVT and allocate a
new one in EnterVT.
Bugzilla: https://bugs.freedesktop.org/102948
Fixes: 06a4654841 ("Make all active CRTCs scan out an all-black
framebuffer in LeaveVT")
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
xserver 1.13.0 was released on September 6th, 2012, almost 5 years ago.
This allows cleaning up a bunch of backwards compatibility code.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
The timer fires 1 second after LeaveVT. This gives the next DRM master
enough time to set up scanout of its own buffers.
Fixes prolonged intermittent black screen when switching from Xorg to
e.g. the GDM Wayland mode login VT.
Fixes: 06a4654841 ("Make all active CRTCs scan out an all-black
framebuffer in LeaveVT")
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
And destroy all other FBs. This is so that other DRM masters can only
get access to this all-black FB, not to any other FB we created, while
we're switched away and not DRM master.
Fixes: 55e513b978 ("Use reference counting for tracking KMS
framebuffer lifetimes")
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Preparatory, no functional change intended yet.
Also inline radeon_pixmap_create_fb into radeon_pixmap_get_fb, since
there's only one call-site anymore.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Despite all the careful planning of the kernel, a link may become
insufficient to handle the currently-set mode. At this point, the
kernel should mark this particular configuration as being broken
and potentially prune the mode before setting the offending connector's
link-status to BAD and send the userspace a hotplug event. This may
happen right after a modeset or later on.
Upon receiving a hot-plug event, we iterate through the connectors to
re-apply the currently-set mode on all the connectors that have a
link-status property set to BAD. The kernel may be able to get the
link to work by dropping to using a lower link bpp (with the same
display bpp). However, the modeset may fail if the kernel has pruned
the mode, so to make users aware of this problem a warning is outputed
in the logs to warn about having a potentially-black display.
This patch does not modify the current behaviour of always propagating
the events to the randr clients. This allows desktop environments to
re-probe the connectors and select a new resolution based on the new
(currated) mode list if a mode disapeared. This behaviour is expected in
order to pass the Display Port compliance tests.
(Ported from xserver commit bcee1b76aa0db8525b491485e90b8740763d7de6)
[ Michel: Bump libdrm dependency to >= 2.4.78 for
DRM_MODE_LINK_STATUS_BAD ]
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
All callers were already passing in a pixmap.
This allows simplifying the rotated scanout case slightly.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
We were adding entries at the start of the list, i.e. the list was
ordered from most recently added to least recently added. However, the
corresponding DRM events are generally expected to arrive in the same
order as they are queued, which means that radeon_drm_queue_alloc would
generally have to traverse the whole list to find the entry
corresponding to an arrived event. Fix this by adding entries at the end
of the list.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Even if TearFree is enabled for the CRTC we're synchronizing to.
v2:
* Move manpage hunk here from previous change.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com> # v1
Even if TearFree is active for the the CRTC we're synchronizing to. In
that case, for Present flips synchronized to vertical blank, the other
scanout buffer is immediately synchronized and flipped to during the
target vertical blank period. For Present flips not synchronized to
vertical blank, we simply use the MSC and timestamp values of the last
vertical blank period for timing purposes, and let the normal TearFree
mechanism handle display updates.
v2:
* Move manpage hunk to next change, since TearFree can still prevent
DRI2 page flipping with this change.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com> # v1
The xserver Present code can submit a flip in response to notifying it
that a vblank event arrived. This can happen before the completion event
of the previous flip is processed. In that case, we were clearing the
drmmode_crtc->flip_pending field prematurely.
Prevent this by only clearing drmmode_crtc->flip_pending when it matches
the framebuffer being scanned out since the flip whose completion event
we're processing.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Allows removing drmmode_clear_pending_flip and the pending_dpms_mode
field and cleaning up the code considerably.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Allows cleaning up the code considerably.
v2:
* Fix "drmWaiVBlank" typo, add blank line for readability (Slava Abramov)
* Rename in/out sequence parameters to "target_seq" and "result_seq",
hopefully that will be clearer.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com> # v1
As long as the CRTC we're synchronizing to doesn't.
v2:
* Remove redundant checks from can_exchange which still prevented DRI2
page flipping
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Preparation for following changes, no functional change intended yet.
v2:
* Add drmmode_screen_damage_destroy callback to prevent use-after-free
on server shutdown
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
To ensure that any existing copies of autotools files will be replaced
with the current versions.
(Cherry picked from amdgpu commit a47c0093338d80d84e7033ad15d051925d542ca0)
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Suggested by one of the tools called by autoreconf.
(Cherry picked from amdgpu commit 842bad4b951296ca25f47b50cb358e502bf30ebb)
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Suggested by one of the tools called by autoreconf.
(Cherry picked from amdgpu commit 227b399badaad9bbef0be5a776ce008d0d243449)
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Xorg doesn't handle the hardware cursor correctly in that case for
rotation and general transforms, and we can't force the SW cursor.
Fixes: f2bc882f1c ("Handle rotation in the driver also with Xorg
1.12-1.18")
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>