aboutsummaryrefslogtreecommitdiff
path: root/hw/display/vga.c
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2024-06-19 10:54:31 -0700
committerRichard Henderson <richard.henderson@linaro.org>2024-06-19 10:54:31 -0700
commit80748eb4fbc70f0a3ae423f2c01cb5a4584d803f (patch)
treee71beaeef6c2dbcb179b039c6a0c541d41c438f6 /hw/display/vga.c
parent223696363bb117241ad9c2facbff0c474afa4104 (diff)
parentfc0870c180872d0f40e63507cc6bf8565ffd8d98 (diff)
Merge tag 'misc-20240619' of https://github.com/philmd/qemu into staging
Misc patches queue . Remove deprecated pc-i440fx-2.0 -> 2.3 machines (Phil) . Always use little endian audio format in virtio-snd (Phil) . Avoid using Monitor in INTERRUPT_STATS_PROVIDER::print_info (Phil) . Introduce x-query-interrupt-controllers QMP command (Phil) . Introduce pnv_chip_foreach_cpu() to remove one CPU_FOREACH use (Cédric) . Constify few uses of IOMMUTLBEvent (Phil) . Wire loongson_ipi device to loongson3_virt/TCG (Jiaxun) . Fix inclusion of tracing headers on s390x/TCG (Phil) . Add few shortcuts missing to readline (Manos) . Update ui/display entries in MAINTAINERS (Gerd) . Use qemu_add_mouse_change_notifier on Cocoa (Akihiko) . Fix Standard VGA screen blanking and cleanups (Gerd) . Fix USB/MTP reported "free space" value (Fabio) . Cast size_memop() returned value (Roman) # -----BEGIN PGP SIGNATURE----- # # iQIzBAABCAAdFiEE+qvnXhKRciHc/Wuy4+MsLN6twN4FAmZyuKYACgkQ4+MsLN6t # wN5guxAAvwJWbxQA8B4+gfiYaMK0AnM4leuCZ+8Sf+LhK32k2UkFA4NnKBkxGmO+ # 45NOEEEEv1Tukvtq1STHkYEdERJbHndpSFk2XmaYY09Ofo54vv2dXy6MD6GJriuA # Pr9Mivzs490RSPXmxhsa8GU5IE6CO3LamgpSeH8XxPTvCbRIiB8LcKsme6utBAZv # 9dHnEX5sXEEY2ZvArQd+eueyJfRyN4+1PpQkE9uH/wLIBqHAkHgSvFVaLo+PtA7T # xfcFvrawRTWIU+P1lojmCMb+mOj+YS7yigpkkYQC4SFm0PEv5J5nyhr/mhhiVuSS # tK8DNNi44F7/Z2CzEwbwk1PEnfKWtCgG2rEiR5uT6E8nmvxaOr2LfswBjLSwVDPS # mBOnjTMLqTBPKq8E8x2di1h2cJ9PZ90zZtWzYD8Eqoq+eqz/x+8z/qP4vifzO+NB # 7lj4IQZzLn+iktDGpjfh2RNoV9F9i9BwFGJqO2i0MzVftezJuGfe9olVOP2ErpnR # jqB7gzgc6g4tYiOK9WchuIeB/S9dU/5qqQxWwINWX0j4cHF6Qq71LyejCTfpqpf8 # jjF65XdGHcyVm9NAnr18MTzwdu3YYWf4w2OGIHg7iGLC0hv3U+EzEEMpv2E6pelM # iXgtqkRQm9qJaSrjfv0MUp9irjq01aIaHceFmP20QtkMP256E6c= # =Ed8Z # -----END PGP SIGNATURE----- # gpg: Signature made Wed 19 Jun 2024 03:53:26 AM PDT # gpg: using RSA key FAABE75E12917221DCFD6BB2E3E32C2CDEADC0DE # gpg: Good signature from "Philippe Mathieu-Daudé (F4BUG) <f4bug@amsat.org>" [full] * tag 'misc-20240619' of https://github.com/philmd/qemu: (74 commits) exec: Make the MemOp enum cast explicit ui+display: rename is_buffer_shared() -> surface_is_allocated() ui+display: rename is_placeholder() -> surface_is_placeholder() stdvga: fix screen blanking ui/cocoa: Use qemu_add_mouse_change_notifier MAINTAINERS: drop spice+ui maintainership MAINTAINERS: drop virtio-gpu maintainership util/readline: Add C-u shortcut util/readline: Add C-n, C-p shortcuts util/readline: Fix lints for readline_handle_byte target/s390x: Use s390_skeys_get|set() helper hw/s390x: Introduce s390_skeys_get|set() helpers hw/mips/loongson3_virt: Wire up loongson_ipi device hw/intc/loongson_ipi: Replace ipi_getcpu with cpu_by_arch_id hw/intc/loongson_ipi: Provide per core MMIO address spaces hw/intc: Remove loongarch_ipi.c hw/usb/dev-mtp: Correctly report free space hw/usb: Remove unused 'host.h' header hw/i386/iommu: Constify IOMMUTLBEvent in vtd_page_walk_hook prototype memory: Constify IOMMUTLBEvent in memory_region_notify_iommu() ... Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'hw/display/vga.c')
-rw-r--r--hw/display/vga.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/hw/display/vga.c b/hw/display/vga.c
index 30facc6c8e..892fedc8dc 100644
--- a/hw/display/vga.c
+++ b/hw/display/vga.c
@@ -1487,7 +1487,7 @@ static void vga_draw_graphic(VGACommonState *s, int full_update)
uint8_t *d;
uint32_t v, addr1, addr;
vga_draw_line_func *vga_draw_line = NULL;
- bool share_surface, force_shadow = false;
+ bool allocate_surface, force_shadow = false;
pixman_format_code_t format;
#if HOST_BIG_ENDIAN
bool byteswap = !s->big_endian_fb;
@@ -1609,10 +1609,10 @@ static void vga_draw_graphic(VGACommonState *s, int full_update)
*/
format = qemu_default_pixman_format(depth, !byteswap);
if (format) {
- share_surface = dpy_gfx_check_format(s->con, format)
- && !s->force_shadow && !force_shadow;
+ allocate_surface = !dpy_gfx_check_format(s->con, format)
+ || s->force_shadow || force_shadow;
} else {
- share_surface = false;
+ allocate_surface = true;
}
if (s->params.line_offset != s->last_line_offset ||
@@ -1620,7 +1620,7 @@ static void vga_draw_graphic(VGACommonState *s, int full_update)
height != s->last_height ||
s->last_depth != depth ||
s->last_byteswap != byteswap ||
- share_surface != is_buffer_shared(surface)) {
+ allocate_surface != surface_is_allocated(surface)) {
/* display parameters changed -> need new display surface */
s->last_scr_width = disp_width;
s->last_scr_height = height;
@@ -1635,14 +1635,14 @@ static void vga_draw_graphic(VGACommonState *s, int full_update)
full_update = 1;
}
if (surface_data(surface) != s->vram_ptr + (s->params.start_addr * 4)
- && is_buffer_shared(surface)) {
+ && !surface_is_allocated(surface)) {
/* base address changed (page flip) -> shared display surfaces
* must be updated with the new base address */
full_update = 1;
}
if (full_update) {
- if (share_surface) {
+ if (!allocate_surface) {
surface = qemu_create_displaysurface_from(disp_width,
height, format, s->params.line_offset,
s->vram_ptr + (s->params.start_addr * 4));
@@ -1655,7 +1655,7 @@ static void vga_draw_graphic(VGACommonState *s, int full_update)
vga_draw_line = vga_draw_line_table[v];
- if (!is_buffer_shared(surface) && s->cursor_invalidate) {
+ if (surface_is_allocated(surface) && s->cursor_invalidate) {
s->cursor_invalidate(s);
}
@@ -1707,7 +1707,7 @@ static void vga_draw_graphic(VGACommonState *s, int full_update)
if (update) {
if (y_start < 0)
y_start = y;
- if (!(is_buffer_shared(surface))) {
+ if (surface_is_allocated(surface)) {
uint8_t *p;
p = vga_draw_line(s, d, addr, width, hpel);
if (p) {
@@ -1762,6 +1762,13 @@ static void vga_draw_blank(VGACommonState *s, int full_update)
if (s->last_scr_width <= 0 || s->last_scr_height <= 0)
return;
+ if (!surface_is_allocated(surface)) {
+ /* unshare buffer, otherwise the blanking corrupts vga vram */
+ surface = qemu_create_displaysurface(s->last_scr_width,
+ s->last_scr_height);
+ dpy_gfx_replace_surface(s->con, surface);
+ }
+
w = s->last_scr_width * surface_bytes_per_pixel(surface);
d = surface_data(surface);
for(i = 0; i < s->last_scr_height; i++) {