Navigation

    全志在线开发者论坛

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • 社区主页

    T113-S3 G2D 裸机测试

    D1-H/D1s
    1
    1
    158
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • L
      L13819506056 LV 4 last edited by whycan

      终于将G2D裸机环境使用搞定了。 简单测试了一下bitblt 和矩形填充。

      extern const unsigned char image_mn_map[800*480*4];/*图片文件*/
      void  g2d_test(void)
      {
         g2d_probe();
         g2d_open();
      	 g2d_blt_h blit_para;
         while(1)
         {
            /* bitblt测试  */
            memset(&blit_para,0,sizeof(g2d_blt_h));
            g2d_image_enh *src = &blit_para.src_image_h;
            g2d_image_enh *des = &blit_para.dst_image_h;
            blit_para.flag_h   =  G2D_ROT_180;//G2D_ROT_V;// G2D_ROT_0;
      
            src->laddr[0] = (uint32_t)image_mn_map;
            src->align[0] = 4;
            src->clip_rect.w = 800;
            src->clip_rect.h = 480;
            src->width       = 800;
            src->height      = 480;
            src->format      = G2D_FORMAT_ARGB8888;
            src->mode        = G2D_PIXEL_ALPHA;
            src->bpremul     = 0;
      
            des->laddr[0]    = r528_de_config.LayerAddr[0] ;
            des->align[0]    = 4;
            des->clip_rect.w = 800;
            des->clip_rect.h = 480;
            des->width       = 800;
            des->height      = 480;
            des->format      = G2D_FORMAT_ARGB8888;
            des->mode        = G2D_PIXEL_ALPHA;
            des->bpremul     = 0;
            long ret         = g2d_ioctl( G2D_CMD_BITBLT_H, (unsigned long )&blit_para);
      
            /* 矩形填充测试  */
            g2d_fillrect_h fill_para;
            memset(&fill_para,0,sizeof(g2d_fillrect_h));
            src = &fill_para.dst_image_h;
            src->laddr[0] = (uint32_t)r528_de_config.LayerAddr[0] ;;
            src->align[0] = 4;
            src->clip_rect.w = 800;
            src->clip_rect.h = 480;
            src->width       = 800;
            src->height      = 480;
            src->format      = G2D_FORMAT_ARGB8888;
            src->mode = G2D_PIXEL_ALPHA;
            src->bpremul = 0;
            src->gamut = G2D_BT709;
            src->color = 0xFFFF0000;
            src->alpha = 0xff;
            ret = g2d_ioctl( G2D_CMD_FILLRECT_H, (unsigned long )&fill_para);
         }
      }
      
      1 Reply Last reply Reply Quote Share 1
      • 1 / 1
      • First post
        Last post

      Copyright © 2021 深圳全志在线有限公司 粤ICP备2021084185号 粤公网安备44030502007680号

      行为准则 | 用户协议 | 隐私权政策