Variable video ram size option
Quoted 25 lines
Quoted 5 lines · Trolle Selander
/ Paul Brook wrote:/
/ >>Trying hard to think up a use for more than 16 Megs in the current case,/
/ >> /
/ >/
/ >I'm pretty sure the current device allows the guest to do page flipping /Quoted 8 lines
/ >(using an oversize virtual framebuffer)./
/ >/
/ >Paul/
/ > /
/ I could have sworn I checked that at some point and found that it/ / didn't, but looking at the vgabios code now it looks like it's all/ / implemented. That definitely bumps the useable limit to 32 Megs even in/ / the current case. Thanks for catching this, I'll add it to the fix list./For games _triple_ buffering is a common technique when there's enough RAM.
With double buffering, after you flip away from screen 0 to screen 1, you have to pause until the next vsync before it's safe to draw a new image on screen 0.
With triple buffering, this pause isn't required which makes games (etc.) able to run at a higher average frame rate.
Quoted 9 lines
(More buffers can smooth the average further, which is more useful when playing video than games, because it adds latency but hides individual frame drawing time spikes. But it's not that useful. Triple buffering is relatively common though.)
So there's a use for 3 screens in the virtual framebuffer - 48 MB?
-- Jamie
While I have my doubts about there being any applications or games using VBE & triple buffering that will actually run at 2560x1600 with any kind of decent performance , I also see no reason to set this limit any lower than the theoretically usable max, so 48 Megs it is.
-- Trolle
Quoted 4 lines
While I have my doubts about there being any applications or games using VBE & triple buffering that will actually run at 2560x1600 with any kind of decent performance , I also see no reason to set this limit any lower than the theoretically usable max, so 48 Megs it is.
You're missing the point. There is no "usable max". The only limits are those implied by 16-bit coordinates, address space, and the imagination of the programmer.
Paul
Quoted 11 lines · Paul Brook
Quoted 5 lines
While I have my doubts about there being any applications or games using VBE & triple buffering that will actually run at 2560x1600 with any kind of decent performance , I also see no reason to set this limit any lower than the theoretically usable max, so 48 Megs it is.
You're missing the point. There is no "usable max". The only limits are those implied by 16-bit coordinates, address space, and the imagination of the programmer.
Paul
True, but my thought was mainly that most of these "vram tricks" are very unlikely to be used by any software run in the VM and thus ending up going to waste and moreover (probably) pointless in a virtual architecture where there is no slow bus between videocard ram and system ram.
In any case, the discussion here has made me reconsider whether we should not enforce any "artificial" limit, and just put recommendations for "sane" in the manpage, since ultimately, my reason for putting the limit in was mostly to prevent users from naively allocationg "pointless" amounts of vram that will almost certainly be wasted. The amounts of "graphic card ram" common today might easily cause new users to make this mistake. What's everyone else's thoughts on this? I'm preparing a slightly updated version of the patch, and I'd like to hear whether everyone agrees there should be no artificial limit enforced.
Just out of curiosity, does anyone have any example of an existing application using VBE that makes use of more than triple-buffered (xres * yres * 4) RAM?
-- Trolle
Quoted 3 lines
Just out of curiosity, does anyone have any example of an existing application using VBE that makes use of more than triple-buffered (xres
* yres * 4) RAM?
I suspect you'll struggle to find *any* serious application that uses VBE nowadays.
Paul
Quoted 10 lines · Paul Brook
Quoted 4 lines
Just out of curiosity, does anyone have any example of an existing application using VBE that makes use of more than triple-buffered (xres
* yres * 4) RAM?I suspect you'll struggle to find *any* serious application that uses VBE nowadays.
Paul
Maybe "application that uses VBE" was a bad way to put it. If I re-phrase the question as "Does anyone know whether there's any application running under the X "vesa" driver or the Windows "Generic VGA" or similar unaccellerated driver that makes use of a larger than triple-buffered (xres * yres * 4) linear framebuffer, or whether the unaccellerated drivers themselves do so in any way?" it will yield more interesting answers. :)
-- Trolle
Quoted 7 lines · Trolle Selander
Maybe "application that uses VBE" was a bad way to put it. If I re-phrase the question as "Does anyone know whether there's any application running under the X "vesa" driver or the Windows "Generic VGA" or similar unaccellerated driver that makes use of a larger than triple-buffered (xres * yres * 4) linear framebuffer, or whether the unaccellerated drivers themselves do so in any way?" it will yield more interesting answers. :)
I think the Linux "vesafb" driver uses all available VRAM for scrolling in draws-text-on-graphic-framebuffer mode.
-- Jamie
Quoted 11 lines · Jamie Lokier
Quoted 7 lines · Trolle Selander
Maybe "application that uses VBE" was a bad way to put it. If I re-phrase the question as "Does anyone know whether there's any application running under the X "vesa" driver or the Windows "Generic VGA" or similar unaccellerated driver that makes use of a larger than triple-buffered (xres * yres * 4) linear framebuffer, or whether the unaccellerated drivers themselves do so in any way?" it will yield more interesting answers. :)
I think the Linux "vesafb" driver uses all available VRAM for scrolling in draws-text-on-graphic-framebuffer mode.
But only with ypan enabled, which wasn't the default when I took a look the last time.
Signature · 2 lines
René Rebe - ExactCODE GmbH - Europe, Germany, Berlin http://exactcode.de | http://t2-project.org | http://rene.rebe.name
Quoted 5 lines · Rene Rebe
Quoted 2 lines
I think the Linux "vesafb" driver uses all available VRAM for scrolling in draws-text-on-graphic-framebuffer mode.
But only with ypan enabled, which wasn't the default when I took a look the last time.
That's right.
I don't know why "ypan" is off by default; it's hard to imagine it not working on anything vaguely VBE-like, or even VESA (pre-VBE), since a lot of DOS games need the panning feature to work for double/triple buffering.
If you're using Linux guest with VESA framebuffer console, rather than a text-mode console, I'd recommend kernel boot option "video=vesafb:ypan", to save considerable CPU when scrolling the console.
I don't know if "video=vesafb:ywrap" works on the QEMU VBE emulation. That'd be better.
-- Jamie
Quoted 2 lines
-- René Rebe - ExactCODE GmbH - Europe, Germany, Berlin
http://exactcode.de | http://t2-project.org | http://rene.rebe.name
Quoted 1 line · Jamie Lokier
I don't know why "ypan" is off by default;
Performance. When reaching the end of video memory ypan does a memcpy on the framebuffer. ywrap doesn't need the memcpy, but doesn't work on all hardware. The memcpy is painful slow because framebuffer *read* access isn't something gfx cards are optimized for.
Quoted 3 lines
If you're using Linux guest with VESA framebuffer console, rather than a text-mode console, I'd recommend kernel boot option "video=vesafb:ypan", to save considerable CPU when scrolling the console.
Should work inside qemu because you should not face the slow-reads issue then. On real hardware it very likely makes scrolling noticeable slower.
cheers,
Gerd
Quoted 7 lines · Gerd Hoffmann
Quoted 1 line · Jamie Lokier
I don't know why "ypan" is off by default;
Performance. When reaching the end of video memory ypan does a memcpy on the framebuffer. ywrap doesn't need the memcpy, but doesn't work on all hardware. The memcpy is painful slow because framebuffer *read* access isn't something gfx cards are optimized for.
Why read the framebuffer at all? In fact why even redraw everything, when you can redraw only the text which changes during scroll, which is what vesafb does by default for normal scrolling?
Quoted 6 lines
Quoted 3 lines
If you're using Linux guest with VESA framebuffer console, rather than a text-mode console, I'd recommend kernel boot option "video=vesafb:ypan", to save considerable CPU when scrolling the console.
Should work inside qemu because you should not face the slow-reads issue then. On real hardware it very likely makes scrolling noticeable slower.
My experience with real hardware is it makes scrolling noticably faster.
-- Jamie
Quoted 9 lines · Jamie Lokier
Quoted 6 lines · Gerd Hoffmann
Quoted 1 line · Jamie Lokier
I don't know why "ypan" is off by default;
Performance. When reaching the end of video memory ypan does a memcpy on the framebuffer. ywrap doesn't need the memcpy, but doesn't work on all hardware. The memcpy is painful slow because framebuffer *read* access isn't something gfx cards are optimized for.
Why read the framebuffer at all?
Has been quite a while that I looked closer at the fb code and followed fb development.
IIRC it has to do something with the scrollback (Shift-PgUp/Down)
implementation: The video memory is used as scrollback buffer. Thus some information is kept in the video memory *only*.
Quoted 1 line
My experience with real hardware is it makes scrolling noticably faster.
Well, maybe it has been changed then. I remember having seen some discussion on changing the scrollback implementation to not depend on video memory, which could have fixed this too.
cheers,
Gerd