Re: [linux-audio-dev] Low latency and X11 Direct Rendering

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: Re: [linux-audio-dev] Low latency and X11 Direct Rendering
From: Enrique Robledo Arnuncio (erobledo_AT_iua.upf.es)
Date: Thu Jun 06 2002 - 00:46:07 EEST


On Wed, Jun 05, 2002 at 02:42:18PM -0700, Andrew Morton wrote:
> A number of PCI video cards hang onto the PCI bus
> for outrageous amounts of time. It gives better
> benchmarks in Windows magazines.
>
> You may be getting bitten by this; dunno. Some xfree drivers
> have an option to not use this (mis)feature.
>

I was starting to fear some kind of hardware problem like this, but
fortunately Matrox seems to be of a different kind...

I have just received a message from Fernando Pablo Lopez-Lezcano
including a patch to the drm driver which fixes it:

BEFORE the patch:

> fragment latency = 1.451247 ms
> cpu latency = 1.160998 ms
> 6.5ms (350)|
> 1MS num_time_samples=44425 num_times_within_1ms=44075 factor=99.212155
> 2MS num_time_samples=44425 num_times_within_2ms=44075 factor=99.212155

AFTER the patch:

> fragment latency = 1.451247 ms
> cpu latency = 1.160998 ms
> 1.7ms ( 0)|
> 1MS num_time_samples=45925 num_times_within_1ms=45925 factor=100.000000
> 2MS num_time_samples=45925 num_times_within_2ms=45925 factor=100.000000

Fernando has posted to the list, but it seems his message is being
delayed. This is a summary of it:

On Wed, Jun 05, 2002 at 02:25:17PM -0700, Fernando Pablo Lopez-Lezcano wrote:
> I did find some problems with the dri interface and found a
> patch inside Jussi Laako's patchset (jussi.laako_AT_kolumbus.fi)
> that fixed it (I was testing with latencytest 0.42). See:
> http://www.pp.song.fi/~visitor/linux/

And below is the part of the patch I have applied (into a 2.4.17 kernel
source).

Thank you all!

   Enrique.

-------

diff -urN linux-2.4.19-pre7/drivers/char/drm/mga_dma.c
linux-2.4.19-pre7-jl1-ll/drivers/char/drm/mga_dma.c
--- linux-2.4.19-pre7/drivers/char/drm/mga_dma.c Wed Aug 8 19:42:15 2001
+++ linux-2.4.19-pre7-jl1-ll/drivers/char/drm/mga_dma.c Mon Apr 29 01:23:18 2002
@@ -61,6 +61,7 @@
                         MGA_WRITE8( MGA_CRTC_INDEX, 0 );
                         return 0;
                 }
+ conditional_schedule();
                 udelay( 1 );
         }

@@ -80,6 +81,7 @@
         for ( i = 0 ; i < dev_priv->usec_timeout ; i++ ) {
                 status = MGA_READ( MGA_STATUS ) & MGA_DMA_IDLE_MASK;
                 if ( status == MGA_ENDPRDMASTS ) return 0;
+ conditional_schedule();
                 udelay( 1 );
         }

@@ -121,6 +123,7 @@
          * How about we clean up after ourselves?
          */
         MGA_WRITE( MGA_RST, MGA_SOFTRESET );
+ conditional_schedule(); /* We shouldn't get here anyway... */
         udelay( 15 ); /* Wait at least 10 usecs */
         MGA_WRITE( MGA_RST, 0 );


New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : Thu Jun 06 2002 - 01:43:40 EEST