summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2016-03-24Require xserver 1.9 or newerMichel Dänzer
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änzer
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änzer
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änzer
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änzer
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-03-23Check for xf86CursorResetCursorMichel Dänzer
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änzer
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änzer
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 Kennedy
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änzer
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änzer
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änzer
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änzer
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änzer
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änzer
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änzer
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änzer
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änzer
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änzer
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 pixmapjimqu
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_pixmapjimqu
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änzer
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 Lysenko
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>
2016-02-17sync: Check if miSyncShmScreenInit symbol is resolved at runtimeMichel Dänzer
It may be disabled in the Xorg build, either explicitly or because the xshmfence library isn't available. (ported from amdgpu commit 1d0b0c1794e65e581a48aa9fb19679d928d82a5d) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-02-16Use render node for DRI3 if availableJammy Zhou
Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com> (ported from amdgpu commit ea558e645786b08d75307716036045170e97b43e) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-01-20Set RADEON_GEM_NO_CPU_ACCESS flag for BOs which don't need CPU accessMichel Dänzer
Failing to do this was resulting in the kernel driver unnecessarily leaving open the possibility of CPU access to those BOs. Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-01-18Fix RandR CRTC transformsMichel Dänzer
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 Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-01-14Set the RandR primary output on startup if Xorg hasn'tMichel Dänzer
Fixes xrandr (XRRGetOutputPrimary) not reporting any output as primary after startup. Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2015-12-25Build RandR 1.4 provider name from chipset name and bus IDMichel Dänzer
Instead of just "radeon", it's now e.g. "KAVERI @ pci:0000:00:01.0". Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2015-12-24HAS_DIRTYTRACKING_ROTATION also supports multiple CRTCsMichel Dänzer
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2015-12-01Load fb module before glamoregl/shadow modulesMichel Dänzer
Fixes unresolved symbols on some systems. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93105 Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2015-11-20Don't advertise any PRIME offloading capabilities without accelerationMichel Dänzer
Acceleration is required even for display offloading. Trying to enable display offloading without acceleration resulted in a crash. Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2015-11-17glamor: Deal with glamor_egl_destroy_textured_pixmap being removedMichel Dänzer
When it's not available, it's safe to call down to the glamor DestroyPixmap hook instead. Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2015-11-17glamor: Restore all ScreenRec hooks during CloseScreenMichel Dänzer
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2015-11-12Remove duplicate free(output_ids) callMichel Dänzer
Fixes double-free regression introduced by commit 875ad48e ("Simplify drmmode_set_mode_major() and avoid leaking memory.").
2015-11-12Clean up radeon_dri2_create_buffer2()Tom St Denis
Remove the depth_pixmap variable from the function and clear out any dead/odd behaviour that results. Signed-off-by: Tom St Denis <tom.stdenis@amd.com> (ported from amdgpu commit 6000aef4e2f0a121b94023484406fb6f04688f74) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2015-11-12Properly handle drmModeAddFB failure in drmmode_crtc_scanout_allocateMichel Dänzer
We were printing an error message, but not propagating the failure. That would probably lead to trouble down the road. (ported from amdgpu commit 21e72fb2418b5cc7fc849a9cf951186e209036b0) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2015-11-12Eliminate redundant data parameter from drmmode_crtc_scanout_createMichel Dänzer
drmmode_crtc_scanout_create just needs to call drmmode_crtc_scanout_allocate when scanout->bo is NULL. This makes it clearer to the reader / compiler that drmmode_crtc_scanout_create doesn't dereference scanout->bo when it's NULL. (ported from amdgpu commit 8da1d0c870e1081d77925807d6e3bbc61a23f54f) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2015-11-12Don't advertise rotation support without hardware acceleration v2Michel Dänzer
Rotation currently doesn't work without acceleration (doesn't actually rotate with Option "NoAccel", crashes with Option "AccelMethod" "none" or when glamor fails to initialize) and would probably be too slow anyway. v2: Also remove now dead code checking for ShadowFB from drmmode_crtc_scanout_allocate(). (ported from amdgpu commit dc40582d5ff94d812cbc08f95cf14b80cd0f410d) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2015-11-12Simplify drmmode_set_mode_major() and avoid leaking memory.Tom St Denis
The function would leak the memory allocated for output_ids. This patch addresses that as well as simplifies the logic somewhat. Signed-off-by: Tom St Denis <tom.stdenis@amd.com> (ported from amdgpu commit 460560502a1bdf26d06f3c30df46fa9f28ffb9e5) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2015-11-12Clean up allocation in RADEONInitVideo()Tom St Denis
The allocation of the adapters should use the correct sizeof (even if allocating an array of pointers). Signed-off-by: Tom St Denis <tom.stdenis@amd.com> (ported from amdgpu commit db3bb2061b9ac16b0922d9afae99874820356a04) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2015-11-12Simplify pick best crtc to fold two loops into oneTom St Denis
This patch folds the two for loops from radeon_pick_best_crtc() into one to reduce the LOC and make the routine easier to read. Signed-off-by: Tom St Denis <tom.stdenis@amd.com> (ported from amdgpu commit 3055724aef76a624718f26d5f0f9e9d567ffbcfb) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2015-11-11dri2: Avoid calculation with undefined msc valueTom St Denis
If the get_msc() call fails for any reason we should avoid updating the vblank counter delta with undefined data. Signed-off-by: Tom St Denis <tom.stdenis@amd.com> Signed-off-by: Michel Dänzer <michel.daenzer@amd.com> (minor fixups) (ported from amdgpu commit 8823c3d4c6db70cff7699b31088f2d92db8faaf4) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2015-10-26Handle failures in setting a CRTC to a DRM mode properlyStephen Chandler Paul
This fixes a bug where running the card out of PPLL's when hotplugging another monitor would result in all of the displays going blank and failing to work properly until X was restarted or the user switched to another VT. [Michel Dänzer: Pass errno instead of -ret to strerror()] Signed-off-by: Stephen Chandler Paul <cpaul@redhat.com> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2015-10-16Call xf86CrtcRotate from initial drmmode_set_desired_modes callMichel Dänzer
Fixes various problems when rotation is specified in xorg.conf. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92475 Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2015-10-02Only align screen / scanout pixmap height where necessaryMichel Dänzer
When using glamor acceleration, the pixmap's header has to have a height that matches exactly what the actual height is minus the GPU memory alignment. Otherwise CRTCs scanning out from the main scanout buffer (e.g. every CRTC that isn't rotated or transformed in some way) won't always work. This results in a bug where rotating one monitor in a multi-monitor setup won't always work properly. Easiest way to reproduce this: - Have two monitors (I've gotten this working with a 1920x1080 and 1280x1024, along with two 1920x1080s) - Rotate one of them from 0° to 90°, then rotate the same monitor from 90° to 180°. The monitor that hasn't been rotated won't properly update, and will stay on a blank screen This doesn't seem to make any difference when using EXA for acceleration. Compared to Stephen Chandler's patch, this drops the height alignment in most places and only keeps it where it's really necessary. Reported-and-Tested-by: Stephen Chandler Paul <cpaul@redhat.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2015-08-20DRI2: Keep MSC monotonic when moving window between CRTCsMichel Dänzer
This mirrors the DRI3 implementation in xserver. Fixes VDPAU video playback hanging when moving the window between CRTCs. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=66384 (Ported from amdgpu commit 63948ea091a9b324327ade7ec4fc5d67ca7e6f6f) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2015-08-19DRI2: Don't ignore rotated CRTCs in amdgpu_dri2_drawable_crtcMichel Dänzer
Waiting for vblank interrupts works fine with rotated CRTCs. The only case we can't handle with rotation is page flipping, which is handled in can_exchange(). This fixes gnome-shell hanging on rotation, probably because amdgpu_dri2_get_msc returned MSC/UST 0 for rotated CRTCs. (Ported from amdgpu commit 7b3212e33cd36fb6f122774df27b56ec4e1a22b8) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2015-08-10add new OLAND pci idAlex Deucher
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-08-11Make selection between DRI2 and DRI3 consistent with other drivers. (v2)Mario Kleiner
Add Option "DRI" to allow selection of maximum DRI level. This allows the user to select the maximum level of DRI implementation to use, DRI2 or DRI3. It replaces the old option "DRI3" which had exactly the same purpose, but differs from the method used in both intel ddx and nouveau ddx. Make this consistent before a new stable driver is released. v2: Retain handling of old Option "DRI3" for backwards compatibility, but Option "DRI" will take precedence over "DRI3" if both are provided. Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>