# PVR2DBlit breaks after first use

**URL:** <https://forums.imgtec.com/t/pvr2dblit-breaks-after-first-use/925>\
**Category:** PowerVR Insider\
**Created:** [November 24, 2010, 6:42pm UTC](https://forums.imgtec.com/t/pvr2dblit-breaks-after-first-use/925 "2010-11-24T18:42:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![johnsoga](https://avatars.discourse-cdn.com/v4/letter/j/8491ac/32.png) [@johnsoga](https://forums.imgtec.com/u/johnsoga)\
**Post date:** [November 24, 2010, 6:42pm UTC](https://forums.imgtec.com/t/pvr2dblit-breaks-after-first-use/925/1 "2010-11-24T18:42:02Z")

</div>

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 )  
  
  
{  
  
  
&nbsp;&nbsp;&nbsp;&nbsp;printf( “Unable to get fb memoryn” );  
  
  
&nbsp;&nbsp;&nbsp;&nbsp;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 );&nbsp;&nbsp;&nbsp;&nbsp;if ( error != PVR2D\_OK )  
  
  
{  
  
  
&nbsp;&nbsp;&nbsp;&nbsp;printf( “Unable to alocate memory for image data: %dn”, error );  
  
  
&nbsp;&nbsp;&nbsp;&nbsp;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 )  
  
  
{  
  
  
&nbsp;&nbsp;&nbsp;&nbsp;printf( “Blit Error: %dn”, error );  
  
  
}  
  
  
error = PVR2DQueryBlitsComplete( context, image\_buffer, 0 );  
  
  
if ( error != PVR2D\_OK )  
  
  
{  
  
  
&nbsp;&nbsp;&nbsp;&nbsp;printf( “Blit Query Error: %dn”, error );  
  
  
}

---

<div class="post-metadata">

**Author:** ![CarlosSarria](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.imgtec.com/carlossarria/32/263_2.png) [@CarlosSarria](https://forums.imgtec.com/u/CarlosSarria)\
**Post date:** [December 3, 2010, 3:57pm UTC](https://forums.imgtec.com/t/pvr2dblit-breaks-after-first-use/925/2 "2010-12-03T15:57:10Z")

</div>

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.
