Re: [maemo-developers] SDL vertical blank (vbl) sync.

2006-05-30 Thread Eero Tamminen
Hi,

> Yes. So to draw without tearing effect either X of framebuffer driver
> should report when to draw (vblank period or which line is currently
> drawn by hardware)

Another possibility is that (SDL) application could ask X server to
ask Framebuffer to flush the framebuffer contents to the LCD controller
when it's done with a frame.  It might even do that directly by calling
the fb ioctls (if there would be such ioctl and it would have access
rights to do it).

AFAIK the framebuffer doesn't have constant update rate to the LCD and
it doesn't immediately push every framebuffer update to the LCD controller.
It does updates only if the framebuffer contents have been updated
(there's an ioctl to tell that) and there's a certain amount of time
since last update.  So, if application could force the framebuffer
flush, it would have time to update the screen before the next
(automated or application forced) flushing happens.


> or the controller has to have two buffers so single
> or multiple SDL_UpdateRects could be pushed to visible screen in one
> operation (SDL_Flip) in appropriate moment. 

Cannot/doesn't SDL do double buffering by itself when asked?
(it would be much slower if it's done in the normal RAM where
the framebuffer resides, but at least there wouldn't be tearing. :))


- Eero

___
maemo-developers mailing list
maemo-developers@maemo.org
https://maemo.org/mailman/listinfo/maemo-developers


Re: [maemo-developers] SDL vertical blank (vbl) sync.

2006-05-30 Thread Frantisek Dufka

Tapani Pälli wrote:



I think there's no guarantee that you will get "HW surface" from SDL, it
will silently fallback to SW surface if it cannot have HW one.

SDL draws to X, X draws to the framebuffer mapped by kernel which then
updates that data to the lcd controller where screen gets finally
updated. I would recommend to blit things in memory, then push only
needed parts with SDL_UpdateRects trying to avoid fullscreen updates.


Yes. So to draw without tearing effect either X of framebuffer driver 
should report when to draw (vblank period or which line is currently 
drawn by hardware) or the controller has to have two buffers so single 
or multiple SDL_UpdateRects could be pushed to visible screen in one 
operation (SDL_Flip) in appropriate moment.


Frantisek
___
maemo-developers mailing list
maemo-developers@maemo.org
https://maemo.org/mailman/listinfo/maemo-developers


Re: [maemo-developers] SDL vertical blank (vbl) sync.

2006-05-30 Thread Tapani Pälli
ext Frantisek Dufka wrote:
> Visti Andresen wrote:
>
>> My "flashingTest" reports that:
>> It got a hardware surface (I should be writing directly to "video
>> memory" accordingly to the SDL docs)
>> And the surface is double buffered.
>>
>> The size of the surface is 800x480 16 bit (R5G6B5)
>> So there should be at least 1536000 bytes of video memory
>>
>> I suppose the kernel display driver is open-source?
>
> Yes, it is. And I _did_ look at it. And somehow I don't think SDL
> hardware surface really means memory in Epson HWA742 controller :-)
> That's why I asked.
>

I think there's no guarantee that you will get "HW surface" from SDL, it
will silently fallback to SW surface if it cannot have HW one.

SDL draws to X, X draws to the framebuffer mapped by kernel which then
updates that data to the lcd controller where screen gets finally
updated. I would recommend to blit things in memory, then push only
needed parts with SDL_UpdateRects trying to avoid fullscreen updates.

> Frantisek
>

// Tapani

> ___
> maemo-developers mailing list
> maemo-developers@maemo.org
> https://maemo.org/mailman/listinfo/maemo-developers
>


___
maemo-developers mailing list
maemo-developers@maemo.org
https://maemo.org/mailman/listinfo/maemo-developers


Re: [maemo-developers] SDL vertical blank (vbl) sync.

2006-05-30 Thread Frantisek Dufka

Visti Andresen wrote:


My "flashingTest" reports that:
It got a hardware surface (I should be writing directly to "video memory" 
accordingly to the SDL docs)
And the surface is double buffered.

The size of the surface is 800x480 16 bit (R5G6B5)
So there should be at least 1536000 bytes of video memory

I suppose the kernel display driver is open-source? 



Yes, it is. And I _did_ look at it. And somehow I don't think SDL 
hardware surface really means memory in Epson HWA742 controller :-) 
That's why I asked.


Frantisek

___
maemo-developers mailing list
maemo-developers@maemo.org
https://maemo.org/mailman/listinfo/maemo-developers


Re: [maemo-developers] SDL vertical blank (vbl) sync.

2006-05-30 Thread Kuisma Salonen




My "flashingTest" reports that:
It got a hardware surface (I should be writing directly to "video memory" 
accordingly to the SDL docs)
And the surface is double buffered.

  
Don't trust SDL, SDL is a liar. In X backend the SDL trusts what X says 
so "HW surface" could mean actually "server sided pixmap".

The size of the surface is 800x480 16 bit (R5G6B5)
So there should be at least 1536000 bytes of video memory

  
The video hardware isn't like in traditional desktop PCs, this in not 
quite right. The display hardware is actually a blackbox which contains 
it's own memory and outer memory space is fully unaware about this (AFAIK).
I suppose the kernel display driver is open-source? 

  

AFAIK it is, so you could dig up the sources...

-- Kuisma

___
maemo-developers mailing list
maemo-developers@maemo.org
https://maemo.org/mailman/listinfo/maemo-developers


Re: [maemo-developers] SDL vertical blank (vbl) sync.

2006-05-30 Thread Visti Andresen
On Mon, 29 May 2006 16:50:50 +0200
Frantisek Dufka <[EMAIL PROTECTED]> wrote:

> Juha Yrjölä wrote:
> 
> > Unfortunately we don't provide user-space with the vsync information (or 
> > "Tearing Effect" signal, as it's called in LCD land).
> > 
> > If there's large enough need for this, we might consider implementing 
> > the support.  The tearing effects should be minimal on the 770, however, 
> > because of the high (around 55 Hz) refresh rate of the display.
> > 
> 
> Hello,
> 
> well the effect is visible even when playing the Ice Age Trailer (I 
> suppose it is not already in the movie data). I think such feature is 
> quite useful for games and movie playback. BTW how big is the 
> framebuffer memory? Is there space for 2 frames so double-buffering is 
> possible? Also is there some datasheet for the Epson hwa742 chip? Can 
> you make it public? I tried to google for it (and for lph8923 too) but 
> found nothing useful. Thanks.

My "flashingTest" reports that:
It got a hardware surface (I should be writing directly to "video memory" 
accordingly to the SDL docs)
And the surface is double buffered.

The size of the surface is 800x480 16 bit (R5G6B5)
So there should be at least 1536000 bytes of video memory

I suppose the kernel display driver is open-source? 

> 
> Frantisek
> ___
> maemo-developers mailing list
> maemo-developers@maemo.org
> https://maemo.org/mailman/listinfo/maemo-developers
___
maemo-developers mailing list
maemo-developers@maemo.org
https://maemo.org/mailman/listinfo/maemo-developers


Re: [maemo-developers] SDL vertical blank (vbl) sync.

2006-05-29 Thread Frantisek Dufka

Juha Yrjölä wrote:

Unfortunately we don't provide user-space with the vsync information (or 
"Tearing Effect" signal, as it's called in LCD land).


If there's large enough need for this, we might consider implementing 
the support.  The tearing effects should be minimal on the 770, however, 
because of the high (around 55 Hz) refresh rate of the display.




Hello,

well the effect is visible even when playing the Ice Age Trailer (I 
suppose it is not already in the movie data). I think such feature is 
quite useful for games and movie playback. BTW how big is the 
framebuffer memory? Is there space for 2 frames so double-buffering is 
possible? Also is there some datasheet for the Epson hwa742 chip? Can 
you make it public? I tried to google for it (and for lph8923 too) but 
found nothing useful. Thanks.


Frantisek
___
maemo-developers mailing list
maemo-developers@maemo.org
https://maemo.org/mailman/listinfo/maemo-developers


Re: [maemo-developers] SDL vertical blank (vbl) sync.

2006-05-29 Thread Juha Yrjölä

Kuisma Salonen wrote:

Hi I was wondering if anyone knows how to sync. the SDL_Flip to the 
vertical blanking of the display.


While it is nice to get 47+ FPS while memset'ing the display, I would 
rather be synced to the display and avoid the tearing at the cost of FPS.
  
This is actually generic issue, not just SDL one. When you call 
SDL_Flip() (or SDL_UpdateRects() etc) it "draws" local data to the 
display HW, and this goes through X. Having synchronization in the 
display driver would solve this. Anyway I am not the person to say more 
about this as I am not enough aware of display HW internals to tell how 
hard implementing this would be and whether it would even be possible.


Unfortunately we don't provide user-space with the vsync information (or 
"Tearing Effect" signal, as it's called in LCD land).


If there's large enough need for this, we might consider implementing 
the support.  The tearing effects should be minimal on the 770, however, 
because of the high (around 55 Hz) refresh rate of the display.


Cheers,
Juha
___
maemo-developers mailing list
maemo-developers@maemo.org
https://maemo.org/mailman/listinfo/maemo-developers


Re: [maemo-developers] SDL vertical blank (vbl) sync.

2006-05-29 Thread Gustavo Sverzut Barbieri
On Monday 29 May 2006 08:42, ext Kuisma Salonen wrote:
> Visti Andresen wrote:
> > Hi I was wondering if anyone knows how to sync. the SDL_Flip to the
> > vertical blanking of the display.
> >
> > While it is nice to get 47+ FPS while memset'ing the display, I would
> > rather be synced to the display and avoid the tearing at the cost of FPS.
>
> This is actually generic issue, not just SDL one. When you call
> SDL_Flip() (or SDL_UpdateRects() etc) it "draws" local data to the
> display HW, and this goes through X. Having synchronization in the
> display driver would solve this. Anyway I am not the person to say more
> about this as I am not enough aware of display HW internals to tell how
> hard implementing this would be and whether it would even be possible.

http://scanline.ca/smooth/

This is a good resource to look at. This guy (http://scanline.ca) is extremely 
good in computer graphics, you may read his code and if it still doesn't 
work, mail him.

-- 
Gustavo Sverzut Barbieri

INdT, Recife, Brazil

Jabber: [EMAIL PROTECTED]
   MSN: [EMAIL PROTECTED]
  ICQ#: 17249123
 Skype: gsbarbieri
Mobile: +55 (81) 9927 0010
 Phone:  +1 (347) 624 6296; [EMAIL PROTECTED]
   GPG: 0xB640E1A2 @ wwwkeys.pgp.net
___
maemo-developers mailing list
maemo-developers@maemo.org
https://maemo.org/mailman/listinfo/maemo-developers


Re: [maemo-developers] SDL vertical blank (vbl) sync.

2006-05-29 Thread Kuisma Salonen

Visti Andresen wrote:

Hi I was wondering if anyone knows how to sync. the SDL_Flip to the vertical 
blanking of the display.

While it is nice to get 47+ FPS while memset'ing the display, I would rather be 
synced to the display and avoid the tearing at the cost of FPS.
  
This is actually generic issue, not just SDL one. When you call 
SDL_Flip() (or SDL_UpdateRects() etc) it "draws" local data to the 
display HW, and this goes through X. Having synchronization in the 
display driver would solve this. Anyway I am not the person to say more 
about this as I am not enough aware of display HW internals to tell how 
hard implementing this would be and whether it would even be possible.


-- Kuisma
___
maemo-developers mailing list
maemo-developers@maemo.org
https://maemo.org/mailman/listinfo/maemo-developers


Re: [maemo-developers] SDL vertical blank (vbl) sync.

2006-05-28 Thread Visti Andresen
On Sun, 28 May 2006 14:47:29 +0200
[EMAIL PROTECTED] (Heike C. Zimmerer) wrote:

> Visti Andresen <[EMAIL PROTECTED]> writes:
> 
> > Hi I was wondering if anyone knows how to sync. the SDL_Flip to the
> > vertical blanking of the display.
> 
> You're sure there's anything like vertical blanking for the 770?  My
> understanding is that VBL is closely tied to the transmission of video
> data through an analog line.

Sort of, vertical blanking occurs when the electron beam retraces back to the 
top of the CRT screen.
And yes it has a dedicated analog line (on a vga/monitor cable, it is shared 
with the luminance/colour data on a composite signal).

> I doubt you will find anything like that
> in digital-only LCD circuitry.  There will, however, be some kind of
> display refresh which uses some timing of its own.  If you look that
> direction, maybe there's some interval which can be used for similar
> tasks.
As you mention internal TFT/LCD displays use different and usually digital 
(until the LCD/TFT controller chip) signalling.
But the controller chip still receives a "top of frame" or "vertical blank" 
signal (at least in those data sheets I have read for LCD displays).

Anyway I would like to sync the SDL_Flip's to the "top of frame" or "vertical 
blank" signal.

The reason for this wish is, that you really can't do anything animated if you 
refresh the display at a random point in time.
Okay you can, but there will be artifacts, these are caused by the top part of 
the display containing one frame and the bottom one containing the next frame.

For those not familiar with the problem I have attached two tiny programs 
(compiled for arm)

flashingTest. Displays some "random" colours, I wrote it to "benchmark" the 
graphics performance of the 770 and to detect the native screen format (its 
16bit R5G6B5 btw.). It do however show the artifacts.

vblSync. Was written especially to show the artifacts. The high DPI of the 770 
display makes them less noticeable but they are still there.

Oh and for those of you who still have the IceAge2 trailer that came with the 
770, the Nokia movie player also shows these artifacts quite clearly in the 
beginning where there are a lot of panning going on.

I can just hope that there are a "hacker" out there who knows how get this kind 
of "scanline" information out of the 770. Otherwise I'll just have to live with 
sub Amiga 500 graphics capabilities :)

> 
> - Heike
> ___
> maemo-developers mailing list
> maemo-developers@maemo.org
> https://maemo.org/mailman/listinfo/maemo-developers


flashingTest.tar.gz
Description: Binary data


vblSync.tar.gz
Description: Binary data
___
maemo-developers mailing list
maemo-developers@maemo.org
https://maemo.org/mailman/listinfo/maemo-developers


Re: [maemo-developers] SDL vertical blank (vbl) sync.

2006-05-28 Thread Heike C. Zimmerer
Visti Andresen <[EMAIL PROTECTED]> writes:

> Hi I was wondering if anyone knows how to sync. the SDL_Flip to the
> vertical blanking of the display.

You're sure there's anything like vertical blanking for the 770?  My
understanding is that VBL is closely tied to the transmission of video
data through an analog line.  I doubt you will find anything like that
in digital-only LCD circuitry.  There will, however, be some kind of
display refresh which uses some timing of its own.  If you look that
direction, maybe there's some interval which can be used for similar
tasks.

- Heike
___
maemo-developers mailing list
maemo-developers@maemo.org
https://maemo.org/mailman/listinfo/maemo-developers


[maemo-developers] SDL vertical blank (vbl) sync.

2006-05-28 Thread Visti Andresen
Hi I was wondering if anyone knows how to sync. the SDL_Flip to the vertical 
blanking of the display.

While it is nice to get 47+ FPS while memset'ing the display, I would rather be 
synced to the display and avoid the tearing at the cost of FPS.
___
maemo-developers mailing list
maemo-developers@maemo.org
https://maemo.org/mailman/listinfo/maemo-developers