summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2016-09-14Fix cursor size for SIMarek Olšák1-2/+8
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> Acked-by: Edward O'Callaghan <funfunctor@folklore1984.net> (Cherry picked from commit c4364520691d18961f0a6b77071baeeffaa80a11)
2016-09-14Add SI PCI IDsRonie Salgado7-0/+443
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> (Cherry picked from commit 2eb5d77b841e55e7328df4b95c0d41fec30ce10f)
2016-09-14Add missing Kaveri PCI ID (1318)Michel Dänzer6-0/+6
Found by comparing src/pcidb/ati_pciids.csv with xf86-video-ati. Reviewed-by: Alex Deucher <alexander.deucher@amd.com> (Cherry picked from commit 7d050d15d49ef25e86e7abe88dafb52370715640)
2016-09-14Add Mullins PCI IDsMichel Dänzer7-0/+97
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97472 Reviewed-by: Alex Deucher <alexander.deucher@amd.com> (Cherry picked from commit aa5492660958e359bdc2107cba9a211ff988c90e)
2016-09-14DRI2: Fix amdgpu_dri2_exchange_buffers width/height copy'n'paste errorQiang Yu1-1/+1
Signed-off-by: Qiang Yu <Qiang.Yu@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> (Cherry picked from commit 73c8dc000ad6b2b53ba3aa7155f5e8f6b55623b7)
2016-09-14DRI2: Add interpolated_vblanks in amdgpu_dri2_get_crtc_mscMichel Dänzer1-2/+6
We need that in amdgpu_dri2_drawable_crtc as well for priv->vblank_delta to work as intended. amdgpu_dri2_get_msc was already doing this. Fixes hangs in some cases when using VDPAU via DRI2 and moving the window between CRTCs. Reviewed-by: Alex Deucher <alexander.deucher@amd.com> (Cherry picked from commit abd1a7901c95e4bc78415cf1b7923623b9177152)
2016-09-14Only 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 (Ported from radeon commit 3be841d0ae7d505cef325993205b12d15e98dba9) Reviewed-by: Alex Deucher <alexander.deucher@amd.com> (Cherry picked from commit b5e2b964b7884c205a7c0fa578e05e867c176fcc)
2016-09-14Destroy all dedicated scanout buffers during CloseScreenMichel Dänzer1-0/+10
Fixes leaking active scanout buffers across a server reset, which also fixes server reset with glamor and active scanout buffers. Reviewed-by: Alex Deucher <alexander.deucher@amd.com> (Cherry picked from commit d96dabc71b1b32dc4b422a9633cdd4e0e95da052)
2016-09-14glamor: Reallocate linear pixmap BO if necessary for DRI2 PRIMEMichel Dänzer1-0/+21
Fixes corruption when using DRI2 PRIME render offloading with the master screen using this driver. Reported-by: Qiang Yu <qiang.yu@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Tested-by: Qiang Yu <qiang.yu@amd.com> (Cherry picked from commit 0007c2f018ba663303d91d847e7c085269a23062)
2016-09-14Move DRI2's local fixup_glamor helper to amdgpu_glamor_set_pixmap_bo v2Michel Dänzer3-50/+53
So it can be used outside of the DRI2 code. v2: Keep pixmap refcnt increment in amdgpu_dri2_create_buffer2 (Qiang Yu) Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Tested-by: Qiang Yu <qiang.yu@amd.com> (v1) (Cherry picked from commit 5518bf5d793439b5bab369e5fc18de9a4a3b9dd6)
2016-09-14Consolidate get_drawable_pixmap helperMichel Dänzer3-27/+16
There were two static helpers for the same purpose. Consolidate them into a single inline helper which can be used anywhere. Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Tested-by: Qiang Yu <qiang.yu@amd.com> (Cherry picked from commit 641f4647b7f51dfd2da330376cd10fa9702b6423)
2016-09-14Add amdgpu_pixmap_get_tiling_infoMichel Dänzer3-1/+36
Retrieves the tiling information about a pixmap BO from the kernel driver. Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Tested-by: Qiang Yu <qiang.yu@amd.com> (Cherry picked from commit 8e40f190e4704c2802bf0f073f17e742786d0f18)
2016-09-14Remove amdgpu_share_pixmap_backingMichel Dänzer2-17/+0
Not used anymore. Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Tested-by: Qiang Yu <qiang.yu@amd.com> (Cherry picked from commit e7eeb6ad1133b6023d34b4489959ae330a8e15dd)
2016-09-14glamor: Fix amdgpu_glamor_share_pixmap_backing for priv->bo == NULLMichel Dänzer1-3/+8
Fixes crash when running a compositor and DRI_PRIME client via DRI2. Reported-by: Qiang Yu <qiang.yu@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Tested-by: Qiang Yu <qiang.yu@amd.com> (Cherry picked from commit b36c77695ba77b59a0ccd868454e3af4fc04d5ff)
2016-09-14add missing bonaire pci idAlex Deucher6-0/+6
Signed-off-by: Alex Deucher <alexander.deucher@amd.com> (Cherry picked from commit 60ced5026ebc34d9f32c7618430b6a7ef7c8eb4b)
2016-09-14Add more Polaris 11 PCI IDsFlora Cui6-12/+30
Signed-off-by: Flora Cui <Flora.Cui@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> (Cherry picked from commit 8e89448ee00da16e05e6777f34bb75d2dd6f7025)
2016-09-14Add more Polaris 10 PCI IDsFlora Cui6-0/+54
Signed-off-by: Flora Cui <Flora.Cui@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> (Cherry picked from commit a59b23d64285741a7a25e314343f6261046d980f)
2016-09-14Fix amdgpu_mode_hotplug crash on multi GPU platform.Qiang Yu1-1/+2
On multi GPU platform, some screen is created by other GPU DDX. Signed-off-by: Qiang Yu <Qiang.Yu@amd.com> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> (Cherry picked from commit 978242977e5dc905e1d5a46b1b0d34b356c7af26)
2016-09-14Handle Zaphod mode correctly in amdgpu_mode_hotplugMichel Dänzer1-10/+34
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 (Ported from radeon commit c801f9f10a5d72d935faf21e72f7e7808fb4f05f) Reviewed-by: Alex Deucher <alexander.deucher@amd.com> (Cherry picked from commit 14606e127f4b6eb0b00fd42cec13d524a67e4c4a)
2016-09-14add strato pci idFlora Cui6-0/+6
Signed-off-by: Flora Cui <flora.cui@amd.com> Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com> (Cherry picked from commit 4822ec7a23d2253c88bc403f17abb6d7a053528c)
2016-09-14Remove RR_Capability_SinkOutput for GPU without CRTC.Qiang Yu1-4/+7
Signed-off-by: Qiang Yu <Qiang.Yu@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> (Cherry picked from commit a0bbb373f902e0ffc14570c85faec7e44134f62e)
2016-04-04glamor: Force GPU rendering to/from pixmaps created via DRI3Michel Dänzer2-6/+11
Fixes crash when running DRI3 clients with ShadowPrimary enabled. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94799 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. (Ported from radeon commit 4693b1bd5b5c381e8b7b68a6f7f0c6696d6a68df) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-03-30DRI3: Refuse to open DRM file descriptor for ssh clientsMichel Dänzer1-1/+38
Fixes hangs when attempting to use DRI3 on display connections forwarded via SSH. Don't do this for Xorg > 1.18.99.1 since the corresponding xserver change has landed in Git master. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93261 (Ported from radeon commit 0b3aac1de9db42bfca545fa331e4985836682ec7) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-03-25Revert "Use render node for DRI3 if available"Michel Dänzer2-35/+3
This reverts commit ea558e645786b08d75307716036045170e97b43e. 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-24add polaris10 pci idFlora Cui6-0/+12
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> Signed-off-by: Flora Cui <Flora.Cui@amd.com> Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
2016-03-24add polaris11 pci idFlora Cui6-0/+36
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> Signed-off-by: Flora Cui <Flora.Cui@amd.com> Reviewed-By: Jammy Zhou <Jammy.Zhou@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-03-24add Polaris chip familiesAlex Deucher1-0/+2
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2016-03-25Require xserver 1.9 or newerMichel Dänzer5-36/+0
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. (Ported from radeon commit e592f32f8b5f5873fcc18b10a69dd5e4ccf11073) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-03-25Fix build against older versions of xserverMichel Dänzer3-9/+31
Also slightly clean up the error handling in amdgpu_scanout_do_update. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94614 (Ported from radeon commit bde466e5d44cad64b4e4eceaa5de80fdbf86356e) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-03-25DRI3 only works with accelerationMichel Dänzer1-6/+9
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94214 (Ported from radeon commit d21ac4669a8b2cdd4eec5e5a94d1950b7423b8b5) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-03-25Check for xf86CursorResetCursorMichel Dänzer1-0/+2
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. (Ported from radeon commit d670c5c9851b4eff21c845d26c7d7e4eb5ee0fa9) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-03-25Don't try DRI2/Present flipping while the HW cursor can't be usedMichel Dänzer5-3/+29
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. (Ported from radeon commit 7f3d0780ca65a90117c2a61362dbc0899bd9c0b0) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-03-24Factor out HW cursor checking code into drmmode_can_use_hw_cursorMichel Dänzer1-10/+29
And add a check for RandR 1.4 multihead. (Ported from radeon commit 3de480e83c0a1824838d662d6d67c9fe85277298) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-03-24Call AMDGPUBlockHandler_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. Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-03-23present: Return rotated CRTCs from amdgpu_present_get_crtcMichel Dänzer1-2/+1
Sync-to-vblank works fine with rotation. We're still checking for rotation in amdgpu_present_check_flip. Returning NULL from here resulted in the xserver present code falling back to the fake CRTC running at 1 fps. (Ported from radeon commit a03271de5ecdaa7790d1316e993c4450b91fe936) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-03-23present: Clear drmmode->fb_id before calling set_mode_major for unflipMichel Dänzer1-0/+7
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. (Ported from radeon commit 40191d82370eb7e58bd34c44966cbf44c3703229) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-03-23Make Option "TearFree" effective for rotated/reflected outputs as wellMichel Dänzer2-41/+219
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. (Ported from radeon commit 798c4fd16d339b1ad5fd729cc884be084c60e38b) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-03-23Consolidate 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. (Ported from radeon commit eb611a2e4ecce7a1ab85fd72b9b78e3269311dd5) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-03-23Remove check for XF86_CRTC_VERSION 3Michel Dänzer1-4/+1
We require xserver >= 1.8, which was already at version 3. (Ported from radeon commit 06602171386e538081c298645fb7ca1a70fe80cc) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-03-23Deal with modesets and page flips crossing on a CRTCMichel Dänzer3-0/+17
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. (Ported from radeon commit a88985f5d1e39caca49ceb65678aaa9cb622a0d2) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-03-23Make DRM event queue xf86CrtcPtr based instead of ScrnInfoPtr basedMichel Dänzer8-111/+86
This allows for a minor simplification of the code. (Ported from radeon commit f5d968cbba3c9b7ec202161f2157d8d64778c817) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-03-23Remove amdgpu_scanout_flip_handlerMichel Dänzer1-8/+1
No longer necessary now that amdgpu_drm_queue_handler can handle e->handler == NULL. (Ported from radeon commit d5dbb07db22d5420c81dfebc060f0dd86e7b8a20) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-03-23DRI2: 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. (Ported from radeon commit e87365117acbd80b7d80fbb5eb30890ef7153291) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-03-23drm_queue: Don't abort events immediately from amdgpu_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. (Ported from radeon commit 3989766edde85d1abe7024577b98fc9b007bc02a) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-03-23Fix RandR CRTC transformsMichel Dänzer1-1/+17
Currently, Xorg will only transform the cursor as of the first time the cursor image changes after a transform is set. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80678 (Ported from radeon commit 9483a3d777919b224f70c3b4d01e4b320a57db31) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-03-18Build RandR 1.4 provider name from chipset name and bus IDMichel Dänzer1-1/+12
Instead of just "amdgpu", it's now e.g. "TONGA @ pci:0000:01:00.0". (Ported from radeon commit c7cf00487cd6d4a5d0f39d5b92ff04f6420d6a32) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-02-27DRI2: Use amdgpu_pixmap_get_handleMichel Dänzer2-41/+31
Now we can share pixmaps with no struct amdgpu_buffer via DRI2. Fixes VDPAU video playback freezing when using an OpenGL compositor with DRI3 enabled and mpv VAAPI hardware decoding with OpenGL output. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89755 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93804 (ported from radeon commit f8b0f23e9f4af9f9097ee5e72d53b45173163c41) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-02-27glamor: Avoid generating GEM flink names for BOs shared via DRI3 (v2)Michel Dänzer4-14/+66
We can't create our own struct amdgpu_buffer representation in this case because destroying that would make the GEM handle inaccessible to glamor as well. So just get the handle directly via dma-buf. (ported from radeon commit 391900a670addec39515f924265bfa9f8bfa9ec0, extended to cache BO handles in the private for non-DRI3 pixmaps as well) v2: Swap whole pixmap privates instead of just BOs in amdgpu_dri2_exchange_buffers to avoid invalidating cached BO handles Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-02-27Make amdgpu_do_pageflip take a pixmap instead of a BOMichel Dänzer4-41/+17
(inspired by radeon commit 7b4fc4a677d252d01c2bf80d162bc35814059eaa) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>