diff options
author | BALATON Zoltan <balaton@eik.bme.hu> | 2019-08-11 23:14:53 +0200 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2019-08-21 10:56:27 +0200 |
commit | 006388a8c78124eb193027366894fe4568065447 (patch) | |
tree | a4e13b8efd633b8ffefcbd3b5f6755b2d17f0388 /hw/display | |
parent | df1e4cf4e72b7ff7ec239afedaf7880ae667e431 (diff) | |
download | qemu-006388a8c78124eb193027366894fe4568065447.zip qemu-006388a8c78124eb193027366894fe4568065447.tar.gz qemu-006388a8c78124eb193027366894fe4568065447.tar.bz2 |
ati-vga: Fix GPIO_MONID register write
Also update bitbang_i2c state when output bits are changed while
enable bits are set. This fixes EDID access by the ATI FCode ROM.
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Message-id: 292e70a92b7fbfd9a4120d433dbdcfda4e5f6c3c.1565558093.git.balaton@eik.bme.hu
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw/display')
-rw-r--r-- | hw/display/ati.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/hw/display/ati.c b/hw/display/ati.c index 6cdcbef..eb54f68 100644 --- a/hw/display/ati.c +++ b/hw/display/ati.c @@ -564,12 +564,15 @@ static void ati_mm_write(void *opaque, hwaddr addr, addr - GPIO_MONID, data, size); /* * Rage128p accesses DDC used to get EDID via these bits. - * Only touch i2c when write overlaps 3rd byte because some - * drivers access this reg via multiple partial writes and - * without this spurious bits would be sent. + * Because some drivers access this via multiple byte writes + * we have to be careful when we send bits to avoid spurious + * changes in bitbang_i2c state. So only do it when mask is set + * and either the enable bits are changed or output bits changed + * while enabled. */ if ((s->regs.gpio_monid & BIT(25)) && - addr <= GPIO_MONID + 2 && addr + size > GPIO_MONID + 2) { + ((addr <= GPIO_MONID + 2 && addr + size > GPIO_MONID + 2) || + (addr == GPIO_MONID && (s->regs.gpio_monid & 0x60000)))) { s->regs.gpio_monid = ati_i2c(&s->bbi2c, s->regs.gpio_monid, 1); } } |