From 5609ac65710052b5da29a373ce6675a7cdaf4193 Mon Sep 17 00:00:00 2001 From: Matthew Kosarek Date: Wed, 18 Oct 2023 13:42:54 -0400 Subject: [PATCH] Capturing the crtc_id --- src/platforms/eglstream-kms/server/egl_output.cpp | 5 ++--- src/platforms/eglstream-kms/server/egl_output.h | 1 + 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/platforms/eglstream-kms/server/egl_output.cpp b/src/platforms/eglstream-kms/server/egl_output.cpp index d6bad33d8d..ca3e129f1f 100644 --- a/src/platforms/eglstream-kms/server/egl_output.cpp +++ b/src/platforms/eglstream-kms/server/egl_output.cpp @@ -217,7 +217,7 @@ void mgek::EGLOutput::configure(size_t kms_mode_index) mgk::DRMModeCrtcUPtr crtc; mgk::DRMModePlaneUPtr plane; std::tie(crtc, plane) = mgk::find_crtc_with_primary_plane(drm_fd, connector); - auto const crtc_id = crtc->crtc_id; + _crtc_id = crtc->crtc_id; plane_id = plane->plane_id; auto ret = drmModeCreatePropertyBlob( @@ -238,7 +238,7 @@ void mgek::EGLOutput::configure(size_t kms_mode_index) atomic_commit(dummy.id(), nullptr, DRM_MODE_ATOMIC_ALLOW_MODESET); EGLAttrib const crtc_filter[] = { - EGL_DRM_CRTC_EXT, static_cast(crtc_id), + EGL_DRM_CRTC_EXT, static_cast(_crtc_id), EGL_NONE}; int found_layers{0}; if (eglGetOutputLayersEXT(display, crtc_filter, &layer, 1, &found_layers) != EGL_TRUE) @@ -284,7 +284,6 @@ int mgek::EGLOutput::atomic_commit(uint64_t fb, const void *drm_event_userdata, if (flags & DRM_MODE_ATOMIC_ALLOW_MODESET) { - auto _crtc_id = crtc_id(); mgk::ObjectProperties crtc_props{drm_fd, _crtc_id, DRM_MODE_OBJECT_CRTC}; /* Activate the CRTC and set the mode */ diff --git a/src/platforms/eglstream-kms/server/egl_output.h b/src/platforms/eglstream-kms/server/egl_output.h index c17350782f..674d7120a4 100644 --- a/src/platforms/eglstream-kms/server/egl_output.h +++ b/src/platforms/eglstream-kms/server/egl_output.h @@ -73,6 +73,7 @@ class EGLOutput : public DisplayConfigurationOutput uint32_t plane_id; std::unique_ptr plane_props; + uint32_t _crtc_id; uint32_t mode_id;