我知道在DRM渲染中,实际像素数据保存在void映射数据中,如下所示:
struct drm_mode_map_dumb arg;
memset(&arg, 0, sizeof(arg));
arg.handle = bo->handle;
ret = drmIoctl(bo->fd, DRM_IOCTL_MODE_MAP_DUMB, &arg);
void* map;
map = mmap(0, bo->size, PROT_READ | PROT_WRITE, MAP_SHARED, bo->fd, arg.offset);
我想知道如何在swapbuffers之后获取GBM中保存的实际像素数据?
struct gbm_bo *bo;
eglSwapBuffers(egl->display, egl->surface);
bo = gbm_surface_lock_front_buffer(gbm->surface);
// How can I get the pixel data from bo ?