canvas: get canvas w/h for frame check [2/2]
authorshihong.zheng <shihong.zheng@amlogic.com>
Tue, 6 Nov 2018 12:29:19 +0000 (20:29 +0800)
committerLuan Yuan <luan.yuan@amlogic.com>
Thu, 14 Mar 2019 09:24:01 +0000 (17:24 +0800)
PD#SWPL-1738

Problem:
support frame crc32 check and dump yuv.

Solution:
support frame check and yuv dump in media_module, add interface
to get canvas width/height.

Verify:
u212

Change-Id: Ieadc95521c4a21bec5685f8c8926d3bb2f92637b
Signed-off-by: shihong.zheng <shihong.zheng@amlogic.com>
drivers/amlogic/media/common/canvas/canvas.c
include/linux/amlogic/media/canvas/canvas.h

index 8e4b1f1..45caef2 100644 (file)
@@ -334,6 +334,27 @@ unsigned int canvas_get_addr(u32 index)
 }
 EXPORT_SYMBOL(canvas_get_addr);
 
+unsigned int canvas_get_width(u32 index)
+{
+       struct canvas_device_info *info = &canvas_info;
+
+       if (!CANVAS_VALID(index))
+               return 0;
+
+       return info->canvasPool[index].width;
+}
+EXPORT_SYMBOL(canvas_get_width);
+
+unsigned int canvas_get_height(u32 index)
+{
+       struct canvas_device_info *info = &canvas_info;
+
+       if (!CANVAS_VALID(index))
+               return 0;
+
+       return info->canvasPool[index].height;
+}
+EXPORT_SYMBOL(canvas_get_height);
 /*********************************************************/
 #define to_canvas(kobj) container_of(kobj, struct canvas_s, kobj)
 static ssize_t addr_show(struct canvas_s *canvas, char *buf)
index b5ad471..98de6f3 100644 (file)
@@ -86,4 +86,8 @@ extern void canvas_update_addr(u32 index, u32 addr);
 
 extern unsigned int canvas_get_addr(u32 index);
 
+extern unsigned int canvas_get_width(u32 index);
+
+extern unsigned int canvas_get_height(u32 index);
+
 #endif /* CANVAS_H */