From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Vladimir Dergachev <volodya@mindspring.com>
Cc: Jon Smirl <jonsmirl@yahoo.com>,
dri-devel@lists.sourceforge.net,
Linux Fbdev development list
<linux-fbdev-devel@lists.sourceforge.net>,
xorg@lists.freedesktop.org
Subject: Re: radeon, apertures & memory mapping
Date: Sun, 13 Mar 2005 17:44:23 +1100 [thread overview]
Message-ID: <1110696263.19810.101.camel@gaston> (raw)
In-Reply-To: <Pine.LNX.4.62.0503122253550.31897@node2.an-vo.com>
On Sat, 2005-03-12 at 22:55 -0500, Vladimir Dergachev wrote:
> Hi Ben,
>
> Hopefully simple question:
>
> If you were able to change configured aperture size - would you like to ?
> I could possibly imaging situation where this is used to regular access to
> the video memory, but you are the driver author..
You cannot change them. They are strapped on the mother board or in the
BIOS ROM. If I was able, I would probably set both apertures to cover
the entire VRAM, though ATI hints that you may have more flexibility
with tiled surfaces if using them split ...
> thank you !
>
> Vladimir Dergachev
>
>
> On Sun, 13 Mar 2005, Benjamin Herrenschmidt wrote:
>
> > Hi !
> >
> > I'm currently rewriting radeonfb to implement support for dual head, and
> > ultimately, to make it more friendly to be hooked on DRM for mesa-solo
> > style setups.
> >
> > I have some issues however related to the way memory is mapped and
> > dealing with apertures. Here is the story, suggestions welcome:
> >
> > The radeon card exposes to the system 2 separate apertures. That is, the
> > PCI region is actually cut by the hardware in two halves, each of them
> > beeing an "aperture". Each aperture can have different configuration for
> > the endian swappers (and possibly the surface tiling registers).
> >
> > I can configure the apertures to both map to the same bit of video
> > memory (both covering the framebuffer from 0), or to be "split", that is
> > aperture 0 covering the framebuffer from 0 to CONFIG_APER_SIZE (size of
> > an aperture, that is half of the PCI BAR allocation), and aperture 1
> > covering the framebuffer from CONFIG_APER_SIZE to CONFIG_APER_SIZE*2.
> >
> > However, I can't change anything to CONFIG_APER_SIZE itself, it's
> > decided by straps, either HW or in the ROM. So we end up with different
> > setups depending on how the BIOS has configured things. I know that
> > Apple chips are usually wired so that CONFIG_APER_SIZE is half the video
> > memory, so if I use the first mode, I can only access half of the video
> > RAM from PCI, if I use the second, each aperture maps a different half
> > of video memory with possibly different endian swapping.
> >
> > But I think the setups in real life are more diverse and some BIOSes
> > will have CONFIG_APER_SIZE at least as big as the entire video memory,
> > thus forcing me to use the "overlapped" setup. In fact, CONFIG_APER_SIZE
> > may even be smaller than half of the vram and thus limiting the CPU to
> > part of the VRAM anyway.
> >
> > I have toyed with all sort of setups, and I have +/- decided to not
> > bother, and always do this, please tell me what you think:
> >
> > Always setup HOST_PATH_CNTL.HDP_APER_CNTL to 0. That is, both apertures
> > are always overlapping. On Macs, or other machines that strap
> > CONFIG_APER_SIZE to half of VRAM, that means only half of vram can be
> > directly accessed by the CPU. I think this is fine because of these:
> >
> > - We only really need to bother about CPU access for the framebuffer
> > itself (and possibly the cursor). That is normal non-accelerated fbdev
> > operations an mmap'ing of the framebuffer in user space. This is not
> > really a problem if that is limited to some part of vram. It puts a
> > small constraint on the allocation of video memory: the framebuffer has
> > to be near the beginning. But my opinion is that a mode switch will
> > pretty much always invalidate everything that is cached in video memory,
> > so the whole allocation can be re-done at that point. Things like
> > texture uploads etc... should use the CP engine and DMA (from either
> > system or AGP memory).
> >
> > - It's actually making things easier for me since I can allocate both
> > framebuffers next to each other, and probably easier for the future
> > video memory allocator since it then gets a larger contiguous chunk of
> > memory to deal with.
> >
> > - It's also easier because If I wanted to take advantage of the "split"
> > setting, I would still need some fallback mecanism for cards who have
> > the aperture size set to all of vram size.
> >
> > Note that I also noticed rather inconsistent usage of memory size vs
> > aperture size in DRI/X. I'm not sure X actually deals with the 2
> > scenarios here (X always only uses aperture 0 for both heads and changes
> > the swapper control on each access).
> >
> > The only drawback is that on the kernel side, for the console, I end up
> > with the ioremap for the second crtc beeing twice as big as necessary
> > since I can't "dynamically" ioremap/iounmap on mode switches (that would
> > be guaranteed to fail after the system has been running for a while). It
> > would be nice if I could play mapping tricks by doing something like
> > allocating the 2 bits of virtual space at boot (get_vm_area), and just
> > remap the pages in them ((un)map_vm_area), but that wouldn't work with
> > architectures like MIPS who have limitations on where in virtual space
> > non-cacheable things are.
> >
> > I could maybe use a single ioremap though, that is use a single
> > aperture, and then switch the swapper on accesses. Though I should also
> > be careful not to end up conflicting with a userland process relying on
> > having the 2 separate aperture swappers stable for the mode on the 2
> > separate framebuffer mappings... Like X would use fb0 while console
> > would use fb1 with a different swapper setting. That would blow up for
> > sure unless fbcon arbitrates accesses with X, which I don't see
> > happening right away. I suppose we'll have to consider both heads linked
> > as far as console ownership is concerned, at least for now, until the
> > kernel console subsystem is overhauled significantly.
> >
> > Ben.
> >
> >
> >
> >
> > -------------------------------------------------------
> > SF email is sponsored by - The IT Product Guide
> > Read honest & candid reviews on hundreds of IT Products from real users.
> > Discover which products truly live up to the hype. Start reading now.
> > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
> > --
> > _______________________________________________
> > Dri-devel mailing list
> > Dri-devel@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/dri-devel
> >
--
Benjamin Herrenschmidt <benh@kernel.crashing.org>
next prev parent reply other threads:[~2005-03-13 6:44 UTC|newest]
Thread overview: 106+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-03-13 1:35 radeon, apertures & memory mapping Benjamin Herrenschmidt
2005-03-13 3:22 ` Jon Smirl
2005-03-13 6:43 ` Benjamin Herrenschmidt
2005-03-13 16:22 ` Jon Smirl
2005-03-14 4:28 ` [Linux-fbdev-devel] " Michel Dänzer
2005-03-14 7:12 ` Benjamin Herrenschmidt
2005-03-14 16:20 ` Michel Dänzer
2005-03-14 21:52 ` Benjamin Herrenschmidt
2005-03-14 22:12 ` Michel Dänzer
2005-03-14 22:37 ` FB model basic issues (WAS: radeon, apertures & memory mapping) Benjamin Herrenschmidt
2005-03-15 4:59 ` Michel Dänzer
2005-03-15 5:14 ` Jon Smirl
2005-03-15 6:01 ` Ville Syrjälä
2005-03-15 6:59 ` Benjamin Herrenschmidt
2005-03-15 14:00 ` Ville Syrjälä
2005-03-15 14:29 ` Jon Smirl
2005-03-15 17:25 ` Jan Gukelberger
2005-03-15 23:34 ` Benjamin Herrenschmidt
2005-03-15 8:51 ` Geert Uytterhoeven
2005-03-15 13:36 ` [Linux-fbdev-devel] " Ville Syrjälä
2005-03-15 23:33 ` Benjamin Herrenschmidt
2005-03-15 23:37 ` Antonino A. Daplas
2005-03-15 23:50 ` [Linux-fbdev-devel] " Benjamin Herrenschmidt
2005-03-16 1:47 ` Ville Syrjälä
2005-03-16 1:51 ` Benjamin Herrenschmidt
2005-03-16 19:51 ` Ville Syrjälä
2005-03-16 21:00 ` Michel Dänzer
2005-03-16 21:07 ` Ville Syrjälä
2005-03-16 23:28 ` Benjamin Herrenschmidt
2005-03-16 23:53 ` Michel Dänzer
2005-03-16 23:25 ` [Linux-fbdev-devel] " Benjamin Herrenschmidt
[not found] ` <1110929582.25201.34.camel@gaston>
2005-03-16 5:21 ` Michel Dänzer
2005-03-16 6:31 ` Benjamin Herrenschmidt
2005-03-16 14:09 ` Ville Syrjälä
2005-03-16 16:48 ` Adam Jackson
2005-03-16 23:20 ` Benjamin Herrenschmidt
2005-03-15 11:30 ` Roland Scheidegger
2005-03-15 13:27 ` Ville Syrjälä
2005-03-15 17:17 ` Michel Dänzer
2005-03-16 3:09 ` Benjamin Herrenschmidt
2005-03-16 20:08 ` Ville Syrjälä
2005-03-16 20:42 ` [Linux-fbdev-devel] " Michel Dänzer
2005-03-16 23:26 ` Benjamin Herrenschmidt
2005-03-16 23:35 ` Jon Smirl
2005-03-17 0:06 ` [Linux-fbdev-devel] " Benjamin Herrenschmidt
2005-03-16 20:58 ` Alex Deucher
2005-03-16 21:08 ` Ville Syrjälä
2005-03-16 21:17 ` Alex Deucher
2005-03-16 23:30 ` Benjamin Herrenschmidt
2005-03-17 0:47 ` Ville Syrjälä
2005-03-17 1:12 ` Benjamin Herrenschmidt
2005-03-17 1:25 ` Ville Syrjälä
2005-03-17 2:00 ` Benjamin Herrenschmidt
2005-03-17 9:08 ` Geert Uytterhoeven
2005-03-17 19:54 ` [Linux-fbdev-devel] " Ville Syrjälä
2005-03-15 22:44 ` Benjamin Herrenschmidt
2005-03-15 23:05 ` Ville Syrjälä
2005-03-15 23:49 ` Benjamin Herrenschmidt
2005-03-16 20:55 ` Ville Syrjälä
2005-03-16 23:27 ` Benjamin Herrenschmidt
2005-03-17 0:14 ` Ville Syrjälä
2005-03-17 0:28 ` Benjamin Herrenschmidt
2005-03-15 6:45 ` Benjamin Herrenschmidt
2005-03-15 5:30 ` Jon Smirl
2005-03-15 6:58 ` Benjamin Herrenschmidt
2005-03-15 21:58 ` Ian Romanick
2005-03-13 3:55 ` radeon, apertures & memory mapping Vladimir Dergachev
2005-03-13 6:44 ` Benjamin Herrenschmidt [this message]
2005-03-13 8:22 ` Ville Syrjälä
2005-03-13 9:20 ` Benjamin Herrenschmidt
2005-03-13 10:39 ` Ville Syrjälä
2005-03-13 12:04 ` Benjamin Herrenschmidt
2005-03-13 16:19 ` Jon Smirl
2005-03-13 17:47 ` Ville Syrjälä
2005-03-13 17:56 ` [Linux-fbdev-devel] " Jon Smirl
2005-03-13 21:52 ` Benjamin Herrenschmidt
2005-03-13 22:17 ` Jon Smirl
2005-03-13 22:41 ` Benjamin Herrenschmidt
2005-03-13 21:51 ` Benjamin Herrenschmidt
2005-03-13 21:49 ` Benjamin Herrenschmidt
2005-03-13 22:10 ` Jon Smirl
2005-03-13 22:20 ` Benjamin Herrenschmidt
2005-03-13 23:00 ` Jon Smirl
2005-03-13 23:11 ` Benjamin Herrenschmidt
2005-03-13 23:27 ` Ville Syrjälä
2005-03-13 23:48 ` Benjamin Herrenschmidt
2005-03-14 0:08 ` Ville Syrjälä
2005-03-14 0:10 ` Benjamin Herrenschmidt
2005-03-14 0:25 ` Jon Smirl
2005-03-14 0:39 ` Ville Syrjälä
2005-03-14 1:02 ` Benjamin Herrenschmidt
2005-03-14 0:54 ` Benjamin Herrenschmidt
2005-03-14 0:41 ` Paul Mackerras
2005-03-14 0:56 ` Ville Syrjälä
2005-03-14 1:05 ` [Linux-fbdev-devel] " Benjamin Herrenschmidt
2005-03-14 1:47 ` Jon Smirl
2005-03-14 3:59 ` Benjamin Herrenschmidt
2005-03-14 4:07 ` Paul Mackerras
2005-03-14 4:40 ` Jon Smirl
2005-03-14 5:09 ` [Linux-fbdev-devel] " Benjamin Herrenschmidt
2005-03-14 16:30 ` Soeren Sandmann
2005-03-14 16:40 ` Ville Syrjälä
2005-03-14 21:54 ` Benjamin Herrenschmidt
2005-03-14 16:16 ` Ville Syrjälä
2005-03-14 21:27 ` Donnie Berkholz
2005-03-14 21:51 ` Benjamin Herrenschmidt
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=1110696263.19810.101.camel@gaston \
--to=benh@kernel.crashing.org \
--cc=dri-devel@lists.sourceforge.net \
--cc=jonsmirl@yahoo.com \
--cc=linux-fbdev-devel@lists.sourceforge.net \
--cc=volodya@mindspring.com \
--cc=xorg@lists.freedesktop.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).