How does drmModeAddFB adds framebuffer with gbm_bo object

Xeechem Chou <[email protected]>
Newsgroups gmane.comp.video.mesa3d.user
Message-ID <CABYQQNDM127ugsYWxqJ4UkMswmTUxXKxyWx0ARKi6PXRuMYUdQ@mail.gmail.com>
Hi, everyone.

Trying to understand how drmModeAddFB work with gbm_bo object.

From google I know that I can use gbm_bo object as framebuffer with kms. The
code is like this.

struct gbm_device *gbm = gbm_create_device(fd);
struct gbm_bo *bo = gbm_bo_create(gbm, width, height,
                                  GBM_BO_FORMAT_XRGB8888,
                                  GBM_BO_USE_SCANOUT | GBM_BO_USE_RENDERING
);

and suppose we have set correct drm connector, encoders and EGL stuff.
Now we can create framebuffer with:

uint32_t handle = gbm_bo_get_handle(bo).u32;
uint32_t stride = gbm_bo_get_stride(bo);
drmModeAddFB(fd, width, height, 24, 32, stride, handle, &fb_id);
//and we can setCrtc now
drmModeSetCrtc(fd, crtc, fb_id, 0,0, connector_id, 1, mode);

But HOW did drmModeAddFB use the bo exactly? I have some example code using
GL to
render something into a egl surface which is created from gbm_bo. And after
drmModeSetCrtc, I did get a triangle on my screen.

BTW, The example code is https://gist.github.com/dvdhrm/1364994

-Xeechem

_______________________________________________
mesa-users mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.