[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 3/8] ati-vga: Fix GPIO_MONID register write
From: |
Gerd Hoffmann |
Subject: |
[Qemu-devel] [PULL 3/8] ati-vga: Fix GPIO_MONID register write |
Date: |
Thu, 22 Aug 2019 10:04:57 +0200 |
From: BALATON Zoltan <address@hidden>
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 <address@hidden>
Message-id: address@hidden
Signed-off-by: Gerd Hoffmann <address@hidden>
---
hw/display/ati.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/hw/display/ati.c b/hw/display/ati.c
index 6cdcbef238fe..eb54f6842fed 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);
}
}
--
2.18.1
- [Qemu-devel] [PULL 0/8] Vga 20190822 patches, Gerd Hoffmann, 2019/08/22
- [Qemu-devel] [PULL 1/8] ati-vga: Add registers for getting apertures, Gerd Hoffmann, 2019/08/22
- [Qemu-devel] [PULL 5/8] ati-vga: Fix hardware cursor image offset, Gerd Hoffmann, 2019/08/22
- [Qemu-devel] [PULL 3/8] ati-vga: Fix GPIO_MONID register write,
Gerd Hoffmann <=
- [Qemu-devel] [PULL 4/8] ati-vga: Fix cursor color with guest_hwcursor=true, Gerd Hoffmann, 2019/08/22
- [Qemu-devel] [PULL 2/8] ati-vga: Add some register definitions for debugging, Gerd Hoffmann, 2019/08/22
- [Qemu-devel] [PULL 7/8] ati-vga: Add limited support for big endian frame buffer aperture, Gerd Hoffmann, 2019/08/22
- [Qemu-devel] [PULL 8/8] ati-vga: Implement dummy VBlank IRQ, Gerd Hoffmann, 2019/08/22
- [Qemu-devel] [PULL 6/8] ati-vga: Attempt to handle CRTC offset not exact multiple of stride, Gerd Hoffmann, 2019/08/22
- Re: [Qemu-devel] [PULL 0/8] Vga 20190822 patches, Peter Maydell, 2019/08/22