diff --git a/cogl/cogl-kms-display.h b/cogl/cogl-kms-display.h index 2192a9f9b..05226df66 100644 --- a/cogl/cogl-kms-display.h +++ b/cogl/cogl-kms-display.h @@ -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__ */ diff --git a/cogl/cogl-kms-renderer.h b/cogl/cogl-kms-renderer.h index 2a619383d..4e4948e56 100644 --- a/cogl/cogl-kms-renderer.h +++ b/cogl/cogl-kms-renderer.h @@ -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__ */ diff --git a/cogl/winsys/cogl-winsys-egl-kms.c b/cogl/winsys/cogl-winsys-egl-kms.c index a40518d90..9be1df10a 100644 --- a/cogl/winsys/cogl-winsys-egl-kms.c +++ b/cogl/winsys/cogl-winsys-egl-kms.c @@ -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; + } + } +}