linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH] Use MTRRs by default for vesafb on x86-64
@ 2003-05-19  9:16 Etienne Lorrain
  0 siblings, 0 replies; 18+ messages in thread
From: Etienne Lorrain @ 2003-05-19  9:16 UTC (permalink / raw)
  To: linux-kernel

  Whatever the processor, you cannot use write combining MTRR
 on 16 colors / 4 BPP modes. In this mode you can copy
 8 pixels at a time by doing a simple movb, but it cannot
 handle 32 pixel copy at the same time by a movd, for instance.
 In 16 color modes, you never have a linear memory mapping
 of pixels.

  Etienne.

___________________________________________________________
Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !
Yahoo! Mail : http://fr.mail.yahoo.com

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH] Use MTRRs by default for vesafb on x86-64
  2003-05-19 10:37   ` Andi Kleen
@ 2003-05-19 12:26     ` Eric W. Biederman
  0 siblings, 0 replies; 18+ messages in thread
From: Eric W. Biederman @ 2003-05-19 12:26 UTC (permalink / raw)
  To: Andi Kleen; +Cc: kraxel, jsimmons, linux-kernel

Andi Kleen <ak@muc.de> writes:

> On Sat, May 17, 2003 at 12:58:39AM +0200, Eric W. Biederman wrote:
> > I don't know if this affects the frame buffers per se.
> > 
> > But often BIOS's on systems with large amounts of memory configure
> > overlapping mtrrs (where an uncacheable mtrr would override a larger
> > cacheable range).  To date this has confused the linux mtrr code when
> > it tries to modify things, and you cannot properly setup mtrrs.    I
> > believe this applies to both the fb case as well as X.
> 
> Interesting. Perhaps it would be really better to use change_page_attr()
> with PAT for this. It would avoid these problems.

At least for x86-64 I would recommend that, as you can count on it existing.

For normal x86 it is more interesting.  But you are less likely to run with 
lots of memory so this case is less likely to show up. I have already heard
people seriously discussing 16GB on an off the shelf on an x86-64
system.  Getting 2GB PC2700 DIMMs is still a bit of a challenge, but
the practical memory size barrier (3GB per task) is finally gone.

For x86-64 a software ``mtrr'' that maps everything the e820 map says
is memory as write-back and everything else as uncacheable by default would
be nice.  As the mtrr interface is already understood by things like X.  And
there needs to be some data structure that remembers what the page
cache-ability attributes should be.

Eric

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH] Use MTRRs by default for vesafb on x86-64
  2003-05-16 22:58 ` Eric W. Biederman
@ 2003-05-19 10:37   ` Andi Kleen
  2003-05-19 12:26     ` Eric W. Biederman
  0 siblings, 1 reply; 18+ messages in thread
From: Andi Kleen @ 2003-05-19 10:37 UTC (permalink / raw)
  To: Eric W. Biederman; +Cc: Andi Kleen, kraxel, jsimmons, linux-kernel

On Sat, May 17, 2003 at 12:58:39AM +0200, Eric W. Biederman wrote:
> I don't know if this affects the frame buffers per se.
> 
> But often BIOS's on systems with large amounts of memory configure
> overlapping mtrrs (where an uncacheable mtrr would override a larger
> cacheable range).  To date this has confused the linux mtrr code when
> it tries to modify things, and you cannot properly setup mtrrs.    I
> believe this applies to both the fb case as well as X.

Interesting. Perhaps it would be really better to use change_page_attr()
with PAT for this. It would avoid these problems.

-Andi

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH] Use MTRRs by default for vesafb on x86-64
  2003-05-19  0:28                   ` Jamie Lokier
@ 2003-05-19  1:24                     ` Dave Jones
  0 siblings, 0 replies; 18+ messages in thread
From: Dave Jones @ 2003-05-19  1:24 UTC (permalink / raw)
  To: Jamie Lokier
  Cc: Alan Cox, Andi Kleen, kraxel, jsimmons, Linux Kernel Mailing List

On Mon, May 19, 2003 at 01:28:20AM +0100, Jamie Lokier wrote:

 > > It works just fine. Just you can't enable MTRRs for framebuffer memory.
 > > Losing a bit of performance for what is (by todays standards) a crap
 > > performing card anyways, is no big deal.
 > 
 > How do you know the blacklist is complete?

no-one complains that they see random crap on their screens any more.
 
		Dave


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH] Use MTRRs by default for vesafb on x86-64
  2003-05-19  0:02                 ` Dave Jones
@ 2003-05-19  0:28                   ` Jamie Lokier
  2003-05-19  1:24                     ` Dave Jones
  0 siblings, 1 reply; 18+ messages in thread
From: Jamie Lokier @ 2003-05-19  0:28 UTC (permalink / raw)
  To: Dave Jones, Alan Cox, Andi Kleen, kraxel, jsimmons,
	Linux Kernel Mailing List

Dave Jones wrote:
>  > My point being that vesafb is used for maximum compatibility, when you
>  > have no other way to drive an unknown framebuffer.  It's the emergency
>  > backup driver.  Shouldn't it be robust when faced with an unknown
>  > framebuffer type, new or old?
> 
> It works just fine. Just you can't enable MTRRs for framebuffer memory.
> Losing a bit of performance for what is (by todays standards) a crap
> performing card anyways, is no big deal.

How do you know the blacklist is complete?

That's my point: with most drivers we accept a few surprises and
change the code, but vesafb is supposed to handle any old crap card
that's thrown at it, as robustly as possible.

-- Jamie

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH] Use MTRRs by default for vesafb on x86-64
  2003-05-18 23:33               ` Jamie Lokier
@ 2003-05-19  0:02                 ` Dave Jones
  2003-05-19  0:28                   ` Jamie Lokier
  0 siblings, 1 reply; 18+ messages in thread
From: Dave Jones @ 2003-05-19  0:02 UTC (permalink / raw)
  To: Jamie Lokier
  Cc: Alan Cox, Andi Kleen, kraxel, jsimmons, Linux Kernel Mailing List

On Mon, May 19, 2003 at 12:33:25AM +0100, Jamie Lokier wrote:

 > My point being that vesafb is used for maximum compatibility, when you
 > have no other way to drive an unknown framebuffer.  It's the emergency
 > backup driver.  Shouldn't it be robust when faced with an unknown
 > framebuffer type, new or old?

It works just fine. Just you can't enable MTRRs for framebuffer memory.
Losing a bit of performance for what is (by todays standards) a crap
performing card anyways, is no big deal.

		Dave


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH] Use MTRRs by default for vesafb on x86-64
  2003-05-18 22:52             ` Dave Jones
@ 2003-05-18 23:33               ` Jamie Lokier
  2003-05-19  0:02                 ` Dave Jones
  0 siblings, 1 reply; 18+ messages in thread
From: Jamie Lokier @ 2003-05-18 23:33 UTC (permalink / raw)
  To: Dave Jones, Alan Cox, Andi Kleen, kraxel, jsimmons,
	Linux Kernel Mailing List

Dave Jones wrote:
>  > If that's the problem, a test which writes a data pattern to a
>  > significant chunk of video RAM in sequence, as fast as possible, and
>  > then reads it would be practically guaranteed to spot this and
>  > indicate that MTRRs aren't suitable for this card in this mode.
> 
> Or you could just add the PCI ID to the quirks list..

My point being that vesafb is used for maximum compatibility, when you
have no other way to drive an unknown framebuffer.  It's the emergency
backup driver.  Shouldn't it be robust when faced with an unknown
framebuffer type, new or old?

Granted if there are only two cards with this problem and we are
confident that no other cards have the problem, a PCI ID would do it.

-- Jamie


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH] Use MTRRs by default for vesafb on x86-64
  2003-05-18 22:34           ` Jamie Lokier
@ 2003-05-18 22:52             ` Dave Jones
  2003-05-18 23:33               ` Jamie Lokier
  0 siblings, 1 reply; 18+ messages in thread
From: Dave Jones @ 2003-05-18 22:52 UTC (permalink / raw)
  To: Jamie Lokier
  Cc: Alan Cox, Andi Kleen, kraxel, jsimmons, Linux Kernel Mailing List

On Sun, May 18, 2003 at 11:34:46PM +0100, Jamie Lokier wrote:

 > If that's the problem, a test which writes a data pattern to a
 > significant chunk of video RAM in sequence, as fast as possible, and
 > then reads it would be practically guaranteed to spot this and
 > indicate that MTRRs aren't suitable for this card in this mode.

Or you could just add the PCI ID to the quirks list..

		Dave


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH] Use MTRRs by default for vesafb on x86-64
  2003-05-18 20:40         ` Alan Cox
@ 2003-05-18 22:34           ` Jamie Lokier
  2003-05-18 22:52             ` Dave Jones
  0 siblings, 1 reply; 18+ messages in thread
From: Jamie Lokier @ 2003-05-18 22:34 UTC (permalink / raw)
  To: Alan Cox
  Cc: Andi Kleen, Dave Jones, kraxel, jsimmons, Linux Kernel Mailing List

Alan Cox wrote:
> > What exactly "doesn't work" with these cards?
> 
> If you sent an MTRR you get crap on the display. I'm not sure if that is
> registers being covered (seems dubious) or other PCI problems perhaps
> with bursts

Is it consistently bad, or is it just an occasional glitch, pixel here
or there that goes wrong?

I like your suggestion of PCI bursts - perhaps the card's FIFO to
video RAM overflows due to RAM being too slow or too busy for display
reads.  It seems quite plausible.  It might even depend on the video mode.

If that's the problem, a test which writes a data pattern to a
significant chunk of video RAM in sequence, as fast as possible, and
then reads it would be practically guaranteed to spot this and
indicate that MTRRs aren't suitable for this card in this mode.

-- Jamie


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH] Use MTRRs by default for vesafb on x86-64
  2003-05-18 16:11       ` Jamie Lokier
@ 2003-05-18 20:40         ` Alan Cox
  2003-05-18 22:34           ` Jamie Lokier
  0 siblings, 1 reply; 18+ messages in thread
From: Alan Cox @ 2003-05-18 20:40 UTC (permalink / raw)
  To: Jamie Lokier
  Cc: Andi Kleen, Dave Jones, kraxel, jsimmons, Linux Kernel Mailing List

On Sul, 2003-05-18 at 17:11, Jamie Lokier wrote:
> > Can you provide PCI info for them to add a quirk ? 
> 
> What exactly "doesn't work" with these cards?

If you sent an MTRR you get crap on the display. I'm not sure if that is
registers being covered (seems dubious) or other PCI problems perhaps
with bursts


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH] Use MTRRs by default for vesafb on x86-64
  2003-05-18  5:39     ` Andi Kleen
@ 2003-05-18 16:11       ` Jamie Lokier
  2003-05-18 20:40         ` Alan Cox
  0 siblings, 1 reply; 18+ messages in thread
From: Jamie Lokier @ 2003-05-18 16:11 UTC (permalink / raw)
  To: Andi Kleen
  Cc: Alan Cox, Dave Jones, kraxel, jsimmons, Linux Kernel Mailing List

Andi Kleen wrote:
> On Fri, May 16, 2003 at 10:51:36PM +0200, Alan Cox wrote:
> > On Iau, 2003-05-15 at 16:16, Dave Jones wrote:
> > > There are PCI ET4000's too.  Though if we can get the PCI IDs for those,
> > > we can work around them with a quirk.  I have one *somewhere*, but it'll
> > > take me a while to dig it out.
> > 
> > Some older SiS cards have problems too. I have a 6326 that doesn't work
> > with sisfb (too old) and vesafb with mtrr fails.
> 
> Can you provide PCI info for them to add a quirk ? 

What exactly "doesn't work" with these cards?

I'm thinking that the only way write-combining MTRRs could possibly
break a framebuffer is if part of the address range is used as a
register bank - otherwise, to the card, it just looks like well
written rendering code.

If this is so, then it might be possible to set write-combining MTRRs
while the framebuffer is operating, but to temporarily disable those
MTRRs while calling into the VESA BIOS code, for these cards.

And if that does work, then it might even be reasonable to temporarily
disable the MTRRs while calling the BIOS for all vesafb cards, thus
removing the need for a blacklist -- which is a headache for something
that needs to be as portable to unknown cards as vesafb.

-- Jamie



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH] Use MTRRs by default for vesafb on x86-64
  2003-05-16 20:51   ` Alan Cox
@ 2003-05-18  5:39     ` Andi Kleen
  2003-05-18 16:11       ` Jamie Lokier
  0 siblings, 1 reply; 18+ messages in thread
From: Andi Kleen @ 2003-05-18  5:39 UTC (permalink / raw)
  To: Alan Cox
  Cc: Dave Jones, Andi Kleen, kraxel, jsimmons, Linux Kernel Mailing List

On Fri, May 16, 2003 at 10:51:36PM +0200, Alan Cox wrote:
> On Iau, 2003-05-15 at 16:16, Dave Jones wrote:
> > There are PCI ET4000's too.  Though if we can get the PCI IDs for those,
> > we can work around them with a quirk.  I have one *somewhere*, but it'll
> > take me a while to dig it out.
> 
> Some older SiS cards have problems too. I have a 6326 that doesn't work
> with sisfb (too old) and vesafb with mtrr fails.

Can you provide PCI info for them to add a quirk ? 

-Andi

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH] Use MTRRs by default for vesafb on x86-64
  2003-05-15 14:56 Andi Kleen
  2003-05-15 15:16 ` Dave Jones
@ 2003-05-16 22:58 ` Eric W. Biederman
  2003-05-19 10:37   ` Andi Kleen
  1 sibling, 1 reply; 18+ messages in thread
From: Eric W. Biederman @ 2003-05-16 22:58 UTC (permalink / raw)
  To: Andi Kleen; +Cc: kraxel, jsimmons, linux-kernel

Andi Kleen <ak@muc.de> writes:

> x86-64 cannot call the 32bit VESA BIOS. This means when vesafb is active
> it does software copying in the vesa frame buffer. This is insanely slow
> when the frame buffer is not marked for write combining. 
> 
> Some discussion showed that the use_mtrr flag was only off for some 
> old broken ET4000 ISA card. x86-64 has no ISA, so this is no concern.
> Make the default depend on CONFIG_ISA. 
> 
> Patch for 2.5.69.  Originally suggested by Gerd Knorr.

I don't know if this affects the frame buffers per se.

But often BIOS's on systems with large amounts of memory configure
overlapping mtrrs (where an uncacheable mtrr would override a larger
cacheable range).  To date this has confused the linux mtrr code when
it tries to modify things, and you cannot properly setup mtrrs.    I
believe this applies to both the fb case as well as X.

Eric

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH] Use MTRRs by default for vesafb on x86-64
  2003-05-15 15:16 ` Dave Jones
  2003-05-15 15:20   ` Andi Kleen
@ 2003-05-16 20:51   ` Alan Cox
  2003-05-18  5:39     ` Andi Kleen
  1 sibling, 1 reply; 18+ messages in thread
From: Alan Cox @ 2003-05-16 20:51 UTC (permalink / raw)
  To: Dave Jones; +Cc: Andi Kleen, kraxel, jsimmons, Linux Kernel Mailing List

On Iau, 2003-05-15 at 16:16, Dave Jones wrote:
> There are PCI ET4000's too.  Though if we can get the PCI IDs for those,
> we can work around them with a quirk.  I have one *somewhere*, but it'll
> take me a while to dig it out.

Some older SiS cards have problems too. I have a 6326 that doesn't work
with sisfb (too old) and vesafb with mtrr fails.


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH] Use MTRRs by default for vesafb on x86-64
  2003-05-15 15:20   ` Andi Kleen
@ 2003-05-15 15:25     ` Dave Jones
  0 siblings, 0 replies; 18+ messages in thread
From: Dave Jones @ 2003-05-15 15:25 UTC (permalink / raw)
  To: Andi Kleen; +Cc: kraxel, jsimmons, linux-kernel

On Thu, May 15, 2003 at 05:20:11PM +0200, Andi Kleen wrote:

 > > There are PCI ET4000's too.  Though if we can get the PCI IDs for those,
 > > we can work around them with a quirk.  I have one *somewhere*, but it'll
 > > take me a while to dig it out.
 > 
 > To make all 0.001 users left of them happy yes. I think the patch should
 > be applied anyways.

Agreed.

		Dave


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH] Use MTRRs by default for vesafb on x86-64
  2003-05-15 15:16 ` Dave Jones
@ 2003-05-15 15:20   ` Andi Kleen
  2003-05-15 15:25     ` Dave Jones
  2003-05-16 20:51   ` Alan Cox
  1 sibling, 1 reply; 18+ messages in thread
From: Andi Kleen @ 2003-05-15 15:20 UTC (permalink / raw)
  To: Dave Jones, Andi Kleen, kraxel, jsimmons, linux-kernel

On Thu, May 15, 2003 at 05:16:33PM +0200, Dave Jones wrote:
> On Thu, May 15, 2003 at 04:56:40PM +0200, Andi Kleen wrote:
> 
>  > x86-64 cannot call the 32bit VESA BIOS. This means when vesafb is active
>  > it does software copying in the vesa frame buffer. This is insanely slow
>  > when the frame buffer is not marked for write combining. 
>  > 
>  > Some discussion showed that the use_mtrr flag was only off for some 
>  > old broken ET4000 ISA card. x86-64 has no ISA, so this is no concern.
>  > Make the default depend on CONFIG_ISA. 
> 
> There are PCI ET4000's too.  Though if we can get the PCI IDs for those,
> we can work around them with a quirk.  I have one *somewhere*, but it'll
> take me a while to dig it out.

To make all 0.001 users left of them happy yes. I think the patch should
be applied anyways.

-Andi

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH] Use MTRRs by default for vesafb on x86-64
  2003-05-15 14:56 Andi Kleen
@ 2003-05-15 15:16 ` Dave Jones
  2003-05-15 15:20   ` Andi Kleen
  2003-05-16 20:51   ` Alan Cox
  2003-05-16 22:58 ` Eric W. Biederman
  1 sibling, 2 replies; 18+ messages in thread
From: Dave Jones @ 2003-05-15 15:16 UTC (permalink / raw)
  To: Andi Kleen; +Cc: kraxel, jsimmons, linux-kernel

On Thu, May 15, 2003 at 04:56:40PM +0200, Andi Kleen wrote:

 > x86-64 cannot call the 32bit VESA BIOS. This means when vesafb is active
 > it does software copying in the vesa frame buffer. This is insanely slow
 > when the frame buffer is not marked for write combining. 
 > 
 > Some discussion showed that the use_mtrr flag was only off for some 
 > old broken ET4000 ISA card. x86-64 has no ISA, so this is no concern.
 > Make the default depend on CONFIG_ISA. 

There are PCI ET4000's too.  Though if we can get the PCI IDs for those,
we can work around them with a quirk.  I have one *somewhere*, but it'll
take me a while to dig it out.

		Dave


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH] Use MTRRs by default for vesafb on x86-64
@ 2003-05-15 14:56 Andi Kleen
  2003-05-15 15:16 ` Dave Jones
  2003-05-16 22:58 ` Eric W. Biederman
  0 siblings, 2 replies; 18+ messages in thread
From: Andi Kleen @ 2003-05-15 14:56 UTC (permalink / raw)
  To: kraxel, jsimmons, linux-kernel


x86-64 cannot call the 32bit VESA BIOS. This means when vesafb is active
it does software copying in the vesa frame buffer. This is insanely slow
when the frame buffer is not marked for write combining. 

Some discussion showed that the use_mtrr flag was only off for some 
old broken ET4000 ISA card. x86-64 has no ISA, so this is no concern.
Make the default depend on CONFIG_ISA. 

Patch for 2.5.69.  Originally suggested by Gerd Knorr.

-Andi

--- linux/drivers/video/vesafb.c	2003-05-08 04:52:58.000000000 +0200
+++ linux-2.5.69-amd64/drivers/video/vesafb.c	2003-05-15 16:55:51.000000000 +0200
@@ -51,7 +51,11 @@
 static u32 pseudo_palette[17];
 
 static int             inverse   = 0;
+#ifndef CONFIG_ISA 
+static int 	      mtrr	 = 1;
+#else
 static int             mtrr      = 0;
+#endif
 
 static int             pmi_setpal = 0;	/* pmi for palette changes ??? */
 static int             ypan       = 0;  /* 0..nothing, 1..ypan, 2..ywrap */





^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2003-05-19 12:17 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-19  9:16 [PATCH] Use MTRRs by default for vesafb on x86-64 Etienne Lorrain
  -- strict thread matches above, loose matches on Subject: below --
2003-05-15 14:56 Andi Kleen
2003-05-15 15:16 ` Dave Jones
2003-05-15 15:20   ` Andi Kleen
2003-05-15 15:25     ` Dave Jones
2003-05-16 20:51   ` Alan Cox
2003-05-18  5:39     ` Andi Kleen
2003-05-18 16:11       ` Jamie Lokier
2003-05-18 20:40         ` Alan Cox
2003-05-18 22:34           ` Jamie Lokier
2003-05-18 22:52             ` Dave Jones
2003-05-18 23:33               ` Jamie Lokier
2003-05-19  0:02                 ` Dave Jones
2003-05-19  0:28                   ` Jamie Lokier
2003-05-19  1:24                     ` Dave Jones
2003-05-16 22:58 ` Eric W. Biederman
2003-05-19 10:37   ` Andi Kleen
2003-05-19 12:26     ` Eric W. Biederman

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).