I know that in DRM rendering, the actual pixel data is saved in void mapped data as follows:
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);
I want to know how to get the actual pixel data saved in GBM after swapbuffers?
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 ?