1 #include "kvm/framebuffer.h"
3 #include <linux/kernel.h>
4 #include <linux/list.h>
8 static LIST_HEAD(framebuffers
);
10 struct framebuffer
*fb__register(struct framebuffer
*fb
)
12 INIT_LIST_HEAD(&fb
->node
);
13 list_add(&fb
->node
, &framebuffers
);
18 int fb__attach(struct framebuffer
*fb
, struct fb_target_operations
*ops
)
20 if (fb
->nr_targets
>= FB_MAX_TARGETS
)
23 fb
->targets
[fb
->nr_targets
++] = ops
;
28 static int start_targets(struct framebuffer
*fb
)
32 for (i
= 0; i
< fb
->nr_targets
; i
++) {
33 struct fb_target_operations
*ops
= fb
->targets
[i
];
48 struct framebuffer
*fb
;
50 list_for_each_entry(fb
, &framebuffers
, node
) {
53 err
= start_targets(fb
);
63 struct framebuffer
*fb
;
65 list_for_each_entry(fb
, &framebuffers
, node
) {
66 munmap(fb
->mem
, fb
->mem_size
);