当前位置: 技术问答>linux和unix
DirectFB设置双缓冲导致panning buffer out of range,急求大神指点
来源: 互联网 发布时间:2017-02-14
本文导语: 本帖最后由 xxhu186 于 2012-04-04 20:09:48 编辑 DirectFB版本1.4.3,基于framebuffer 将编译好的DirectFB库文件移植到ST的板子上运行 调用源代码如下: static IDirectFB *dfb = NULL; static IDirectFBSurface *primary = NULL; ...
将编译好的DirectFB库文件移植到ST的板子上运行
调用源代码如下:
static IDirectFB *dfb = NULL;
static IDirectFBSurface *primary = NULL;
static int screen_width = 0;
static int screen_height = 0;
int Directfb_Init()
{
DFBGraphicsDeviceDescription gdesc;
DFBWindowDescription desc;
DFBDisplayLayerConfig config;
DFBSurfaceDescription dsc;
/* Initialize DirectFB including command line parsing. */
DFBCHECK (DirectFBInit( NULL, NULL ));
DirectFBSetOption( "system", "fbdev" );
DirectFBSetOption( "fbdev", "/dev/fb0" );
DirectFBSetOption( "mode", "720x576" );
DirectFBSetOption( "depth", "32" );
DirectFBSetOption("pixelformat","ARGB");
DirectFBSetOption( "no-cursor", NULL );
DirectFBSetOption( "bg-none", NULL );
DirectFBSetOption("layer-buffer-mode","auto");
/* Create the super interface. */
DFBCHECK(DirectFBCreate( &dfb ));
printf("=========DirectFBCreated.n");
DFBCHECK (dfb->SetCooperativeLevel (dfb, DFSCL_FULLSCREEN));
printf("===============n");
dsc.flags = DSDESC_CAPS;
dsc.caps = DSCAPS_PRIMARY | DSCAPS_DOUBLE;//| DSCAPS_FLIPPING;
//dsc.caps = DSCAPS_PRIMARY;//如果使用这句,程序可以正常运行
DFBCHECK (dfb->CreateSurface( dfb, &dsc, &primary ));
printf("=========CreateSurface primary.n");
DFBCHECK (primary->GetSize (primary, &screen_width, &screen_height));
DFBCHECK (primary->FillRectangle (primary, 0, 0, screen_width, screen_height));
printf("=========screen_width:%d,screen_height:%d.n",screen_width,screen_height);
DFBCHECK (primary->Flip (primary, NULL, 0));
printf("=========Flip screen.n");
printf("exit Directfb_Init.n");
return 0;
}
这是个很常见的调用流程,但是我在板子上跑总是在CreateSurface()时失败。错误打印如下:
~~~~~~~~~~~~~~~~~~~~~~~~~~| DirectFB 1.4.3 |~~~~~~~~~~~~~~~~~~~~~~~~~~
(c) 2001-2009 The world wide DirectFB Open Source Community
(c) 2000-2004 Convergence (integrated media) GmbH
----------------------------------------------------------------
(*) DirectFB/Core: Single Application Core. (2012-03-26 20:34)
(*) Direct/Thread: Started 'VT Switcher' (1095) [CRITICAL OTHER/OTHER 0/0] ...
(*) Direct/Thread: Started 'VT Flusher' (-1) [DEFAULT OTHER/OTHER 0/0] ...
(*) DirectFB/FBDev: Found 'STAPIFB' (ID 102) with frame buffer at 0x4c19e000, 4860k (MMIO 0xfe20b000, 4k)
(*) DirectFB/Graphics: Generic Software Rasterizer 0.6 (directfb.org)
(*) DirectFB/Core/WM: Default 0.3 (directfb.org)
=========DirectFBCreated.
===============
(!) DirectFB/FBDev: yres 576, vyres 576, offset 576
(!?!) *** BUG [panning buffer out of range] *** [fbdev.c:1502 in dfb_fbdev_pan()]
=========CreateSurface primary.
=========screen_width:720,screen_height:576.
(!) DirectFB/FBDev: yres 576, vyres 576, offset 576
(!?!) *** BUG [panning buffer out of range] *** [fbdev.c:1502 in dfb_fbdev_pan()]
osd.c :
(#) DirectFBError [primary->Flip (primary, NULL, 0)]: Internal bug!
(!!!) *** WARNING [Application exited without deinitialization of DirectFB!] *** [core.c:862 in dfb_core_deinit_check()]
(!!!) *** WARNING [still objects in 'Layer Region Pool'] *** [object.c:241 in fusion_object_pool_destroy()]
(!!!) *** WARNING [still objects in 'Layer Context Pool'] *** [object.c:241 in fusion_object_pool_destroy()]
(!!!) *** WARNING [still objects in 'Surface Pool'] *** [object.c:241 in fusion_object_pool_destroy()]
Close
看了directfb源代码中关于offset的部分,但是没看懂。求大神们指教。
|
分辨率没有设置对吧,修改下
/etc/directfbrc
/etc/directfbrc
您可能感兴趣的文章:
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。