Discussion:
[directfb-users] Change in rendering speed between DFSCL_FULLSCREEN and DFSCL_NORMAL SetCooperativeLevel
Marc Lantelme
2012-05-04 10:48:23 UTC
Permalink
One more precision :

I fount out that it's the blitting operation that slows down the rendering,
for a picture in 1920*1080, in normal mode, it takes 200ms, in fullscreen
mode 2,5 seconds.
I have also seen that the blitting is performed by the software, because of
wrong alpha pixelformat...

So here are my configurations for pixel format :

##############################################
--> directfbrc :
----------------------
system=stgfbdev
module-dir=/usr/lib/directfb-stsdk
depth=32
pixelformat=ARGB
hardware
#software-warn
no-cursor
bg-none

##############################################
-->graphics initialization :
-------------------------------------
insmod modules/stgfb_core.ko mod_init=NO g_devnum=1 layer_name="GFX_LAYER0"
g_mem="16" g_format="ARGB8888" g_tvOutMode="1920x1080-50i" g_width="1920"
g_height="1080"
fbset -xres 1920 -yres 1080 -depth 32
/root/modules/stgfb_control /dev/fb0 a 128

##############################################
-->directfb software init :
-------------------------------------
DFBCHECK(gWavePeerDfb->SetCooperativeLevel(gWavePeerDfb, DFSCL_FULLSCREEN));
dsc.flags = DSDESC_CAPS;
dsc.caps = DSCAPS_PRIMARY | DSCAPS_DOUBLE;
DFBCHECK(gWavePeerDfb->CreateSurface( gWavePeerDfb, &dsc,
&gWavePeerPrimaryMain ));

DFBCHECK(gWavePeerPrimaryMain->GetPixelFormat( gWavePeerPrimaryMain,
&pixelformat ));
DFBCHECK(gWavePeerPrimaryMain->GetSize(gWavePeerPrimaryMain,
&gWavePeerWidth, &gWavePeerHeight));

DFBCHECK(gWavePeerPrimaryMain->Clear(gWavePeerPrimaryMain, 0, 0, 0, 0x00));

DFBCHECK(gWavePeerPrimaryMain->GetSubSurface( gWavePeerPrimaryMain, NULL,
&gWavePeerPrimary ));

DFBCHECK(gWavePeerPrimary->Lock(gWavePeerPrimary, DSLF_READ, &DestPtr,
&gPitch));
DFBCHECK(gWavePeerPrimary->Unlock(gWavePeerPrimary));
DFBCHECK(gWavePeerPrimary->SetBlittingFlags(gWavePeerPrimary,
DSBLIT_BLEND_ALPHACHANNEL));
DFBCHECK(gWavePeerPrimary->SetDrawingFlags(gWavePeerPrimary, DSDRAW_BLEND));
DFBCHECK(gWavePeerPrimary->Flip(gWavePeerPrimary, NULL, DSFLIP_WAITFORSYNC |
DSFLIP_BLIT));


##############################################
-->During the blit I perform following call :
-------------------------------------------------------------
desc.flags = 0;
desc.flags |= DSDESC_WIDTH | DSDESC_HEIGHT;
desc.flags |= DSDESC_PIXELFORMAT;
desc.flags |= DSDESC_PREALLOCATED;
desc.caps = DSCAPS_VIDEOONLY;

desc.width = in_bitmapwidth; /* width of bitmap to display */
desc.height = in_bitmapheight; /* heigh of bitmap to display */
desc.pixelformat = DSPF_ARGB;

desc.preallocated[0].data = in_bitmap;
desc.preallocated[0].pitch = 512 or 1024; /* depending on width of bitmap to
display */
desc.preallocated[1].data = NULL;
desc.preallocated[1].pitch = 0;

DFBCHECK(gWavePeerDfb->CreateSurface(gWavePeerDfb, &desc, &newSurface));


DFBCHECK(gWavePeerPrimary->SetBlittingFlags(gWavePeerPrimary,
DSBLIT_BLEND_ALPHACHANNEL));
DFBCHECK(gWavePeerPrimary->Blit(gWavePeerPrimary,
newSurface,
&src_rect,
in_rect->fX, in_rect->fY));





##############################################
So, am I configuring something wrong that makes the blitting be performed by
the software and not by the hardware?
I have enabled the option "software-warn" in directfbrc and obtain the warn
during the blitting operation

Thank you for your answers ^^.

Marc
--
View this message in context: http://old.nabble.com/Change-in-rendering-speed-between-DFSCL_FULLSCREEN-and-DFSCL_NORMAL-SetCooperativeLevel-tp33763303p33763458.html
Sent from the DirectFB Users mailing list archive at Nabble.com.
Andre DRASZIK
2012-05-04 12:55:05 UTC
Permalink
Hi,
Post by Marc Lantelme
DFBCHECK(gWavePeerPrimary->SetBlittingFlags(gWavePeerPrimary,
DSBLIT_BLEND_ALPHACHANNEL));
DFBCHECK(gWavePeerPrimary->SetDrawingFlags(gWavePeerPrimary, DSDRAW_BLEND));
DirectFB's default blend mode is not a porter duff mode, which has two
implications:
- blend results are unexpected and not what you want
- this blend mode can only be accelerated in very specific cases with
the driver you are using.

You might want to
surface->SetPorterDuff (surface, DSPD_SRC_OVER);
Post by Marc Lantelme
desc.flags = 0;
desc.flags |= DSDESC_WIDTH | DSDESC_HEIGHT;
desc.flags |= DSDESC_PIXELFORMAT;
desc.flags |= DSDESC_PREALLOCATED;
desc.caps = DSCAPS_VIDEOONLY;
desc.width = in_bitmapwidth; /* width of bitmap to display */
desc.height = in_bitmapheight; /* heigh of bitmap to display */
desc.pixelformat = DSPF_ARGB;
desc.preallocated[0].data = in_bitmap;
desc.preallocated[0].pitch = 512 or 1024; /* depending on width of bitmap to
display */
desc.preallocated[1].data = NULL;
desc.preallocated[1].pitch = 0;
DFBCHECK(gWavePeerDfb->CreateSurface(gWavePeerDfb, &desc, &newSurface));
The hardware can not access virtual memory, hence operations using this
surface will always be done in software.


Cheers,
Andre'
Denis Oliver Kropp
2012-05-04 18:01:08 UTC
Permalink
Post by Andre DRASZIK
Hi,
Post by Marc Lantelme
DFBCHECK(gWavePeerPrimary->SetBlittingFlags(gWavePeerPrimary,
DSBLIT_BLEND_ALPHACHANNEL));
DFBCHECK(gWavePeerPrimary->SetDrawingFlags(gWavePeerPrimary, DSDRAW_BLEND));
DirectFB's default blend mode is not a porter duff mode, which has two
- blend results are unexpected and not what you want
- this blend mode can only be accelerated in very specific cases with
the driver you are using.
You might want to
surface->SetPorterDuff (surface, DSPD_SRC_OVER);
There's a blending howto in the Wiki:

http://www.directfb.org/wiki/index.php/Blending_HOWTO
--
Best regards,
Denis Oliver Kropp

.------------------------------------------.
| DirectFB - Hardware accelerated graphics |
| http://www.directfb.org/ |
"------------------------------------------"
Loading...