mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-24 15:56:41 +00:00
drm: account for guard page
This makes the rendering issue with mesa gears disappear. Issue #4148
This commit is contained in:
parent
04d8e03ecb
commit
3e284558a1
@ -1493,12 +1493,16 @@ class Gpu::Session_component : public Genode::Session_object<Gpu::Session>
|
||||
Genode::Dataspace_capability alloc_buffer(Genode::size_t size) override
|
||||
{
|
||||
/*
|
||||
* XXX size might not be page aligned, allocator overhead is not
|
||||
* XXX allocator overhead is not
|
||||
* included, mapping costs are not included and we throw at
|
||||
* different locations...
|
||||
*
|
||||
* => better construct Buffer object as whole
|
||||
*/
|
||||
|
||||
/* roundup to next page size and add guarding page */
|
||||
size = ((size + 0xffful) & ~0xffful) + 0x1000;
|
||||
|
||||
Genode::size_t const need = size + sizeof(Genode::Registered<Buffer>);
|
||||
Genode::size_t const avail = _guard.quota() - _guard.consumed();
|
||||
if (need > avail) { throw Gpu::Session_component::Out_of_ram(); }
|
||||
|
Loading…
Reference in New Issue
Block a user