This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

when we are trying to paint continuously on screen with help of DirectDraw then CPU utilization reached 100%and the whole systems gets hanged.

Other Parts Discussed in Thread: AM3517

I  have Am3517  Windows Embedded compact 7  BSP 

I am facing an issue with display driver, i.e. when we are trying to paint continuously on screen with help of DirectDraw then CPU utilization reached 100%and the whole systems gets hanged.

 

We have observed this issue with sample application which has come with “Windows Embedded Compact 7” OS (for example: the donut application).

 

We have verified CPU consumption is up to 100%.with Windows Embedded compact 7 Remote Performance Monitoring Tool.

 

Is there any issue with direct draw or Am3517 display driver has some issues?

  • I think the issue (at least with Donut application) is the way it is calling flip. (I'm looking at it from the display driver perspective and what options it is getting called with).

    Basically what is happening right now is that display driver's flip is getting called with 0 options and the display driver will continuously return DDERR_WASSTILLDRAWING till it is done displaying the previous frame. The 100% cpu utilization is because of this continuous loop in donuts.c::flipscreen.

        From donuts.c:    ddrval = lpFrontBuffer->lpVtbl->Flip( lpFrontBuffer, NULL, 0 );

    I modified the display driver (as an experiment) to hardcode the option DDFLIP_WAITNOTBUSY in the flip function.  With this the cpu utilization drops to about 20% with no discernible difference in visual experience. This is because display driver will now block on vsync interrupt waiting for the previous frame to finish displaying (display driver anyway cannot udpate more than the vsync rate).

    If you enable the option I mentioned in the call to flip I think even in your application you should see the cpu utilization come down.  

    Hope this helps.