mirror of
https://github.com/genodelabs/genode.git
synced 2025-06-01 07:00:55 +00:00
parent
66fedecf34
commit
89f99df44d
@ -396,6 +396,22 @@ class Lima::Call
|
|||||||
|
|
||||||
Gpu::Vram_id_space _buffer_space { };
|
Gpu::Vram_id_space _buffer_space { };
|
||||||
|
|
||||||
|
template <typename FN>
|
||||||
|
bool _apply_handle(uint32_t handle, FN const &fn)
|
||||||
|
{
|
||||||
|
Buffer_id const id { .value = handle };
|
||||||
|
|
||||||
|
bool found = false;
|
||||||
|
try {
|
||||||
|
_buffer_space.apply<Buffer>(id, [&] (Buffer &b) {
|
||||||
|
fn(b);
|
||||||
|
found = true;
|
||||||
|
});
|
||||||
|
} catch (Genode::Id_space<Buffer>::Unknown_id) { }
|
||||||
|
|
||||||
|
return found;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Play it safe, glmark2 apparently submits araound 110 KiB at
|
* Play it safe, glmark2 apparently submits araound 110 KiB at
|
||||||
* some point.
|
* some point.
|
||||||
@ -405,14 +421,15 @@ class Lima::Call
|
|||||||
|
|
||||||
void _wait_for_mapping(uint32_t handle, unsigned op)
|
void _wait_for_mapping(uint32_t handle, unsigned op)
|
||||||
{
|
{
|
||||||
Buffer_id const id { .value = handle };
|
(void)_apply_handle(handle, [&] (Buffer &b) {
|
||||||
do {
|
do {
|
||||||
if (_main_ctx.gpu().set_tiling(id, 0, op))
|
if (_main_ctx.gpu().set_tiling(b.id(), 0, op))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
char buf;
|
char buf;
|
||||||
(void)::read(_main_ctx.fd(), &buf, sizeof(buf));
|
(void)::read(_main_ctx.fd(), &buf, sizeof(buf));
|
||||||
} while (true);
|
} while (true);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
int _wait_for_syncobj(int fd)
|
int _wait_for_syncobj(int fd)
|
||||||
@ -446,22 +463,6 @@ class Lima::Call
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename FN>
|
|
||||||
bool _apply_handle(uint32_t handle, FN const &fn)
|
|
||||||
{
|
|
||||||
Buffer_id const id { .value = handle };
|
|
||||||
|
|
||||||
bool found = false;
|
|
||||||
try {
|
|
||||||
_buffer_space.apply<Buffer>(id, [&] (Buffer &b) {
|
|
||||||
fn(b);
|
|
||||||
found = true;
|
|
||||||
});
|
|
||||||
} catch (Genode::Id_space<Buffer>::Unknown_id) { }
|
|
||||||
|
|
||||||
return found;
|
|
||||||
}
|
|
||||||
|
|
||||||
Dataspace_capability _lookup_cap_from_handle(uint32_t handle)
|
Dataspace_capability _lookup_cap_from_handle(uint32_t handle)
|
||||||
{
|
{
|
||||||
Dataspace_capability cap { };
|
Dataspace_capability cap { };
|
||||||
|
Loading…
x
Reference in New Issue
Block a user