summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2016-08-03Use DRM_MODE_PAGE_FLIP_TARGET_ABSOLUTE/RELATIVE flags when availableHEADmasterMichel Dänzer6-7/+69
2016-08-01Use EventCallback to avoid flushing every time in the FlushCallbackMichel Dänzer2-15/+66
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>
2016-07-22Don't enable DRI3 by default with EXAMichel Dänzer2-3/+4
It doesn't work correctly in all cases, see e.g. https://bugs.freedesktop.org/show_bug.cgi?id=95475 . I'm not sure this is fixable, given EXA's architecture. Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-07-22Don't enable micro-tiling for scanout buffers on pre-R600Michel Dänzer1-5/+6
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>
2016-07-22Add explicit RADEON_DRM_QUEUE_ERROR defineMichel Dänzer6-9/+12
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>
2016-07-20Adapt to video API 22Keith Packard1-1/+21
Deal with drm fd wakeup Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-and-Tested-by: Michel Dänzer <michel.daenzer@amd.com>
2016-07-19Adapt Block/WakeupHandler signature for ABI 23Adam Jackson1-0/+5
Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-06-24Only use RandR APIs if RandR is enabledMichel Dänzer2-10/+13
Fixes crash with Xinerama enabled, which disables RandR. Fixes: https://bugs.debian.org/827984 Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-06-21Adapt to XF86_CRTC_VERSION 7Michel Dänzer1-5/+13
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>
2016-06-01EXA/6xx/7xx: accelerate PictOpOver with component alphaTan Hu3-2/+36
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 4375a6e75e5d41139be7031a0dee58c057ecbd07. Signed-off-by: Tan Hu <tan.hu@zte.com.cn> Reviewed-by: Grigori Goronzy <greg@chown.ath.cx>
2016-06-01EXA/6xx/7xx: fast solid pixmap supportTan Hu2-149/+526
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 94d0d14914a025525a0766669b556eaa6681def7. Signed-off-by: Tan Hu <tan.hu@zte.com.cn> Reviewed-by: Grigori Goronzy <greg@chown.ath.cx>
2016-06-01Add .editorconfig fileMichel Dänzer1-0/+10
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>
2016-05-12Explicitly set the fbcon pixmap pitch againMichel Dänzer2-11/+15
The kernel driver returns 0 as the pitch of the fbcon BO via the DRM_RADEON_GEM_GET_TILING ioctl, so we ended up using an incorrect pitch in some cases. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94901 Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-05-11Enable DRI3 by default when building for Xorg >= 1.18.3Michel Dänzer2-0/+6
Seems to work well enough in general now. Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-04-19Handle Zaphod mode correctly in radeon_mode_hotplugMichel Dänzer1-10/+35
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>
2016-04-12present: Support async flipsMichel Dänzer1-4/+1
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>
2016-04-12Add support for async flips to radeon_do_pageflipMichel Dänzer4-6/+19
Will be used by the next change. No functional change here. Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-04-11Remove RR_Capability_SinkOutput for GPU without CRTCQiang Yu1-4/+7
Signed-off-by: Qiang Yu <Qiang.Yu@amd.com> (Ported from amdgpu commit a0bbb373f902e0ffc14570c85faec7e44134f62e) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-04-11dri3: Return NULL from radeon_dri3_pixmap_from_fd if calloc fails.Tom St Denis1-0/+1
Signed-off-by: Tom St Denis <tom.stdenis@amd.com> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2016-04-11Post 7.7.0 release version bumpMichel Dänzer1-1/+1
2016-04-07Bump version for 7.7.0 releaseMichel Dänzer1-1/+1
2016-04-04Update manpage entry for Option "TearFree"Michel Dänzer1-3/+4
It's now effective for rotation as well. (Ported from amdgpu commit faf9d720b7d650f5f1ea657a874d08eac3972e60) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-04-01Identify DRM event queue entries by sequence number instead of by pointerMichel Dänzer6-72/+84
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>
2016-03-31Update pixmap pitch in radeon_set_pixmap_boMichel Dänzer2-11/+10
Stop second guessing it in drmmode_crtc_scanout_create. Fixes display corruption in some cases with TearFree enabled. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94751 Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-03-28DRI3: Refuse to open DRM file descriptor for ssh clients (v2)Michel Dänzer1-1/+38
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)
2016-03-25Revert "Use render node for DRI3 if available"Michel Dänzer3-36/+4
This reverts commit cd94248ffa7d8fe0b57476f79e7e860dee66d1b0. 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>
2016-03-24Call RADEONBlockHandler_KMS before setting initial modesMichel Dänzer1-2/+2
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>
2016-03-24Require xserver 1.9 or newerMichel Dänzer5-33/+1
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>
2016-03-24Fix build against older versions of xserverMichel Dänzer3-11/+33
Also slightly clean up the error handling in radeon_scanout_do_update. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94614 Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-03-24Use radeon_alloc_pixmap_bo for allocating scanout BOsMichel Dänzer1-15/+9
This enables tiling for scanout BOs used for TearFree / ShadowPrimary, and simplifies the code a little. Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-03-24DRI3 only works with accelerationMichel Dänzer1-6/+9
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94214 Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-03-23TearFree can only work with accelerationMichel Dänzer1-4/+6
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-03-23Check for xf86CursorResetCursorMichel Dänzer2-0/+8
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>
2016-03-23Don't try DRI2/Present flipping while the HW cursor can't be usedMichel Dänzer5-3/+28
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>
2016-03-23Factor out HW cursor checking code into drmmode_can_use_hw_cursorMichel Dänzer1-10/+29
And add a check for RandR 1.4 multihead. Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-03-23Use correct tiling in drmmode_create_bo_pixmapRyan Kennedy1-3/+6
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>
2016-03-10present: Return rotated CRTCs from radeon_present_get_crtcMichel Dänzer1-2/+1
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>
2016-03-09present: Clear drmmode->fb_id before calling set_mode_major for unflipMichel Dänzer1-0/+6
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>
2016-03-09Make Option "TearFree" effective for rotated/reflected outputs as well (v2)Michel Dänzer2-41/+214
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)
2016-03-09Consolidate pScreen usage in drmmode_set_mode_majorMichel Dänzer1-7/+5
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>
2016-03-08Remove check for XF86_CRTC_VERSION 3Michel Dänzer1-4/+2
We require xserver >= 1.8, which was already at version 3. Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-03-01Deal with modesets and page flips crossing on a CRTCMichel Dänzer3-1/+20
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>
2016-02-27Make DRM event queue xf86CrtcPtr based instead of ScrnInfoPtr basedMichel Dänzer8-110/+83
This allows for a minor simplification of the code. Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-02-27DRI2: Also clear dri2_flipping when client disconnects before eventMichel Dänzer1-2/+3
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>
2016-02-27Remove radeon_scanout_flip_handlerMichel Dänzer1-8/+1
No longer necessary now that radeon_drm_queue_handler can handle e->handler == NULL. Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-02-25drm_queue: Don't abort events immediately from radeon_drm_abort_clientMichel Dänzer1-5/+13
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>
2016-02-17glamor: Return NullPixmap on failure to create shareable pixmapjimqu1-1/+3
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>
2016-02-17Move radeon_glamor_destroy_pixmap before radeon_glamor_create_pixmapjimqu1-35/+35
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>
2016-02-17Remove pci_dev test from radeon_get_scrninfoMichel Dänzer1-4/+1
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>
2016-02-17Initialize drmmode_crtc dpms_mode to DPMSModeOffMykola Lysenko1-0/+1
This disables query of disabled pipes for drmWaitVBlank on X start Signed-off-by: Mykola Lysenko <Mykola.Lysenko@amd.com> (ported from amdgpu commit 4eb9cedca080b30c57ded349a397620ee7d0cd46) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>