Skip to content

Commit 6b73b7e

Browse files
committed
fixes example project: [template][bare-metal][an552]
1 parent f8bd66f commit 6b73b7e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+111184
-19891
lines changed

examples/[template][bare-metal][an552]/project/mdk/RTE/Acceleration/Eyeball.c

Lines changed: 4496 additions & 1522 deletions
Large diffs are not rendered by default.

examples/[template][bare-metal][an552]/project/mdk/RTE/Acceleration/LeftEye.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
/* Generated on Fri Nov 14 18:56:32 2025 from -i */
2+
/* Generated on Wed Dec 17 11:10:06 2025 from -i */
33
/* Re-sized : True */
44
/* Rotated : 0.0 deg */
55

@@ -6736,6 +6736,9 @@ const arm_2d_tile_t c_tileLeftEyeMask2 = {
67366736
.nAddress = ((intptr_t)c_bmpLeftEyeCCCA8888) + 3,
67376737
};
67386738

6739+
6740+
6741+
67396742
extern const arm_2d_tile_t c_tileLeftEyeMask;
67406743

67416744
ARM_SECTION("arm2d.tile.c_tileLeftEyeMask")
@@ -6750,7 +6753,7 @@ const arm_2d_tile_t c_tileLeftEyeMask = {
67506753
.bIsRoot = true,
67516754
.bHasEnforcedColour = true,
67526755
.tColourInfo = {
6753-
.chScheme = ARM_2D_COLOUR_8BIT,
6756+
.chScheme = ARM_2D_COLOUR_MASK_A8,
67546757
},
67556758
},
67566759
.pchBuffer = (uint8_t *)c_bmpLeftEyeAlpha,

examples/[template][bare-metal][an552]/project/mdk/RTE/Acceleration/arm_2d_cfg.h

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,13 @@ extern "C" {
6262
// <i> Note that enabling this feature will add the support for a special colour type: ARM_2D_CHANNEL_8in32
6363
// <i> This feature is disabled by default to save code size
6464
#ifndef __ARM_2D_CFG_SUPPORT_COLOUR_CHANNEL_ACCESS__
65-
# define __ARM_2D_CFG_SUPPORT_COLOUR_CHANNEL_ACCESS__ 1
65+
# define __ARM_2D_CFG_SUPPORT_COLOUR_CHANNEL_ACCESS__ 0
6666
#endif
6767

6868
// <q>Enable ccca8888(ARGB8888) implicit conversion
6969
// <i> This feature is disabled by default to save code size
7070
#ifndef __ARM_2D_CFG_SUPPORT_CCCA8888_IMPLICIT_CONVERSION__
71-
# define __ARM_2D_CFG_SUPPORT_CCCA8888_IMPLICIT_CONVERSION__ 1
71+
# define __ARM_2D_CFG_SUPPORT_CCCA8888_IMPLICIT_CONVERSION__ 0
7272
#endif
7373

7474
// <q>Improve the Quality of IIR Blur
@@ -175,21 +175,20 @@ extern "C" {
175175

176176
// <q> When opacity is 255, call the non-opacity version of API implicitily
177177
// <i> This option is used to improve the performance and reduce the application complexity in API selection. Disable this feature allows linker to remove unused APIs further.
178-
// <i> This option is enabled by default
178+
// <i> This option is disabled by default
179179
#ifndef __ARM_2D_CFG_CALL_NON_OPACITY_VERSION_IMPLICITILY_FOR_255__
180-
# define __ARM_2D_CFG_CALL_NON_OPACITY_VERSION_IMPLICITILY_FOR_255__ 1
180+
# define __ARM_2D_CFG_CALL_NON_OPACITY_VERSION_IMPLICITILY_FOR_255__ 0
181181
#endif
182182

183-
// <q> Optimize the scaler version of transform operations for pointer-like resources
183+
// <q> Optimize the transform operations for pointer-like resources
184184
// <i> This feature is enabled by default. There is no guarantee that the performance will increase or decrease. It is all depends your applications. In most of the case, enabling it helps.
185-
// <i> This feature has no meaning when the anti-alias transform is disabled or the helium acceleration is available.
185+
// <i> This feature has no meaning when the anti-alias transform is disabled.
186186
#ifndef __ARM_2D_CFG_OPTIMIZE_FOR_POINTER_LIKE_SHAPES_IN_TRANSFORM__
187187
# define __ARM_2D_CFG_OPTIMIZE_FOR_POINTER_LIKE_SHAPES_IN_TRANSFORM__ 1
188188
#endif
189189

190-
// <q> Optimize the scaler version of transform operations for hollow out masks
190+
// <q> Optimize the transform operations for hollow out masks
191191
// <i> This feature is disabled by default. There is no guarantee that the performance will increase or decrease. It is all depends your applications. If your application uses a lot of hollow out masks, it might help.
192-
// <i> This feature has no meaning when the anti-alias transform is disabled or the helium acceleration is available.
193192
#ifndef __ARM_2D_CFG_OPTIMIZE_FOR_HOLLOW_OUT_MASK_IN_TRANSFORM__
194193
# define __ARM_2D_CFG_OPTIMIZE_FOR_HOLLOW_OUT_MASK_IN_TRANSFORM__ 0
195194
#endif
@@ -198,7 +197,7 @@ extern "C" {
198197
// <i> Ignore the user application code when a PFB is output of the areas that generated with the layout assistant. Enabling this feature can improve the user application performance. This feature is disabled by default. It is recommended when you trys to optimize the application performance.
199198
// <i> If you see some visual elements are imcomplete, you can choose those layout assistants with "_open" as posfix in corresonding area. For example, arm_2d_align_centre() can be changed to arm_2d_align_centre_open().
200199
#ifndef __ARM_2D_CFG_OPTIMIZE_FOR_PFB_IN_LAYOUT_ASSISTANT__
201-
# define __ARM_2D_CFG_OPTIMIZE_FOR_PFB_IN_LAYOUT_ASSISTANT__ 1
200+
# define __ARM_2D_CFG_OPTIMIZE_FOR_PFB_IN_LAYOUT_ASSISTANT__ 0
202201
#endif
203202

204203
// <q> Force to disable Anti-Alias in Fill-colour-with-transformed-mask-and-opacity.

examples/[template][bare-metal][an552]/project/mdk/RTE/Acceleration/arm_2d_disp_adapter_0.c

Lines changed: 51 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -715,8 +715,6 @@ static void __user_scene_player_init(void)
715715
extern arm_2d_helper_2d_copy_handler_t __disp_adapter0_request_2d_copy;
716716
extern arm_2d_helper_dma_copy_handler_t __disp_adapter0_request_dma_copy;
717717

718-
719-
arm_2d_helper_3fb_cfg_t tCFG = {
720718
arm_2d_helper_3fb_cfg_t tCFG = {
721719
.tScreenSize = {
722720
#if __DISP0_CFG_ROTATE_SCREEN__ == 1\
@@ -1061,10 +1059,54 @@ void __disp_adapter0_vres_asset_2dcopy( uintptr_t pObj,
10611059
}
10621060
}
10631061

1062+
__WEAK
1063+
bool __disp_adapter0_vres_asset_hint_on_load(uintptr_t pObj,
1064+
arm_2d_vres_t *ptVRES,
1065+
arm_2d_region_t *ptRegion)
1066+
{
1067+
ARM_2D_UNUSED(pObj);
1068+
ARM_2D_UNUSED(ptVRES);
1069+
ARM_2D_UNUSED(ptRegion);
1070+
1071+
/*
1072+
* NOTE: When return true, it means user provides buffer and stores
1073+
* the buffer address in ptVRES->tTile.nAddress. Once you have
1074+
* return true, you take the responsiblity to manage the buffer,
1075+
* and please make sure you return true in
1076+
* __disp_adapter0_vres_asset_hint_depose also.
1077+
*
1078+
*/
1079+
return false;
1080+
}
1081+
1082+
__WEAK
1083+
bool __disp_adapter0_vres_asset_hint_depose(uintptr_t pObj,
1084+
arm_2d_vres_t *ptVRES,
1085+
intptr_t pBuffer)
1086+
{
1087+
ARM_2D_UNUSED(pObj);
1088+
ARM_2D_UNUSED(ptVRES);
1089+
ARM_2D_UNUSED(pBuffer);
1090+
1091+
/*
1092+
* NOTE: When return true, it means user provides buffer and stores
1093+
* the buffer address in ptVRES->tTile.nAddress.
1094+
*
1095+
* NOTE: It is YOUR responsibility to manage the buffer (e.g. release)
1096+
* and the display adapter service will NOT release the buffer
1097+
* for you.
1098+
*/
1099+
return false;
1100+
}
1101+
1102+
10641103
intptr_t __disp_adapter0_vres_asset_loader (uintptr_t pObj,
10651104
arm_2d_vres_t *ptVRES,
10661105
arm_2d_region_t *ptRegion)
10671106
{
1107+
bool bUserAllocated =
1108+
__disp_adapter0_vres_asset_hint_on_load(pObj, ptVRES, ptRegion);
1109+
10681110
COLOUR_INT *pBuffer = NULL;
10691111
size_t nPixelSize = sizeof(COLOUR_INT);
10701112
size_t tBufferSize;
@@ -1088,7 +1130,8 @@ intptr_t __disp_adapter0_vres_asset_loader (uintptr_t pObj,
10881130

10891131
/* background load mode */
10901132
do {
1091-
if (ptVRES->tTile.tInfo.u3ExtensionID != ARM_2D_TILE_EXTENSION_VRES) {
1133+
if (ptVRES->tTile.tInfo.u3ExtensionID != ARM_2D_TILE_EXTENSION_VRES /* NOT copy only */
1134+
&& !bUserAllocated) { /* NO user provided buffer*/
10921135
break;
10931136
}
10941137

@@ -1114,7 +1157,6 @@ intptr_t __disp_adapter0_vres_asset_loader (uintptr_t pObj,
11141157
/* default condition */
11151158
tBufferSize = ptRegion->tSize.iHeight * nBytesPerLine;
11161159

1117-
11181160
#if __DISP0_CFG_USE_HEAP_FOR_VIRTUAL_RESOURCE_HELPER__
11191161
pBuffer = __disp_adapter0_aligned_malloc(tBufferSize, nPixelSize);
11201162
assert(NULL != pBuffer);
@@ -1133,6 +1175,7 @@ intptr_t __disp_adapter0_vres_asset_loader (uintptr_t pObj,
11331175
}
11341176
pBuffer = (COLOUR_INT *)((uintptr_t)ptPFB + sizeof(arm_2d_pfb_t));
11351177
#endif
1178+
11361179
/* load content into the buffer */
11371180
if (nBitsPerPixel < 8) {
11381181
/* A1, A2 and A4 support */
@@ -1180,6 +1223,10 @@ void __disp_adapter0_vres_buffer_deposer (
11801223
arm_2d_vres_t *ptVRES,
11811224
intptr_t pBuffer )
11821225
{
1226+
if (__disp_adapter0_vres_asset_hint_depose(pTarget, ptVRES, pBuffer)) {
1227+
return ;
1228+
}
1229+
11831230
#if __DISP0_CFG_USE_HEAP_FOR_VIRTUAL_RESOURCE_HELPER__
11841231
ARM_2D_UNUSED(pTarget);
11851232
ARM_2D_UNUSED(ptVRES);

examples/[template][bare-metal][an552]/project/mdk/RTE/Acceleration/arm_2d_disp_adapter_0.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ extern "C" {
102102
// <o>Height of the PFB block
103103
// <i> The height of your PFB block size used in disp0
104104
#ifndef __DISP0_CFG_PFB_BLOCK_HEIGHT__
105-
# define __DISP0_CFG_PFB_BLOCK_HEIGHT__ 240
105+
# define __DISP0_CFG_PFB_BLOCK_HEIGHT__ 24
106106
#endif
107107

108108
// <o>Width Alignment of generated PFBs

0 commit comments

Comments
 (0)