libdrm/iris: check for more than 1 sync object

In '_generic_syncobj_wait' check if sync-objetcs exist, return error
otherwise. Do not wait because the execution model is synchroneous,
meaning no batch buffers are in execution when this function is called
(_drm_mutex).

issue #5224
This commit is contained in:
Sebastian Sumpf 2024-06-03 09:23:48 +02:00 committed by Norman Feske
parent c85e53cb2a
commit ac4aaa208f

View File

@ -1265,31 +1265,19 @@ class Drm::Call
" tiemout_nsec=", p.timeout_nsec, " tiemout_nsec=", p.timeout_nsec,
" flags=", p.flags); " flags=", p.flags);
if (p.count_handles > 1) {
Genode::error(__func__, " count handles > 1 - not supported");
return -1;
}
uint32_t * handles = reinterpret_cast<uint32_t *>(p.handles); uint32_t * handles = reinterpret_cast<uint32_t *>(p.handles);
bool ok = false;
try { try {
Sync_obj::Id const id { .value = handles[0] }; for (uint32_t i = 0; i < p.count_handles; i++) {
_sync_objects.apply<Sync_obj>(id, [&](Sync_obj &) { Sync_obj::Id const id { .value = handles[i] };
ok = true; /* just make sure id's are valid */
}); _sync_objects.apply<Sync_obj>(id, [](Sync_obj &) {});
}
} catch (Sync_obj::Sync::Unknown_id) { } catch (Sync_obj::Sync::Unknown_id) {
errno = EINVAL; errno = EINVAL;
return -1; return -1;
} }
if (ok) { return 0;
return 0;
} else
Genode::error("unknown sync object handle ", handles[0]);
errno = EINVAL;
return -1;
} }
int _generic_syncobj_destroy(void *arg) int _generic_syncobj_destroy(void *arg)