qemu with hax to log dma reads & writes jcs.org/2018/11/12/vfio

Revert "hw/display/ramfb: initialize fw-config space with xres/ yres"

This reverts commit f79081b4b71b72640bedd40a7cd76f864c8287f1.

Patch has broken byteorder handling: RAMFBCfg fields are in bigendian
byteorder, the reset function doesn't care so native byteorder is used
instead. Given this went unnoticed so far the feature is obviously
unused, so just revert the patch.

Cc: Hou Qiming <hqm03ster@gmail.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Acked-by: Laszlo Ersek <lersek@redhat.com>
Message-id: 20200429115236.28709-2-kraxel@redhat.com

+6 -30
+1 -11
hw/display/ramfb-standalone.c
··· 3 3 #include "qemu/module.h" 4 4 #include "hw/loader.h" 5 5 #include "hw/qdev-properties.h" 6 - #include "hw/isa/isa.h" 7 6 #include "hw/display/ramfb.h" 8 7 #include "ui/console.h" 9 8 ··· 13 12 SysBusDevice parent_obj; 14 13 QemuConsole *con; 15 14 RAMFBState *state; 16 - uint32_t xres; 17 - uint32_t yres; 18 15 } RAMFBStandaloneState; 19 16 20 17 static void display_update_wrapper(void *dev) ··· 37 34 RAMFBStandaloneState *ramfb = RAMFB(dev); 38 35 39 36 ramfb->con = graphic_console_init(dev, 0, &wrapper_ops, dev); 40 - ramfb->state = ramfb_setup(dev, errp); 37 + ramfb->state = ramfb_setup(errp); 41 38 } 42 39 43 - static Property ramfb_properties[] = { 44 - DEFINE_PROP_UINT32("xres", RAMFBStandaloneState, xres, 0), 45 - DEFINE_PROP_UINT32("yres", RAMFBStandaloneState, yres, 0), 46 - DEFINE_PROP_END_OF_LIST(), 47 - }; 48 - 49 40 static void ramfb_class_initfn(ObjectClass *klass, void *data) 50 41 { 51 42 DeviceClass *dc = DEVICE_CLASS(klass); 52 43 53 44 set_bit(DEVICE_CATEGORY_DISPLAY, dc->categories); 54 45 dc->realize = ramfb_realizefn; 55 - device_class_set_props(dc, ramfb_properties); 56 46 dc->desc = "ram framebuffer standalone device"; 57 47 dc->user_creatable = true; 58 48 }
+1 -15
hw/display/ramfb.c
··· 13 13 14 14 #include "qemu/osdep.h" 15 15 #include "qapi/error.h" 16 - #include "qemu/option.h" 17 16 #include "hw/loader.h" 18 17 #include "hw/display/ramfb.h" 19 18 #include "ui/console.h" ··· 31 30 struct RAMFBState { 32 31 DisplaySurface *ds; 33 32 uint32_t width, height; 34 - uint32_t starting_width, starting_height; 35 33 struct RAMFBCfg cfg; 36 34 bool locked; 37 35 }; ··· 117 115 RAMFBState *s = (RAMFBState *)opaque; 118 116 s->locked = false; 119 117 memset(&s->cfg, 0, sizeof(s->cfg)); 120 - s->cfg.width = s->starting_width; 121 - s->cfg.height = s->starting_height; 122 118 } 123 119 124 - RAMFBState *ramfb_setup(DeviceState* dev, Error **errp) 120 + RAMFBState *ramfb_setup(Error **errp) 125 121 { 126 122 FWCfgState *fw_cfg = fw_cfg_find(); 127 123 RAMFBState *s; ··· 133 129 134 130 s = g_new0(RAMFBState, 1); 135 131 136 - const char *s_fb_width = qemu_opt_get(dev->opts, "xres"); 137 - const char *s_fb_height = qemu_opt_get(dev->opts, "yres"); 138 - if (s_fb_width) { 139 - s->cfg.width = atoi(s_fb_width); 140 - s->starting_width = s->cfg.width; 141 - } 142 - if (s_fb_height) { 143 - s->cfg.height = atoi(s_fb_height); 144 - s->starting_height = s->cfg.height; 145 - } 146 132 s->locked = false; 147 133 148 134 rom_add_vga("vgabios-ramfb.bin");
+2 -2
hw/vfio/display.c
··· 353 353 &vfio_display_dmabuf_ops, 354 354 vdev); 355 355 if (vdev->enable_ramfb) { 356 - vdev->dpy->ramfb = ramfb_setup(DEVICE(vdev), errp); 356 + vdev->dpy->ramfb = ramfb_setup(errp); 357 357 } 358 358 vfio_display_edid_init(vdev); 359 359 return 0; ··· 479 479 &vfio_display_region_ops, 480 480 vdev); 481 481 if (vdev->enable_ramfb) { 482 - vdev->dpy->ramfb = ramfb_setup(DEVICE(vdev), errp); 482 + vdev->dpy->ramfb = ramfb_setup(errp); 483 483 } 484 484 return 0; 485 485 }
+1 -1
include/hw/display/ramfb.h
··· 4 4 /* ramfb.c */ 5 5 typedef struct RAMFBState RAMFBState; 6 6 void ramfb_display_update(QemuConsole *con, RAMFBState *s); 7 - RAMFBState *ramfb_setup(DeviceState *dev, Error **errp); 7 + RAMFBState *ramfb_setup(Error **errp); 8 8 9 9 /* ramfb-standalone.c */ 10 10 #define TYPE_RAMFB_DEVICE "ramfb"
+1 -1
stubs/ramfb.c
··· 6 6 { 7 7 } 8 8 9 - RAMFBState *ramfb_setup(DeviceState* dev, Error **errp) 9 + RAMFBState *ramfb_setup(Error **errp) 10 10 { 11 11 error_setg(errp, "ramfb support not available"); 12 12 return NULL;