1
0
Fork 0

kms-winsys: Add api that tells cogl to ignore a crtc

An application might for whatever reason want to control a specific output
directly and have cogl only swap the other outputs if any. So add an api that
allows setting a crtc to be ignored.

https://bugzilla.gnome.org/show_bug.cgi?id=730536
This commit is contained in:
Adel Gadllah 2014-05-21 20:24:52 +02:00
parent fe183554ca
commit d9afc6dada
3 changed files with 42 additions and 2 deletions

View file

@ -67,6 +67,8 @@ typedef struct {
uint32_t *connectors;
uint32_t count;
CoglBool ignore;
} CoglKmsCrtc;
/**
@ -97,5 +99,21 @@ cogl_kms_display_set_layout (CoglDisplay *display,
int n_crtcs,
CoglError **error);
/**
* cogl_kms_display_set_layout:
* @onscreen: a #CoglDisplay
* @id: KMS output id
* @ignore: Ignore ouput or not
*
* Tells cogl to ignore (or stop ignoring) a ctrc which means
* it never flips buffers at this crtc.
*
* Stability: unstable
*/
void
cogl_kms_display_set_ignore_crtc (CoglDisplay *display,
uint32_t id,
CoglBool ignore);
COGL_END_DECLS
#endif /* __COGL_KMS_DISPLAY_H__ */

View file

@ -68,6 +68,7 @@ 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);
struct gbm_device *
cogl_kms_renderer_get_gbm (CoglRenderer *renderer);
COGL_END_DECLS
#endif /* __COGL_KMS_RENDERER_H__ */

View file

@ -582,7 +582,7 @@ flip_all_crtcs (CoglDisplay *display, CoglFlipKMS *flip, int fb_id)
CoglKmsCrtc *crtc = l->data;
int ret;
if (crtc->count == 0)
if (crtc->count == 0 || crtc->ignore)
continue;
ret = drmModePageFlip (kms_renderer->fd,
@ -1238,3 +1238,24 @@ cogl_kms_display_set_layout (CoglDisplay *display,
return TRUE;
}
void
cogl_kms_display_set_ignore_crtc (CoglDisplay *display,
uint32_t id,
CoglBool ignore)
{
CoglDisplayEGL *egl_display = display->winsys;
CoglDisplayKMS *kms_display = egl_display->platform;
GList *l;
for (l = kms_display->crtcs; l; l = l->next)
{
CoglKmsCrtc *crtc = l->data;
if (crtc->id == id)
{
crtc->ignore = ignore;
break;
}
}
}