linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/bochs: fix blanking
@ 2022-09-06 14:29 Gerd Hoffmann
  2022-09-07  7:36 ` Thomas Zimmermann
  0 siblings, 1 reply; 2+ messages in thread
From: Gerd Hoffmann @ 2022-09-06 14:29 UTC (permalink / raw)
  To: dri-devel
  Cc: Gerd Hoffmann, David Airlie, Daniel Vetter, Thomas Zimmermann,
	Takashi Iwai, open list:DRM DRIVER FOR BOCHS VIRTUAL GPU,
	open list

VGA_IS1_RC is the color mode register (VGA_IS1_RM the one for monochrome
mode, note C vs. M at the end).  So when using VGA_IS1_RC make sure the
vga device is actually in color mode and set the corresponding bit in the
misc register.

Reproducible when booting VMs in UEFI mode with some edk2 versions (edk2
fix is on the way too).  Doesn't happen in BIOS mode because in that
case the vgabios already flips the bit.

Fixes: 250e743915d4 ("drm/bochs: Add screen blanking support")
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 drivers/gpu/drm/tiny/bochs.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/tiny/bochs.c b/drivers/gpu/drm/tiny/bochs.c
index 08de13774862..a51262289aef 100644
--- a/drivers/gpu/drm/tiny/bochs.c
+++ b/drivers/gpu/drm/tiny/bochs.c
@@ -309,6 +309,8 @@ static void bochs_hw_fini(struct drm_device *dev)
 static void bochs_hw_blank(struct bochs_device *bochs, bool blank)
 {
 	DRM_DEBUG_DRIVER("hw_blank %d\n", blank);
+	/* enable color bit (so VGA_IS1_RC access works) */
+	bochs_vga_writeb(bochs, VGA_MIS_W, VGA_MIS_COLOR);
 	/* discard ar_flip_flop */
 	(void)bochs_vga_readb(bochs, VGA_IS1_RC);
 	/* blank or unblank; we need only update index and set 0x20 */
-- 
2.37.3


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] drm/bochs: fix blanking
  2022-09-06 14:29 [PATCH] drm/bochs: fix blanking Gerd Hoffmann
@ 2022-09-07  7:36 ` Thomas Zimmermann
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Zimmermann @ 2022-09-07  7:36 UTC (permalink / raw)
  To: Gerd Hoffmann, dri-devel
  Cc: David Airlie, Daniel Vetter, Takashi Iwai,
	open list:DRM DRIVER FOR BOCHS VIRTUAL GPU, open list


[-- Attachment #1.1: Type: text/plain, Size: 1603 bytes --]



Am 06.09.22 um 16:29 schrieb Gerd Hoffmann:
> VGA_IS1_RC is the color mode register (VGA_IS1_RM the one for monochrome
> mode, note C vs. M at the end).  So when using VGA_IS1_RC make sure the
> vga device is actually in color mode and set the corresponding bit in the
> misc register.
> 
> Reproducible when booting VMs in UEFI mode with some edk2 versions (edk2
> fix is on the way too).  Doesn't happen in BIOS mode because in that
> case the vgabios already flips the bit.
> 
> Fixes: 250e743915d4 ("drm/bochs: Add screen blanking support")
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>

Acked-by: Thomas Zimmermann <tzimmermann@suse.de>

> ---
>   drivers/gpu/drm/tiny/bochs.c | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/gpu/drm/tiny/bochs.c b/drivers/gpu/drm/tiny/bochs.c
> index 08de13774862..a51262289aef 100644
> --- a/drivers/gpu/drm/tiny/bochs.c
> +++ b/drivers/gpu/drm/tiny/bochs.c
> @@ -309,6 +309,8 @@ static void bochs_hw_fini(struct drm_device *dev)
>   static void bochs_hw_blank(struct bochs_device *bochs, bool blank)
>   {
>   	DRM_DEBUG_DRIVER("hw_blank %d\n", blank);
> +	/* enable color bit (so VGA_IS1_RC access works) */
> +	bochs_vga_writeb(bochs, VGA_MIS_W, VGA_MIS_COLOR);
>   	/* discard ar_flip_flop */
>   	(void)bochs_vga_readb(bochs, VGA_IS1_RC);
>   	/* blank or unblank; we need only update index and set 0x20 */

-- 
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Ivo Totev

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-09-07  7:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-06 14:29 [PATCH] drm/bochs: fix blanking Gerd Hoffmann
2022-09-07  7:36 ` Thomas Zimmermann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).