QEMU-Arm Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jamin Lin <jamin_lin@aspeedtech.com>
To: "Cédric Le Goater" <clg@kaod.org>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	"Steven Lee" <steven_lee@aspeedtech.com>,
	"Troy Lee" <leetroy@gmail.com>,
	"Kane Chen" <kane_chen@aspeedtech.com>,
	"Andrew Jeffery" <andrew@codeconstruct.com.au>,
	"Joel Stanley" <joel@jms.id.au>,
	"Pierrick Bouvier" <pierrick.bouvier@oss.qualcomm.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Gerd Hoffmann" <kraxel@redhat.com>,
	"open list:ASPEED BMCs" <qemu-arm@nongnu.org>,
	"open list:All patches CC here" <qemu-devel@nongnu.org>
Cc: Jamin Lin <jamin_lin@aspeedtech.com>, Troy Lee <troy_lee@aspeedtech.com>
Subject: [PATCH v2 1/6] hw/display/vga: Allow a device to report vendor specific blanking
Date: Thu, 10 Sep 2026 01:44:49 +0000	[thread overview]
Message-ID: <20260910014447.4110781-2-jamin_lin@aspeedtech.com> (raw)
In-Reply-To: <20260910014447.4110781-1-jamin_lin@aspeedtech.com>

The common code decides that the display is blanked by looking at bit 5
of the attribute controller index register. A device which instead gates
the sync signals through vendor specific registers has no way to express
that, and keeps scanning out the last image after its CRTC was disabled.

Add an optional is_blanked() callback for such a device to report it.
Devices which leave it unset are unaffected.

Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
---
 hw/display/vga_int.h | 1 +
 hw/display/vga.c     | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/hw/display/vga_int.h b/hw/display/vga_int.h
index ca69ae9815..a017ab7a99 100644
--- a/hw/display/vga_int.h
+++ b/hw/display/vga_int.h
@@ -99,6 +99,7 @@ typedef struct VGACommonState {
     uint8_t palette[768];
     int32_t bank_offset;
     int (*get_bpp)(struct VGACommonState *s);
+    bool (*is_blanked)(struct VGACommonState *s);
     void (*get_params)(struct VGACommonState *s, VGADisplayParams *params);
     void (*get_resolution)(struct VGACommonState *s,
                         int *pwidth,
diff --git a/hw/display/vga.c b/hw/display/vga.c
index cb0e28b79b..1d96308060 100644
--- a/hw/display/vga.c
+++ b/hw/display/vga.c
@@ -1814,7 +1814,7 @@ static bool vga_update_display(void *opaque)
         /* nothing to do */
     } else {
         full_update = 0;
-        if (!(s->ar_index & 0x20)) {
+        if (!(s->ar_index & 0x20) || (s->is_blanked && s->is_blanked(s))) {
             graphic_mode = GMODE_BLANK;
         } else {
             graphic_mode = s->gr[VGA_GFX_MISC] & VGA_GR06_GRAPHICS_MODE;
@@ -1936,7 +1936,7 @@ static void vga_update_text(void *opaque, uint32_t *chardata)
 
     qemu_flush_coalesced_mmio_buffer();
 
-    if (!(s->ar_index & 0x20)) {
+    if (!(s->ar_index & 0x20) || (s->is_blanked && s->is_blanked(s))) {
         graphic_mode = GMODE_BLANK;
     } else {
         graphic_mode = s->gr[VGA_GFX_MISC] & VGA_GR06_GRAPHICS_MODE;
-- 
2.53.0


  reply	other threads:[~2026-09-10  1:46 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-10  1:44 [PATCH v2 0/6] Add ASPEED VGA PCI device support Jamin Lin
2026-09-10  1:44 ` Jamin Lin [this message]
2026-09-10  1:44 ` [PATCH v2 2/6] hw/display/vga: Move VGA_HPEL_NEUTRAL to vga_int.h Jamin Lin
2026-09-10  1:44 ` [PATCH v2 3/6] hw/display/aspeed-vga: Add ASPEED VGA display controller Jamin Lin
2026-09-10  1:44 ` [PATCH v2 4/6] hw/display/aspeed-vga: Add the hardware overlay cursor Jamin Lin
2026-09-10  1:44 ` [PATCH v2 5/6] hw/display/aspeed-vga: Add the 2D graphics engine Jamin Lin
2026-09-10  1:44 ` [PATCH v2 6/6] docs/system/arm/aspeed: Document the VGA display controller Jamin Lin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260910014447.4110781-2-jamin_lin@aspeedtech.com \
    --to=jamin_lin@aspeedtech.com \
    --cc=andrew@codeconstruct.com.au \
    --cc=clg@kaod.org \
    --cc=joel@jms.id.au \
    --cc=kane_chen@aspeedtech.com \
    --cc=kraxel@redhat.com \
    --cc=leetroy@gmail.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=pierrick.bouvier@oss.qualcomm.com \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=steven_lee@aspeedtech.com \
    --cc=troy_lee@aspeedtech.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox