Skip to content

Commit 1d6ac07

Browse files
committed
Refactor virtio-gpu and virgl code
1 parent ab288dc commit 1d6ac07

14 files changed

+1350
-1386
lines changed

Makefile

+5-1
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,10 @@ ifeq ($(ENABLE_VIRGL),1)
7575
CFLAGS += $(shell pkg-config virglrenderer gl egl epoxy --cflags)
7676
LDFLAGS += $(shell pkg-config virglrenderer gl egl epoxy --libs)
7777
OBJS_EXTRA += virgl.o
78+
OBJS_EXTRA += window-gl.o
79+
else
80+
OBJS_EXTRA += virtio-gpu-sw.o
81+
OBJS_EXTRA += window-sw.o
7882
endif
7983

8084
$(call set-feature, VIRGL)
@@ -94,7 +98,7 @@ else
9498
endif
9599

96100
ifeq ($(ENABLE_VIRTIOGPU),1)
97-
OBJS_EXTRA += window.o
101+
OBJS_EXTRA += window-events.o
98102
OBJS_EXTRA += virtio-gpu.o
99103
endif
100104

common.h

-6
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,6 @@ static inline void bitmap_set_bit(unsigned long *map, unsigned long bit)
3434
set_bit(bit % BITS_PER_LONG, &map[bit / BITS_PER_LONG]);
3535
}
3636

37-
size_t copy_iov_to_buf(const struct iovec *iov,
38-
const unsigned int iov_cnt,
39-
size_t offset,
40-
void *buf,
41-
size_t bytes);
42-
4337
/* Range check
4438
* For any variable range checking:
4539
* if (x >= minx && x <= maxx) ...

main.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
#define PRIV(x) ((emu_state_t *) x->priv)
1818

19+
extern const struct window_backend g_window;
20+
1921
/* Define fetch separately since it is simpler (fixed width, already checked
2022
* alignment, only main RAM is executable).
2123
*/
@@ -735,7 +737,7 @@ static int semu_start(int argc, char **argv)
735737
virtio_gpu_init(&(emu.vgpu));
736738
virtio_gpu_add_scanout(&(emu.vgpu), 1024, 768);
737739

738-
window_init();
740+
g_window.window_init();
739741
#endif
740742
#if SEMU_HAS(VIRGL)
741743
semu_virgl_init(&(emu.vgpu));

0 commit comments

Comments
 (0)