g2d_blit_2d: fail with status -20

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

g2d_blit_2d: fail with status -20

2,289件の閲覧回数
yongtang
Contributor I

Hi,FreeScale

     I meet a very strange question on blit image which with G2D_I420,I blit image with physical continued memory as below,if the source image with 576*360,blit success,but if with 480*300,blit failed,how can i fix this?

     int width = 480;

   int height = 300;

   int o_width = 320;

   int o_height = 240;

  g2d_buf* mpInputBuf = g2d_alloc(width * height * 3 / 2, 0);

  g2d_buf* mpOutputBuf = g2d_alloc(o_width * o_height * 4, 0);

   mInputSurface.planes[0] = mpInputBuf->buf_paddr;

   mInputSurface.planes[1] = mpInputBuf->buf_paddr+ a_width*height;

   mInputSurface.planes[2] = mInputSurface.planes[1] + a_width*height / 4;

   mInputSurface.left = 0;

   mInputSurface.top = 0;

   mInputSurface.right = width;

   mInputSurface.bottom = height;

   mInputSurface.stride = width;

   mInputSurface.width  = width;

   mInputSurface.height = height;

   mInputSurface.rot    = G2D_ROTATION_0;

   mInputSurface.format = G2D_I420;

   mInputSurface.blendfunc = G2D_ZERO;

   mInputSurface.global_alpha = 0;     //Global alpha value 0~255

   mInputSurface.clrcolor = 0;

   mOutputSurface.planes[0] = mpOutputBuf->buf_paddr;

   mOutputSurface.left = 0;

   mOutputSurface.top = 0;

   mOutputSurface.right = o_width;

   mOutputSurface.bottom = o_height;

   mOutputSurface.stride = o_width;

   mOutputSurface.width  = o_width;

   mOutputSurface.height = o_height;

   mOutputSurface.rot    = G2D_ROTATION_0;

   mOutputSurface.format = G2D_RGBA8888;

   mOutputSurface.blendfunc = G2D_SRC_ALPHA;//G2D_ZERO;

   mOutputSurface.global_alpha = 0;     //Global alpha value 0~255

   mOutputSurface.clrcolor = 0;

   if(0 != g2d_make_current(mhG2d, G2D_HARDWARE_2D))

   {    

      return -4;

   }

   g2d_enable(mhG2d,G2D_BLEND);

   if(0 != g2d_blit(mhG2d, &mInputSurface, &mOutputSurface))

   {

      g2d_finish(mhG2d);

    

      return -5;

   }

   g2d_disable(mhG2d, G2D_BLEND);

   if(0 != g2d_finish(mhG2d))

   {    

      return -6;

   }

ラベル(1)
タグ(2)
0 件の賞賛
返信
1 返信

1,113件の閲覧回数
igorpadykov
NXP Employee
NXP Employee

Hi yong

recommended to try latest Vivante v5.0.11p7.4 gpu library (included

in L3.14.52), attached document Table 9. New features shows its

improvements.

Best regards

igor

-----------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer button. Thank you!

-----------------------------------------------------------------------------------------------------------------------

0 件の賞賛
返信