summary refs log tree commit diff stats
path: root/hw/display/ati.c
diff options
context:
space:
mode:
authorBALATON Zoltan <balaton@eik.bme.hu>2023-11-01 21:45:36 +0100
committerMarc-André Lureau <marcandre.lureau@redhat.com>2023-11-06 15:58:37 +0400
commitf7ecde051dd73fad8265e83c26ea69ae0a86e1d4 (patch)
tree29c3f46da776ccd1d3764e3026e84ba6ffbe8b04 /hw/display/ati.c
parent9d9ae0f07bc5f7c7f51832c6446dd3e115531427 (diff)
downloadfocaccia-qemu-f7ecde051dd73fad8265e83c26ea69ae0a86e1d4.tar.gz
focaccia-qemu-f7ecde051dd73fad8265e83c26ea69ae0a86e1d4.zip
ati-vga: Fix aperture sizes
Apparently these should be half the memory region sizes confirmed at
least by Radeon FCocde ROM while Rage 128 Pro ROMs don't seem to use
these. Linux r100 DRM driver also checks for a bit in HOST_PATH_CNTL
so we also add that even though the FCode ROM does not seem to set it.

Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-ID: <d077d4f90d19db731df78da6f05058db074cada1.1698871239.git.balaton@eik.bme.hu>
Diffstat (limited to 'hw/display/ati.c')
-rw-r--r--hw/display/ati.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/hw/display/ati.c b/hw/display/ati.c
index 6e38e00502..9a9ea754bd 100644
--- a/hw/display/ati.c
+++ b/hw/display/ati.c
@@ -349,14 +349,17 @@ static uint64_t ati_mm_read(void *opaque, hwaddr addr, unsigned int size)
                                       PCI_BASE_ADDRESS_0, size) & 0xfffffff0;
         break;
     case CONFIG_APER_SIZE:
-        val = s->vga.vram_size;
+        val = s->vga.vram_size / 2;
         break;
     case CONFIG_REG_1_BASE:
         val = pci_default_read_config(&s->dev,
                                       PCI_BASE_ADDRESS_2, size) & 0xfffffff0;
         break;
     case CONFIG_REG_APER_SIZE:
-        val = memory_region_size(&s->mm);
+        val = memory_region_size(&s->mm) / 2;
+        break;
+    case HOST_PATH_CNTL:
+        val = BIT(23); /* Radeon HDP_APER_CNTL */
         break;
     case MC_STATUS:
         val = 5;