linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Surda <shurdeek@panorama.sth.ac.at>
To: linux-kernel@vger.kernel.org
Subject: memcpy to videoram eats too much CPU on ATI cards (cache trashing?)
Date: Mon, 27 Aug 2001 20:13:51 +0200	[thread overview]
Message-ID: <20010827201351.H17545@shurdeek.cb.ac.at> (raw)

[-- Attachment #1: Type: text/plain, Size: 2360 bytes --]

Dear kernel gurus,

First of all I want to apologise for writing here, but I think this is the
place with the greatest chance of getting some help. I have done extensive
research on the problem and talked to many people including driver developers
and was unable to find any solutions yet.

So, fist a little intro: when watching videos with Xv under XFree86, a certain
function is called to transfer the data from system RAM to video RAM. This
function is driver specific, but for all the drivers I checked (mga, tdfx,
mach64, r128) it has the same contents, looks like pasted. It basically does a
for (h--) memcpy (blah, blah, blah).

The point is that with mga, tdfx and what I heard nvidia too, this doesn't
cause any CPU load (or more precisely, non-measurable load). However, with
mach64 and r128, it DOES. I did some more research.

memcpy-ing 380kB at 25fps takes about 5ms per frame and causes X to eat 1% cpu
time (time measurements were done by tsc)
memcpy-ing 760kB at 25fps takes about 11ms per frame, but instead of eating
2% CPU time, it eats 35% (yes, that's 35 times more)

The speed isn't the real problem (when you multiply it you get about 70MB/s
and that's definitely enough). The problem is that this eats CPU time, and
that shouldn't (or at least not so much).

This happens on both of my systems, one with PIIMobile/366 and mach64, and one
with Duron 650 with r128. I had a voodoo before for tests, and CPU load wasn't
measurable, from what I heard mga and nvidia as well, so it is something
ATI-specific. Some other people having ATI cards have the same problem (from
what I read on gatos-devel list), but I have never heard someone explicitely
say "the problem doesn't exist on my ATI".

MTRR is enabled correctly, disabling it only worsens the problem.

I have been in close contact with the driver developer and XFree86 maintainer,
but none of them seem to know exactly how to solve it. Current theory is that
this is caused by some cache being trashed, but I have no idea how to fix it.

Oh yes, I already tried using a memcpy written in assembly utilizing MMX, but
it didn't show any change.

I would be very grateful for ideas.

Please CC me, I'm not on the list.

Bye,

Peter Surda (Shurdeek) <shurdeek@panorama.sth.ac.at>, ICQ 10236103, +436505122023

--
Failure is not an option. It comes bundled with your Microsoft product.

[-- Attachment #2: Type: application/pgp-signature, Size: 232 bytes --]

             reply	other threads:[~2001-08-27 18:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-08-27 18:13 Peter Surda [this message]
2001-08-27 19:22 ` memcpy to videoram eats too much CPU on ATI cards (cache trashing?) Alan Cox
2001-08-27 21:40   ` Rogier Wolff
2001-08-27 22:01     ` Peter Surda
2001-09-06  6:18       ` (solved) memcpy to videoram eats too much CPU on ATI cards Peter Surda
2001-09-06 11:37       ` Daniel Egger
2001-09-06 13:10         ` Peter Surda

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=20010827201351.H17545@shurdeek.cb.ac.at \
    --to=shurdeek@panorama.sth.ac.at \
    --cc=linux-kernel@vger.kernel.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).