From: "Albert D. Cahalan" <acahalan@cs.uml.edu>
To: langausd@fachschaft.informatik.uni-stuttgart.de (Siggi Langauf)
Cc: debian-powerpc@lists.debian.org, linuxppc-dev@lists.linuxppc.org
Subject: Re: No cache control on ppc??
Date: Sat, 12 Jan 2002 16:39:20 -0500 (EST) [thread overview]
Message-ID: <200201122139.g0CLdK5376343@saturn.cs.uml.edu> (raw)
In-Reply-To: <Pine.LNX.4.21.0201121753510.11140-100000@darkwing.informatik.uni-stuttgart.de> from "Siggi Langauf" at Jan 12, 2002 06:10:42 PM
> On i586 (or newer) machines with AGP, the X server can set some MTRR
> ranges. AFAIUI, these tell the (CPU-internal) cache controller not to
> cache video memory (which wouln't make any sense, as that is used
> write-only).
It would make sense. You could fill up cache lines in the CPU,
then force a write-out all at once. You could then free the
cache line for future use.
> I haven't found anything similar in powerpc kernels, so I assume
> there is nothing like this. Is that correct? If so, is that a
> hardware restriction? Does the hardware do this automagically?
Oh come on... You get:
1. 4 cache-control bits per page table entry
2. instructions to manipulate cache lines
3. prefetch instructions (on "G4" chips: MPC7400, MPC7410...)
4. some TLB control that might be useful
5. 8 data BAT registers, allowing 4 super-size (256 MB) pages
6. 64-bit FPU (and 128-bit AltiVec) registers for memory copy
BTW, some of the above is good for RAID, IP checksums...
The serious problem is Apple's crappy 100 MHz bus. You'll have a
hard time moving much beyond 700 MiB/s I think. Supercomputer? Not.
I'm getting 351 in plus 351 out with 16 doubles on a Mac Cube.
Another problem is lack of OS support. You can't set mmap()
flags to indicate: cached, coherency not enforced, unguarded,
and no writeback. This is what you need. It would be nice to
get the BAT registers too, since user space does a lot more
memory access than the kernel does.
I don't know very much about MPEG, but something like this
would be a reasonable plan I guess:
Get some nice memory to use. Maybe 32 MiB, BAT mapped, with
all the attributes mentioned above. Flush all the cache lines
out -- you MUST if you have non-coherent memory, and it's a
nice idea anyway. Repeat before every use of the memory.
Get your video data, using raw IO. You'd really be asking
for several frames ahead of course.
Bite off a small chunk of the image. Pulling a number out of
my ass, I'll say 128x128 pixels and 4 frames deep. This fits
nicely into my 1 MB L2 cache. Go with 64x64 for the MPC7410.
Prefetch your data. If you have AltiVec, use AltiVec prefetch.
Do the decryption on that little chunk. Do the various motion
compensation things and inter-frame stuff on that little chunk.
You can process this tile in multiple frames to get better
cache usage. That is, you are doing work for future frames.
Now you may either
a. write back your cache, then start video DMA + color transform
b. do color transform interleaved with writing to video memory
Scaling goes there too, if you must. You might limit scaling
to small integer ratios, and pad/crop as needed to reach the
exact size desired.
Assuming you don't use DMA: make sure the video memory has the
same attributes as everything else, and use explicit cache
write-back instructions to push out the data.
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
next parent reply other threads:[~2002-01-12 21:39 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <Pine.LNX.4.21.0201121753510.11140-100000@darkwing.informatik.uni-stuttgart.de>
2002-01-12 21:39 ` Albert D. Cahalan [this message]
2002-01-13 5:36 ` No cache control on ppc?? Timothy A. Seufert
2002-01-13 6:51 ` Albert D. Cahalan
2002-01-13 8:06 ` "Cache Profiler" ? (was: No cache control on ppc??) Elizabeth Barham
2002-01-13 19:36 ` Benjamin Herrenschmidt
2002-01-15 9:17 ` Elizabeth Barham
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=200201122139.g0CLdK5376343@saturn.cs.uml.edu \
--to=acahalan@cs.uml.edu \
--cc=debian-powerpc@lists.debian.org \
--cc=langausd@fachschaft.informatik.uni-stuttgart.de \
--cc=linuxppc-dev@lists.linuxppc.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).