[PATCH] vga: Allow writing VBE_DISPI_ID5 to ID register

Dennis Wölfing posted 1 patch 2 years, 11 months ago
Test checkpatch passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20210607115303.228659-1-denniswoelfing@gmx.de
Maintainers: Gerd Hoffmann <kraxel@redhat.com>
hw/display/vga.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
[PATCH] vga: Allow writing VBE_DISPI_ID5 to ID register
Posted by Dennis Wölfing 2 years, 11 months ago
The highest VBE_DISPI_INDEX_ID version supported by QEMU is
VBE_DISPI_ID5. But currently QEMU only allows writing values up to
VBE_DISPI_ID4 to the VBE_DISPI_INDEX_ID register.

As a result of this when a lower version is written to this register and
later VBE_DISPI_ID5 is written back, reads from the register will
continue to report the lower version.

Indeed SeaBIOS is doing that during VGA initialization which causes
guests to always read VBE_DISPI_ID0 instead of the correct version.

Signed-off-by: Dennis Wölfing <denniswoelfing@gmx.de>
---
 hw/display/vga.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/hw/display/vga.c b/hw/display/vga.c
index 28a90e30d0..9d1f66af40 100644
--- a/hw/display/vga.c
+++ b/hw/display/vga.c
@@ -752,7 +752,8 @@ void vbe_ioport_write_data(void *opaque, uint32_t addr, uint32_t val)
                 val == VBE_DISPI_ID1 ||
                 val == VBE_DISPI_ID2 ||
                 val == VBE_DISPI_ID3 ||
-                val == VBE_DISPI_ID4) {
+                val == VBE_DISPI_ID4 ||
+                val == VBE_DISPI_ID5) {
                 s->vbe_regs[s->vbe_index] = val;
             }
             break;
--
2.31.1


Re: [PATCH] vga: Allow writing VBE_DISPI_ID5 to ID register
Posted by Dennis Wölfing 2 years, 10 months ago
Ping
https://lore.kernel.org/qemu-devel/20210607115303.228659-1-denniswoelfing@gmx.de/

On 07.06.21 13:53, Dennis Wölfing wrote:
> The highest VBE_DISPI_INDEX_ID version supported by QEMU is
> VBE_DISPI_ID5. But currently QEMU only allows writing values up to
> VBE_DISPI_ID4 to the VBE_DISPI_INDEX_ID register.
>
> As a result of this when a lower version is written to this register and
> later VBE_DISPI_ID5 is written back, reads from the register will
> continue to report the lower version.
>
> Indeed SeaBIOS is doing that during VGA initialization which causes
> guests to always read VBE_DISPI_ID0 instead of the correct version.
>
> Signed-off-by: Dennis Wölfing <denniswoelfing@gmx.de>
> ---
>   hw/display/vga.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/hw/display/vga.c b/hw/display/vga.c
> index 28a90e30d0..9d1f66af40 100644
> --- a/hw/display/vga.c
> +++ b/hw/display/vga.c
> @@ -752,7 +752,8 @@ void vbe_ioport_write_data(void *opaque, uint32_t addr, uint32_t val)
>                   val == VBE_DISPI_ID1 ||
>                   val == VBE_DISPI_ID2 ||
>                   val == VBE_DISPI_ID3 ||
> -                val == VBE_DISPI_ID4) {
> +                val == VBE_DISPI_ID4 ||
> +                val == VBE_DISPI_ID5) {
>                   s->vbe_regs[s->vbe_index] = val;
>               }
>               break;
> --
> 2.31.1
>