简化CMakeLists.txt中的依赖文件

This commit is contained in:
Uziel 2024-10-08 08:33:12 +00:00
parent 81b612465e
commit f42638d022
2 changed files with 19 additions and 9 deletions

View File

@ -22,7 +22,7 @@ include_directories(
link_directories(
"/usr/lib"
"/usr/local/lib"
#"/usr/lib/mali-g5x/"
"/usr/lib/mali-g5x/"
)
@ -61,10 +61,7 @@ set(DEP_LIBS
m
pthread
EGL
GLESv2
GL
OpenGL
#X11
mali
)
#

View File

@ -23,6 +23,7 @@
#include "GLES2/gl2ext.h"
#include "EGL/egl.h"
#include "EGL/eglext.h"
// #define XORG_SHOW
@ -53,6 +54,7 @@ int g_stop;
#else
#define USE_GBM_FORMAT GBM_FORMAT_XRGB8888
#define USE_FORMAT USE_GBM_FORMAT
#endif
EGLDisplay egldisplay;
@ -252,6 +254,7 @@ int gbm_mode_set() {
return 0;
}
gbmBo = gbm_surface_lock_front_buffer(gbmSurface);
union gbm_bo_handle bo_handle = gbm_bo_get_handle(gbmBo);
printf("gbm bo handle: %d\n", bo_handle);
dumb_handle = bo_handle.u32;
@ -332,6 +335,12 @@ int gbm_mode_set() {
memcpy(&mode_crtc.mode, modes+i, sizeof(struct drm_mode_modeinfo));
drm_ioctl(fd, DRM_IOCTL_MODE_SETCRTC, &mode_crtc);
// EGLImageKHR eglImage = eglCreateImageKHR(egldisplay, EGL_NO_CONTEXT, EGL_NATIVE_PIXMAP_KHR, gbmBo, NULL);
// if (eglImage == EGL_NO_IMAGE_KHR) {
// int __e = eglGetError();
// printf("create eglImage failed: 0x%x\n", __e);
// }
// eglDestroyImageKHR(egldisplay, eglImage);
return 0;
}
@ -376,6 +385,10 @@ void print_glinfo() {
printf("===================================\n");
}
#define PRINT_CONFIG(display, config, type) \
{ int _tmp; eglGetConfigAttrib(display, config, type, &_tmp); printf("config val " #type ":0x%x\n", _tmp);}
static int matchConfigToVisual(EGLDisplay display, EGLint visualId, EGLConfig* configs, int count)
{
EGLint id = 0;
@ -383,10 +396,9 @@ static int matchConfigToVisual(EGLDisplay display, EGLint visualId, EGLConfig* c
int retId = -1;
for (int i = 0; i < count; ++i)
{
// eglGetConfigAttrib(display, configs[i], EGL_SURFACE_TYPE, &suf_type);
// printf("suf_type: 0x%x\n", suf_type);
// eglGetConfigAttrib(display, configs[i], EGL_NATIVE_VISUAL_TYPE, &suf_type);
// printf("native_visual_type: 0x%x\n", suf_type);
PRINT_CONFIG(display, configs[i], EGL_SURFACE_TYPE);
// PRINT_CONFIG(display, configs[i], EGL_SAMPLES);
// PRINT_CONFIG(display, configs[i], EGL_RENDERABLE_TYPE);
if (!eglGetConfigAttrib(display, configs[i], EGL_NATIVE_VISUAL_ID, &id))
continue;
@ -485,6 +497,7 @@ int init(void)
};
eglsurface = eglCreateWindowSurface(egldisplay, eglconfig, (EGLNativeWindowType)(gbmSurface), win_attrlist);
#endif
ASSERT_EQ(eglGetError(), EGL_SUCCESS);
if (eglsurface == EGL_NO_SURFACE) {
int e = eglGetError();