diff mbox

[1/2] cirrus_vga: also assign gr0/1 when writting shadow_gr0/1

Message ID 6b781a1bec0f609301d111b0389fa9784f9629c9.1253536404.git.quintela@redhat.com
State Superseded
Headers show

Commit Message

Juan Quintela Sept. 21, 2009, 12:35 p.m. UTC
This is a regression/bug caused by previous vga_cleanup.  This fixes
Ubuntu installer reported by:
	 Pierre Riteau

Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 hw/cirrus_vga.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

Comments

Markus Armbruster Sept. 23, 2009, 7:16 p.m. UTC | #1
Juan Quintela <quintela@redhat.com> writes:

> This is a regression/bug caused by previous vga_cleanup.  This fixes
> Ubuntu installer reported by:
> 	 Pierre Riteau
>
> Signed-off-by: Juan Quintela <quintela@redhat.com>

Broken in commit 22286bc6.  Patch restores old behavior of
cirrus_vga_ioport_write() for address 0x3cf.

But what about cirrus_mmio_blt_write() for address
CIRRUS_MMIO_BLTBGCOLOR + 0?  There we had

    cirrus_hook_write_gr(s, 0x00, value);

which did not update s->vga.gr[0x00].  It does with your patch, doesn't
it?

Same for CIRRUS_MMIO_BLTFGCOLOR + 0.
Juan Quintela Sept. 29, 2009, 11:20 p.m. UTC | #2
Markus Armbruster <armbru@redhat.com> wrote:
> Juan Quintela <quintela@redhat.com> writes:
>
>> This is a regression/bug caused by previous vga_cleanup.  This fixes
>> Ubuntu installer reported by:
>> 	 Pierre Riteau
>>
>> Signed-off-by: Juan Quintela <quintela@redhat.com>
>
> Broken in commit 22286bc6.  Patch restores old behavior of
> cirrus_vga_ioport_write() for address 0x3cf.
>
> But what about cirrus_mmio_blt_write() for address
> CIRRUS_MMIO_BLTBGCOLOR + 0?  There we had
>
>     cirrus_hook_write_gr(s, 0x00, value);
>
> which did not update s->vga.gr[0x00].  It does with your patch, doesn't
> it?
>
> Same for CIRRUS_MMIO_BLTFGCOLOR + 0.

Yeap :(
My VGA expertise is inexistent, I don't know what to do here.  I will
also fix that.

Thanks for the review, Juan.
diff mbox

Patch

diff --git a/hw/cirrus_vga.c b/hw/cirrus_vga.c
index 7e95f10..ae4be82 100644
--- a/hw/cirrus_vga.c
+++ b/hw/cirrus_vga.c
@@ -1490,9 +1490,11 @@  cirrus_vga_write_gr(CirrusVGAState * s, unsigned reg_index, int reg_value)
 #endif
     switch (reg_index) {
     case 0x00:			// Standard VGA, BGCOLOR 0x000000ff
+	s->vga.gr[reg_index] = reg_value & gr_mask[reg_index];
 	s->cirrus_shadow_gr0 = reg_value;
 	break;
     case 0x01:			// Standard VGA, FGCOLOR 0x000000ff
+	s->vga.gr[reg_index] = reg_value & gr_mask[reg_index];
 	s->cirrus_shadow_gr1 = reg_value;
 	break;
     case 0x02:			// Standard VGA