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:
parent
fe183554ca
commit
d9afc6dada
@ -67,6 +67,8 @@ typedef struct {
|
|||||||
|
|
||||||
uint32_t *connectors;
|
uint32_t *connectors;
|
||||||
uint32_t count;
|
uint32_t count;
|
||||||
|
|
||||||
|
CoglBool ignore;
|
||||||
} CoglKmsCrtc;
|
} CoglKmsCrtc;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -97,5 +99,21 @@ cogl_kms_display_set_layout (CoglDisplay *display,
|
|||||||
int n_crtcs,
|
int n_crtcs,
|
||||||
CoglError **error);
|
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
|
COGL_END_DECLS
|
||||||
#endif /* __COGL_KMS_DISPLAY_H__ */
|
#endif /* __COGL_KMS_DISPLAY_H__ */
|
||||||
|
@ -68,6 +68,7 @@ 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);
|
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__ */
|
||||||
|
@ -582,7 +582,7 @@ flip_all_crtcs (CoglDisplay *display, CoglFlipKMS *flip, int fb_id)
|
|||||||
CoglKmsCrtc *crtc = l->data;
|
CoglKmsCrtc *crtc = l->data;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (crtc->count == 0)
|
if (crtc->count == 0 || crtc->ignore)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
ret = drmModePageFlip (kms_renderer->fd,
|
ret = drmModePageFlip (kms_renderer->fd,
|
||||||
@ -1238,3 +1238,24 @@ cogl_kms_display_set_layout (CoglDisplay *display,
|
|||||||
|
|
||||||
return TRUE;
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user