Results 1 to 4 of 4

Thread: Check the busy status of the OpenVG core

  1. #1
    Junior Member
    Join Date
    Oct 2009
    Posts
    6

    Check the busy status of the OpenVG core

    Hello,

    Is there a way to check the (gpu/state machine?) status on openVG?

    Currently the only way I have to synchronize is vgFinish which will stall the CPU and it cannot by used by my application. I need a mechanism to poll the state without blocking, such:

    rslt = vgIsFinish();

    Or getting a callback when finished... if it is done I can swap buffers and render the next frame other wise I can check later.

    Thanks in advance.

  2. #2
    Senior Member
    Join Date
    May 2008
    Posts
    104

    Re: Check the busy status of the OpenVG core

    You don't need to worry about when rendering is complete, the swap handles presentation and synchronization.

    You can explicitly flush a context with vgFlush() if you'd like, but a swap has an explicit flush. The swap will block until it's safe to start issuing rendering commands again. This could before the previous frame has completed rendering. But it will ensure your not rendering to a buffer which is currently being displayed.

    There normally lots of mechanism under the cover to do this kind of synchronization, but it's not necessary for applications by any means since the implementation can always handle all the synchronization that's required.

    Keep in mind however, some implementation might be more optimal then others, allowing greater overlap of resources.

  3. #3
    Junior Member
    Join Date
    Oct 2009
    Posts
    6

    Re: Check the busy status of the OpenVG core

    Well, the thing is I am working in part of the implementation, I cannot afford to wait any blocking function since I would be wasting precious CPU time on doing nothing. Since I am the one swapping the buffers directly, I was wondering if there was a standard mechanism of checking the status using the API or I had to drill down to the system to get an IRQ or something else to get that status flag. I guess I just can do the latest.

  4. #4
    Senior Member
    Join Date
    May 2008
    Posts
    104

    Re: Check the busy status of the OpenVG core

    If you doing the implementation, you shouldn't be calling eglSwapBuffers(), only applications should be doing this. The implementation of eglSwapBuffers() should tie into platform/OS specific code which handles synchronization and the actual buffer swap. In the implementation of this, you should make use of the OpenVG driver's internals to handle synchronization. How this is handled, depends on the windowing system, driver etc.

    If your aiming for something optimal, you want to ensure eglSwapBuffers() will only block the application as long as it needs too. This allows it to start queue rendering commands while the GPU is busy. But you also need to ensure it doesn't return before it's safe to do so. Driver's absolutely need a mechanism to know when rendering is complete, popular mechanisms are callbacks, or blocking function calls. If it's a blocking function call, you can have a thread block waiting for rendering to complete prior to doing the actual swap, so you can return early on the eglSwapBuffers().

Similar Threads

  1. Replies: 3
    Last Post: 06-24-2012, 07:01 AM
  2. Confused regarding status of OpenVG API
    By Seefer in forum OpenVG and VGU
    Replies: 3
    Last Post: 01-06-2009, 11:30 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •