13 struct bhyvegc_image *gc_image;
18 bhyvegc_init(int width, int height, void *fbaddr)
21 struct bhyvegc_image *gc_image;
23 gc = calloc(1, sizeof (struct bhyvegc));
25 gc_image = calloc(1, sizeof(struct bhyvegc_image));
26 gc_image->width = width;
27 gc_image->height = height;
29 gc_image->data = fbaddr;
32 gc_image->data = calloc(width * height, sizeof (uint32_t));
36 gc->gc_image = gc_image;
42 bhyvegc_set_fbaddr(struct bhyvegc *gc, void *fbaddr)
45 if (gc->gc_image->data && gc->gc_image->data != fbaddr)
46 free(gc->gc_image->data);
47 gc->gc_image->data = fbaddr;
51 bhyvegc_resize(struct bhyvegc *gc, int width, int height)
53 struct bhyvegc_image *gc_image;
55 gc_image = gc->gc_image;
57 gc_image->width = width;
58 gc_image->height = height;
60 gc_image->data = reallocarray(gc_image->data, width * height,
62 if (gc_image->data != NULL)
63 memset(gc_image->data, 0, width * height *
68 struct bhyvegc_image *
69 bhyvegc_get_image(struct bhyvegc *gc)
74 return (gc->gc_image);