[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 02/10] ati-vga: Fix aperture sizes
|
From: |
marcandre . lureau |
|
Subject: |
[PULL 02/10] ati-vga: Fix aperture sizes |
|
Date: |
Mon, 6 Nov 2023 17:32:11 +0400 |
From: BALATON Zoltan <balaton@eik.bme.hu>
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>
---
hw/display/ati_regs.h | 1 +
hw/display/ati.c | 7 +++++--
hw/display/ati_dbg.c | 1 +
3 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/hw/display/ati_regs.h b/hw/display/ati_regs.h
index d6282b2ef2..c697b328da 100644
--- a/hw/display/ati_regs.h
+++ b/hw/display/ati_regs.h
@@ -56,6 +56,7 @@
#define CONFIG_APER_SIZE 0x0108
#define CONFIG_REG_1_BASE 0x010c
#define CONFIG_REG_APER_SIZE 0x0110
+#define HOST_PATH_CNTL 0x0130
#define MEM_CNTL 0x0140
#define MC_FB_LOCATION 0x0148
#define MC_AGP_LOCATION 0x014C
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;
diff --git a/hw/display/ati_dbg.c b/hw/display/ati_dbg.c
index bd0ecd48c7..4aec1c383a 100644
--- a/hw/display/ati_dbg.c
+++ b/hw/display/ati_dbg.c
@@ -38,6 +38,7 @@ static struct ati_regdesc ati_reg_names[] = {
{"CONFIG_APER_SIZE", 0x0108},
{"CONFIG_REG_1_BASE", 0x010c},
{"CONFIG_REG_APER_SIZE", 0x0110},
+ {"HOST_PATH_CNTL", 0x0130},
{"MEM_CNTL", 0x0140},
{"MC_FB_LOCATION", 0x0148},
{"MC_AGP_LOCATION", 0x014C},
--
2.41.0
- [PULL 00/10] Gpu patches, marcandre . lureau, 2023/11/06
- [PULL 01/10] virtio-gpu-rutabaga: Add empty interface to fix arm64 crash, marcandre . lureau, 2023/11/06
- [PULL 02/10] ati-vga: Fix aperture sizes,
marcandre . lureau <=
- [PULL 03/10] ati-vga: Support unaligned access to GPIO DDC registers, marcandre . lureau, 2023/11/06
- [PULL 04/10] ati-vga: Add 30 bit palette access register, marcandre . lureau, 2023/11/06
- [PULL 05/10] ati-vga: Implement fallback for pixman routines, marcandre . lureau, 2023/11/06
- [PULL 06/10] virtio-gpu: block migration of VMs with blob=true, marcandre . lureau, 2023/11/06
- [PULL 07/10] virtio-gpu: factor out restore mapping, marcandre . lureau, 2023/11/06
- [PULL 08/10] virtio-gpu: move scanout restoration to post_load, marcandre . lureau, 2023/11/06
- [PULL 10/10] Revert "virtio-gpu: block migration of VMs with blob=true", marcandre . lureau, 2023/11/06
- [PULL 09/10] virtio-gpu: add virtio-gpu/blob vmstate subsection, marcandre . lureau, 2023/11/06
- Re: [PULL 00/10] Gpu patches, Stefan Hajnoczi, 2023/11/06