- if (ret == -1)
- return ret;
-
- if (fd != -1 && (pfd[1].revents & POLLIN)) {
- char buf[256];
-
- // read all there is ...
- while (read(pfd[1].fd, buf, sizeof(buf)) == sizeof(buf))
- ;
-
- // Display current status
- if (!c->c->surfaces.empty()) {
- puts("Surfaces:");
- for (auto const &i : c->c->surfaces) {
- struct genivi::rect const &r = i.second->dst_rect;
- struct genivi::size const &s = i.second->size;
- printf("%d [%ux%u] (%ux%u@%dx%d), ", i.first, s.w, s.h, r.w, r.h,
- r.x, r.y);
- }
- puts("\b\b ");
- }
-
- if (!c->c->layers.empty()) {
- puts("Layers:");
- for (auto const &i : c->c->layers) {
- struct genivi::rect const &r = i.second->dst_rect;
- struct genivi::size const &s = i.second->size;
- printf("%d [%ux%u] (%ux%u@%dx%d), ", i.first, s.w, s.h, r.w, r.h,
- r.x, r.y);
- }
- puts("\b\b ");
- }
- }
+struct afb_instance *g_afb_instance;
+
+int afb_instance::init() {
+ if (!this->display->ok()) {
+ return -1;