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.

TDA4VM: EGLImageKHR create failed

Other Parts Discussed in Thread: TDA4VM

型号: TDA4VM

rootfs:7.2

I'm using eglCreateImageKHR to create EGLImageKHR to return nullptr.
Can help to point out the BUG or provide a TDA4VM platform  create the Simple Code of EGLImageKHR ?

- - code - - -
// /dev/dri/renderD128
// /dev/dri/by-path/platform-4e20000000.gpu-card
// /dev/dri/by-path/platform-4e20000000.gpu-render
int drmfd = open("/dev/dri/by-path/platform-4e20000000.gpu-render", O_RDWR, 0);
struct gbm_device *gbm_dev = gbm_create_device(drmfd);
struct gbm_bo* gbmbo = gbm_bo_create(gbm_dev, swidth, sheight, GBM_FORMAT_ARGB8888, GBM_BO_USE_RENDERING);
uint32_t bostride = gbm_bo_get_stride(gbmbo);
void *addr, *map_data;
addr = gbm_bo_map(gbmbo, 0, 0, swidth, sheight, GBM_BO_TRANSFER_READ, &bostride, &map_data);
unsigned int offset = 0;
EGLint attr[] = {
EGL_WIDTH, swidth,
EGL_HEIGHT, sheight,
EGL_LINUX_DRM_FOURCC_EXT, DRM_FORMAT_RGBA8888,
EGL_DMA_BUF_PLANE0_FD_EXT, drmfd,
EGL_DMA_BUF_PLANE0_OFFSET_EXT, offset,
EGL_DMA_BUF_PLANE0_PITCH_EXT, swidth * 4,
EGL_NONE,EGL_NONE
};
PFNEGLCREATEIMAGEKHRPROC eglCreateImageKHR;
eglCreateImageKHR = (PFNEGLCREATEIMAGEKHRPROC)eglGetProcAddress("eglCreateImageKHR");

EGLDisplay disp = eglGetCurrentDisplay();
EGLImageKHR imageKHR = eglCreateImageKHR(disp, EGL_NO_CONTEXT, EGL_LINUX_DMA_BUF_EXT, NULL, attr);
the imageKHR I got was a nullptr, but there was no error log.
  • Hello,

    Thank you for reporting. While we look into your code on TDA4, I want to point you to an example that can be used as a reference for EGLImage in general:

    https://git.ti.com/cgit/glsdk/omapdrmtest/

    You can refer to util/display-kmscube.c as an example. We will also try and publish a simpler example.

    Regards

    Hemant

  • Thank you for providing simple, I encountered a compilation error while referring to omapdrmtest.

    main.cpp:(.text+0x2a8): undefined reference to `omap_device_new(int)'

    I confirm that I have successfully connected these SO's. Is this library working in TDA4 rootfs7.2?
    libc.so,libdrm.so,libdrm_omap.so,libdrm_freedreno.so

    ----code-----

    int main()
    {

    struct display_kmscube *disp_kmsc = NULL;
    struct display *disp;
    int ret, i, enabled = 0;
    float fov = 45, distance = 8, connector_id = 4;

    disp_kmsc = (struct display_kmscube *)calloc(1, sizeof(*disp_kmsc));
    if (!disp_kmsc) {
    ERROR("allocation failed");
    goto fail;
    }

    disp_kmsc->gl.distance = distance;
    disp_kmsc->gl.fov = fov;
    disp_kmsc->user_connector_id = connector_id;
    disp = &disp_kmsc->base; // 其中包含了egldisplay

    for (i=0; i<MAX_FACES; i++) {
    pthread_mutex_init(&disp_kmsc->lock[i], NULL);
    }
    pthread_mutex_init(&disp_kmsc->init_lock, NULL);

    disp->fd = open("/dev/dri/by-path/platform-4e20000000.gpu-render", O_RDWR);
    if (disp->fd < 0) {
    ERROR("could not open drm device: %s (%d)", strerror(errno), errno);
    goto fail;
    }

    disp->dev = omap_device_new(disp->fd);

  • Hello,

    Sorry for not being clear. I had shared the link for code reference only. Like I mentioned, we are working on a simpler example tried on TDA4. I will update you as soon as we have that.

    Regards

    Hemant

  • Thanks, I'm looking forward to it.
    Looking forward to a solution on rootfs7.2.

  • hello
    I'm still curious, Libdrm_freedreno. so and libdrm_omap.so 'are not available, I guess because the function parameters in. H and so are not aligned. (rootfs7.2)