-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Atomic commit fails if IN_FENCE_FD is set #622
Comments
@cubanismo is working on adding support for IN_FENCE_FD and OUT_FENCE_PTR to our nvidia-drm module, so these should be working properly in near-future driver release. By "properly" I mean leveraging the synchronization capabilities of the GPU's display hardware. Having said that, I checked with him and we agreed that our current behavior of failing when IN_FENCE_FD is specified is wrong (and, yeah, returning -EPERM is extra wrong). Instead, we should be calling drm_atomic_helper_wait_for_fences to do a CPU wait on the fence. This is what the nouveau driver does, for example. As you pointed out, there isn't really a good way for userspace to determine whether IN_FENCE_FD is supported, implying the intention was probably for it to always be supported. At worst using a CPU wait as described above. If we had noticed this problem earlier we would most likely have made such a change as a short-term fix. However, at this point, since a better fix is right around the corner, there may not be any benefit to doing that. |
Thanks for the update. PS: The issue I mentioned re "commit being applied anyway" turned out to be a bug on my side where I would render directly to the front buffer if too many commits failed in a row. |
Atomic commits fail if this is set on the Nvidia driver, it seems: NVIDIA/open-gpu-kernel-modules#622 Kwin also has a check for this https://invent.kde.org/plasma/kwin/-/merge_requests/4770. This fixes Anvil and cosmic-comp on the Nvidia 555 beta driver. (I'm not sure why it only started to be a problem; `EGL_ANDROID_native_fence_sync` is present in the 550 driver, etc.)
Atomic commits fail if this is set on the Nvidia driver, it seems: NVIDIA/open-gpu-kernel-modules#622 Kwin also has a check for this https://invent.kde.org/plasma/kwin/-/merge_requests/4770. This fixes Anvil and cosmic-comp on the Nvidia 555 beta driver. (I'm not sure why it only started to be a problem; `EGL_ANDROID_native_fence_sync` is present in the 550 driver, etc.)
NVIDIA Open GPU Kernel Modules Version
550.40.59
Please confirm this issue does not happen with the proprietary driver (of the same version). This issue tracker is only for bugs specific to the open kernel driver.
Operating System and Version
n/a
Kernel Release
n/a
Please confirm you are running a stable release kernel (e.g. not a -rc). We do not accept bug reports for unreleased kernels.
Hardware: GPU
n/a
Describe the bug
When an atomic commit contains an IN_FENCE_FD, the nvidia driver rejects the commit with EPERM:
-1 is EPERM.
First of all this is not a correct error code for this situation.
But more importantly, this makes it impossible to synchronize presentation with rendering from the compositor side. The workaround is to just not use IN_FENCE_FD if the nvidia driver is detected. Kinda absurd since nvidia was the vendor pushing for explicit sync in the first place.
If that is the expected workaround, then maybe the driver should just accept such commits instead of returning an error.
For whatever reason, one of my users reports that the commits are nevertheless applied by the nvidia driver even though the atomic commit fails. This might be a separate bug.
To Reproduce
n/a
Bug Incidence
Always
nvidia-bug-report.log.gz
n/a
More Info
I don't have nvidia hardware so I cannot fill out the remaining fields.
The text was updated successfully, but these errors were encountered: