Bläddra i källkod

Move graphic-related coalesced MMIO flushes to affected device models

This is conceptually cleaner and will allow us to drop the nographic
timer. Moreover, it will be mandatory to fully exploit future per-device
coalesced MMIO rings.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Jan Kiszka 14 år sedan
förälder
incheckning
e9a07334fb
3 ändrade filer med 8 tillägg och 2 borttagningar
  1. 4 0
      hw/g364fb.c
  2. 4 0
      hw/vga.c
  3. 0 2
      vl.c

+ 4 - 0
hw/g364fb.c

@@ -245,6 +245,8 @@ static void g364fb_update_display(void *opaque)
 {
 {
     G364State *s = opaque;
     G364State *s = opaque;
 
 
+    qemu_flush_coalesced_mmio_buffer();
+
     if (s->width == 0 || s->height == 0)
     if (s->width == 0 || s->height == 0)
         return;
         return;
 
 
@@ -297,6 +299,8 @@ static void g364fb_screen_dump(void *opaque, const char *filename)
     uint8_t *data_buffer;
     uint8_t *data_buffer;
     FILE *f;
     FILE *f;
 
 
+    qemu_flush_coalesced_mmio_buffer();
+
     if (s->depth != 8) {
     if (s->depth != 8) {
         error_report("g364: unknown guest depth %d", s->depth);
         error_report("g364: unknown guest depth %d", s->depth);
         return;
         return;

+ 4 - 0
hw/vga.c

@@ -1838,6 +1838,8 @@ static void vga_update_display(void *opaque)
     VGACommonState *s = opaque;
     VGACommonState *s = opaque;
     int full_update, graphic_mode;
     int full_update, graphic_mode;
 
 
+    qemu_flush_coalesced_mmio_buffer();
+
     if (ds_get_bits_per_pixel(s->ds) == 0) {
     if (ds_get_bits_per_pixel(s->ds) == 0) {
         /* nothing to do */
         /* nothing to do */
     } else {
     } else {
@@ -1958,6 +1960,8 @@ static void vga_update_text(void *opaque, console_ch_t *chardata)
     char msg_buffer[80];
     char msg_buffer[80];
     int full_update = 0;
     int full_update = 0;
 
 
+    qemu_flush_coalesced_mmio_buffer();
+
     if (!(s->ar_index & 0x20)) {
     if (!(s->ar_index & 0x20)) {
         graphic_mode = GMODE_BLANK;
         graphic_mode = GMODE_BLANK;
     } else {
     } else {

+ 0 - 2
vl.c

@@ -1196,7 +1196,6 @@ static void gui_update(void *opaque)
     DisplayState *ds = opaque;
     DisplayState *ds = opaque;
     DisplayChangeListener *dcl = ds->listeners;
     DisplayChangeListener *dcl = ds->listeners;
 
 
-    qemu_flush_coalesced_mmio_buffer();
     dpy_refresh(ds);
     dpy_refresh(ds);
 
 
     while (dcl != NULL) {
     while (dcl != NULL) {
@@ -1212,7 +1211,6 @@ static void nographic_update(void *opaque)
 {
 {
     uint64_t interval = GUI_REFRESH_INTERVAL;
     uint64_t interval = GUI_REFRESH_INTERVAL;
 
 
-    qemu_flush_coalesced_mmio_buffer();
     qemu_mod_timer(nographic_timer, interval + qemu_get_clock_ms(rt_clock));
     qemu_mod_timer(nographic_timer, interval + qemu_get_clock_ms(rt_clock));
 }
 }