Skip to content

Commit e6d7de8

Browse files
committed
Fixed regions on hisi-v4, updated README
1 parent 7798496 commit e6d7de8

File tree

5 files changed

+30
-2
lines changed

5 files changed

+30
-2
lines changed

src/hal/hisi/v4_hal.c

+5-1
Original file line numberDiff line numberDiff line change
@@ -338,10 +338,13 @@ int v4_region_create(char handle, hal_rect rect)
338338
v4_rgn_cnf region, regionCurr;
339339
v4_rgn_chn attrib, attribCurr;
340340

341+
memset(&region, 0, sizeof(region));
341342
region.type = V4_RGN_TYPE_OVERLAY;
342-
region.overlay.pixFmt = V4_PIXFMT_ABGR1555;
343+
region.overlay.pixFmt = V4_PIXFMT_ARGB1555;
343344
region.overlay.size.width = rect.width;
344345
region.overlay.size.height = rect.height;
346+
region.overlay.canvas = handle;
347+
345348
if (ret = v4_rgn.fnGetRegionConfig(handle, &regionCurr)) {
346349
fprintf(stderr, "[v4_rgn] Creating region %d...\n", handle);
347350
if (ret = v4_rgn.fnCreateRegion(handle, &region))
@@ -372,6 +375,7 @@ int v4_region_create(char handle, hal_rect rect)
372375
attrib.overlay.point.x = rect.x;
373376
attrib.overlay.point.y = rect.y;
374377
attrib.overlay.layer = 7;
378+
attrib.overlay.attachDest = V4_RGN_DEST_MAIN;
375379

376380
v4_rgn.fnAttachChannel(handle, &channel, &attrib);
377381

src/hal/hisi/v4_rgn.h

+22-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@ typedef enum {
1111
V4_RGN_BLK_END
1212
} v4_rgn_blk;
1313

14+
typedef enum {
15+
V4_RGN_DEST_MAIN,
16+
V4_RGN_DEST_MPF0,
17+
V4_RGN_DEST_MPF1,
18+
V4_RGN_DEST_END
19+
} v4_rgn_dest;
20+
1421
typedef enum {
1522
V4_RGN_TYPE_OVERLAY,
1623
V4_RGN_TYPE_COVER,
@@ -43,6 +50,8 @@ typedef struct {
4350
int quality;
4451
int qualOff;
4552
v4_rgn_inv invert;
53+
v4_rgn_dest attachDest;
54+
unsigned short colorLut[2];
4655
} v4_rgn_ovlc;
4756

4857
typedef struct {
@@ -59,6 +68,7 @@ typedef struct {
5968
};
6069
unsigned int color;
6170
unsigned int layer;
71+
int absOrRatioCoord;
6272
} v4_rgn_covc;
6373

6474
typedef struct {
@@ -67,8 +77,19 @@ typedef struct {
6777
unsigned int bgAlpha;
6878
// Accepts values from 0-15
6979
unsigned int layer;
80+
unsigned short colorLut[2];
7081
} v4_rgn_ovlxc;
7182

83+
typedef struct {
84+
int quadRangleOn;
85+
union {
86+
v4_common_rect rect;
87+
v4_rgn_qdr quadR;
88+
};
89+
unsigned int color;
90+
unsigned int layer;
91+
} v4_rgn_covxc;
92+
7293
typedef struct {
7394
v4_common_rect rect;
7495
v4_rgn_blk blkSize;
@@ -82,7 +103,7 @@ typedef struct {
82103
union {
83104
v4_rgn_ovlc overlay;
84105
v4_rgn_covc cover;
85-
v4_rgn_covc coverex;
106+
v4_rgn_covxc coverex;
86107
v4_rgn_ovlxc overlayex;
87108
v4_rgn_mosc mosaic;
88109
};

src/hal/sstar/i6_hal.c

+1
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,7 @@ int i6_region_create(char handle, hal_rect rect)
323323
region.pixFmt = I6_RGN_PIXFMT_ARGB1555;
324324
region.size.width = rect.width;
325325
region.size.height = rect.height;
326+
326327
if (ret = i6_rgn.fnGetRegionConfig(handle, &regionCurr)) {
327328
fprintf(stderr, "[i6_rgn] Creating region %d...\n", handle);
328329
if (ret = i6_rgn.fnCreateRegion(handle, &region))

src/hal/sstar/i6c_hal.c

+1
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,7 @@ int i6c_region_create(char handle, hal_rect rect)
407407
region.pixFmt = I6C_RGN_PIXFMT_ARGB1555;
408408
region.size.width = rect.width;
409409
region.size.height = rect.height;
410+
410411
if (ret = i6c_rgn.fnGetRegionConfig(0, handle, &regionCurr)) {
411412
fprintf(stderr, "[i6c_rgn] Creating region %d...\n", handle);
412413
if (ret = i6c_rgn.fnCreateRegion(0, handle, &region))

src/hal/sstar/i6f_hal.c

+1
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,7 @@ int i6f_region_create(char handle, hal_rect rect)
384384
region.pixFmt = I6F_RGN_PIXFMT_ARGB1555;
385385
region.size.width = rect.width;
386386
region.size.height = rect.height;
387+
387388
if (ret = i6f_rgn.fnGetRegionConfig(0, handle, &regionCurr)) {
388389
fprintf(stderr, "[i6f_rgn] Creating region %d...\n", handle);
389390
if (ret = i6f_rgn.fnCreateRegion(0, handle, &region))

0 commit comments

Comments
 (0)