diff --git a/cogl/cogl-kms-renderer.h b/cogl/cogl-kms-renderer.h index c2606f8c8..2a619383d 100644 --- a/cogl/cogl-kms-renderer.h +++ b/cogl/cogl-kms-renderer.h @@ -68,5 +68,6 @@ cogl_kms_renderer_set_kms_fd (CoglRenderer *renderer, int cogl_kms_renderer_get_kms_fd (CoglRenderer *renderer); +struct gbm_device *cogl_kms_renderer_get_gbm (CoglRenderer *renderer); COGL_END_DECLS #endif /* __COGL_KMS_RENDERER_H__ */ diff --git a/cogl/winsys/cogl-winsys-egl-kms.c b/cogl/winsys/cogl-winsys-egl-kms.c index a475c55a7..a40518d90 100644 --- a/cogl/winsys/cogl-winsys-egl-kms.c +++ b/cogl/winsys/cogl-winsys-egl-kms.c @@ -1117,6 +1117,20 @@ cogl_kms_renderer_set_kms_fd (CoglRenderer *renderer, renderer->kms_fd = fd; } +struct gbm_device * +cogl_kms_renderer_get_gbm (CoglRenderer *renderer) +{ + _COGL_RETURN_VAL_IF_FAIL (cogl_is_renderer (renderer), NULL); + if (renderer->connected) + { + CoglRendererEGL *egl_renderer = renderer->winsys; + CoglRendererKMS *kms_renderer = egl_renderer->platform; + return kms_renderer->gbm; + } + else + return NULL; +} + int cogl_kms_renderer_get_kms_fd (CoglRenderer *renderer) {