[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] ati-vga: Add registers for getting apertures
From: |
Gerd Hoffmann |
Subject: |
Re: [Qemu-devel] [PATCH] ati-vga: Add registers for getting apertures |
Date: |
Fri, 5 Jul 2019 15:59:19 +0200 |
User-agent: |
NeoMutt/20180716 |
On Fri, Jul 05, 2019 at 12:02:26PM +0200, BALATON Zoltan wrote:
> Some drivers (e.g. Linux radeon drm and MacOS) access these to find
> apertures to access card. Try to implement these but not sure these
> are correct yet.
> + case CONFIG_APER_SIZE:
> + val = s->vga.vram_size;
> + break;
Given the math linux is doing I don't think this is correct:
static u32 r100_get_accessible_vram(struct radeon_device *rdev)
{
u32 aper_size;
u8 byte;
aper_size = RREG32(RADEON_CONFIG_APER_SIZE);
[ ... ]
/* Single function older card. We read HDP_APER_CNTL to see how the BIOS
* have set it up. We don't write this as it's broken on some ASICs but
* we expect the BIOS to have done the right thing (might be too
optimistic...)
*/
if (RREG32(RADEON_HOST_PATH_CNTL) & RADEON_HDP_APER_CNTL)
return aper_size * 2;
return aper_size;
}
IIRC old ati cards had a pci bar twice the size of the vram, where the lower
half of the pci bar was straight access to the video memory and the upper
half byteswapped access.
I think that is the background of the "aper_size * 2" logic above, and
RADEON_HDP_APER_CNTL is probably a config bit for the behavior.
cheers,
Gerd