diff mbox

libqeglfs.so not found on imx6

Message ID CAOMZO5Be5Y_81g8F1to4kRX7e3TgOqRa6-kVXti0C5pchzCW1w@mail.gmail.com
State Not Applicable
Headers show

Commit Message

Fabio Estevam March 4, 2017, 7:41 p.m. UTC
On Sat, Mar 4, 2017 at 11:47 AM, Fabio Estevam <festevam@gmail.com> wrote:
> Hi Gary,
>
> On Sat, Mar 4, 2017 at 9:33 AM, Fabio Estevam <festevam@gmail.com> wrote:
>
>> Not yet, still stuck at the "drmModeGetResources failed" error.
>
> I can also get this same error with the new kmscube package from:
> https://cgit.freedesktop.org/mesa/kmscube/log/
>
> # kmscube
> drmModeGetResources failed: Invalid argument
> failed to initialize legacy DRM
>
> It works if I explicitly pass the /dev/dri device:
>
> kmscube -D /dev/dri/card1
>
> I think QT5 is trying to access /dev/dri/card0, but it should be using
> /dev/dri/card1 instead.

Yes, this is the problem.

If I do an ugly hack like this:

         return false;

Comments

Gary Bisson March 6, 2017, 10:19 a.m. UTC | #1
Hi Fabio,

On Sat, Mar 4, 2017 at 8:41 PM, Fabio Estevam <festevam@gmail.com> wrote:
> On Sat, Mar 4, 2017 at 11:47 AM, Fabio Estevam <festevam@gmail.com> wrote:
>> Hi Gary,
>>
>> On Sat, Mar 4, 2017 at 9:33 AM, Fabio Estevam <festevam@gmail.com> wrote:
>>
>>> Not yet, still stuck at the "drmModeGetResources failed" error.
>>
>> I can also get this same error with the new kmscube package from:
>> https://cgit.freedesktop.org/mesa/kmscube/log/
>>
>> # kmscube
>> drmModeGetResources failed: Invalid argument
>> failed to initialize legacy DRM
>>
>> It works if I explicitly pass the /dev/dri device:
>>
>> kmscube -D /dev/dri/card1
>>
>> I think QT5 is trying to access /dev/dri/card0, but it should be using
>> /dev/dri/card1 instead.
>
> Yes, this is the problem.
>
> If I do an ugly hack like this:
>
> --- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsdevice.cpp
> +++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsdevice.cpp
> @@ -344,7 +344,7 @@ bool QEglFSKmsDevice::open()
>      Q_ASSERT(m_gbm_device == Q_NULLPTR);
>
>      qCDebug(qLcEglfsKmsDebug) << "Opening device" << m_path;
> -    m_dri_fd = qt_safe_open(m_path.toLocal8Bit().constData(), O_RDWR
> | O_CLOEXEC);
> +    m_dri_fd = qt_safe_open("/dev/dri/card1", O_RDWR | O_CLOEXEC);
>      if (m_dri_fd == -1) {
>          qErrnoWarning("Could not open DRM device %s", qPrintable(m_path));
>          return false;
> --
> 2.7.4
>
> Then the demo is launched. It still do not run very well, but at least
> it starts.
>
> Does anyone have an idea on what would be a proper fix?

That's strange I didn't have to do that. Worst part is that my demo
image is using Qt5.6.2 (same as your image) and that I checked no
special env variable is set.

Maybe you can try your kernel on my image, see if that works.

Regards,
Gary
Jagan Teki March 6, 2017, 11:03 a.m. UTC | #2
On Mon, Mar 6, 2017 at 3:49 PM, Gary Bisson
<gary.bisson@boundarydevices.com> wrote:
> Hi Fabio,
>
> On Sat, Mar 4, 2017 at 8:41 PM, Fabio Estevam <festevam@gmail.com> wrote:
>> On Sat, Mar 4, 2017 at 11:47 AM, Fabio Estevam <festevam@gmail.com> wrote:
>>> Hi Gary,
>>>
>>> On Sat, Mar 4, 2017 at 9:33 AM, Fabio Estevam <festevam@gmail.com> wrote:
>>>
>>>> Not yet, still stuck at the "drmModeGetResources failed" error.
>>>
>>> I can also get this same error with the new kmscube package from:
>>> https://cgit.freedesktop.org/mesa/kmscube/log/
>>>
>>> # kmscube
>>> drmModeGetResources failed: Invalid argument
>>> failed to initialize legacy DRM
>>>
>>> It works if I explicitly pass the /dev/dri device:
>>>
>>> kmscube -D /dev/dri/card1
>>>
>>> I think QT5 is trying to access /dev/dri/card0, but it should be using
>>> /dev/dri/card1 instead.
>>
>> Yes, this is the problem.
>>
>> If I do an ugly hack like this:
>>
>> --- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsdevice.cpp
>> +++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsdevice.cpp
>> @@ -344,7 +344,7 @@ bool QEglFSKmsDevice::open()
>>      Q_ASSERT(m_gbm_device == Q_NULLPTR);
>>
>>      qCDebug(qLcEglfsKmsDebug) << "Opening device" << m_path;
>> -    m_dri_fd = qt_safe_open(m_path.toLocal8Bit().constData(), O_RDWR
>> | O_CLOEXEC);
>> +    m_dri_fd = qt_safe_open("/dev/dri/card1", O_RDWR | O_CLOEXEC);
>>      if (m_dri_fd == -1) {
>>          qErrnoWarning("Could not open DRM device %s", qPrintable(m_path));
>>          return false;
>> --
>> 2.7.4
>>
>> Then the demo is launched. It still do not run very well, but at least
>> it starts.
>>
>> Does anyone have an idea on what would be a proper fix?
>
> That's strange I didn't have to do that. Worst part is that my demo
> image is using Qt5.6.2 (same as your image) and that I checked no
> special env variable is set.
>
> Maybe you can try your kernel on my image, see if that works.

I just used rootfs, from the link, and kernel 4.9.13 mainline.

Able to see the demo nicely.

Order:
- kmscube
- Boundary devices Tux
- jellyfish
- ideas in motion
- 28 fps (1. Lord of the Rings)

So, I'm investigating config options on buildroot will let you know
for further update.

thanks!
Jagan Teki March 6, 2017, 11:44 a.m. UTC | #3
On Mon, Mar 6, 2017 at 4:33 PM, Jagan Teki <jagannadh.teki@gmail.com> wrote:
> On Mon, Mar 6, 2017 at 3:49 PM, Gary Bisson
> <gary.bisson@boundarydevices.com> wrote:
>> Hi Fabio,
>>
>> On Sat, Mar 4, 2017 at 8:41 PM, Fabio Estevam <festevam@gmail.com> wrote:
>>> On Sat, Mar 4, 2017 at 11:47 AM, Fabio Estevam <festevam@gmail.com> wrote:
>>>> Hi Gary,
>>>>
>>>> On Sat, Mar 4, 2017 at 9:33 AM, Fabio Estevam <festevam@gmail.com> wrote:
>>>>
>>>>> Not yet, still stuck at the "drmModeGetResources failed" error.
>>>>
>>>> I can also get this same error with the new kmscube package from:
>>>> https://cgit.freedesktop.org/mesa/kmscube/log/
>>>>
>>>> # kmscube
>>>> drmModeGetResources failed: Invalid argument
>>>> failed to initialize legacy DRM
>>>>
>>>> It works if I explicitly pass the /dev/dri device:
>>>>
>>>> kmscube -D /dev/dri/card1
>>>>
>>>> I think QT5 is trying to access /dev/dri/card0, but it should be using
>>>> /dev/dri/card1 instead.
>>>
>>> Yes, this is the problem.
>>>
>>> If I do an ugly hack like this:
>>>
>>> --- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsdevice.cpp
>>> +++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsdevice.cpp
>>> @@ -344,7 +344,7 @@ bool QEglFSKmsDevice::open()
>>>      Q_ASSERT(m_gbm_device == Q_NULLPTR);
>>>
>>>      qCDebug(qLcEglfsKmsDebug) << "Opening device" << m_path;
>>> -    m_dri_fd = qt_safe_open(m_path.toLocal8Bit().constData(), O_RDWR
>>> | O_CLOEXEC);
>>> +    m_dri_fd = qt_safe_open("/dev/dri/card1", O_RDWR | O_CLOEXEC);
>>>      if (m_dri_fd == -1) {
>>>          qErrnoWarning("Could not open DRM device %s", qPrintable(m_path));
>>>          return false;
>>> --
>>> 2.7.4
>>>
>>> Then the demo is launched. It still do not run very well, but at least
>>> it starts.
>>>
>>> Does anyone have an idea on what would be a proper fix?
>>
>> That's strange I didn't have to do that. Worst part is that my demo
>> image is using Qt5.6.2 (same as your image) and that I checked no
>> special env variable is set.
>>
>> Maybe you can try your kernel on my image, see if that works.
>
> I just used rootfs, from the link, and kernel 4.9.13 mainline.
>
> Able to see the demo nicely.
>
> Order:
> - kmscube
> - Boundary devices Tux
> - jellyfish
> - ideas in motion
> - 28 fps (1. Lord of the Rings)
>
> So, I'm investigating config options on buildroot will let you know
> for further update.

And by the way, did anyone find this issue.

In file included from
/workspace/buildroot/output/host/usr/arm-buildroot-linux-gnueabihf/sysroot/usr/include/EGL/egl.h:39:0,
                 from
../../../../include/QtEglSupport/5.8.0/QtEglSupport/private/../../../../../src/platformsupport/eglconvenience/qt_egl_p.h:63,
                 from
../../../../include/QtEglSupport/5.8.0/QtEglSupport/private/qt_egl_p.h:1,
                 from api/qeglfsglobal_p.h:56,
                 from api/qeglfsintegration_p.h:54,
                 from qeglfsmain.cpp:41:
/workspace/buildroot/output/host/usr/arm-buildroot-linux-gnueabihf/sysroot/usr/include/EGL/eglplatform.h:119:22:
fatal error: X11/Xlib.h: No such file or directory
 #include <X11/Xlib.h>
                      ^
compilation terminated.

Look like Qt5.8.0 is unable to build with current tool-chain, 5.6.2 succeeded

thanks!
Fabio Estevam March 6, 2017, 11:46 a.m. UTC | #4
On Mon, Mar 6, 2017 at 8:44 AM, Jagan Teki <jagannadh.teki@gmail.com> wrote:
>
> And by the way, did anyone find this issue.
>
> In file included from
> /workspace/buildroot/output/host/usr/arm-buildroot-linux-gnueabihf/sysroot/usr/include/EGL/egl.h:39:0,
>                  from
> ../../../../include/QtEglSupport/5.8.0/QtEglSupport/private/../../../../../src/platformsupport/eglconvenience/qt_egl_p.h:63,
>                  from
> ../../../../include/QtEglSupport/5.8.0/QtEglSupport/private/qt_egl_p.h:1,
>                  from api/qeglfsglobal_p.h:56,
>                  from api/qeglfsintegration_p.h:54,
>                  from qeglfsmain.cpp:41:
> /workspace/buildroot/output/host/usr/arm-buildroot-linux-gnueabihf/sysroot/usr/include/EGL/eglplatform.h:119:22:
> fatal error: X11/Xlib.h: No such file or directory
>  #include <X11/Xlib.h>
>                       ^
> compilation terminated.
>
> Look like Qt5.8.0 is unable to build with current tool-chain, 5.6.2 succeeded

Yes, that's why I needed to switch to QT 5.6.2 on my tests.

I would be interested to know if you are able to run the Qt5 Cinematic
demo well when building it from Buildroot master.

Thanks
Jagan Teki March 6, 2017, 12:08 p.m. UTC | #5
On Mon, Mar 6, 2017 at 5:16 PM, Fabio Estevam <festevam@gmail.com> wrote:
> On Mon, Mar 6, 2017 at 8:44 AM, Jagan Teki <jagannadh.teki@gmail.com> wrote:
>>
>> And by the way, did anyone find this issue.
>>
>> In file included from
>> /workspace/buildroot/output/host/usr/arm-buildroot-linux-gnueabihf/sysroot/usr/include/EGL/egl.h:39:0,
>>                  from
>> ../../../../include/QtEglSupport/5.8.0/QtEglSupport/private/../../../../../src/platformsupport/eglconvenience/qt_egl_p.h:63,
>>                  from
>> ../../../../include/QtEglSupport/5.8.0/QtEglSupport/private/qt_egl_p.h:1,
>>                  from api/qeglfsglobal_p.h:56,
>>                  from api/qeglfsintegration_p.h:54,
>>                  from qeglfsmain.cpp:41:
>> /workspace/buildroot/output/host/usr/arm-buildroot-linux-gnueabihf/sysroot/usr/include/EGL/eglplatform.h:119:22:
>> fatal error: X11/Xlib.h: No such file or directory
>>  #include <X11/Xlib.h>
>>                       ^
>> compilation terminated.
>>
>> Look like Qt5.8.0 is unable to build with current tool-chain, 5.6.2 succeeded
>
> Yes, that's why I needed to switch to QT 5.6.2 on my tests.
>
> I would be interested to know if you are able to run the Qt5 Cinematic
> demo well when building it from Buildroot master.

- Jelly fish: working
-------------------------
# glmark2-es2-drm -b jellyfish
MESA-LOADER: device is not located on the PCI bus
MESA-LOADER: device is not located on the PCI bus
MESA-LOADER: device is not located on the PCI bus
** Failed to set swap interval. Results may be bounded above by refresh rate.
=======================================================
    glmark2 2014.03
=======================================================
    OpenGL Information
    GL_VENDOR:     etnaviv
    GL_RENDERER:   Gallium 0.4 on Vivante GC2000 rev 5108
    GL_VERSION:    OpenGL ES 2.0 Mesa 17.0.1
=======================================================
** Failed to set swap interval. Results may be bounded above by refresh rate.
[jellyfish] <default>: FPS: 25 FrameTime: 40.000 ms
================================

- CinematicExperience:
-----------------------------
- demo launched but 'Black' object on list like 'Lord of the Rings' etc

# CinematicExperience-demo
MESA-LOADER: device is not located on the PCI bus
MESA-LOADER: device is not located on the PCI bus
MESA-LOADER: device is not located on the PCI bus
Failed to move cursor on screen LVDS1: -14
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
QOpenGLFramebufferObject: Unsupported framebuffer format.
QOpenGLFramebufferObject: Framebuffer incomplete, missing attachment.
QOpenGLFramebufferObject: Unsupported framebuffer format.
QOpenGLFramebufferObject: Framebuffer incomplete, missing attachment.
QOpenGLFramebufferObject: Unsupported framebuffer format.
QOpenGLFramebufferObject: Framebuffer incomplete, missing attachment.
QOpenGLFramebufferObject: Unsupported framebuffer format.
QOpenGLFramebufferObject: Framebuffer incomplete, missing attachment.


thanks!
Fabio Estevam March 6, 2017, 12:18 p.m. UTC | #6
On Mon, Mar 6, 2017 at 9:08 AM, Jagan Teki <jagannadh.teki@gmail.com> wrote:

> - CinematicExperience:
> -----------------------------
> - demo launched but 'Black' object on list like 'Lord of the Rings' etc
>
> # CinematicExperience-demo
> MESA-LOADER: device is not located on the PCI bus
> MESA-LOADER: device is not located on the PCI bus
> MESA-LOADER: device is not located on the PCI bus
> Failed to move cursor on screen LVDS1: -14
> libpng warning: iCCP: known incorrect sRGB profile
> libpng warning: iCCP: known incorrect sRGB profile
> QOpenGLFramebufferObject: Unsupported framebuffer format.
> QOpenGLFramebufferObject: Framebuffer incomplete, missing attachment.
> QOpenGLFramebufferObject: Unsupported framebuffer format.
> QOpenGLFramebufferObject: Framebuffer incomplete, missing attachment.
> QOpenGLFramebufferObject: Unsupported framebuffer format.
> QOpenGLFramebufferObject: Framebuffer incomplete, missing attachment.
> QOpenGLFramebufferObject: Unsupported framebuffer format.
> QOpenGLFramebufferObject: Framebuffer incomplete, missing attachment.

I also saw this defect here. Would be nice to understand where it comes from.

Gary,

Do you have the Buildroot hash that your demo was generated from?

Thanks
Peter Seiderer March 6, 2017, 9:05 p.m. UTC | #7
Hello Jagan,

On Mon, 6 Mar 2017 17:14:23 +0530, Jagan Teki <jagannadh.teki@gmail.com> wrote:

> On Mon, Mar 6, 2017 at 4:33 PM, Jagan Teki <jagannadh.teki@gmail.com> wrote:
> > On Mon, Mar 6, 2017 at 3:49 PM, Gary Bisson
> > <gary.bisson@boundarydevices.com> wrote:
> >> Hi Fabio,
> >>
> >> On Sat, Mar 4, 2017 at 8:41 PM, Fabio Estevam <festevam@gmail.com> wrote:
> >>> On Sat, Mar 4, 2017 at 11:47 AM, Fabio Estevam <festevam@gmail.com> wrote:
> >>>> Hi Gary,
> >>>>
> >>>> On Sat, Mar 4, 2017 at 9:33 AM, Fabio Estevam <festevam@gmail.com> wrote:
> >>>>
> >>>>> Not yet, still stuck at the "drmModeGetResources failed" error.
> >>>>
> >>>> I can also get this same error with the new kmscube package from:
> >>>> https://cgit.freedesktop.org/mesa/kmscube/log/
> >>>>
> >>>> # kmscube
> >>>> drmModeGetResources failed: Invalid argument
> >>>> failed to initialize legacy DRM
> >>>>
> >>>> It works if I explicitly pass the /dev/dri device:
> >>>>
> >>>> kmscube -D /dev/dri/card1
> >>>>
> >>>> I think QT5 is trying to access /dev/dri/card0, but it should be using
> >>>> /dev/dri/card1 instead.
> >>>
> >>> Yes, this is the problem.
> >>>
> >>> If I do an ugly hack like this:
> >>>
> >>> --- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsdevice.cpp
> >>> +++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsdevice.cpp
> >>> @@ -344,7 +344,7 @@ bool QEglFSKmsDevice::open()
> >>>      Q_ASSERT(m_gbm_device == Q_NULLPTR);
> >>>
> >>>      qCDebug(qLcEglfsKmsDebug) << "Opening device" << m_path;
> >>> -    m_dri_fd = qt_safe_open(m_path.toLocal8Bit().constData(), O_RDWR
> >>> | O_CLOEXEC);
> >>> +    m_dri_fd = qt_safe_open("/dev/dri/card1", O_RDWR | O_CLOEXEC);
> >>>      if (m_dri_fd == -1) {
> >>>          qErrnoWarning("Could not open DRM device %s", qPrintable(m_path));
> >>>          return false;
> >>> --
> >>> 2.7.4
> >>>
> >>> Then the demo is launched. It still do not run very well, but at least
> >>> it starts.
> >>>
> >>> Does anyone have an idea on what would be a proper fix?
> >>
> >> That's strange I didn't have to do that. Worst part is that my demo
> >> image is using Qt5.6.2 (same as your image) and that I checked no
> >> special env variable is set.
> >>
> >> Maybe you can try your kernel on my image, see if that works.
> >
> > I just used rootfs, from the link, and kernel 4.9.13 mainline.
> >
> > Able to see the demo nicely.
> >
> > Order:
> > - kmscube
> > - Boundary devices Tux
> > - jellyfish
> > - ideas in motion
> > - 28 fps (1. Lord of the Rings)
> >
> > So, I'm investigating config options on buildroot will let you know
> > for further update.
> 
> And by the way, did anyone find this issue.
> 
> In file included from
> /workspace/buildroot/output/host/usr/arm-buildroot-linux-gnueabihf/sysroot/usr/include/EGL/egl.h:39:0,
>                  from
> ../../../../include/QtEglSupport/5.8.0/QtEglSupport/private/../../../../../src/platformsupport/eglconvenience/qt_egl_p.h:63,
>                  from
> ../../../../include/QtEglSupport/5.8.0/QtEglSupport/private/qt_egl_p.h:1,
>                  from api/qeglfsglobal_p.h:56,
>                  from api/qeglfsintegration_p.h:54,
>                  from qeglfsmain.cpp:41:
> /workspace/buildroot/output/host/usr/arm-buildroot-linux-gnueabihf/sysroot/usr/include/EGL/eglplatform.h:119:22:
> fatal error: X11/Xlib.h: No such file or directory
>  #include <X11/Xlib.h>
>                       ^
> compilation terminated.
> 
> Look like Qt5.8.0 is unable to build with current tool-chain, 5.6.2 succeeded

Should not happen ;-), mind to share the .config file?

Regards,
Peter

> 
> thanks!
Fabio Estevam March 6, 2017, 10:41 p.m. UTC | #8
Hi Peter,

On Mon, Mar 6, 2017 at 6:05 PM, Peter Seiderer <ps.report@gmx.net> wrote:

> Should not happen ;-), mind to share the .config file?

I am also able to reproduce this build error. Just shared my defconfig
on a new thread, so that we can discuss about it.

Thanks
diff mbox

Patch

--- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsdevice.cpp
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsdevice.cpp
@@ -344,7 +344,7 @@  bool QEglFSKmsDevice::open()
     Q_ASSERT(m_gbm_device == Q_NULLPTR);

     qCDebug(qLcEglfsKmsDebug) << "Opening device" << m_path;
-    m_dri_fd = qt_safe_open(m_path.toLocal8Bit().constData(), O_RDWR
| O_CLOEXEC);
+    m_dri_fd = qt_safe_open("/dev/dri/card1", O_RDWR | O_CLOEXEC);
     if (m_dri_fd == -1) {
         qErrnoWarning("Could not open DRM device %s", qPrintable(m_path));