vesa linear framebuffer - Xwindows
This is a discussion on vesa linear framebuffer - Xwindows ; Hi
If i have a bmp in memory, and i want to ask the display card to
draw it out to the screen. can linear framebuffer do that ofr me?
thanks
from Peter (cmk128@hotmail.com...
-
vesa linear framebuffer
Hi
If i have a bmp in memory, and i want to ask the display card to
draw it out to the screen. can linear framebuffer do that ofr me?
thanks
from Peter (cmk128@hotmail.com
-
Re: vesa linear framebuffer
wrote in message
news:1167730653.456507.14890@s34g2000cwa.googlegro ups.com...
> Hi
> If i have a bmp in memory, and i want to ask the display card to
> draw it out to the screen. can linear framebuffer do that ofr me?
> thanks
> from Peter (cmk128@hotmail.com
No. VESA doesn't handle bitmap formats.
However, since BMPs are easy to parse, it is quite easy to display them.
There are a few things to take care of first. Ideally, the RGB format of
your screen should be the same as the one in BMPs. If not -- and you should
always check, since different video cards use different layouts -- you
should write a conversion routine and apply that on the bitmap in memory.
After that, you can copy entire rows from memory to the screen. You can also
reverse the BMP up-down in memory (BMPs are typically stored upside-down in
files) and try a faster block copy, but it's probably not worth the trouble.
But it makes updating parts of the screen a bit easier.
A caveat to watch for is the scan line alignment of BMPs (always filled up
to 4 pixels); then again, your screen buffer may have an alignment of its
own.
[Jongware]
-
Re: vesa linear framebuffer
[Jongware] ¼g¹D¡G
> wrote in message
> news:1167730653.456507.14890@s34g2000cwa.googlegro ups.com...
> > Hi
> > If i have a bmp in memory, and i want to ask the display card to
> > draw it out to the screen. can linear framebuffer do that ofr me?
> > thanks
> > from Peter (cmk128@hotmail.com
>
> No. VESA doesn't handle bitmap formats.
> However, since BMPs are easy to parse, it is quite easy to display them.
> There are a few things to take care of first. Ideally, the RGB format of
> your screen should be the same as the one in BMPs. If not -- and you should
> always check, since different video cards use different layouts -- you
> should write a conversion routine and apply that on the bitmap in memory.
> After that, you can copy entire rows from memory to the screen. You can also
> reverse the BMP up-down in memory (BMPs are typically stored upside-down in
> files) and try a faster block copy, but it's probably not worth the trouble.
> But it makes updating parts of the screen a bit easier.
> A caveat to watch for is the scan line alignment of BMPs (always filled up
> to 4 pixels); then again, your screen buffer may have an alignment of its
> own.
>
> [Jongware]
Hi Jongware
My problem is that, if i draw a 800x600 bitmap to screen, i need to
loop 800x600 times, it is too slow. So how can we use vesa to fix this
problem¡H
thanks
from Peter (cmk128@hotmail.com)
-
Re: vesa linear framebuffer
cmk128@hotmail.com wrote:
....
> My problem is that, if i draw a 800x600 bitmap to screen, i need to
> loop 800x600 times, it is too slow. So how can we use vesa to fix this
> problem
Hi Peter,
What are you doing 800 * 600 times? You don't want to be calculating y *
width + x for every pixel! If you're bank-switching, you don't want to
be doing that for every pixel. In an earlier post, you mention a
framerate of 2/sec. Yup, that's too slow!
Where "are" we? I know we're in your own OS (right?), but... still real
mode, or have we switched to pmode? Have you got the video card in 800 *
600 (* some depth)? With linear frame buffer? Or is that what you need
to do?
That won't get you "hardware acceleration", but... even with bank
switching, you ought to be able to get it going "acceptably" fast.
Best,
Frank
-
Re: vesa linear framebuffer
Frank Kotler wrote:
> cmk128@hotmail.com wrote:
>
> ...
> > My problem is that, if i draw a 800x600 bitmap to screen, i need to
> > loop 800x600 times, it is too slow. So how can we use vesa to fix this
> > problem
>
> Hi Peter,
>
> What are you doing 800 * 600 times? You don't want to be calculating y *
> width + x for every pixel! If you're bank-switching, you don't want to
> be doing that for every pixel. In an earlier post, you mention a
> framerate of 2/sec. Yup, that's too slow!
>
> Where "are" we? I know we're in your own OS (right?), but... still real
> mode, or have we switched to pmode? Have you got the video card in 800 *
> 600 (* some depth)? With linear frame buffer? Or is that what you need
> to do?
>
> That won't get you "hardware acceleration", but... even with bank
> switching, you ought to be able to get it going "acceptably" fast.
>
> Best,
> Frank
Thank you Frank for reading
Supposed i am in protected mode, some people mentioned the
"clipping method" in the earlier post. But i still don't understand, if
i want to update part of the screen, what i need to do is copy the all
pixels to display memory, that means if i want to update 400x400 , then
i need to loop 400x400 times (if the hardware doesn't help me). This is
very very slow, i want to know, can i just call a vesa function and it
helps me to do it.
SO FAR I KNOW, VESA LINEAR BUFFER IS NOT THE SOLUTION 
thanks again
from Peter
-
Re: vesa linear framebuffer
wrote in message
news:1167884330.353459.43160@i80g2000cwc.googlegro ups.com...
> Frank Kotler wrote:
>> cmk128@hotmail.com wrote:
>> ...
>> > My problem is that, if i draw a 800x600 bitmap to screen, i need to
>> > loop 800x600 times, it is too slow. So how can we use vesa to fix this
>> > problem
>>
>> What are you doing 800 * 600 times? You don't want to be calculating y *
>> width + x for every pixel! If you're bank-switching, you don't want to
>> be doing that for every pixel. In an earlier post, you mention a
>> framerate of 2/sec. Yup, that's too slow!
>>
>> Where "are" we? I know we're in your own OS (right?), but... still real
>> mode, or have we switched to pmode? Have you got the video card in 800 *
>> 600 (* some depth)? With linear frame buffer? Or is that what you need
>> to do?
>>
>> That won't get you "hardware acceleration", but... even with bank
>> switching, you ought to be able to get it going "acceptably" fast.
....
> Supposed i am in protected mode, some people mentioned the
> "clipping method" in the earlier post. But i still don't understand, if
> i want to update part of the screen, what i need to do is copy the all
> pixels to display memory, that means if i want to update 400x400 , then
> i need to loop 400x400 times (if the hardware doesn't help me). This is
> very very slow, i want to know, can i just call a vesa function and it
> helps me to do it.
> SO FAR I KNOW, VESA LINEAR BUFFER IS NOT THE SOLUTION 
"Linear buffer" is not "a solution" at all. It is simply the easiest memory
layout to copy to. And AFAIK, there are no VESA functions to block-copy. You
might want to google for the VBE3 specs, though.
You are wrong in the "very very" slow. I'm quite surprised 800x600, even if
it were true color, copies at a measly 2fps. Even using plain rep mosvd it
is possible to update in realtime.
[Jongware]
-
Re: vesa linear framebuffer
> If i have a bmp in memory, and i want to ask the display card to
> draw it out to the screen. can linear framebuffer do that ofr me?
No, the linear framebuffer only allows the CPU to access the whole
framebuffer in one continuous address space.
If a VGA compatible address space has to be used (using a 64KB windows), a
framebuffer large than 64KB need some form of memory-bank switching to get
access to a particular part of the framebuffer.
In either way, you have to transfer the data from memory to the framebuffer
yourself. Preferably with the fastest data transfer instructions possible
(e.g REP MOVSD or some MMX/SSE instructions).
A linear framebuffers helps to simplify the code to do the work, it won't
make is necessarily faster.
H.