fix(quest): keep KGSL submitted timestamps monotonic

An older submission that returns late must not hide a newer one. Contexts
with user-generated timestamps can have gaps, so they keep the failed read
instead of waiting once per integer.
This commit is contained in:
Anuar Lukpanov committed 2026-11-01 11:46:01 +05:00
1 parent 1259abed5f
commit 3193a7a706
2 files changed
+22 -4

No files matched your search

+10
View File
@@ -125,6 +125,11 @@ int main(void) {
retired = 6;
assert(read_timestamp(3, &timestamp) == 0 && timestamp == 6);
submit(8);
submit(7);
retired = 8;
assert(read_timestamp(3, &timestamp) == 0 && timestamp == 8);
create_context(3);
retired = 0;
waits = 0;
@@ -134,6 +139,11 @@ int main(void) {
bl_kgsl_track(mock, 42, IOCTL_KGSL_DRAWCTXT_DESTROY, &destroy, &rc);
assert(read_timestamp(3, &timestamp) == -1 && errno == EACCES);
struct kgsl_drawctxt_create user = {.flags = KGSL_CONTEXT_USER_GENERATED_TS, .drawctxt_id = 3};
bl_kgsl_track(mock, 42, IOCTL_KGSL_DRAWCTXT_CREATE, &user, &rc);
waits = 0;
assert(read_timestamp(3, &timestamp) == -1 && errno == EACCES && waits == 0);
errno = EACCES;
assert(read_timestamp(5000, &timestamp) == -1 && errno == EACCES);