summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2017-10-20Always call drmModeFreeProperty after drmModeGetPropertyHEADmasterMichel Dänzer1-2/+2
We were not doing so in all cases, leaking memory allocated by the latter. Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-10-20Call TimerFree for timer created in LeaveVTMichel Dänzer1-0/+1
We were leaking the memory allocated by TimerSet. Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-10-20Free memory returned by xf86GetEntityInfoMichel Dänzer2-8/+17
We were leaking it. Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-10-20Free pAMDGPUEnt memory in AMDGPUFreeRecMichel Dänzer2-6/+4
We were freeing it earlier but then still trying to access it in AMDGPUFreeRec. Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-10-20Bail if there's a problem with ShadowFBMichel Dänzer1-4/+4
If we hit a problem while setting up ShadowFB, just carrying on trying to set up HW acceleration instead is unlikely to work. (Ported from radeon commit 7d435354099119234d443b07e2df1c7b9f97cf3c) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-10-19Fix VT switching with ShadowFBMichel Dänzer1-60/+94
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: c16ff42f927d ("Make all active CRTCs scan out an all-black framebuffer in LeaveVT") (Ported from radeon commit 34da04daec82077571558ac3fe1ec0c1203a01ad) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-10-05Clarify when TearFree is automatically enabled.Darren Salt1-2/+2
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2017-10-05Post-release version bumpMichel Dänzer1-1/+1
2017-09-08Bump version for 1.4.0 releasexf86-video-amdgpu-1.4.0Michel Dänzer1-1/+1
2017-08-31Require xserver >= 1.13Michel Dänzer14-303/+58
xserver 1.13.0 was released on September 6th, 2012, almost 5 years ago. This allows cleaning up a bunch of backwards compatibility code. (Ported from radeon commit 5cdd334b3402c2431deb3a87a8d04ef590da53ee) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-08-30Use a timer for unreferencing the all-black FBMichel Dänzer1-15/+27
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: c16ff42f927d ("Make all active CRTCs scan out an all-black framebuffer in LeaveVT") (Ported from radeon commit 9d9c565c84601f4c6c73ad769f86491088683f7a) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-08-30Remove drmmode_scanout_freeMichel Dänzer2-11/+0
Not used anymore. (Cherry picked from radeon commit e4a3df19d588a4310fcb889ef34e205d0e92e4d7) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-08-30Make all active CRTCs scan out an all-black framebuffer in LeaveVTMichel Dänzer3-10/+97
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: b09fde0d81e0 ("Use reference counting for tracking KMS framebuffer lifetimes") (Ported from radeon commit 06a465484101f21e99d3a0a62fb03440bcaff93e) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-08-30Create amdgpu_master_screen helperMichel Dänzer1-4/+10
Preparatory, no functional change intended yet. (Ported from radeon commit 7f0cd68d1b0c132e32ae736371bce3e12ed33c7a) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-08-30Create amdgpu_pixmap_get_fb_ptr helperMichel Dänzer1-19/+27
Preparatory, no functional change intended yet. Also inline amdgpu_pixmap_create_fb into amdgpu_pixmap_get_fb, since there's only one call-site. (Ported from radeon commit 20f6b56fdb74d88086e8e094013fedbb14e50a24) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-08-30Create drmmode_set_mode helperMichel Dänzer2-33/+52
Preparatory, no functional change intended yet. (Ported from radeon commit 4bc992c31059eb50e22df4ebf5b92d08411f41ef) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-08-29Create amdgpu_pixmap_clear helperMichel Dänzer3-13/+23
Preparatory, no functional change intended yet. (Ported from radeon commit 3f6210ca2c8ef60d59efc8139151d3b9838bb875) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-08-22modesetting: re-set the crtc's mode when link-status goes BADMartin Peres2-1/+44
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 ] (Ported from radeon commit 0472a605e0ec8fec1892bbc3a84698b7ef9c5296) Acked-by: Harry Wentland <harry.wentland@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-08-22Make amdgpu_scanout_do_update take a PixmapPtr instead of a DrawablePtrMichel Dänzer3-11/+10
All callers were already passing in a pixmap. This allows simplifying the rotated scanout case slightly. (Ported from radeon commit d822a0f47070374ad0c1a97b559bae27724dc52a) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-08-22Use xorg_list_append for the DRM event listMichel Dänzer2-1/+8
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 amdgpu_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. (Ported from radeon commit 3e24770b1b472fc15df56d06f5f04778c9db63dd) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-08-22Consolidate amdgpu_scanout_flip_abort/handler helpersMichel Dänzer1-49/+36
While at it, make them use crtc->driver_private. (Ported from radeon commit 36ce7920136c0d723c9397a84e7dd5926a9c7943) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-08-22Always allow DRI2 page flipping with TearFreeMichel Dänzer2-6/+2
Even if TearFree is enabled for the CRTC we're synchronizing to. (Ported from radeon commit d314cbfb228bb4b8762714f98d0c114a8ee3f061) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-08-22Always allow Present page flipping with TearFreeMichel Dänzer4-23/+152
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. (Ported from radeon commit 4445765af5b97d0cfd10889fe6d6f58f2ce85659) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-08-22Pass extents to amdgpu_scanout_do_updateMichel Dänzer3-22/+24
Preparation for following change, no functional change intended yet. (Ported from radeon commit 65e0c5ea1b4adff21d673dbf54af99704c429627) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-08-22Add source drawable parameter to amdgpu_scanout_do_updateMichel Dänzer3-11/+13
Preparation for following changes, no functional change intended yet. (Ported from radeon commit 1443270e52e8562bd8dc3603f301963bd4027cef) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-08-22Handle multiple "pending" Present flipsMichel Dänzer2-12/+18
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. (Ported from radeon commit 7c10ee9c88378d773c0bcf651fdc5d9f2c6dc5e5) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-08-22Wait for pending flips synchronously before turning off a CRTCMichel Dänzer5-60/+21
Allows removing drmmode_clear_pending_flip and the pending_dpms_mode field and cleaning up the code considerably. (Ported from radeon commit e6d7dc2070f4d21a6900916bb70a31839112882c) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-08-22Create drmmode_crtc_wait_pending_event helper macroMichel Dänzer1-4/+10
Preparation for following change, no functional change intended yet. (Ported from radeon commit f87acdbfb1b0b6d2769764772a52ea8b81675e20) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-08-22Create drmmode_wait_vblank helperMichel Dänzer6-128/+85
Allows cleaning up the code considerably. (Ported from radeon commit 99f1d7a474af3683fe1a66f50c0bb8935478ff0a) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-08-22Pass reference CRTC to amdgpu_do_pageflip directlyMichel Dänzer4-16/+7
Simplifies the code slightly. (Ported from radeon commit 49cc61ab970ee28d4509b4e2dd0a57165136889f) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-08-18Remove drmmode_crtc->scanout_destroy[] arrayMichel Dänzer2-19/+4
No longer necessary since we're reference counting framebuffers. (Ported from radeon commit 3f120fa1d5d921656a367751bc079e020e9ab105) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-08-15Adapt to PixmapDirtyUpdateRec::src being a DrawablePtrMichel Dänzer3-13/+43
2017-08-03Allow DRI page flipping when some CRTCs use separate scanout buffersMichel Dänzer5-34/+16
As long as the CRTC we're synchronizing to doesn't. (Ported from radeon commit 5309bde0c4e28adf2b167191c6d7011a19e31eed) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-08-03Add drmmode_crtc_can_flip helperMichel Dänzer3-9/+15
To reduce code duplication between DRI2 and Present. No functional change intended yet. (Ported from radeon commit 9bc3eef74452d924f9101c024f66ad9b14c404c8) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-08-02Use root window (pixmap) instead of screen pixmap for scanout updatesMichel Dänzer2-8/+15
Preparation for following changes, no functional change intended yet. (Ported from radeon commit c2d26890691ec105858f086b63170ad94c6f7f05) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-07-27Only handle reflection in the driver with Xorg < 1.16Michel Dänzer1-0/+6
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: ba2aa0a8c12a ("Handle rotation in the driver also with Xorg 1.12-1.18") (Cherry picked from radeon commit 7d7abf99b5441ddb04dbee99bc8fa7abc30d4c46) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-07-27autogen.sh: Pass -f to autoreconfMichel Dänzer1-1/+1
To ensure that any existing copies of autotools files will be replaced with the current versions. Acked-by: Alex Deucher <alexander.deucher@amd.com>
2017-07-27Makefile.am: Set ACLOCAL_AMFLAGS = -I m4Michel Dänzer1-0/+2
Suggested by one of the tools called by autoreconf. Acked-by: Alex Deucher <alexander.deucher@amd.com>
2017-07-27Add AC_CONFIG_MACRO_DIRS([m4]) to configure.acMichel Dänzer1-0/+1
Suggested by one of the tools called by autoreconf. Acked-by: Alex Deucher <alexander.deucher@amd.com>
2017-07-26If a TearFree flip fails, fall back to non-TearFree operationMichel Dänzer3-13/+22
In order to avoid possible freeze / log file spam in that case. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99769 (Ported from radeon commit 94dc2b80f3ef0b2c17c20501d824fb0447d52e7a) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-07-13Use drmmode_crtc->scanout_id instead of 0 to check for scanout bufferMichel Dänzer3-5/+6
Preparation for following change, no functional change intended. (Ported from radeon commit aff267ee36cc6a703a532f91f82adc1ba1425ff3) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-06-27Only call drmmode_scanout_free for non-GPU screens in LeaveVTMichel Dänzer1-1/+2
Destroying the scanout buffers of GPU screens resulted in a crash when switching back to the Xorg VT. Fixes: b10ecdbd89b0 ("Use drmmode_crtc_scanout_* helpers for RandR 1.4 scanout pixmaps") (Ported from radeon commit c9dd28cb0c9c3de676eadac61e727732510f6b9b) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-06-27Improve drmmode_fb_reference debugging codeMichel Dänzer1-12/+16
If a reference count is <= 0, call FatalError with the call location (in case it doesn't get resolved in the backtrace printed by FatalError). Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-06-21Increase reference count of FB assigned to drmmode_crtc->flip_pendingMichel Dänzer2-6/+10
Otherwise, it could happen that we destroy the FB before the flip completes, resulting in use-after-free and most likely a crash. Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-06-15modesetting: Validate the atom for enum propertiesAdam Jackson1-1/+2
The client could have said anything here, and if what they said doesn't actually name an atom NameForAtom() will return NULL, and strcmp() will be unhappy about that. [copied from xserver d4995a3936ae283b9080fdaa0905daa669ebacfc] Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-and-Tested-by: Michel Dänzer <michel.daenzer@amd.com>
2017-06-08Improve AMDGPUPreInitAccel_KMS log messagesMichel Dänzer2-13/+13
Now it should always be clear in the log file why acceleration isn't enabled. Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-05-26Use reference counting for tracking KMS framebuffer lifetimesMichel Dänzer5-117/+219
References are held by the pixmaps corresponding to the FBs (so the same KMS FB can be reused as long as the pixmap exists) and by the CRTCs scanning out from them (so a KMS FB is only destroyed once it's not being scanned out anymore, preventing intermittent black screens and worse issues due to a CRTC turning off when it should be on). v2: * Only increase reference count in drmmode_fb_reference if it was sane before * Make drmmode_fb_reference's indentation match the rest of drmmode_display.h (Ported from radeon commit 55e513b978b2afc52b7cafc5bfcb0d1dc78d75f6) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-05-24Update URLsMichel Dänzer3-11/+11
* Point to the amd-gfx mailing list * Specify the component in all bugzilla URLs * Use https:// for all HTML URLs (Ported from radeon commit d80d01a73c2eaba2e3649b7bc0a3541b3ff782f6) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-05-24Simplify tracking of PRIME scanout pixmapMichel Dänzer3-15/+16
Remember the shared pixmap passed to drmmode_set_scanout_pixmap for each CRTC, and just compare against that. Fixes leaving stale entries in ScreenRec::pixmap_dirty_list under some circumstances, which would usually result in use-after-free and a crash down the line. (Ported from radeon commit 7dc68e26755466f9056f8c72195ab8690660693d) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-05-17Use plain glamor_egl_create_textured_screen().Eric Anholt1-4/+3
Since 5064ffab631 (2014), glamor's implementation of _ext just drops the back_pixmap arg, which we were passing NULL (the default) to anyway. Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> (Ported from radeon commit 2b7d77b90108911777a11ecaa63435552000c958)