summaryrefslogtreecommitdiff
authorPengcheng Chen <pengcheng.chen@amlogic.com>2017-01-09 09:26:14 (GMT)
committer Pengcheng Chen <pengcheng.chen@amlogic.com>2017-01-10 01:04:06 (GMT)
commitf2da1cf0e92ce3fb339e25b059665aa3c3a835f2 (patch)
tree90953ad7d0e952ad1bd1d64c4e699cb75ff5be51
parent4fcdd6456d921911a6d1bd691bfdcd1153ed635d (diff)
downloadsystem-f2da1cf0e92ce3fb339e25b059665aa3c3a835f2.zip
system-f2da1cf0e92ce3fb339e25b059665aa3c3a835f2.tar.gz
system-f2da1cf0e92ce3fb339e25b059665aa3c3a835f2.tar.bz2
PD#137623 ge2dlib:add ge2dlib interface
add readme.txt of ge2dlib API and test code Change-Id: I00ef6b071ce1e750eb310b62e1264cf4604ed063 Signed-off-by: Pengcheng Chen <pengcheng.chen@amlogic.com>
Diffstat
-rw-r--r--libge2d/ge2d_feature_test.c3
-rw-r--r--libge2d/ge2d_load_test.c6
-rw-r--r--libge2d/readme.txt75
3 files changed, 49 insertions, 35 deletions
diff --git a/libge2d/ge2d_feature_test.c b/libge2d/ge2d_feature_test.c
index 23a197d..fa58247 100644
--- a/libge2d/ge2d_feature_test.c
+++ b/libge2d/ge2d_feature_test.c
@@ -58,9 +58,6 @@ static void print_usage(void)
printf ("Usage: ge2d_feature_test [options]\n\n");
printf ("Options:\n\n");
printf (" --op <0:fillrect, 1:blend, 2:strechblit, 3:blit> ge2d operation case.\n");
- printf (" --duration <milliseconds> Duration of each ge2d operation case.\n");
- printf (" --size <width>x<height> Set ge2d size.\n");
- printf (" --pixelformat <0:ARGB, 1:ABGR, 2:NV21> Set ge2d pixelformat.\n");
printf (" --help Print usage information.\n");
printf ("\n");
}
diff --git a/libge2d/ge2d_load_test.c b/libge2d/ge2d_load_test.c
index e3baec7..89074db 100644
--- a/libge2d/ge2d_load_test.c
+++ b/libge2d/ge2d_load_test.c
@@ -52,7 +52,7 @@ static void print_usage(void)
printf (" --op <0:fillrect, 1:blend, 2:strechblit, 3:blit> ge2d operation case.\n");
printf (" --duration <milliseconds> Duration of each ge2d operation case.\n");
printf (" --size <width>x<height> Set ge2d size.\n");
- printf (" --pixelformat <0:ARGB, 1:ABGR, 2:NV21> Set ge2d pixelformat.\n");
+ printf (" --pixelformat <define as pixel_format_t> Set ge2d pixelformat.\n");
printf (" --help Print usage information.\n");
printf ("\n");
}
@@ -219,11 +219,11 @@ int main(int argc, char **argv)
if (ret < 0)
goto exit;
-
+ #if 0
ret = aml_read_file(SRC_FILE_NAME,&ge2dinfo);
if (ret < 0)
goto exit;
-
+ #endif
stime = myclock();
for ( i = 0;i%100 || myclock()<(stime+DEMOTIME); i++) {
ret = aml_ge2d_process(&ge2dinfo);
diff --git a/libge2d/readme.txt b/libge2d/readme.txt
index b2aab2c..7587bf2 100644
--- a/libge2d/readme.txt
+++ b/libge2d/readme.txt
@@ -14,12 +14,13 @@ typedef struct aml_ge2d_info {
unsigned int color;
unsigned int gl_alpha;
} aml_ge2d_info_t;
-其数据结构含义如下:
-unsigned int offset: osd的y_offset;
-unsigned int blend_mode: blend_mode 只对blend操作有效;
-unsigned int color: 目前只对fillrectangle有效;
-GE2DOP ge2d_op: ge2d支持的操作
-ge2d支持的操作:
+
+some bits of struct aml_ge2d_info:
+unsigned int offset: y_offset of osd
+unsigned int blend_mode: only valid when work under blend operation
+unsigned int color: only valid when fillrectangle operation
+GE2DOP ge2d_op: supported ge2d operation
+supported ge2d operation include:
AML_GE2D_FILLRECTANGLE,
AML_GE2D_BLEND,
AML_GE2D_STRETCHBLIT,
@@ -35,46 +36,62 @@ typedef struct buffer_info {
int format;
unsigned int rotation;
} buffer_info_t;
-其数据结构含义如下:
-memtype: 如果由mem alloc,则设为:CANVAS_ALLOC
- 如果使用osd,则设为:CANVAS_OSD0/CANVAS_OSD1
-char* vaddr: 不填,for debug
-unsigned long paddr; 如果由mem alloc,则填写mem phy addr
- 如果使用osd,则不设,kernel会自行获取;
-unsigned int canvas_w;
-unsigned int canvas_h; 如果由mem alloc,则填写canvas width,height, related to mem size.
- 如果使用osd,则不设,kernel会自行获取;
-int format; 如果由mem alloc,则填写pixel format
- 如果使用osd,则不设,kernel会自行获取;
-rectangle_t rect; 根据实际情况填写rect,必须填;
-unsigned int rotation; 可设为0/90/180/270;
+some bits of struct buffer_info:
+memtype: if used as mem alloc:CANVAS_ALLOC
+ if used as OSD0/OSD1:CANVAS_OSD0/CANVAS_OSD1
+char* vaddr: not need set,for debug
+unsigned long paddr: if used as mem alloc,it is mem phy addr
+ if used as OSD0/OSD1,leave it unset,it will set by kernel;
+unsigned int canvas_w,
+unsigned int canvas_h: if used as mem alloc,for src, set it to rect.w, rect.h;
+ for dst, set it to canvas width,canvas height,
+ related to mem size.
+ if used as OSD0/OSD1,leave it unset,it will set by kernel;
+int format: if used as mem alloc,set pixel format
+ if used as OSD0/OSD1,leave it unset,it will set by kernel;
+rectangle_t rect: must be set,set it according real rect value.
+unsigned int rotation: it can be set GE2D_ROTATION,rotation 0/90/180/270;
-1. AML_GE2D_FILLRECTANGLE 需要设置的数据结构内容如下:
-需要设置:
-src_info[0];
+1. AML_GE2D_FILLRECTANGLE need set content:
+src_info[0];
dst_info;
color;
offset;
-2.AML_GE2D_BLEND需要设置的数据结构内容如下:
-需要设置:
+2.AML_GE2D_BLEND need set content:
src_info[0];
src_info[1];
dst_info;
blend_mode;
offset;
-
-3.AML_GE2D_STRETCHBLIT 需要设置的数据结构内容如下:
-需要设置:
+
+3.AML_GE2D_STRETCHBLIT need set content:
src_info[0];
dst_info;
offset;
-3.AML_GE2D_BLIT 需要设置的数据结构内容如下:
-需要设置:
+3.AML_GE2D_BLIT need set content:
src_info[0];
dst_info;
offset;
+/////////////////////////////////////////////////////////////////
+The test application include ge2d_load_test and ge2d_feature test.
+ge2d_load_test provide ge2d loading test.
+ ge2d_load_test --op 2 --duration 3000 --size 1920x1080 --pixelformat 0
+ --op <0:fillrect, 1:blend, 2:strechblit, 3:blit> ge2d operation case.
+ --duration <milliseconds> Duration of each ge2d operation case.
+ --size <width>x<height> Set ge2d size.
+ --pixelformat <define as pixel_format_t> Set ge2d pixelformat.
+
+note: tester can change memtype to GE2D_CANVAS_ALLOC/GE2D_CANVAS_OSD0/GE2D_CANVAS_OSD1 as your requirement
+ if src memtype is GE2D_CANVAS_ALLOC, it can read data from file via aml_read_file.
+ge2d_feature_test provide ge2d operation example.
+ge2d_feature_test --op 0
+ --op <0:fillrect, 1:blend, 2:strechblit, 3:blit> ge2d operation case;
+note: tester can change memtype to GE2D_CANVAS_ALLOC/GE2D_CANVAS_OSD0/GE2D_CANVAS_OSD1 as your requirement
+ if src1 memtype is GE2D_CANVAS_ALLOC, you can read data from file via aml_read_file_src1
+ if src2 memtype is GE2D_CANVAS_ALLOC, you can read data from file via aml_read_file_src2
+ if dst memtype is GE2D_CANVAS_ALLOC, you can write data to file aml_write_file