This further reduces the compositing slowdown due to flushing overhead,
by only flushing when the X server actually sends XDamageNotify events
to a client, and there hasn't been a flush yet in the meantime.
v2: Use ScreenPrivateKey, fixes invalid memory access with GPU screens
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
We only need to flush for XDamageNotify events.
Significantly reduces compositing slowdown due to flushing overhead, in
particular with glamor.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
The display engine didn't support it.
Fixes display corruption with options "TearFree" and "ShadowPrimary"
(and rotation or transforms with current xserver) on pre-R600.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Should make the radeon_drm_queue_alloc error handling clearer, and gets
rid of a compile warning about it returning NULL.
Reviewed-by: Alexandre Demers <alexandre.f.demers@gmail.com>
Now the HW cursor can be used with TearFree rotation.
This also allows always using the separate scanout pixmap mechanism for
rotation, so that should be much smoother even without TearFree enabled.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Subpixel text rendering is typically done with a solid src and
a pixmap mask. Traditionally, this cannot be accelerated in a single
pass and requires two passes [1]. However, we can cheat a little
with a constant blend color.
We can use:
const.A = src.A / src.A
const.R = src.R / src.A
const.G = src.G / src.A
const.B = src.B / src.A
dst.A = const.A * (src.A * mask.A) + (1 - (src.A * mask.A)) * dst.A
dst.R = const.R * (src.A * mask.R) + (1 - (src.A * mask.R)) * dst.R
dst.G = const.G * (src.A * mask.G) + (1 - (src.A * mask.G)) * dst.G
dst.B = const.B * (src.A * mask.B) + (1 - (src.A * mask.B)) * dst.B
This only needs a single source value. src.A is cancelled down in
the right places.
[1] http://anholt.livejournal.com/32058.html
r6xx still be used on some machine,
Ported from commit 4375a6e75e.
Signed-off-by: Tan Hu <tan.hu@zte.com.cn>
Reviewed-by: Grigori Goronzy <greg@chown.ath.cx>
Solid pixmaps are currently implemented with scratch pixmaps, which
is slow. This replaces the hack with a proper implementation. The
Composite shader can now either sample a src/mask or use a constant
value.
r6xx still be used on some machine,
Ported from commit 94d0d14914.
Signed-off-by: Tan Hu <tan.hu@zte.com.cn>
Reviewed-by: Grigori Goronzy <greg@chown.ath.cx>
Basically a conversion from .dir-locals.el, but also correctly handles
files which predominantly use tabs for indentation.
Also, EditorConfig supports many more editors and IDEs.
Acked-by: Alex Deucher <alexander.deucher@amd.com>
We need to scan both screens of the entity for existing connectors, and
enumerate DVI & HDMI connectors consistently regardless of which screen
they're assigned to.
Fixes crash when hot-(un)plugging connectors in Zaphod mode.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93415
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
The xserver Present code only calls radeon_present_flip with
sync_flip=FALSE if radeon_present_screen_init sets
PresentCapabilityAsync, and the latter only sets it if the kernel driver
advertises support for async flips.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
It's now effective for rotation as well.
(Ported from amdgpu commit faf9d720b7d650f5f1ea657a874d08eac3972e60)
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
If the memory for an entry was allocated at the same address as that for
a previously cancelled entry, the handler could theoretically be called
prematurely, triggered by the DRM event which was submitted for the
cancelled entry.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Fixes hangs when attempting to use DRI3 on display connections forwarded
via SSH.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93261
v2: Don't do this for Xorg > 1.18.99.1 since the corresponding xserver
change has landed in Git master.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com> (v1)
This reverts commit cd94248ffa.
It broke VDPAU<->GL interop with DRI3 enabled, because the Gallium VDPAU
code doesn't support DRI3 yet. We can consider re-enabling this once
there is a Mesa release where the Gallium VDPAU code supports DRI3.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94675
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Doing it the other way around meant that there was still a possibility
for the front buffer contents to be uninitialized when they start being
scanned out.
(Ported from amdgpu commit 4a60b4b1851a3cbc2d8ad9048d68eeb6947cf132)
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
1.9.0 was released in August 2010.
We were already unintentionally relying on things not available in 1.8
for at least a year, and nobody has complained.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
This enables tiling for scanout BOs used for TearFree / ShadowPrimary,
and simplifies the code a little.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
If it's available, Xorg calls it on each mode configuration change. It
does what xf86_reload_cursors does (and more), so we don't need to call
the latter anymore.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Flipping doesn't interact correctly with SW cursor: A flip makes the SW
cursor disappear. It will only appear again when the cursor is moved,
but it will be surrounded by corruption, because the SW cursor code
will restore stale screen contents at the old cursor location before
drawing the cursor at the new location.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
The callers were using 0 for the tiling flags, causing surfaces to be
incorrectly treated as linear. This issue was causing corruption on Cayman
just after login with GNOME3. The kernel was rejecting the cs in
drmmode_copy_fb due to invalid texture pitch.
Signed-off-by: Ryan Kennedy <Ryan.Kennedy@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Sync-to-vblank works fine with rotation. We're still checking for
rotation in radeon_present_check_flip.
Returning NULL from here resulted in the xserver present code falling
back to the fake CRTC running at 1 fps.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Without this, drmmode_set_mode_major may just re-set the FB for the
last flipped BO, in which case the display will probably freeze.
Reproduction recipe: Enable rotation while a fullscreen client is
flipping.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Support varies by xserver version:
< 1.12: No support for the driver handling rotation/reflection
1.12-1.15: Support for driver handling rotation/reflection, but there's
a bug preventing the HW cursor from being visible everywhere
it should be on rotated outputs, so we can only support
TearFree for reflection.
>= 1.16: While the bug above is still there (fixes pending review),
the driver can force SW cursor for rotated outputs, so we
can support TearFree for rotation as well.
v2: Don't set crtc->driverIsPerformingTransform after xf86CrtcRotate if
it wasn't set before. Fixes breaking rotation with TearFree disabled.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com> (v1)
We were already relying on pScrn->pScreen being non-NULL in some cases,
which is supposedly always true ever since this function is no longer
getting called from ScreenInit.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
If we set a mode while a flip is pending, the kernel driver may program
the flip to the hardware after the modeset. If that happens, the hardware
will display the BO from the flip, whereas we will assume it displays the
BO from the modeset. In other words, the display will most likely freeze,
at least until another modeset.
Prevent this condition by waiting for a pending flip to finish before
setting a mode.
Fixes display freezing when setting rotation or a transform with
TearFree enabled.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Fixes the following problem:
With DRI3 enabled, run glxgears with LIBGL_DRI3_DISABLE=1, make it
fullscreen and press Escape while it's still fullscreen. This could
result in dri2_flipping not getting cleared, spuriously preventing apps
using DRI3 from flipping.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Keep them around until the DRM event arrives, but then call the abort
functions instead of the handler functions.
This is a prerequisite for the following fix.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
If we were asked to create a shareable pixmap, it doesn't make sense
to return a pixmap which isn't shareable. Doing so caused trouble down
the line such as a crash with older versions of glamor when trying to
use GLX pixmaps of bpp < 32 via DRI2.
Signed-off-by: JimQu <jim.qu@amd.com>
(ported from amdgpu commit 2fcb7dadd3c71cd405cbbaafc777697538ca9c29)
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
The next commit will call the former from the latter. No functional
change.
Signed-off-by: JimQu <jim.qu@amd.com>
(ported from amdgpu commit 5269a2228bff6023c1a7f3e8534027e1d7addc25)
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
The pci_dev parameter can never be NULL since we only support KMS.
Reported-by: Tom St Denis <tom.stdenis@amd.com>
(ported from amdgpu commit 6e42c58375a4c3229da93c27bbd104af145c6163)
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>