diff options
author | Anton Kindestam <antonki@kth.se> | 2018-06-02 12:53:54 +0200 |
---|---|---|
committer | Jan Ekström <jeebjp@gmail.com> | 2018-07-09 02:17:47 +0300 |
commit | 7beee68f8d8617557990a5f860d9d1f99c4ba009 (patch) | |
tree | 592bd1673b1edd902746e4bf39d9c7406d69f987 /video/out/drm_common.c | |
parent | 1298b9d201fc61cfffc6f82d78ae27fc294655b7 (diff) | |
download | mpv-7beee68f8d8617557990a5f860d9d1f99c4ba009.tar.bz2 mpv-7beee68f8d8617557990a5f860d9d1f99c4ba009.tar.xz |
context_drm_egl: Fix CRTC setup and release code when using atomic
The previous code did not save enough information about the old state,
and could end up changing what plane the fbcon:s FB got attached to,
or in worse case causing a blank screen (observed in some multi-screen
setups on Sandy Bridge).
In addition refactor the handling of drmModeModeInfo property blobs to
not leak, as well as enable reuse of already created blobs.
Diffstat (limited to 'video/out/drm_common.c')
-rw-r--r-- | video/out/drm_common.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/video/out/drm_common.c b/video/out/drm_common.c index df06744fbe..aa3d0998c4 100644 --- a/video/out/drm_common.c +++ b/video/out/drm_common.c @@ -237,7 +237,7 @@ static bool setup_mode(struct kms *kms, int mode_id) return false; } - kms->mode = kms->connector->modes[mode_id]; + kms->mode.mode = kms->connector->modes[mode_id]; return true; } @@ -281,7 +281,7 @@ struct kms *kms_create(struct mp_log *log, const char *connector_spec, .fd = open_card(card_no), .connector = NULL, .encoder = NULL, - .mode = { 0 }, + .mode = {{0}}, .crtc_id = -1, .card_no = card_no, }; @@ -324,7 +324,6 @@ struct kms *kms_create(struct mp_log *log, const char *connector_spec, } } - drmModeFreeResources(res); return kms; @@ -341,6 +340,7 @@ void kms_destroy(struct kms *kms) { if (!kms) return; + drm_mode_destroy_blob(kms->fd, &kms->mode); if (kms->connector) { drmModeFreeConnector(kms->connector); kms->connector = NULL; @@ -425,7 +425,7 @@ void kms_show_available_cards_and_connectors(struct mp_log *log) double kms_get_display_fps(const struct kms *kms) { - return mode_get_Hz(&kms->mode); + return mode_get_Hz(&kms->mode.mode); } int drm_validate_connector_opt(struct mp_log *log, const struct m_option *opt, |