summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/bochs/bochs.h
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2021-04-21 10:08:59 +0200
committerThomas Zimmermann <tzimmermann@suse.de>2021-04-27 14:14:12 +0200
commit250e743915d47163a075e63f282e9818b54651f1 (patch)
treeba7f63c7156cd4696be8c4acb10aa96e30137cf0 /drivers/gpu/drm/bochs/bochs.h
parentba4e0339a6a33e2ba341703ce14ae8ca203cb2f1 (diff)
downloadlinux-250e743915d47163a075e63f282e9818b54651f1.tar.bz2
drm/bochs: Add screen blanking support
On bochs DRM driver, the execution of "setterm --blank force" results in a frozen screen instead of a blank screen. It's due to the lack of the screen blanking support in its code. Actually, the QEMU bochs vga side can switch to the blanking mode when the bit 0x20 is cleared on VGA_ATT_IW register (0x3c0), which updates ar_index in QEMU side. So, essentially, we'd just need to clear the bit at pipe disable callback; that's what this patch does essentially. However, a tricky part is that the access via VGA_ATT_IW is done in "flip-flop"; the first write is for index and the second write is for the data like palette. Meanwhile, in the current bochs DRM driver, the flip-flop wasn't considered, and it calls only the register update once with the value 0x20. The spec and the actual VGA implementation in QEMU suggests that the flip flop flag is discarded by reading the CRTC index register (VGA_IS1_RC, 0x3da). So, in this patch, we add the helper to read a byte and the call to clear the flip flop flag before changing the blank / unblank setup via VGA_ATT_IW register. v1->v2: * discard ar_flip_flop by reading 0x3da, add bochs_vga_readb() * include video/vga.h for VGA register definitions * move the blank/unblank code to bochs_hw_blank() Signed-off-by: Takashi Iwai <tiwai@suse.de> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Link: https://patchwork.freedesktop.org/patch/msgid/20210421080859.14869-1-tiwai@suse.de
Diffstat (limited to 'drivers/gpu/drm/bochs/bochs.h')
-rw-r--r--drivers/gpu/drm/bochs/bochs.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/gpu/drm/bochs/bochs.h b/drivers/gpu/drm/bochs/bochs.h
index e5bd1d517a18..e9645c612aff 100644
--- a/drivers/gpu/drm/bochs/bochs.h
+++ b/drivers/gpu/drm/bochs/bochs.h
@@ -78,6 +78,7 @@ struct bochs_device {
int bochs_hw_init(struct drm_device *dev);
void bochs_hw_fini(struct drm_device *dev);
+void bochs_hw_blank(struct bochs_device *bochs, bool blank);
void bochs_hw_setmode(struct bochs_device *bochs,
struct drm_display_mode *mode);
void bochs_hw_setformat(struct bochs_device *bochs,