kms_winsys: Add cogl_kms_renderer_get_gbm api

Applications might want to get the underlying gbm device so add a getter for it.

https://bugzilla.gnome.org/show_bug.cgi?id=730536
This commit is contained in:
Adel Gadllah 2014-05-13 21:08:59 +02:00
parent 52a646abc5
commit fe183554ca
2 changed files with 15 additions and 0 deletions

View File

@ -68,5 +68,6 @@ cogl_kms_renderer_set_kms_fd (CoglRenderer *renderer,
int int
cogl_kms_renderer_get_kms_fd (CoglRenderer *renderer); cogl_kms_renderer_get_kms_fd (CoglRenderer *renderer);
struct gbm_device *cogl_kms_renderer_get_gbm (CoglRenderer *renderer);
COGL_END_DECLS COGL_END_DECLS
#endif /* __COGL_KMS_RENDERER_H__ */ #endif /* __COGL_KMS_RENDERER_H__ */

View File

@ -1117,6 +1117,20 @@ cogl_kms_renderer_set_kms_fd (CoglRenderer *renderer,
renderer->kms_fd = fd; 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 int
cogl_kms_renderer_get_kms_fd (CoglRenderer *renderer) cogl_kms_renderer_get_kms_fd (CoglRenderer *renderer)
{ {