12 struct bhyvegc_image *gc_image;
17 bhyvegc_init(int width, int height, void *fbaddr)
20 struct bhyvegc_image *gc_image;
22 gc = calloc(1, sizeof (struct bhyvegc));
24 gc_image = calloc(1, sizeof(struct bhyvegc_image));
25 gc_image->width = width;
26 gc_image->height = height;
28 gc_image->data = fbaddr;
31 gc_image->data = calloc(width * height, sizeof (uint32_t));
35 gc->gc_image = gc_image;
41 bhyvegc_set_fbaddr(struct bhyvegc *gc, void *fbaddr)
44 if (gc->gc_image->data && gc->gc_image->data != fbaddr)
45 free(gc->gc_image->data);
46 gc->gc_image->data = fbaddr;
50 bhyvegc_resize(struct bhyvegc *gc, int width, int height)
52 struct bhyvegc_image *gc_image;
54 gc_image = gc->gc_image;
56 gc_image->width = width;
57 gc_image->height = height;
59 gc_image->data = realloc(gc_image->data,
60 sizeof (uint32_t) * width * height);
61 memset(gc_image->data, 0, width * height * sizeof (uint32_t));
65 struct bhyvegc_image *
66 bhyvegc_get_image(struct bhyvegc *gc)
71 return (gc->gc_image);