Re: Slow Xv performance on 256AV aka NM2200
Diego SANTA CRUZ <[email protected]> 05 Dec 2002 19:35:05 +0100
| Newsgroups | gmane.comp.xfree86.neomagic |
|---|---|
| Organization | Ecole Polytechnique F??d??rale de Lausanne - EPFL |
| Message-ID | <[email protected]> |
> I'm having problems getting full framerates playing a DVD with the
> neomagic driver (I currently get about 18-20 fps). There seems to be a
> *huge* slowdown when writing to overlay memory, due to two (correct)
> writes in NEOCopyYV12Data().
[snip.]
>
> As it stands, the X server consumes 40-50% of the CPU while trying to
> play a DVD or vob file with vlc/ogle/xine. I narrowed down the slowdown
> to two writes to overlay memory in NEOCopyYV12Data(). If I change it not
> to write to overlay memory but to write to a temporary variable instead
> (see following diff), the X server then consumes virtually 0% of CPU
> (according to top). Of course it's not very useful this way, but it
> shows where the bottleneck is.
>
I think your patch does not prove much, except that the time is spent in
the patched function. As far as I can see an optimising compiler will
remove the entire loop, since tmp is not used anywhere outside the loop.
Even if tmp was used it could optimize all but the last iteration of the
loop. Maybe you could try to somewhere else in main memory.
>
> --- neo_video.c Tue Dec 3 12:51:58 2002
> +++ neo_video.c.hack Tue Dec 3 12:52:26 2002
> @@ -1037,6 +1037,7 @@
> int height, int width)
> {
> CARD32 *pDst = (CARD32 *) dst;
> + CARD32 tmp;
> int i;
>
> width >>= 1;
> @@ -1045,14 +1046,14 @@
> while (--height >= 0){
>
> for (i =0; i < width; i++){
> - pDst[i] = src1[i << 1] | (src1[(i << 1) + 1] << 16) |
> + tmp = src1[i << 1] | (src1[(i << 1) + 1] << 16) |
> (src3[i] << 8) | (src2[i] << 24);
> }
> pDst += dstPitch;
> src1 += srcPitch1;
>
> for (i =0; i < width; i++){
> - pDst[i] = src1[i << 1] | (src1[(i << 1) + 1] << 16) |
> + tmp = src1[i << 1] | (src1[(i << 1) + 1] << 16) |
> (src3[i] << 8) | (src2[i] << 24);
> }
> pDst += dstPitch;
>
> So the question is, why do these writes chew so much CPU time? Is there
> some AGP knob that needs to be set or something? Any help would be
> greatly appreciated.
I think the neomagic driver does not use AGP (but I might be wrong here
as I know next to nothing about it). On my machine (HP Omnibook 4150) I
cannot get AGP for the NM2200 to work because the BIOS does not
initialise the aperture base register of the AGP controller.
25 fps requires 16 MB/sec (20MB/sec for 30 fps) for 720*480*2
resolution. The PCI bandwidth should be more than 100 MB/sec so it
should be enough.
Diego
--
-------------------------------------------------------
Diego Santa Cruz
PhD. student
Publications available at http://ltswww.epfl.ch/~dsanta
Signal Processing Institute (LTS1 / ITS / STI)
Swiss Federal Institute of Technology (EPFL)
EPFL - STI - ITS, CH-1015 Lausanne, Switzerland
E-mail: [email protected]
Phone: +41 - 21 - 693 26 57
Fax: +41 - 21 - 693 76 00
-------------------------------------------------------