mirror of
https://github.com/xemu-project/xemu.git
synced 2024-11-24 20:19:44 +00:00
vga: edid fixes, qxl clang workaround, vga mmio subregion fix.
-----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQIcBAABAgAGBQJbt0bsAAoJEEy22O7T6HE44oEP/AisWyCoubdZuUv6U1/5HWJl ow/1Hsum9RUz2Y278TRH8wVjJ8RdTpY7mFhFG8bQYreishmGmlVWyl+SSxaOgeaA gOoWc3k+Z7jAToZC+l3eiRVoDPPDa7yb8ezmTB+MOlhImDZMCQpCsrorQYgicobc xo7BVsXddOBLipZWtO6HK28LR1CdOonp4fOJHsQAqCLNG4xIpjXMqjTkrG5G4wn9 hsS/PNVr+ZTSsCtTKmqIyvWIJimqXlkcLTkTPuD16SmyedQR/cr0EIUgRZgJoTh9 0Qg3T7hp6l1ZQDWxTgKhZlhuOkH6uqLAcBDBqKTHn47XYrxNPkK7c769aR/F4ZOi oDfj5PeR3lx0vNo2tE2tcGzExjqdRKk2MsUhc+ww+Yypaflzc8lgAdwKH5fTJ7PU qayAkkpzSW6rLkMUniscr0a7a7AZlMqGFJ/pZbPx6b6tGTU0pyWMM74Ait09nwxe lbg2wW6hC6VRwYyLeYSzFh0khQ856G3/jhKNYDB15/GNeMqbv/4DXcIMycM76+aZ RkEpdsb/cR+yTtOCQMzD4pLR/XOPdPco8rF7P0o26rWyRCR6qljd4jg8caogm3bA vF7N6H7QwmzICEPkDNqV2luYOEQaiszedYj306j9b1qGYdu6bPbvgJU1bzYMH7oy d+RKYhYBaOyX//qs2t9W =Uq7Q -----END PGP SIGNATURE----- Merge remote-tracking branch 'remotes/kraxel/tags/vga-20181005-pull-request' into staging vga: edid fixes, qxl clang workaround, vga mmio subregion fix. # gpg: Signature made Fri 05 Oct 2018 12:11:40 BST # gpg: using RSA key 4CB6D8EED3E87138 # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" # gpg: aka "Gerd Hoffmann <gerd@kraxel.org>" # gpg: aka "Gerd Hoffmann (private) <kraxel@gmail.com>" # Primary key fingerprint: A032 8CFF B93A 17A7 9901 FE7D 4CB6 D8EE D3E8 7138 * remotes/kraxel/tags/vga-20181005-pull-request: edid: fix vendor default secondary-vga: delete mmio subregions upon exit hw/display/qxl: Suppress clang-7 warning about misaligned atomic operation edid: Ignore built binary Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
commit
e2e3436add
1
.gitignore
vendored
1
.gitignore
vendored
@ -107,6 +107,7 @@
|
||||
/qemu-doc.html
|
||||
/qemu-doc.info
|
||||
/qemu-doc.txt
|
||||
/qemu-edid
|
||||
/qemu-img
|
||||
/qemu-nbd
|
||||
/qemu-options.def
|
||||
|
@ -301,7 +301,7 @@ void qemu_edid_generate(uint8_t *edid, size_t size,
|
||||
/* =============== set defaults =============== */
|
||||
|
||||
if (!info->vendor || strlen(info->vendor) != 3) {
|
||||
info->vendor = "EMU";
|
||||
info->vendor = "RHT";
|
||||
}
|
||||
if (!info->name) {
|
||||
info->name = "QEMU Monitor";
|
||||
|
@ -1893,7 +1893,31 @@ static void qxl_send_events(PCIQXLDevice *d, uint32_t events)
|
||||
trace_qxl_send_events_vm_stopped(d->id, events);
|
||||
return;
|
||||
}
|
||||
old_pending = atomic_fetch_or(&d->ram->int_pending, le_events);
|
||||
/*
|
||||
* Older versions of Spice forgot to define the QXLRam struct
|
||||
* with the '__aligned__(4)' attribute. clang 7 and newer will
|
||||
* thus warn that atomic_fetch_or(&d->ram->int_pending, ...)
|
||||
* might be a misaligned atomic access, and will generate an
|
||||
* out-of-line call for it, which results in a link error since
|
||||
* we don't currently link against libatomic.
|
||||
*
|
||||
* In fact we set up d->ram in init_qxl_ram() so it always starts
|
||||
* at a 4K boundary, so we know that &d->ram->int_pending is
|
||||
* naturally aligned for a uint32_t. Newer Spice versions
|
||||
* (with Spice commit beda5ec7a6848be20c0cac2a9a8ef2a41e8069c1)
|
||||
* will fix the bug directly. To deal with older versions,
|
||||
* we tell the compiler to assume the address really is aligned.
|
||||
* Any compiler which cares about the misalignment will have
|
||||
* __builtin_assume_aligned.
|
||||
*/
|
||||
#ifdef HAS_ASSUME_ALIGNED
|
||||
#define ALIGNED_UINT32_PTR(P) ((uint32_t *)__builtin_assume_aligned(P, 4))
|
||||
#else
|
||||
#define ALIGNED_UINT32_PTR(P) ((uint32_t *)P)
|
||||
#endif
|
||||
|
||||
old_pending = atomic_fetch_or(ALIGNED_UINT32_PTR(&d->ram->int_pending),
|
||||
le_events);
|
||||
if ((old_pending & le_events) == le_events) {
|
||||
return;
|
||||
}
|
||||
|
@ -309,6 +309,14 @@ static void pci_secondary_vga_exit(PCIDevice *dev)
|
||||
VGACommonState *s = &d->vga;
|
||||
|
||||
graphic_console_close(s->con);
|
||||
memory_region_del_subregion(&d->mmio, &d->mrs[0]);
|
||||
memory_region_del_subregion(&d->mmio, &d->mrs[1]);
|
||||
if (d->flags & (1 << PCI_VGA_FLAG_ENABLE_QEXT)) {
|
||||
memory_region_del_subregion(&d->mmio, &d->mrs[2]);
|
||||
}
|
||||
if (d->flags & (1 << PCI_VGA_FLAG_ENABLE_EDID)) {
|
||||
memory_region_del_subregion(&d->mmio, &d->mrs[3]);
|
||||
}
|
||||
}
|
||||
|
||||
static void pci_secondary_vga_init(Object *obj)
|
||||
|
@ -4,7 +4,7 @@
|
||||
#include "hw/hw.h"
|
||||
|
||||
typedef struct qemu_edid_info {
|
||||
const char *vendor;
|
||||
const char *vendor; /* http://www.uefi.org/pnp_id_list */
|
||||
const char *name;
|
||||
const char *serial;
|
||||
uint32_t dpi;
|
||||
|
@ -122,6 +122,15 @@
|
||||
#ifndef __has_feature
|
||||
#define __has_feature(x) 0 /* compatibility with non-clang compilers */
|
||||
#endif
|
||||
|
||||
#ifndef __has_builtin
|
||||
#define __has_builtin(x) 0 /* compatibility with non-clang compilers */
|
||||
#endif
|
||||
|
||||
#if __has_builtin(__builtin_assume_aligned) || QEMU_GNUC_PREREQ(4, 7)
|
||||
#define HAS_ASSUME_ALIGNED
|
||||
#endif
|
||||
|
||||
/* Implement C11 _Generic via GCC builtins. Example:
|
||||
*
|
||||
* QEMU_GENERIC(x, (float, sinf), (long double, sinl), sin) (x)
|
||||
|
Loading…
Reference in New Issue
Block a user