1) When you told DSCAPS_SYSTEMONLY then the surface lays in system memory. But hardware can't copy data from system memory into video memory (primary).
2) When you created the surface in video memory you can't set new pointer because your data were allocated in SYSTEM memory. The DirectFB copies your picture from system memory without acceleration. If you do Unlock() then DirectFB will restore correct pointer to VIDEO memory ( without your picture ). To blit with acceleration you should create "system" surface with preallocated data. 2. Create "video" surface. 3. Blit from "system" to "video". ( software blitting only ) 4. Copy from "video" to primary ( with hardware acceleration ). 2007/10/5, Homam Dabis <[EMAIL PROTECTED]>: > > > > Update. > > I used Lock to get access to the secondary surface pointer. This works ok > but no acceleration. If I unlock it before blitting then I get acceleration > but no picture. > > I do the following: > > > > sdsc.flags = //DSDESC_CAPS | > > DSDESC_WIDTH | > > DSDESC_HEIGHT | > > DSDESC_PIXELFORMAT;// | > > // DSDESC_PREALLOCATED; > > //sdsc.caps = DSCAPS_SYSTEMONLY; > > > > > //sdsc.preallocated[0].data = underlay_osb.pBits; > > //sdsc.preallocated[0].pitch = underlay_osb.nStride; > > ret = s_dfb->CreateSurface( s_dfb, &sdsc, &s_osbSurface ); > > > > DFBSurfaceLockFlags flags = DSLF_WRITE | DSLF_READ ; > > void * ptr; > > int pitch; > > s_osbSurface->Lock(s_osbSurface,flags,&ptr,&pitch); > > underlay_osb.pBits = ptr; > > //s_osbSurface->Unlock(s_osbSurface);//if I call this I get acceleration but > no picture > > s_primary->SetBlittingFlags( s_primary, DSBLIT_NOFX ); > > s_primary->Blit( s_primary, s_osbSurface, &clipRect, x, y ); > > > > Any ideas why I get no picture if I unlock the secondary surface. > > How can I get around this problem. > > Homam. > > > > ----- Original Message ---- > From: Homam Dabis <[EMAIL PROTECTED]> > To: directfb-users@directfb.org > Sent: Friday, 5 October, 2007 10:24:29 AM > Subject: [directfb-users] Unable to use hardware acceleration > > > > We are attempting to blit a secondary onto a primary surface. > > The primary is created as follows: > > > > /* Create the primary surface */ > > sdsc.flags = DSDESC_CAPS | > > DSDESC_WIDTH | > > DSDESC_HEIGHT | > > DSDESC_PIXELFORMAT; > > sdsc.caps = DSCAPS_PRIMARY | DSCAPS_VIDEOONLY; > > ret = s_dfb->CreateSurface( s_dfb, &sdsc, &s_primary ); > > > > Whist the secondary is created as follows: > > > > sdsc.flags = DSDESC_CAPS | > > DSDESC_WIDTH | > > DSDESC_HEIGHT | > > DSDESC_PIXELFORMAT | > > DSDESC_PREALLOCATED; > > sdsc.caps = DSCAPS_SYSTEMONLY; > > sdsc.preallocated[0].data = underlay_osb.pBits; > > sdsc.preallocated[0].pitch = underlay_osb.nStride; > > ret = s_dfb->CreateSurface( s_dfb, &sdsc, &s_osbSurface ); > > > > s_primary->SetBlittingFlags( s_primary, DSBLIT_NOFX ); > > s_primary->Blit( s_primary, s_osbSurface, &clipRect, x, y ); > > > > This works but without hardware acceleration because of the "sdsc.caps = > DSCAPS_SYSTEMONLY". Not setting this parameter results in no picture on the > screen which I am unsure why. The rendering is done via third party hence the > preallocated pointers. > > > > Any idea why I dont get a picture if I don't set the DSCAPS_SYSTEMONLY > parameter. > > > > If not possible then one idea which I want to know if feasible is to do the > following > > > > underlay_osb.pBits = secondary surface pointer. > > > > Is it possible to do that and if so how could I get access to the secondary > surface pointer. Would this create other problems. > > > > Any other suggestions/ideas would be grately appreciated. > > > > By the way, I know that hw acceleration works since I ran df_dok. > > > > Thanks. > > > > Homam. > > > > > > > ________________________________ Yahoo! Answers - Get better answers from someone who knows. Try it now. > > > > ________________________________ Yahoo! Answers - Get better answers from someone who knows. Try it now. > _______________________________________________ > directfb-users mailing list > directfb-users@directfb.org > http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-users > > -- Best Regards Nikita Egorov [EMAIL PROTECTED] [EMAIL PROTECTED] _______________________________________________ directfb-users mailing list directfb-users@directfb.org http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-users