Skip to content

Commit f7ecde0

Browse files
zbalatonelmarco
authored andcommitted
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 <[email protected]> Reviewed-by: Marc-André Lureau <[email protected]> Message-ID: <d077d4f90d19db731df78da6f05058db074cada1.1698871239.git.balaton@eik.bme.hu>
1 parent 9d9ae0f commit f7ecde0

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

hw/display/ati.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -349,14 +349,17 @@ static uint64_t ati_mm_read(void *opaque, hwaddr addr, unsigned int size)
349349
PCI_BASE_ADDRESS_0, size) & 0xfffffff0;
350350
break;
351351
case CONFIG_APER_SIZE:
352-
val = s->vga.vram_size;
352+
val = s->vga.vram_size / 2;
353353
break;
354354
case CONFIG_REG_1_BASE:
355355
val = pci_default_read_config(&s->dev,
356356
PCI_BASE_ADDRESS_2, size) & 0xfffffff0;
357357
break;
358358
case CONFIG_REG_APER_SIZE:
359-
val = memory_region_size(&s->mm);
359+
val = memory_region_size(&s->mm) / 2;
360+
break;
361+
case HOST_PATH_CNTL:
362+
val = BIT(23); /* Radeon HDP_APER_CNTL */
360363
break;
361364
case MC_STATUS:
362365
val = 5;

hw/display/ati_dbg.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ static struct ati_regdesc ati_reg_names[] = {
3838
{"CONFIG_APER_SIZE", 0x0108},
3939
{"CONFIG_REG_1_BASE", 0x010c},
4040
{"CONFIG_REG_APER_SIZE", 0x0110},
41+
{"HOST_PATH_CNTL", 0x0130},
4142
{"MEM_CNTL", 0x0140},
4243
{"MC_FB_LOCATION", 0x0148},
4344
{"MC_AGP_LOCATION", 0x014C},

hw/display/ati_regs.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
#define CONFIG_APER_SIZE 0x0108
5757
#define CONFIG_REG_1_BASE 0x010c
5858
#define CONFIG_REG_APER_SIZE 0x0110
59+
#define HOST_PATH_CNTL 0x0130
5960
#define MEM_CNTL 0x0140
6061
#define MC_FB_LOCATION 0x0148
6162
#define MC_AGP_LOCATION 0x014C

0 commit comments

Comments
 (0)