Skip to content

Commit

Permalink
improve 3FB service
Browse files Browse the repository at this point in the history
  • Loading branch information
GorgonMeducer committed Dec 26, 2024
1 parent ccf8600 commit f6e76a9
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 19 deletions.
2 changes: 1 addition & 1 deletion ARM.Arm-2D.pdsc
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@
</RTE_Components_h>
</component>

<component Cclass="Acceleration" Cgroup="Arm-2D Helper" Csub="PFB" Cversion="2.5.0" condition="Arm-2D-CORE">
<component Cclass="Acceleration" Cgroup="Arm-2D Helper" Csub="PFB" Cversion="2.5.1" condition="Arm-2D-CORE">
<description>Helper services for LCD adaptor(s), e.g. Generic Partial Framebuffer, Scene Player etc.</description>
<files>
<file category="include" name="Helper/Include/" />
Expand Down
4 changes: 2 additions & 2 deletions Helper/Include/arm_2d_helper_pfb.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
* Title: #include "arm_2d_helper_pfb.h"
* Description: Public header file for the PFB helper service
*
* $Date: 05. Dec 2024
* $Revision: V.1.12.3
* $Date: 26. Dec 2024
* $Revision: V.1.12.4
*
* Target Processor: Cortex-M cores
* -------------------------------------------------------------------- */
Expand Down
33 changes: 17 additions & 16 deletions Helper/Source/arm_2d_helper_pfb.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
* Title: #include "arm_2d_helper_pfb.c"
* Description: the pfb helper service source code
*
* $Date: 05. Dec 2024
* $Revision: V.1.12.3
* $Date: 26. Dec 2024
* $Revision: V.1.12.4
*
* Target Processor: Cortex-M cores
* -------------------------------------------------------------------- */
Expand Down Expand Up @@ -3165,11 +3165,12 @@ __arm_2d_helper_3fb_get_drawing_pointer(arm_2d_helper_3fb_t *ptThis, bool bIsNew

uint_fast8_t chDrawingIndex;
uint_fast8_t chReadyToDrawIndex;

uint_fast8_t chReadyToFlushIndex;

arm_irq_safe {
chDrawingIndex = this.Runtime.u2Drawing;
chReadyToDrawIndex = this.Runtime.u2ReadyToDraw;
chReadyToFlushIndex = this.Runtime.u2ReadyToFlush;
}

uintptr_t pnAddress = this.tCFG.pnAddress[chDrawingIndex];
Expand All @@ -3179,7 +3180,7 @@ __arm_2d_helper_3fb_get_drawing_pointer(arm_2d_helper_3fb_t *ptThis, bool bIsNew
arm_irq_safe {

/* drawing: no */
if (ARM_2D_3FB_INVALID_IDX == this.Runtime.u2Drawing) {
if (ARM_2D_3FB_INVALID_IDX == chDrawingIndex) {
/* ensure ready-to-draw: available */
assert(ARM_2D_3FB_INVALID_IDX != chReadyToDrawIndex);

Expand All @@ -3197,10 +3198,10 @@ __arm_2d_helper_3fb_get_drawing_pointer(arm_2d_helper_3fb_t *ptThis, bool bIsNew
} /* drawing: yes */

/* check whether Ready-To-Flush is empty */
if (this.Runtime.u2ReadyToFlush == ARM_2D_3FB_INVALID_IDX) {
if ((ARM_2D_3FB_INVALID_IDX == chReadyToFlushIndex)
&& (ARM_2D_3FB_INVALID_IDX != chReadyToDrawIndex)
&& (ARM_2D_3FB_INVALID_IDX != chDrawingIndex)) {

/* ensure ready-to-draw: available */
assert(ARM_2D_3FB_INVALID_IDX != chReadyToDrawIndex);
this.Runtime.tState[chDrawingIndex] = ARM_3FB_STATE_COPYING_AS_SOURCE;
this.Runtime.tState[chReadyToDrawIndex] = ARM_3FB_STATE_COPYING_AS_TARGET;
this.Runtime.u2ReadyToDraw = ARM_2D_3FB_INVALID_IDX;
Expand All @@ -3213,12 +3214,13 @@ __arm_2d_helper_3fb_get_drawing_pointer(arm_2d_helper_3fb_t *ptThis, bool bIsNew
if (bPrepareForCopy) {

this.Runtime.bFBCopyComplete = false;
__arm_2d_helper_3fb_dma_copy(ptThis,
this.tCFG.evtOnDMACopy.pObj,
this.tCFG.pnAddress[chDrawingIndex],
this.tCFG.pnAddress[chReadyToDrawIndex],
this.tCFG.tScreenSize.iWidth * this.tCFG.tScreenSize.iHeight,
this.tCFG.chPixelBits >> 3);
ARM_2D_INVOKE_RT_VOID(this.tCFG.evtOnDMACopy.fnHandler,
ARM_2D_PARAM(ptThis,
this.tCFG.evtOnDMACopy.pObj,
this.tCFG.pnAddress[chDrawingIndex],
this.tCFG.pnAddress[chReadyToDrawIndex],
this.tCFG.tScreenSize.iWidth * this.tCFG.tScreenSize.iHeight,
this.tCFG.chPixelBits >> 3));

while(true) {
if (this.Runtime.bFBCopyComplete) {
Expand Down Expand Up @@ -3278,15 +3280,14 @@ bool __arm_2d_helper_3fb_draw_bitmap( arm_2d_helper_3fb_t *ptThis,
int16_t iWidth = MIN(iPFBWidth, iLCDWidth);

return this.tCFG.evtOn2DCopy.fnHandler(ptThis,
this.tCFG.evtOnDMACopy.pObj,
this.tCFG.evtOn2DCopy.pObj,
pnSource,
wPFBStrideInByte,
pnTarget,
wLCDStrideInByte,
iWidth,
iHeight,
chBytePerPixel
);
chBytePerPixel);
}


Expand Down

0 comments on commit f6e76a9

Please sign in to comment.