Skip to content

Commit

Permalink
Update infinity6c support
Browse files Browse the repository at this point in the history
  • Loading branch information
viktorxda committed Feb 2, 2025
1 parent 8ed94f9 commit 84bb11c
Show file tree
Hide file tree
Showing 74 changed files with 50 additions and 14,856 deletions.
3 changes: 0 additions & 3 deletions bmp/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,7 @@ extern "C" {
#include "config.h"

#ifdef __SIGMASTAR__
#include "mi_common.h"
#include "mi_rgn.h"
//#include "mi_vpe.h"
#include "mi_venc.h"

#define IO_BASE 0x1F000000
#define IO_SIZE 0x400000
Expand Down
38 changes: 17 additions & 21 deletions bmp/region.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ int create_region(int *handle, int x, int y, int width, int height) {
PIXEL_FORMAT_DEFAULT; // PIXEL_FORMAT_1555;// E_MI_RGN_PIXEL_FORMAT_I4;
// //;PIXEL_FORMAT_1555;//E_MI_RGN_PIXEL_FORMAT_I4;//PIXEL_FORMAT_1555

s32Ret = MI_RGN_GetAttr(*handle, &stRegionCurrent);
s32Ret = MI_RGN_GetAttr(DEV *handle, &stRegionCurrent);
#else
MPP_CHN_S stChn;

Expand Down Expand Up @@ -64,7 +64,7 @@ int create_region(int *handle, int x, int y, int width, int height) {
fprintf(stderr, "[%s:%d]RGN_GetAttr failed with %#x , creating region %d...\n",
__func__, __LINE__, s32Ret, *handle);
#ifdef __SIGMASTAR__
s32Ret = MI_RGN_Create(*handle, &stRegion);
s32Ret = MI_RGN_Create(DEV *handle, &stRegion);
#else
s32Ret = HI_MPI_RGN_Create(*handle, &stRegion);
#endif
Expand All @@ -89,11 +89,11 @@ int create_region(int *handle, int x, int y, int width, int height) {
__LINE__);
#ifdef __SIGMASTAR__
stChn.s32OutputPortId = 1;
MI_RGN_DetachFromChn(*handle, &stChn);
MI_RGN_DetachFromChn(DEV *handle, &stChn);
stChn.s32OutputPortId = 0;
MI_RGN_DetachFromChn(*handle, &stChn);
MI_RGN_Destroy(*handle);
s32Ret = MI_RGN_Create(*handle, &stRegion);
MI_RGN_DetachFromChn(DEV *handle, &stChn);
MI_RGN_Destroy(DEV *handle);
s32Ret = MI_RGN_Create(DEV *handle, &stRegion);
#else
HI_MPI_RGN_DetachFromChn(*handle, &stChn);
HI_MPI_RGN_Destroy(*handle);
Expand All @@ -107,7 +107,7 @@ int create_region(int *handle, int x, int y, int width, int height) {
}

#ifdef __SIGMASTAR__
s32Ret = MI_RGN_GetDisplayAttr(*handle, &stChn, &stChnAttrCurrent);
s32Ret = MI_RGN_GetDisplayAttr(DEV *handle, &stChn, &stChnAttrCurrent);
#else
s32Ret = HI_MPI_RGN_GetDisplayAttr(*handle, &stChn, &stChnAttrCurrent);
#endif
Expand All @@ -129,9 +129,9 @@ int create_region(int *handle, int x, int y, int width, int height) {
__func__, __LINE__, *handle, &stChn.s32ChnId);
#ifdef __SIGMASTAR__
stChn.s32OutputPortId = 1;
MI_RGN_DetachFromChn(*handle, &stChn);
MI_RGN_DetachFromChn(DEV *handle, &stChn);
stChn.s32OutputPortId = 0;
MI_RGN_DetachFromChn(*handle, &stChn);
MI_RGN_DetachFromChn(DEV *handle, &stChn);
#else
HI_MPI_RGN_DetachFromChn(*handle, &stChn);
#endif
Expand All @@ -158,9 +158,9 @@ int create_region(int *handle, int x, int y, int width, int height) {
*/

stChn.s32OutputPortId = 0;
s32Ret = MI_RGN_AttachToChn(*handle, &stChn, &stChnAttr);
s32Ret = MI_RGN_AttachToChn(DEV *handle, &stChn, &stChnAttr);
stChn.s32OutputPortId = 1;
s32Ret = MI_RGN_AttachToChn(*handle, &stChn, &stChnAttr);
s32Ret = MI_RGN_AttachToChn(DEV *handle, &stChn, &stChnAttr);
#else
memset(&stChnAttr, 0, sizeof(RGN_CHN_ATTR_S));
stChnAttr.bShow = 1;
Expand Down Expand Up @@ -312,7 +312,7 @@ int set_bitmap(int handle, BITMAP *bitmap) {
int s32Ret = 0;
#if !defined(_x86) && !defined(__ROCKCHIP__)
#ifdef __SIGMASTAR__
s32Ret = MI_RGN_SetBitMap(handle, (MI_RGN_Bitmap_t *)(bitmap));
s32Ret = MI_RGN_SetBitMap(DEV handle, (MI_RGN_Bitmap_t *)(bitmap));
#elif __GOKE__
s32Ret = HI_MPI_RGN_SetBitMap(handle, (BITMAP_S *)(bitmap));
#endif
Expand Down Expand Up @@ -365,7 +365,7 @@ unsigned long set_bitmapEx(int handle, BITMAP *bitmap, int BitsPerPixel) {
// bitmap->u32Height
// * byteWidth);

s32Ret = MI_RGN_UpdateCanvas(handle);
s32Ret = MI_RGN_UpdateCanvas(DEV handle);

if (verbose)
printf("MI_RGN_UpdateCanvas completed byteWidth:%d!\n", byteWidth);
Expand All @@ -390,10 +390,10 @@ int unload_region(int *handle) {

stChn.eModId = E_MI_RGN_MODID_VPE;
stChn.s32OutputPortId = 1;
MI_RGN_DetachFromChn(*handle, &stChn);
MI_RGN_DetachFromChn(DEV *handle, &stChn);
stChn.s32OutputPortId = 0;
MI_RGN_DetachFromChn(*handle, &stChn);
s32Ret = MI_RGN_Destroy(*handle);
MI_RGN_DetachFromChn(DEV *handle, &stChn);
s32Ret = MI_RGN_Destroy(DEV *handle);
if (s32Ret)
fprintf(stderr, "[%s:%d]RGN_Destroy failed with %#x %d!\n", __func__, __LINE__, s32Ret,
*handle);
Expand All @@ -414,7 +414,7 @@ int unload_region(int *handle) {
#ifdef __SIGMASTAR__

int GetCanvas(int handle, MI_RGN_CanvasInfo_t *stCanvasInfo) {
int s32Result = MI_RGN_GetCanvasInfo(handle, stCanvasInfo);
int s32Result = MI_RGN_GetCanvasInfo(DEV handle, stCanvasInfo);
if (s32Result != MI_RGN_OK)
return s32Result;

Expand Down Expand Up @@ -468,7 +468,3 @@ void DrawBitmap1555ToI4(uint16_t *srcBitmap, uint32_t width, uint32_t height, ui
}

#endif
// //if (MI_RGN_UpdateCanvas(hHandle) != MI_RGN_OK)
// // return s32Result;

// }
13 changes: 9 additions & 4 deletions osd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1851,7 +1851,7 @@ static void draw_screenBMP() {
// LastDrawn));
if (DrawOSD)
if (useDirectBMPBuffer) {
int s32Ret = MI_RGN_UpdateCanvas(osds[FULL_OVERLAY_ID].hand);
int s32Ret = MI_RGN_UpdateCanvas(DEV osds[FULL_OVERLAY_ID].hand);
bmpBuff.pData = NULL; // we must reset it so that we get it the next
// iteration to draw!
if (verbose && s32Ret != 0)
Expand Down Expand Up @@ -2254,7 +2254,12 @@ static void InitMSPHook() {
}

#ifdef __SIGMASTAR__
int s32Ret = MI_RGN_Init(&g_stPaletteTable);
#if __INFINITY6C__
if (MI_SYS_Init(0))
fprintf(stderr, "[%s:%d]MI_SYS_Init failed with!\n", __func__, __LINE__);
#endif

int s32Ret = MI_RGN_Init(DEV &g_stPaletteTable);
if (verbose)
printf("MI_RGN_Init results: %d\n", s32Ret);
if (s32Ret)
Expand Down Expand Up @@ -2352,7 +2357,7 @@ static void InitMSPHook() {
void *bmp = get_directBMP(osds[FULL_OVERLAY_ID].hand);
memcpy(bmp, bitmap.pData,
bitmap.u32Height * getRowStride(bitmap.u32Width, PIXEL_FORMAT_BitsPerPixel));
MI_RGN_UpdateCanvas(osds[FULL_OVERLAY_ID].hand);
MI_RGN_UpdateCanvas(DEV osds[FULL_OVERLAY_ID].hand);

if (true) {
useDirectBMPBuffer = true;
Expand Down Expand Up @@ -2423,7 +2428,7 @@ static void CloseMSP() {
// s32Ret = MI_RGN_Destroy(&osds[FULL_OVERLAY_ID].hand);
s32Ret = unload_region(&osds[FULL_OVERLAY_ID].hand);

deinit = MI_RGN_DeInit();
deinit = MI_RGN_DeInit(DEV2);
if (deinit)
printf("[%s:%d]RGN_DeInit failed with %#x!\n", __func__, __LINE__, s32Ret);
#endif
Expand Down
69 changes: 0 additions & 69 deletions sdk/infinity6/include/CusEarlyInit_para.h

This file was deleted.

Loading

0 comments on commit 84bb11c

Please sign in to comment.