11#include "region.h"
22
3+ #if defined(__INFINITY6C__ )
4+ #include "bmp/star/i6c_hal.c"
5+ #endif
6+
37// https://wx.comake.online/doc/ds82ff82j7jsd9-SSD220/customer/development/mi/en/exclude/mi_rgn.html
48
59#ifdef __SIGMASTAR__
@@ -25,7 +29,9 @@ int create_region(int *handle, int x, int y, int width, int height) {
2529 MI_RGN_ChnPortParam_t stChnAttrCurrent ;
2630
2731#if __INFINITY6C__
28- stChn .eModId = E_MI_MODULE_ID_VENC ;
32+ hal_rect rect = { .height = height , .width = width ,
33+ .x = x , .y = y };
34+ return i6c_region_create (0 ,rect ,255 );
2935#else
3036 stChn .eModId = E_MI_RGN_MODID_VPE ;
3137#endif
@@ -344,9 +350,11 @@ void *get_directBMP(int handle) {
344350 MI_RGN_CanvasInfo_t stCanvasInfo ;
345351 memset (& stCanvasInfo , 0 , sizeof (stCanvasInfo ));
346352 int s32Ret = GetCanvas (handle , & stCanvasInfo );
347- // printf("OSD Handle:%d CanvasStride: %d , Canvas size : %d:%d\r\n",
348- // handle, stCanvasInfo.u32Stride, stCanvasInfo.stSize.u32Width,
349- // stCanvasInfo.stSize.u32Height);
353+
354+ if (s32Ret )
355+ printf ("GetCanvas Res: %X OSD Handle:%d CanvasStride: %d , Canvas size : %d:%d\r\n" ,
356+ s32Ret , handle , stCanvasInfo .u32Stride , stCanvasInfo .stSize .u32Width ,
357+ stCanvasInfo .stSize .u32Height );
350358 return (void * )(stCanvasInfo .virtAddr );
351359#endif
352360 return NULL ;
@@ -422,8 +430,8 @@ int unload_region(int *handle) {
422430}
423431#ifdef __SIGMASTAR__
424432
425- int GetCanvas (int handle , MI_RGN_CanvasInfo_t * stCanvasInfo ) {
426- int s32Result = MI_RGN_GetCanvasInfo (DEV handle , stCanvasInfo );
433+ int GetCanvas (int handle , MI_RGN_CanvasInfo_t * stCanvasInfo ) {
434+ int s32Result = MI_RGN_GetCanvasInfo (DEV handle , stCanvasInfo );
427435 if (s32Result != MI_RGN_OK )
428436 return s32Result ;
429437
0 commit comments