path: root/video/out/drm_common.h
diff options
authorrr- <>2016-10-04 22:07:19 +0200
committerwm4 <wm4@nowhere>2016-10-07 00:22:23 +0200
commit403f489f6cccf8e6bf74ac1b57fa083759af60ec (patch)
treeba03d5a0b98edec382ed086005e73e47ee422d70 /video/out/drm_common.h
parente9c43258b8efbdc7ba5350dd12426f58599b80c7 (diff)
vo_drm: change CLI options + refactors
- Change connector selection to accept human readable names (such as eDP-1, HDMI-A-2) rather than arbitrary numbers. - Change GPU selection to accept GPU number rather than device paths. - Merge connector and GPU selection into one --drm-connector. - Add support for --drm-connector=help. - Add support for --drm-* in EGL backend. - Refactor KMS; reduce state sharing across drm_common.
Diffstat (limited to 'video/out/drm_common.h')
1 files changed, 16 insertions, 4 deletions
diff --git a/video/out/drm_common.h b/video/out/drm_common.h
index 53ec9e35df..6796472cfc 100644
--- a/video/out/drm_common.h
+++ b/video/out/drm_common.h
@@ -21,6 +21,7 @@
#include <stdbool.h>
#include <xf86drm.h>
#include <xf86drmMode.h>
+#include "options/m_option.h"
struct kms {
struct mp_log *log;
@@ -29,6 +30,7 @@ struct kms {
drmModeEncoder *encoder;
drmModeModeInfo mode;
uint32_t crtc_id;
+ int card_no;
struct vt_switcher {
@@ -43,12 +45,22 @@ void vt_switcher_destroy(struct vt_switcher *s);
void vt_switcher_poll(struct vt_switcher *s, int timeout_ms);
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);
+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);
-bool kms_setup(struct kms *kms, const char *device_path, int conn_id, int mode_id);
+struct kms *kms_create(struct mp_log *log, const char *connector_spec,
+ int mode_id);
void kms_destroy(struct kms *kms);
double kms_get_display_fps(const struct kms *kms);
+void kms_show_available_connectors(struct mp_log *log, int card_no);
+void kms_show_available_modes(struct mp_log *log,
+ const drmModeConnector *connector);
+void kms_show_available_cards_and_connectors(struct mp_log *log);
+int drm_validate_connector_opt(struct mp_log *log, const struct m_option *opt,
+ struct bstr name, struct bstr param);