mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 02:03:56 -06:00
virtio-gpu: Move print_stats timer to VirtIOGPUGL
Move print_stats timer to VirtIOGPUGL for consistency with cmdq_resume_bh and fence_poll that are used only by GL device. Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com> Message-Id: <20241024210311.118220-4-dmitry.osipenko@collabora.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
This commit is contained in:
parent
a723d2eaf0
commit
a0a8f47fd0
2 changed files with 7 additions and 5 deletions
|
@ -574,6 +574,7 @@ static struct virgl_renderer_callbacks virtio_gpu_3d_cbs = {
|
||||||
static void virtio_gpu_print_stats(void *opaque)
|
static void virtio_gpu_print_stats(void *opaque)
|
||||||
{
|
{
|
||||||
VirtIOGPU *g = opaque;
|
VirtIOGPU *g = opaque;
|
||||||
|
VirtIOGPUGL *gl = VIRTIO_GPU_GL(g);
|
||||||
|
|
||||||
if (g->stats.requests) {
|
if (g->stats.requests) {
|
||||||
fprintf(stderr, "stats: vq req %4d, %3d -- 3D %4d (%5d)\n",
|
fprintf(stderr, "stats: vq req %4d, %3d -- 3D %4d (%5d)\n",
|
||||||
|
@ -588,7 +589,7 @@ static void virtio_gpu_print_stats(void *opaque)
|
||||||
} else {
|
} else {
|
||||||
fprintf(stderr, "stats: idle\r");
|
fprintf(stderr, "stats: idle\r");
|
||||||
}
|
}
|
||||||
timer_mod(g->print_stats, qemu_clock_get_ms(QEMU_CLOCK_VIRTUAL) + 1000);
|
timer_mod(gl->print_stats, qemu_clock_get_ms(QEMU_CLOCK_VIRTUAL) + 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void virtio_gpu_fence_poll(void *opaque)
|
static void virtio_gpu_fence_poll(void *opaque)
|
||||||
|
@ -651,9 +652,10 @@ int virtio_gpu_virgl_init(VirtIOGPU *g)
|
||||||
virtio_gpu_fence_poll, g);
|
virtio_gpu_fence_poll, g);
|
||||||
|
|
||||||
if (virtio_gpu_stats_enabled(g->parent_obj.conf)) {
|
if (virtio_gpu_stats_enabled(g->parent_obj.conf)) {
|
||||||
g->print_stats = timer_new_ms(QEMU_CLOCK_VIRTUAL,
|
gl->print_stats = timer_new_ms(QEMU_CLOCK_VIRTUAL,
|
||||||
virtio_gpu_print_stats, g);
|
virtio_gpu_print_stats, g);
|
||||||
timer_mod(g->print_stats, qemu_clock_get_ms(QEMU_CLOCK_VIRTUAL) + 1000);
|
timer_mod(gl->print_stats,
|
||||||
|
qemu_clock_get_ms(QEMU_CLOCK_VIRTUAL) + 1000);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -194,7 +194,6 @@ struct VirtIOGPU {
|
||||||
uint64_t hostmem;
|
uint64_t hostmem;
|
||||||
|
|
||||||
bool processing_cmdq;
|
bool processing_cmdq;
|
||||||
QEMUTimer *print_stats;
|
|
||||||
|
|
||||||
uint32_t inflight;
|
uint32_t inflight;
|
||||||
struct {
|
struct {
|
||||||
|
@ -230,6 +229,7 @@ struct VirtIOGPUGL {
|
||||||
bool renderer_reset;
|
bool renderer_reset;
|
||||||
|
|
||||||
QEMUTimer *fence_poll;
|
QEMUTimer *fence_poll;
|
||||||
|
QEMUTimer *print_stats;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct VhostUserGPU {
|
struct VhostUserGPU {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue