I am working on an MPC5121e MBX core and I am trying to get hardware accelerated blitting working. I am to the point now that I can blit once to the screen and then library won’t let me do it again and PVR2DQueryBlitsComplete always returns -8 which is PVR2DERROR_BLT_NOTCOMPLETE. If I reload the modules then I can again blit once and then I can’t again. The following code is what I am using for the blitting. I first fill the screen with yellow and then blit white box over the whole screen.
PVR2DMEMINFO *frame_buffer;
if ( PVR2DGetFrameBuffer( context, PVR2D_FB_PRIMARY_SURFACE, &frame_buffer ) != PVR2D_OK )
{
printf( “Unable to get fb memoryn” );
return -1;
}
memset( frame_buffer->pBase, 0xef, frame_buffer->ui32MemSize );
unsigned int image_size = frame_buffer->ui32MemSize;
PVR2DMEMINFO *image_buffer;
PVR2DERROR error = PVR2DMemAlloc( context, image_size, PVR2D_ALIGNMENT_4, 0, &image_buffer ); if ( error != PVR2D_OK )
{
printf( “Unable to alocate memory for image data: %dn”, error );
return -1;
}
memset( image_buffer->pBase, 0xff, image_buffer->ui32MemSize );
PVR2DBLTINFO blit;
memset( &blit, 0, sizeof(blit) );
blit.CopyCode = PVR2DROPcopy;
blit.BlitFlags = PVR2D_BLIT_DISABLE_ALL;
blit.pSrcMemInfo = image_buffer;
blit.SrcStride = display_info.lStride;
blit.SrcX = 0;
blit.SrcY = 0;
blit.SizeX = 1024;
blit.SizeY = 768;
blit.SrcFormat = display_info.eFormat;
blit.pDstMemInfo = frame_buffer;
blit.DstStride = display_info.lStride;
blit.DstX = 0;
blit.DstY = 0;
blit.DSizeX = 1024;
blit.DSizeY = 768;
blit.DstFormat = display_info.eFormat;
error = PVR2DBlt( context, &blit );
if ( error != PVR2D_OK )
{
printf( “Blit Error: %dn”, error );
}
error = PVR2DQueryBlitsComplete( context, image_buffer, 0 );
if ( error != PVR2D_OK )
{
printf( “Blit Query Error: %dn”, error );
}
Hi John,
This seems like the drivers are not handling correctly the end-of-blit interrupt so you are not allowed to do the next blit. Sadly the MPC5121e drivers have been ported by Freescale and I think they stopped supporting it long ago. The only think I can suggest is trying to get some help from Freescale themselves.
Best regards
Carlos.