diff options
Diffstat (limited to 'meta/recipes-devtools/qemu/qemu-0.13.0/qemu-vmware-vga-depth.patch')
| -rw-r--r-- | meta/recipes-devtools/qemu/qemu-0.13.0/qemu-vmware-vga-depth.patch | 115 |
1 files changed, 115 insertions, 0 deletions
diff --git a/meta/recipes-devtools/qemu/qemu-0.13.0/qemu-vmware-vga-depth.patch b/meta/recipes-devtools/qemu/qemu-0.13.0/qemu-vmware-vga-depth.patch new file mode 100644 index 0000000000..5bdbaf3937 --- /dev/null +++ b/meta/recipes-devtools/qemu/qemu-0.13.0/qemu-vmware-vga-depth.patch | |||
| @@ -0,0 +1,115 @@ | |||
| 1 | # fix VMware VGA driver depth calculation error, which may cause segmentation fault | ||
| 2 | # | ||
| 3 | # ktian1, 06/29/2010 | ||
| 4 | Index: qemu-0.13.0/console.h | ||
| 5 | =================================================================== | ||
| 6 | --- qemu-0.13.0.orig/console.h 2011-01-17 16:41:58.000000000 +0800 | ||
| 7 | +++ qemu-0.13.0/console.h 2011-01-17 16:48:00.000000000 +0800 | ||
| 8 | @@ -171,6 +171,12 @@ | ||
| 9 | void (*free_displaysurface)(DisplaySurface *surface); | ||
| 10 | }; | ||
| 11 | |||
| 12 | +struct DisplayPostCallback { | ||
| 13 | + void (*postcall) (void *); | ||
| 14 | + void *parm; | ||
| 15 | + struct DisplayPostCallback *next; | ||
| 16 | +}; | ||
| 17 | + | ||
| 18 | struct DisplayState { | ||
| 19 | struct DisplaySurface *surface; | ||
| 20 | void *opaque; | ||
| 21 | @@ -178,6 +184,7 @@ | ||
| 22 | |||
| 23 | struct DisplayAllocator* allocator; | ||
| 24 | struct DisplayChangeListener* listeners; | ||
| 25 | + struct DisplayPostCallback* postcalls; | ||
| 26 | |||
| 27 | void (*mouse_set)(int x, int y, int on); | ||
| 28 | void (*cursor_define)(QEMUCursor *cursor); | ||
| 29 | @@ -229,6 +236,12 @@ | ||
| 30 | ds->listeners = dcl; | ||
| 31 | } | ||
| 32 | |||
| 33 | +static inline void register_displaypostcallback(DisplayState *ds, DisplayPostCallback *dpc) | ||
| 34 | +{ | ||
| 35 | + dpc->next = ds->postcalls; | ||
| 36 | + ds->postcalls = dpc; | ||
| 37 | +} | ||
| 38 | + | ||
| 39 | static inline void dpy_update(DisplayState *s, int x, int y, int w, int h) | ||
| 40 | { | ||
| 41 | struct DisplayChangeListener *dcl = s->listeners; | ||
| 42 | Index: qemu-0.13.0/hw/vmware_vga.c | ||
| 43 | =================================================================== | ||
| 44 | --- qemu-0.13.0.orig/hw/vmware_vga.c 2011-01-17 16:42:36.000000000 +0800 | ||
| 45 | +++ qemu-0.13.0/hw/vmware_vga.c 2011-01-17 16:48:00.000000000 +0800 | ||
| 46 | @@ -957,8 +957,9 @@ | ||
| 47 | } | ||
| 48 | } | ||
| 49 | |||
| 50 | -static void vmsvga_reset(struct vmsvga_state_s *s) | ||
| 51 | +static void vmsvga_reset(void *parm) | ||
| 52 | { | ||
| 53 | + struct vmsvga_state_s *s = (struct vmsvga_state_s *)parm; | ||
| 54 | s->index = 0; | ||
| 55 | s->enable = 0; | ||
| 56 | s->config = 0; | ||
| 57 | @@ -1163,6 +1164,8 @@ | ||
| 58 | |||
| 59 | static void vmsvga_init(struct vmsvga_state_s *s, int vga_ram_size) | ||
| 60 | { | ||
| 61 | + DisplayPostCallback *dpc; | ||
| 62 | + | ||
| 63 | s->scratch_size = SVGA_SCRATCH_SIZE; | ||
| 64 | s->scratch = qemu_malloc(s->scratch_size * 4); | ||
| 65 | |||
| 66 | @@ -1190,7 +1193,10 @@ | ||
| 67 | |||
| 68 | rom_add_vga(VGABIOS_FILENAME); | ||
| 69 | |||
| 70 | - vmsvga_reset(s); | ||
| 71 | + dpc = qemu_mallocz(sizeof(DisplayPostCallback)); | ||
| 72 | + dpc->postcall = vmsvga_reset; | ||
| 73 | + dpc->parm = s; | ||
| 74 | + register_displaypostcallback(s->vga.ds, dpc); | ||
| 75 | } | ||
| 76 | |||
| 77 | static void pci_vmsvga_map_ioport(PCIDevice *pci_dev, int region_num, | ||
| 78 | Index: qemu-0.13.0/qemu-common.h | ||
| 79 | =================================================================== | ||
| 80 | --- qemu-0.13.0.orig/qemu-common.h 2011-01-17 16:41:58.000000000 +0800 | ||
| 81 | +++ qemu-0.13.0/qemu-common.h 2011-01-17 16:48:00.000000000 +0800 | ||
| 82 | @@ -205,6 +205,7 @@ | ||
| 83 | typedef struct DisplayChangeListener DisplayChangeListener; | ||
| 84 | typedef struct DisplaySurface DisplaySurface; | ||
| 85 | typedef struct DisplayAllocator DisplayAllocator; | ||
| 86 | +typedef struct DisplayPostCallback DisplayPostCallback; | ||
| 87 | typedef struct PixelFormat PixelFormat; | ||
| 88 | typedef struct TextConsole TextConsole; | ||
| 89 | typedef TextConsole QEMUConsole; | ||
| 90 | Index: qemu-0.13.0/vl.c | ||
| 91 | =================================================================== | ||
| 92 | --- qemu-0.13.0.orig/vl.c 2011-01-17 16:42:36.000000000 +0800 | ||
| 93 | +++ qemu-0.13.0/vl.c 2011-01-17 16:48:00.000000000 +0800 | ||
| 94 | @@ -1814,6 +1814,7 @@ | ||
| 95 | char boot_devices[33] = "cad"; /* default to HD->floppy->CD-ROM */ | ||
| 96 | DisplayState *ds; | ||
| 97 | DisplayChangeListener *dcl; | ||
| 98 | + DisplayPostCallback *dpc; | ||
| 99 | int cyls, heads, secs, translation; | ||
| 100 | QemuOpts *hda_opts = NULL, *opts; | ||
| 101 | int optind; | ||
| 102 | @@ -2960,6 +2961,13 @@ | ||
| 103 | } | ||
| 104 | dpy_resize(ds); | ||
| 105 | |||
| 106 | + dpc = ds->postcalls; | ||
| 107 | + while (dpc != NULL) { | ||
| 108 | + if (dpc->postcall != NULL) | ||
| 109 | + dpc->postcall(dpc->parm); | ||
| 110 | + dpc = dpc->next; | ||
| 111 | + } | ||
| 112 | + | ||
| 113 | dcl = ds->listeners; | ||
| 114 | while (dcl != NULL) { | ||
| 115 | if (dcl->dpy_refresh != NULL) { | ||
