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.

TDA2PXEVM: [OpenGL] how to run multiple OpenGL renders(windows) into one screen

Part Number: TDA2PXEVM

Hello All:

  As we discussed before that VisionSDK is not support the QT environment.

  We have the AVM which is developed by QT that we need to porting to VisionSDK.

 This AVM will create two QT windows(part of the whole screen) that each window will run OpenGL to render the output to parts of the screen.(Eg. 50%s for each window),

 please see the diagram as following 

For now, without QT window support, how can we:

1. Create multiple window(or surface) for each OpenGL?

2.Each OpenGL render only render part(50%)  of the screen? 

Any suggestion is appreciated!

  • Hi,

    You can use vDRM available in VisionSDK 3.05 to achieve this.
    1. Use 2 display pipelines
    2. Map them as 2 independent displays on A15 using vDRM
    3. Each OpenGL application writes to separate display. They are independent apps
    4. Blend the display pipelines from M4 using DSS overlay manager

    This is the most efficient implementation for your use case. It avoids GPU copy, GPU composition and uses HW features to perform the blending.

    Regards,
    Anand
  • Hi Anand:

    Anand Balagopalakrishnan said:
    3. Each OpenGL application writes to separate display. They are independent apps

      we only have one application, and run OpenGL twice, each using GPU rendering to the half of the screen.

    For EGL, can we create two window or surfaces, and each use GPU to the own surface, and overlay this two surface only on EGL level?

  • Hi:

      can we create two windows of suface in EGL level then let the display subsystem to do layer Composition?

  • Hi,

    If you are using a single application and running OpenGL twice, the approach is very simple and can be addressed within the OpenGL paradigm itself. You should create a single EGLDisplay and EGLSurface that spans the complete display.

    In the first pass, set the view port to left half. The second pass, set the view port to second half. This is what Qt will be doing as well.

    Regards,
    Anand
  • Hi,

    Having given the viewport approach with single process, I still think two different applications is better because it makes more optimal use of GPU.

    If you model two halves of screen as two different virtual displays, you can run two applications in parallel. Each application will have its own EGLDisplay, EGLSurface and will latch onto a virtual display. Since they are non-overlapping, both applications can run in parallel. This can potentially enable running vertex and fragment processing stages of both applications in parallel. On the flip side, you have to take care of synchronization between applications so that the rendered frames arrive in sync (if required).

    With a single application, there is a multi-pass and you will serialize the OpenGL calls for each half. There could be time when half the GPU is idle.

    This is a tradeoff you have to consider in your design - complexity vs efficiency.

    Regards,
    Anand
  • Anand Balagopalakrishnan said:
    In the first pass, set the view port to left half. The second pass, set the view port to second half. This is what Qt will be doing as well.

    yes, I try it like :

    1. render1:

        glViewport(0,0,x,y)

        .....

    2. render2:

       glViewport(x,y,w,h)

       ....

    3. eglSwap()

    but it only display the output of render2

  • Hi Anand:
    Yes agree that, but the two window(AVM view) has connection between each other, for now, we want to fix it ASAP just for demo show.
  • Hi,

    The SGX is a deferred rendering GPU. As such, the render calls are triggered on eglSwap(). Can you try a glFlush() in between the two render calls?

    The other approach is to use a pixmap surface and render to it.

    Regards,
    Anand
  • Hi All:
    just comments that:
    1. using glViewPort() you can create much window as you like.
    2. for us, two window are rendering in one application(process) that if we draw two windows with one eglswap(), several times, the eglswap() will block. thus we must draw one window then call eglswap() immediately, issue will be fixed and get better performance.
  • Hi,

    Thanks for the update. Makes sense.

    Regards,
    Anand