Age | Commit message (Collapse) | Author |
|
This way we can reuse it, instead of redoing it later on.
v2: Pass the AMDGPUEnt as argument.
v3: free() the string at AMDGPUFreeRec (Michel)
v4: Inline amdgpu_bus_id, move at top of mdgpu_kernel_open_fd (Michel)
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> (v3)
Acked-by: Alex Deucher <alexander.deucher@amd.com>
|
|
XNFasprintf cannot fail - aka busid cannot be NULL.
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
|
|
The func is a u, instead of a signed int.
v2: Drop the precision - s/1u/u/ (Michel)
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
|
|
The former of these is a UMS artefact which gives incorrect and
misleading promise whether KMS is supported. Not to mention that
AMDGPU is a only KMS driver.
In a similar fashion xf86LoadKernelModule() is a relic of the times,
where platforms had no scheme of detecting and loading the appropriate
kernel module.
Notes:
- Since there is no reply from Robert the code is still around, behind
a FreeBSD guard.
- If FreeBSD still needs this they should look and fix it ASAP, as:
- wayland itself or compositors do _not_ load kernel modules
- the kernel module should be loaded early to control the clocks/fan,
hence temperature of the card
v2: Keep the code as FreeBSD only, add 'Notes' in the commit message.
Cc: Robert Millan <rmh@freebsd.org>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
|
|
Use the device node path, if the server knows it.
Note:
ODEV_ATTRIB_PATH was introduced with xserver 1.13 - the minimum version
required to build amdgpu. Yet it's defined in xf86platformBus.h. With
the header included only when XSERVER_PLATFORM_BUS is set.
Keep things obvious and use a ODEV_ATTRIB_PATH guard.
v2: Rebase, add commit message
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
|
|
Without the 'extern' this looks like a definition not just a
declaration, in every file that includes the header. gcc 10 is stricter
about this kind of multiple definition.
|
|
xserver 19 expects the SourceValidate hook to always be filled in with
something valid. For earlier servers it's harmless to simply fill this
in with a do-nothing function instead of NULL.
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
|
|
|
|
FindClientResourcesByType finds pixmaps from all screens, but trying to
process ones from other screens here makes no sense and likely results
in a crash or memory corruption.
Fixes: c16ff42f927d ("Make all active CRTCs scan out an all-black
framebuffer in LeaveVT")
(Ported from radeon commit 2faaecc69b127248718e759c6c98c84d56dd1b6b)
|
|
Avoids a crash described in
https://gitlab.freedesktop.org/xorg/driver/xf86-video-amdgpu/merge_requests/43#note_223718
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
|
|
The current non-DC kernel driver also handles flipping between different
pitches correctly.
Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
|
|
Current DC handles flipping between different pitches correctly.
Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
|
|
The corresponding check in the xserver Present code was removed again,
because flipping between different pitches can work in some cases.
Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
|
|
These are already used by xserver, Mesa and some other projects.
Current Debian testing brings e.g. GCC 8.3.0 and clang 7.0.1.
|
|
Even with SW cursor, page flipping can be used while no X cursor is
visible.
Occurred to me in the context of xorg/xserver#828.
|
|
This can legitimately fail if the pixmap's storage is shared from
another device, e.g. when using PRIME render offloading.
|
|
All callers were passing TRUE.
Reviewed-and-tested-by: Flora Cui <flora.cui@amd.com>
|
|
This way, the MSC will continue ticking at the rate of (the last mode
which was enabled for) that CRTC, instead of the client running
unthrottled.
Reviewed-and-tested-by: Flora Cui <flora.cui@amd.com>
|
|
otherwise client would wait for reply forever and desktop appears hang.
Signed-off-by: Flora Cui <flora.cui@amd.com>
Acked-by: Feifei Xu <Feifei.Xu@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
|
|
Even if glamor_gbm_bo_from_pixmap / glamor_fd_from_pixmap themselves
don't trigger any drawing, there could already be unflushed drawing to
the pixmap whose storage we share with a client.
|
|
If get_fb_ptr returns NULL, try again after pixmap_get_handle, it should
work then.
Fixes spurious Present page flipping failures using "normal" pixmaps
which aren't shared with direct rendering clients, e.g. with a
compositor using the RENDER extension.
Bugzilla: https://bugs.freedesktop.org/110417
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
|
|
|
|
This adds tiling support to the driver, it retrieves the tile info from
the kernel and translates it into the server format and exposes the
property.
(Ported from xserver commits 8fb8bbb3062f1a06621ab7030a9e89d5e8367b35
and 6abdb54a11dac4e8854ff94ecdcb90a14321ab31)
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
|
|
|
|
Current DC handles any changes of tiling parameters for flips.
v2:
* Just check all tiling bits if DRM minor < 31 or DC is disabled.
Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
|
|
So that it can be used outside of drmmode_display.c as well.
Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
|
|
This reverts commit 720a61000aeb139005bd8125908cec66a6e69554.
We're going to make use of it now.
Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
|
|
This reverts commit 9c23076b9e81c36ac2408c491f9b2d546829ee8e.
Some scenarios have come to light where this failed to ensure the docker
image exists:
* If the master branch of a forked repository is used for an MR which
doesn't modify .gitlab-ci.yml, the docker-image job may not run.
* If the docker-image job of the first pipeline in a forked repository
is cancelled or fails for any reason, and .gitlab-ci.yml isn't
modified for the next pipeline run.
|
|
drm_queue_handler just puts the event on the signalled list; without
calling drm_queue_handle_deferred, actual processing of the event may be
delayed indefinitely, e.g. until another event arrives from the kernel.
This could result in DRI2 clients hanging during DPMS off.
Fixes: 739181c8d3334 "Add amdgpu_drm_handle_event wrapper for
drmHandleEvent"
Reviewed-by: Aaron Liu <aaron.liu@amd.com>
Tested-by: Aaron Liu <aaron.liu@amd.com>
|
|
If they don't, flipping will result in corrupted display.
Test case:
* Run Xorg at 1920x1080 with no window manager
* glxgears -geometry 2048x1080
The Present extension code in xserver 1.21 will check for this.
Tested-by: Jax Lin <jax.lin@amd.com>
|
|
If the window is currently flipping.
This might make a difference when the property gets disabled: Variable
refresh will now be disabled immediately in that case, instead of only
when the window can no longer use page flipping at all.
Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
|
|
Instead of scanning for PropertyNotify events. Reasons:
* Works even if no client listens to PropertyNotify events for the
window.
* No overhead on delivery of unrelated events, and no overhead at all
if Option "VariableRefresh" is disabled.
v2:
* Use shorter variable name amdgpu_vrr_atom.
* Call MakeAtom regardless of info->instance_id, for robustness vs VRR
being enabled in some but not all AMDGPU screens.
Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
|
|
Preparation for the following change.
v2:
* Add comments explaining what the wrappers are wrapping.
* Use global amdgpu_property_vectors_wrapped to keep track of whether
the vectors need to be (un)wrapped, for robustness against VRR being
enabled in some but not all AMDGPU screens.
Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
|
|
Windows aren't associated with GPU screens, and amdgpu_present_flip is
never called for them, so VRR can never actually be enabled for them.
Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
|
|
It's not used in that case.
Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
|
|
The name of a forked repository can be changed later, in which case this
would fail to refer to the main repository.
Pointed out by Eric Engestrom in
https://gitlab.freedesktop.org/mesa/mesa/merge_requests/224 .
|
|
Otherwise there's normally no need to run it. It will also run when a
new branch is created, which ensures that the docker image always exists
(e.g. in a newly forked repository).
Inspired by https://gitlab.freedesktop.org/mesa/mesa/merge_requests/143
|
|
drm_wait_pending_flip stopped waiting if drm_handle_event returned 0,
but that might have processed only some unrelated DRM events. As long as
the flip is pending, we have to keep waiting for its completion event.
Noticed while working on the previous fix.
Acked-by: Alex Deucher <alexander.deucher@amd.com>
|
|
drmHandleEvent can be interrupted by a signal in read(), in which case
it doesn't process any events but returns -1, which
drm_handle_event propagated to its callers. This could cause the
following failure cascade:
1. drm_wait_pending_flip stopped waiting for a pending flip.
2. Its caller cleared drmmode_crtc->flip_pending before the flip
completed.
3. Another flip was attempted but got an unexpected EBUSY error because
the previous flip was still pending.
4. TearFree was disabled due to the error.
The solution is to call drmHandleEvent if it was interrupted by a
signal. We can do that in drm_handle_event, because when that is called,
either it is known that there are events ready to be processed, or the
caller has to wait for events to arrive anyway.
v2:
* Use ErrorF instead of xf86DrvMsg with hard-coded screen 0.
Bugzilla: https://bugs.freedesktop.org/109364
Reviewed-by: Alex Deucher <alexander.deucher@amd.com> # v1
|
|
And only clear it if it matches the framebuffer of the completed flip
being processed.
Fixes
(WW) AMDGPU(0): flip queue failed: Device or resource busy
(WW) AMDGPU(0): Page flip failed: Device or resource busy
(EE) AMDGPU(0): present flip failed
due to clobbering drmmode_crtc->flip_pending.
Reproducer: Enable TearFree, run warzone2100 fullscreen, toggle
Vertical sync on/off under Video Options. Discovered while investigating
https://bugs.freedesktop.org/109364 .
Acked-by: Alex Deucher <alexander.deucher@amd.com>
|
|
We were using a relative target of 0, meaning "complete the flip ASAP".
This could result in the flip sometimes, but not always completing in
the same vertical blank period where the corresponding drawing occurred,
potentially causing judder artifacts with applications updating their
window contents synchronized to the display refresh. A good way to test
this is the vsynctester.com site in a windowed browser, where the judder
results in the large "VSYNC" text intermittently appearing red or cyan
instead of the expected gray.
To avoid this, use a relative target MSC of 1, meaning that if a
vertical blank period is in progress, the flip will only complete in the
next one.
Reported by Julian Tempel and Brandon Wright in
https://bugs.freedesktop.org/106175 .
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
|
|
If the compositing manager uses direct rendering (as is usually the case
these days), the storage of a pixmap allocated by glamor_create_pixmap
needs to be reallocated for sharing it with the compositing manager.
Instead, allocate pixmap storage which can be shared directly.
Acked-by: Alex Deucher <alexander.deucher@amd.com>
|
|
To make sure the client can't use the shared pixmap storage for direct
rendering first, which could produce garbage.
Bugzilla: https://bugs.freedesktop.org/109235
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
|
|
To make sure the client can't use the shared pixmap storage for direct
rendering first, which could produce garbage.
Bugzilla: https://bugs.freedesktop.org/109235
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
|
|
It would crash if RandR is disabled, e.g. because Xinerama is enabled.
Bugzilla: https://bugs.freedesktop.org/109230
(Ported from radeon commit b1c01698f577577e4a88bad0ae08fb5d998e7ebb)
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
|
|
There's no point in listening for hotplug events if RandR is disabled,
as there's no other mechanism for them to be propagated. We were already
mostly ignoring them in that case.
Inspired by
https://gitlab.freedesktop.org/xorg/driver/xf86-video-intel/commit/1a489142c8e6a4828348cc9afbd0f430d3b1e2d8
(via https://bugs.freedesktop.org/109230#c11).
(Ported from radeon commit 38db1bbcfc019c92884c7819a6630c70e543f6b2)
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
|
|
kaniko can also work in unprivileged runners.
Based on v2 of
https://gitlab.freedesktop.org/xorg/xserver/merge_requests/92 .
Acked-by: Alex Deucher <alexander.deucher@amd.com>
|
|
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
|
|
present_unflip can get called between present_check_flip and
present_flip, in which case the latter would pass a NULL WindowPtr to
the former, resulting in a crash.
present_flip should never get called for a window which has already been
destroyed, so there's no need to clear info->flip_window.
Bugzilla: https://bugs.freedesktop.org/109067
Fixes: 2d18b37159edc "Check last flip window instead of screen root
before flipping"
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
|
|
amdgpu_do_pageflip() indexed the flipdata->fb[] array
indexing over config->num_crtc, but the flip completion
routines, e.g., drmmode_flip_handler(), index that array
via the crtc hw id from drmmode_get_crtc_id(crtc).
This is mismatched and causes indexing into the wrong
array slot at flip completion -> Server crash.
Always use drmmode_get_crtc_id(crtc) for indexing into
the array to fix this.
Tested on a dual-X-Screen setup with one video output
assigned to each X-Screen, page-flipping an OpenGL app
on either of both X-Screens. This used to crash when
flipping on X-Screen 1, now it doesn't anymore.
Fixes: 9b6782c821e0 "Store FB for each CRTC in drmmode_flipdata_rec"
(Ported from radeon commit 0058fd2ebf4c900b12f129984e98886a7ac84b2f)
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
|