qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Chad Jablonski" <chad@jablonski.xyz>
To: "BALATON Zoltan" <balaton@eik.bme.hu>,
	"Chad Jablonski" <chad@jablonski.xyz>
Cc: <qemu-devel@nongnu.org>, "Gerd Hoffmann" <kraxel@redhat.com>,
	<marcandre.lureau@redhat.com>
Subject: Re: [PATCH] ati-vga: Fix framebuffer mapping by using hardware-correct aperture sizes
Date: Mon, 13 Oct 2025 16:04:09 -0400	[thread overview]
Message-ID: <DDHGPB02664A.3C0GAHH5K41QT@jablonski.xyz> (raw)
In-Reply-To: <31fa1128-e693-494d-2515-467866d1598b@eik.bme.hu>

>
> I'm not saying the 64MB alignment is not correct (I don't know what is 
> correct and assuming the Xorg driver was tested with real cards it's 
> possible this assumption holds) but maybe it comes from having a 64MB VRAM 
> BAR that contains twice the size of actual VRAM including the AGP window 
> which also satisfies the 32MB alignment for VRAM, so the commit message 
> may nees to be adjusted to say that instead of something not supported by 
> documentation. Do you have any PCI cards? There were PCI versions of 
> these. I wonder if they also have the same VRAM BAR. If not then no 
> problem, we can go with what works for known drivers.
>

Unfortunately I don't have a PCI Rage 128. They actually seem to be somewhat
rare compared to the AGP versions!

Testing results from two Rage 128 AGP cards:

Card                      VRAM    PCI BAR0   CONFIG_MEMSIZE  CONFIG_APER_SIZE  AGP_APER_OFFSET
-----------------------   ----    --------   --------------  ----------------  ---------------
Rage 128 Pro Ultra TF     32MB    64MB       0x02000000      0x02000000        0x02000000
Rage 128 RF/SG AGP        16MB    64MB       0x01000000      0x02000000        0x02000000


* PCI BAR0 (Region 0) is fixed at 64MB for both cards, regardless of actual
  VRAM size.

* CONFIG_MEMSIZE correctly reports actual VRAM size (32MB and 16MB).

* CONFIG_APER_SIZE is fixed at 32MB (0x02000000) on both cards, regardless
  of:
   - Actual VRAM size
   - AGP enabled/disabled status
   - AGP_APER_SIZE configuration (tested with 8MB AGP enabled)

   This directly contradicts the Rage 128 Pro Register Reference Guide
   (pg. 3-202) which states: "Size of linear apertures (both 0 and 1).
   This includes both the frame buffer image and the AGP system memory
   image area."

* AGP_APER_OFFSET is also fixed at 32MB (0x02000000) on both cards. On the
  16MB card, this creates a 16MB gap between the end of framebuffer and the
  start of the AGP window.

So for Rage 128, CONFIG_APER_SIZE should be set to a fixed 32MB value, not
dynamically calculated from CONFIG_MEMSIZE + AGP space as the documentation
suggests and as was previously implemented by me 😬.

I'm less sure about the Radeon and your additional context around the Radeon
on PowerPC makes me very nervous to change it right now. Especially given I
have a single example of that card and it's for a PC. I think it makes more
sense to leave the behavior of CONFIG_APER_SIZE for that card unchanged.

I will send a v2 patch that:
  * Sets Rage 128 CONFIG_APER_SIZE to 32MB
  * Updates the commit message to reflect that
  * Leaves Radeon unchanged (half of the vram_size)
  * Addresses the style issues



      reply	other threads:[~2025-10-13 20:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-01  3:46 [PATCH] ati-vga: Fix framebuffer mapping by using hardware-correct aperture sizes Chad Jablonski
2025-10-07 20:52 ` BALATON Zoltan
2025-10-07 20:57   ` BALATON Zoltan
2025-10-13 14:52   ` Chad Jablonski
2025-10-13 16:24     ` BALATON Zoltan
2025-10-13 20:04       ` Chad Jablonski [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DDHGPB02664A.3C0GAHH5K41QT@jablonski.xyz \
    --to=chad@jablonski.xyz \
    --cc=balaton@eik.bme.hu \
    --cc=kraxel@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).