30#ifndef __ARM_2D_HELPER_PFB_H__
31#define __ARM_2D_HELPER_PFB_H__
36#include "./__arm_2d_helper_common.h"
45# pragma clang diagnostic push
46# pragma clang diagnostic ignored "-Wgnu-zero-variadic-macro-arguments"
47# pragma clang diagnostic ignored "-Wmissing-declarations"
48# pragma clang diagnostic ignored "-Wpadded"
58#define ARM_2D_FPS_MODE_RENDER_ONLY 0
59#define ARM_2D_FPS_MODE_REAL 1
112#define ARM_2D_HELPER_PFB_INIT( __CB_ADDR, \
123 ARM_SECTION(".bss.noinit.arm_2d_pfb_pool") \
127 __PIXEL_TYPE tBuffer[(__PFB_WIDTH) * (__PFB_HEIGHT)]; \
128 } s_tPFBs[__PFB_NUM]; \
130 arm_2d_helper_pfb_cfg_t tCFG = { \
131 .tDisplayArea.tSize = { \
132 .iWidth = (__SCREEN_WIDTH), \
133 .iHeight = (__SCREEN_HEIGHT), \
136 .FrameBuffer.ptPFBs = (arm_2d_pfb_t *)s_tPFBs, \
137 .FrameBuffer.tFrameSize = { \
138 .iWidth = (__PFB_WIDTH), \
139 .iHeight = (__PFB_HEIGHT), \
141 .FrameBuffer.u24BufferSize = sizeof(s_tPFBs[0].tBuffer), \
142 .FrameBuffer.u7ColourFormat = (__COLOUR_FORMAT), \
143 .FrameBuffer.u8PFBNum = dimof(s_tPFBs), \
148 arm_2d_helper_pfb_init((__CB_ADDR), &tCFG); \
159#define ARM_2D_HELPER_PFB_UPDATE_ON_DRAW_HANDLER( \
163 arm_2d_helper_pfb_update_dependency((__CB_ADDR), \
164 ARM_2D_PFB_DEPEND_ON_DRAWING, \
165 (arm_2d_helper_pfb_dependency_t []) {{ \
167 .fnHandler = (__HANDLER), \
168 .pTarget = (NULL,##__VA_ARGS__),\
173#define __IMPL_ARM_2D_REGION_LIST(__NAME, ...) \
175 __NAME##_offset = __COUNTER__, \
178 arm_2d_region_list_item_t __NAME[] = {
181#define IMPL_ARM_2D_REGION_LIST(__NAME, ...) \
182 __IMPL_ARM_2D_REGION_LIST(__NAME,##__VA_ARGS__)
185#define END_IMPL_ARM_2D_REGION_LIST(...) \
188#define __ADD_REGION_TO_LIST(__NAME, ...) \
190 .ptNext = (arm_2d_region_list_item_t *) \
191 &(__NAME[__COUNTER__ - __NAME##_offset]), \
197#define ADD_REGION_TO_LIST(__NAME, ...) \
198 __ADD_REGION_TO_LIST(__NAME, ##__VA_ARGS__)
201#define __ADD_LAST_REGION_TO_LIST(__NAME, ...) \
209#define ADD_LAST_REGION_TO_LIST(__NAME, ...) \
210 __ADD_LAST_REGION_TO_LIST(__NAME, ##__VA_ARGS__)
213#define IMPL_PFB_ON_DRAW(__NAME) IMPL_ON_DRAW_EVT(__NAME)
216#define IMPL_PFB_ON_LOW_LV_RENDERING(__NAME) \
217 void __NAME(void *pTarget, \
218 const arm_2d_pfb_t *ptPFB, \
222#define IMPL_PFB_ON_FRAME_SYNC_UP(__NAME) \
223 bool __NAME(void *pTarget)
225#define IMPL_PFB_BEFORE_FLUSHING(__NAME) \
226 bool __NAME(void *pTarget, \
227 arm_2d_pfb_t *ptOrigin, \
228 arm_2d_pfb_t *ptScratch)
280#define init_arm_2d_helper_pfb( __CB_ADDR, \
290 ARM_2D_HELPER_PFB_INIT( \
310#define update_arm_2d_helper_pfb_on_draw_handler( \
314 ARM_2D_HELPER_PFB_UPDATE_ON_DRAW_HANDLER( \
316 (__HANDLER),##__VA_ARGRS__)
329#define arm_2d_helper_pfb_report_rendering_complete(__PFB_HELPER_PTR,...) \
330 __arm_2d_helper_pfb_report_rendering_complete((__PFB_HELPER_PTR), \
331 (NULL,##__VA_ARGS__))
334#define __arm_2d_helper_dirty_region_update_dirty_regions0 \
335 __arm_2d_helper_dirty_region_update_dirty_regions
348#define __arm_2d_helper_dirty_region_update_dirty_regions3( __helper_ptr, \
350 __visible_area_ptr, \
353 __arm_2d_helper_dirty_region_update_dirty_regions2( \
356 (__visible_area_ptr), \
367#define __arm_2d_helper_dirty_region_update_dirty_regions1( __helper_ptr, \
370 __arm_2d_helper_dirty_region_update_dirty_regions2( \
388#define arm_2d_helper_dirty_region_update_dirty_regions( __helper_ptr, \
391 ARM_CONNECT2(__arm_2d_helper_dirty_region_update_dirty_regions, \
392 __ARM_VA_NUM_ARGS(__VA_ARGS__))((__helper_ptr), \
396#define impl_arm_2d_region_list(__NAME, ...) \
397 IMPL_ARM_2D_REGION_LIST(__NAME,##__VA_ARGS__)
398#define add_region_to_list(__NAME, ...) \
399 ADD_REGION_TO_LIST(__NAME, ##__VA_ARGS__)
400#define add_last_region_to_list(__NAME, ...) \
401 ADD_LAST_REGION_TO_LIST(__NAME, ##__VA_ARGS__)
402#define end_impl_arm_2d_region_list(...) \
403 END_IMPL_ARM_2D_REGION_LIST(__VA_ARGS__)
405#define impl_pfb_on_draw(__NAME) IMPL_PFB_ON_DRAW(__NAME)
406#define impl_pfb_on_low_lv_rendering(__NAME) \
407 IMPL_PFB_ON_LOW_LV_RENDERING(__NAME)
457 uint32_t wSourceStride,
459 uint32_t wTargetStride,
462 uint_fast8_t chBytePerPixel );
489 uint32_t nDataItemCount,
490 uint_fast8_t chDataItemSize);
509#define ARM_2D_3FB_INVALID_IDX 3
519 uint8_t u2Drawing : 2;
520 uint8_t u2Flushing : 2;
521 uint8_t u2ReadyToFlush : 2;
522 uint8_t u2ReadyToDraw : 2;
524 uintptr_t tSemaphore;
525 bool bFBCopyComplete;
539 uint32_t u24Size : 24;
556 uint8_t chUserRegionIndex;
558 uint8_t bUpdated : 1;
561 uint16_t bFromInternalPool : 1;
562 uint16_t bFromHeap : 1;
563 uint16_t u2UpdateState : 2;
564 uint16_t u12KEY : 12;
660 uint32_t u24BufferSize : 24;
661 uint32_t u7ColourFormat : 7 ;
663 uint32_t u8PFBNum : 8;
664 uint32_t bDoNOTUpdateDefaultFrameBuffer : 1;
665 uint32_t bDisableDynamicFPBSize : 1;
666 uint32_t bSwapRGB16 : 1;
667 uint32_t bDebugDirtyRegions : 1;
669 uint32_t u3PixelWidthAlign : 3;
670 uint32_t u3PixelHeightAlign : 3;
671 uint32_t u4PoolReserve : 4;
689 ARM_2D_PERFC_RENDER = 0,
692 __ARM_2D_PERFC_COUNT,
717 } OptimizedDirtyRegions;
721 uint32_t wPFBPixelCount;
724 uint8_t chFreePFBCount;
726 uint16_t bIsDirtyRegionOptimizationEnabled : 1;
727 uint16_t bEnableDirtyRegionOptimizationRequest : 1;
728 uint16_t bDisableDirtyRegionOptimizationRequest : 1;
729 uint16_t bEncounterDynamicDirtyRegion : 1;
730 uint16_t bFailedToOptimizeDirtyRegion : 1;
731 uint16_t bIsUsingOptimizedDirtyRegionList : 1;
734 uint16_t bIsNewFrame : 1;
735 uint16_t bIgnoreCanvasColour : 1;
736 uint16_t bIgnoreLowLevelFlush : 1;
737 uint16_t bHideNavigationLayer : 1;
738 uint16_t bIsDryRun : 1;
739 uint16_t bNoAdditionalDirtyRegionList : 1;
740 uint16_t bFirstIteration : 1;
741 uint16_t bIsRegionChanged : 1;
746 uintptr_t pFPBPoolAvailable;
761 int32_t nRenderingCycle;
786 uint8_t bForceToUseMinimalEnclosure : 1;
787 uint8_t bSuspendUpdate : 1;
789 uint8_t bOnlyUpdateMinimalEnclosure : 1;
791 uint8_t chUpdateLifeCycle;
808 uint8_t chUpdateLifeCycle;
960 bool bConsiderDryRun);
1053 uint_fast8_t chMask,
1312 uint_fast8_t chCount);
1337 uint8_t chUserRegionIndex);
1391 uint8_t chNextUserIndex);
1404 uint8_t chNextUserIndex);
1432 uint_fast16_t hwCount);
1445 uint_fast16_t hwCount);
1795#if defined(__clang__)
1796# pragma clang diagnostic pop