Jump to content


Photo

[SOLVED] Building Qt5 with OpenGL ES2 and EGL (ubuntu 12.07)


  • Please log in to reply
7 replies to this topic

#1 osnwt

osnwt

    Member

  • Members
  • PipPip
  • 15 posts

Posted 10 January 2015 - 03:04 PM

I want to use the pcduino3 board for OpenGL ES2 applications written in Qt5 (besides of all, it allows to use OpenGL ES2 subset to build the same apps for both ARM and desktop PCs). Doing so, I tried to build Qt5 for pcduino on desktop machine. Finally I managed to make it buildable, but no OpenGL examples work, all terminate with well-known error:

EGL Error : Could not create the egl surface: error = 0x300b (EGL_BAD_NATIVE_WINDOW)

I am new in OpenGL, but AFAIK it is because I need to provide platform hooks for the device building Qt5. The problem is that I did not find a working example of such hooks file for pcduino3. Other device configs in Qt5 (5.4.0) contain "fbdev_window" type which isn't defined in installed headers. Actually, even EGL, GLES2, etc directories do not exist (I linked them to similar header directories in Qt5 source). If I install some Mesa packages, then I have them but with new libs OpenGL ES2 hardware acceleration of native driver is lost. I think that in platform hooks I should get and return the native window handle instead of fbdev_window handle to use accelerated drivers and libraries. But how do I get that if no OpenGL ES2 dev headers installed?

 

So the question to all: has anybody managed to build Qt5 for pcduino3 for original ubuntu image (not latest 14.10, but previous 12.07)?

 

I tried to search forum but qt or qt5 search words are too shot, and no search allowed for them.

 


  • carpinteyrolkh likes this

#2 cwilt

cwilt

    Advanced Member

  • Members
  • PipPipPip
  • 1,012 posts

Posted 11 January 2015 - 01:28 AM

If I can get some time I can try building qt5 as I am running the the previous ubuntu and report back to you.



#3 osnwt

osnwt

    Member

  • Members
  • PipPip
  • 15 posts

Posted 11 January 2015 - 01:43 AM

Thanks. I have some achievements so far, but not a lot.

 

I've built qt5 almost in full, including webkit and examples (few features excluded only like databases, etc). As for platform plugins I built linuxfb and eglfs. After copying device hooks file from another device (which used linuxfb), I have a version with default qpa=linuxfb. It can draw on screen. But windows drawn do not react to events (mouse, keyboard, redraw). And they do not support OpenGL context.

 

As for eglfs, I need to rewrite platform hooks file. I did not manage how to do that yet and wanted to see how to initialize OpenGL context without Qt first. So I took an OpenGL ES SDK from here: http://malideveloper...-for-mali/sdks/ and tried to build examples directly on pcduino. Still no luck, the kit was built fine but the same runtime error "Failed to create EGL surface".

 

So to resolve the issue with Qt5 I need to resolve it first with SDK which compiled well, but doesn't run. Any help will be greatly appreciated. I can't believe that no one yet tried to build OpenGL ES applications for pcduino3 using stock kernel and rootfs. Or if anybody knows which non-stock kernel works for that, that's also the solution.

 

 



#4 osnwt

osnwt

    Member

  • Members
  • PipPip
  • 15 posts

Posted 12 January 2015 - 02:04 AM

It looks like that pcduino firmware uses x11 version of Mali drivers, not linuxfb. Thus it doesn't work with Qt5. This explains the issue.



#5 cwilt

cwilt

    Advanced Member

  • Members
  • PipPipPip
  • 1,012 posts

Posted 12 January 2015 - 03:11 AM

Ah yes, that would do it.



#6 osnwt

osnwt

    Member

  • Members
  • PipPip
  • 15 posts

Posted 13 January 2015 - 01:51 AM

Finally yes, it works on stock ubuntu (no kernel/rootfs rebuilds, just stock with few dependencies from packages).

Built with all demos including OpenGL and webkit (aarrrhhh, so long to build - took 1:40 on quad-core i7 to cross-compile, I guess it would be 4 days on pcduino3 itself or even more).

 

So what I know now:

- it works on stock image;

- it uses almost half of GPU abilities according to reports from similar boards;

- we need to rebuild the kernel to update Mali driver to newer revision to use both GPU cores;

- IIRC, the new ubuntu 14.10 is not yet accelerated, so it might be a good candidate to play with.



#7 cwilt

cwilt

    Advanced Member

  • Members
  • PipPipPip
  • 1,012 posts

Posted 13 January 2015 - 02:25 AM

congrats



#8 eco747

eco747

    Newbie

  • Members
  • Pip
  • 1 posts

Posted 19 October 2016 - 04:25 PM

Hello,

Will you tell us how you did it (exactly) ?






1 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users


    Google (1)