Commit 52443be5 authored by Bas Nieuwenhuizen's avatar Bas Nieuwenhuizen
Browse files

radv: Check that the master_fd actually is a master.

Since 8059add04 "drm: allow render capable master with DRM_AUTH ioctls" in
the kernel, the assumption that the fd from a primary node that is working
for rendering is a master fd, is not true anymore.

This causes issues in that if we already have a "master fd", leases stop
working as it only allows 1 master fd for the wsi.

This open codes drmIsMaster because I don't think we should bump libdrm
requirements in backports.

Fixes: 451b58a5 "radv: Add KHR_display extension to radv [v5]"
parent 697e2e1f
Pipeline #31183 passed with stages
in 14 minutes and 21 seconds
......@@ -296,7 +296,9 @@ radv_physical_device_init(struct radv_physical_device *device,
.query = AMDGPU_INFO_ACCEL_WORKING
};
if (drmCommandWrite(master_fd, DRM_AMDGPU_INFO, &request, sizeof (struct drm_amdgpu_info)) < 0 || !accel_working) {
if (drmAuthMagic(master_fd, 0) == -EACCES /* Open coded !drmIsMaster */ ||
drmCommandWrite(master_fd, DRM_AMDGPU_INFO, &request, sizeof (struct drm_amdgpu_info)) < 0 ||
!accel_working) {
close(master_fd);
master_fd = -1;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment