15#include <l4/re/util/env_ns>
16#include <l4/re/util/video/goos_fb>
17#include <l4/re/video/goos>
19namespace L4Re {
namespace Util {
namespace Video {
24 L4::Cap<L4Re::Video::Goos> _goos;
25 L4Re::Video::View _view;
26 L4::Cap<L4Re::Dataspace> _buffer;
36 unsigned _buffer_index;
41 using namespace L4Re::Video;
44 long ret = _goos->info(&gi);
50 ret = _goos->create_view(&_view);
57 _view = _goos->view(0);
60 ret = _view.info(&vi);
70 ret = _goos->get_static_buffer(vi.
buffer_index, _buffer);
78 ret = _goos->create_buffer(buffer_sz, _buffer);
82 _buffer_index =
static_cast<unsigned>(ret);
83 _flags |= F_dyn_buffer;
97 ret = _view.set_info(vi);
101 ret = _view.push_top();
109 Goos_fb(Goos_fb
const &);
110 void operator = (Goos_fb
const &);
117 long init(L4::Cap<L4Re::Video::Goos> goos)
123 long init(
char const *name)
126 _goos = ns.query<L4Re::Video::Goos>(name);
130 _flags |= F_dyn_goos;
137 if (!_goos.is_valid())
140 if (_flags & F_dyn_view)
141 _goos->delete_view(_view);
143 if (_flags & F_dyn_buffer)
144 _goos->delete_buffer(_buffer_index);
146 if (_buffer.is_valid())
149 if (_flags & F_dyn_goos)
153 int view_info(L4Re::Video::View::Info *info)
154 {
return _view.info(info); }
156 L4Re::Video::View
const *view()
const {
return &_view; }
157 L4Re::Video::View *view() {
return &_view; }
159 L4::Cap<L4Re::Dataspace> buffer()
const {
return _buffer; }
160 void *attach_buffer()
167 ->attach(&fb_addr, _buffer->size(),
176 int refresh(
int x,
int y,
int w,
int h)
177 {
return _view.refresh(x, y, w, h); }
179 L4::Cap<L4Re::Video::Goos> goos()
const {
return _goos; }
static Env const * env() noexcept
Returns the initial environment for the current task.
L4::Cap< Rm > rm() const noexcept
Object-capability to the region map.
L4::Cap< void > alloc() noexcept override
Allocate a capability.
void free(L4::Cap< void > cap, l4_cap_idx_t task=L4_INVALID_CAP, unsigned unmap_flags=L4_FP_ALL_SPACES) noexcept override
Free a capability.
unsigned char bytes_per_pixel() const
Query size of pixel in bytes.
@ L4_INVALID_CAP
Invalid capability selector.
#define L4_SUPERPAGESHIFT
Size of a large page, log2-based.
_Cap_alloc & cap_alloc
Capability allocator.
Documentation of the L4 Runtime Environment utility functionality in C++.
@ RW
Readable and writable region.
@ Search_addr
Search for a suitable address range.
unsigned long height
Height.
unsigned long width
Width.
Pixel_info pixel_info
Pixel information.
bool has_dynamic_views() const
Return whether dynamic view are supported.
Pixel_info pixel_info
Pixel information.
unsigned long height
Height of the view in pixels.
unsigned long width
Width of the view in pixels.
unsigned buffer_index
Number of the buffer used for this view.
unsigned long xpos
X position in pixels of the view in the Goos.
unsigned long buffer_offset
Offset in the memory buffer in bytes.
unsigned long bytes_per_line
Bytes per line.
bool has_static_buffer() const
Return whether the view has a static buffer.
unsigned long ypos
Y position in pixels of the view in the Goos.