AnsweredAssumed Answered

How to set the g2d param to implement yuyv convert to RGB32

Question asked by bobo zhong on May 11, 2016
Latest reply on May 24, 2016 by bobo zhong

I want to test the function which is yuyv  to convert to RGB32 in 3.10.53 kernel. But I found the output picture is seprate  more picture, and this picture is blurred.

 

Could you help me to see it?

 

The G2D convert code as following:

 

struct g2d_surface src, dst;

struct g2d_buf *buf;

void *handle = NULL;

int size = 640 * 480;

 

 

ret = g2d_open(&handle);

    if(ret < 0) {

   printf("g2d open fail for the ivicar\n");
   return 0;

    }

 

   buf = g2d_alloc(size * 2, 1);

 

    memcpy(buf.buf_vaddr, buf_yuyv, size * 2);

 

    src.planes[0] = buf.buf_paddr;

    src.left = 0;

    src.top = 0;

    src.right = 640;

    src.bottom = 480;

    src.stride = 640;

    src.width = 640;

    src.height = 480;

    src.rot = G2D_ROTATION_0;

    src.format = G2D_YUYV;

 

    dst.planes[0] = g_fb_phys;

    dst.left = 0;

    dst.top = 0;

    dst.right = 640;

    dst.bottom = 480;

    dst.stride = 640;

    dst.width = 640;

    dst.height = 480;

    dst.rot = G2D_ROTATION_0;

    dst.format = G2D_RGBA8888;

 

    g2d_blit(handle, &src, &dst);

    g2d_finish(handle);

    usleep(1000);

    g2d_close(handle);

   g2d_free(buf);

Outcomes