Tutorial
FM4, S6E2DH/S6E2DF/S6E2D5/S6E2D3 Series, 32-Bit Microcontroller, Graphic Driver User Manual, Doc. No. 002-04387 Rev. *A
60
/* To use partial rendering we switch on clipping and set the rectangle */
mmlGdcPeSurfAttribute(s_ctx, MML_GDC_PE_STORE, MML_GDC_PE_SURF_ATTR_USE_CLIPPING,
MM_TRUE);
mmlGdcPeActiveArea(s_ctx, MML_GDC_PE_STORE, 0, y_start, s_win.GetWidth(), lines);
This code ensures that all mmlGdcPeBlt() calls never write pixels to the target buffer below line y_start or above
y lines. In some cases the driver will detect that a blit operation for the upper part does not affect any pixels
in the clipped target buffer. The driver will generate a warning in this case and does not trigger any operation in the
HW.
Note:
Please remember the default zero point for blit operations is the lower left corner of the buffer.
To render the whole frame we need to call our render function 2 times and add the required instructions for
synchronization:
UTIL_SUCCESS(ret, mmlGdcPeWaitForDispFrameEnd(s_display, s_nSyncPoint));
UTIL_SUCCESS(ret, Render(s_display.GetHeight() - s_nSyncPoint, s_nSyncPoint));
UTIL_SUCCESS(ret, mmlGdcPeWaitForDispFrameEnd(s_display, s_display. GetHeight()));
UTIL_SUCCESS(ret, Render(0, s_display.GetHeight() - s_nSyncPoint));
The first instruction is a wait instruction for the line position s_nSyncPoint. Then we render the buffer part above the
sync point. Now we wait for the end of the screen and start to render the lower part of the screen.
s_nSyncPoint is set to a line below the middle of the screen because the bars are more present in the lower part so
this part will take more time.
This example splits the target buffer into 2 parts. It is possible to use 3 or more parts however it is not recommended
because each sync point will generate a render gap because the command sequencer must wait for a display
controller line.
Note:
It is possible to get a frame drop if the render time is too long for one part and the display line sync point is already
passed when the command sequencer reaches this instruction. It means the command sequencer will wait one
frame until the expected line is passed next time.