您尚未登录。

楼主 #1 2020-11-23 11:55:58

xinxin
会员
注册时间: 2019-10-28
已发帖子: 8
积分: 28

Opengl EGL初始化失败,返回EGL_NO_DISPLAY

A33用mali OpenGL错误,有没有遇到过

测试代码如下:

egl_dpy = eglGetDisplay(EGL_DEFAULT_DISPLAY);
   if (egl_dpy == EGL_NO_DISPLAY)
      egl_fatal("failed to get a display");
   if (!eglInitialize(egl_dpy, &major, &minor))
      egl_fatal("failed to initialize EGL");

用默认显示器,eglGetDisplay可以过,eglInitialize会错误,返回EGL_NO_DISPLAY
eglGetDisplay(EGL_DEFAULT_DISPLAY);

-----------

char *fbdev = "/dev/fb0";
   fd = open(fbdev, O_RDWR);
   if (fd < 0)
      egl_fatal("failed to open %s", fbdev);
   egl_dpy = eglGetDisplay((EGLNativeDisplayType)fd);
   
   if (egl_dpy == EGL_NO_DISPLAY)
      egl_fatal("failed to get a display");
   if (!eglInitialize(egl_dpy, &major, &minor))
      egl_fatal("failed to initialize EGL");

如果先打开/dev/fb0
则eglGetDisplay会错误,返回EGL_NO_DISPLAY


ls
egl*
[root@dragonboard /root]# ./egl 
open /dev/fb0
UMP: ump_arch_open() failed to open UMP device driver
failed to initialize EGL
Aborted
[root@dragonboard /root]# insmod /lib/modules/3.4.39/ump.ko 
[   62.165246] UMP: UMP device driver  loaded
[root@dragonboard /root]# ./egl 
open /dev/fb0
failed to initialize EGL
Aborted
[root@dragonboard /root]# insmod /lib/modules/3.4.39/mali.ko 
[   84.345159] axp22_dcdc2: Failed to create debugfs directory
[   84.351573] =========================================================
[   84.358719]        Mali GPU Information         
[   84.363970] voltage             : 1140 mV
[   84.368417] initial frequency   : 408000000 MHz
[   84.373469] frame buffer address: 0x58c00000 - 0x78c00000
[   84.379466] frame buffer size   : 512 MB
[   84.383834] =========================================================
[   84.393913] Mali: Mali device driver loaded
[root@dragonboard /root]# ./egl 
open /dev/fb0
failed to initialize EGL
Aborted
[root@dragonboard /root]# 

离线

楼主 #2 2020-11-23 11:59:01

xinxin
会员
注册时间: 2019-10-28
已发帖子: 8
积分: 28

Re: Opengl EGL初始化失败,返回EGL_NO_DISPLAY

这个是fb的参数,开启了双缓冲,测试双缓冲也正常

the framebuffer device was opended successfully.
id                        
smem_start                1488977920
smem_len                  3072000
type                      0
type_aux                  0
visual                    2
xpanstep                  1
ypanstep                  1
line_length               3200
mmio_start                0
mmio_len                  0
accel                     0

xres                      800
yres                      480
xres_virturl              800
yres_virtual              960
xoffset                   0
yoffset                   0
bits_per_pixel            32
grayscale                 0
fb_bitfield red.offset    16
fb_bitfield    .length    8
fb_bitfield    .msb_right 0
fb_bitfield green.offset  8
fb_bitfield      .length  8
fb_bitfield    .msb_right 0
fb_bitfield blue.offset   0
fb_bitfield     .length   8
fb_bitfield    .msb_right 0
fb_bitfield transp.offset 24
fb_bitfield       .length 8
fb_bitfield    .msb_right 0
nonstd                    0
activate                  0
height                    0
widht                     0
accel_flags               0
pixclock                  30303
left_margin               46
right_margin              209
upper_margin              18
lower_margin              22
hsync_len                 0
vsync_len                 5
sync                      0
vmode                     0
rotate                    0
the framebuffer devices was mapped to memory successfully
bye the framebuffer

最近编辑记录 xinxin (2020-11-23 11:59:42)

离线

楼主 #3 2020-11-23 12:26:33

xinxin
会员
注册时间: 2019-10-28
已发帖子: 8
积分: 28

Re: Opengl EGL初始化失败,返回EGL_NO_DISPLAY

通过eglGetError取到的错误是EGL_BAD_ALLOC

离线

页脚

工信部备案:粤ICP备20025096号 Powered by FluxBB

感谢为中文互联网持续输出优质内容的各位老铁们。 QQ: 516333132, 微信(wechat): whycan_cn (哇酷网/挖坑网/填坑网) service@whycan.cn