From 67caea357c23443cf583ad401a38bbaae19e3df8 Mon Sep 17 00:00:00 2001 From: rr- Date: Sat, 7 Nov 2015 12:41:40 +0000 Subject: vo_drm: move initialization to drm_common Makes KMS initialization procedures reusable so that they can be used by the upcoming DRM EGL adapter. --- video/out/drm_common.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'video/out/drm_common.h') diff --git a/video/out/drm_common.h b/video/out/drm_common.h index 5e6c1915ba..da26af7f97 100644 --- a/video/out/drm_common.h +++ b/video/out/drm_common.h @@ -18,6 +18,18 @@ #ifndef MP_VT_SWITCHER_H #define MP_VT_SWITCHER_H +#include +#include + +struct kms { + struct mp_log *log; + int fd; + drmModeConnector *connector; + drmModeEncoder *encoder; + drmModeModeInfo mode; + uint32_t crtc_id; +}; + struct vt_switcher { int tty_fd; struct mp_log *log; @@ -33,4 +45,8 @@ void vt_switcher_interrupt_poll(struct vt_switcher *s); void vt_switcher_acquire(struct vt_switcher *s, void (*handler)(void*), void *user_data); void vt_switcher_release(struct vt_switcher *s, void (*handler)(void*), void *user_data); +struct kms *kms_create(struct mp_log *log); +int kms_setup(struct kms *kms, const char *device_path, int conn_id, int mode_id); +void kms_destroy(struct kms *kms); + #endif -- cgit v1.2.3