ARTICLE AD BOX
On dumb-buffre creation according exampe (https://manpages.debian.org/testing/libdrm-dev/drm-memory.7.en.html)
struct drm_mode_create_dumb creq; struct drm_mode_destroy_dumb dreq; struct drm_mode_map_dumb mreq; uint32_t fb; int ret; void *map; /* create dumb buffer */ memset(&creq, 0, sizeof(creq)); creq.width = 1920; creq.height = 1080; creq.bpp = 32; ret = drmIoctl(fd, DRM_IOCTL_MODE_CREATE_DUMB, &creq); if (ret < 0) { /* buffer creation failed; see "errno" for more error codes */ ... } /* creq.pitch, creq.handle and creq.size are filled by this ioctl with * the requested values and can be used now. */ /* create framebuffer object for the dumb-buffer */ ret = drmModeAddFB(fd, 1920, 1080, 24, 32, creq.pitch, creq.handle, &fb); if (ret) { /* frame buffer creation failed; see "errno" */ ...Call drmIoctl(fd, DRM_IOCTL_MODE_CREATE_DUMB, &creq); returns with code -1 (Cannot allocate memory). Creation of smaller size buffers (e.g. 64x64) leads to -22 (Invalid parameter) return code of next drmModeAddFB(fd, 64, 64, 24, 32, creq.pitch, creq.handle, &fb); call.
So, what can be the issue? How drmIoctl(DRM_IOCTL_MODE_CREATE_DUMB) and drmModeAddFB() calls should be tied one with another and with DRM device resolution?
