This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch devs/devilhorns/apos
in repository efl.

View the commit online.

commit 47c4f384b0baeab45e4b36fb703facd7049db7ac
Author: Christopher Michael <devilho...@comcast.net>
AuthorDate: Thu Oct 10 16:18:15 2024 -0400

    ecore_drm2: Fix ecore_drm2_display_mode_set
    
    ecore_drm2_display_mode_set shouold also be setting the crtc state
    'active' value based on if there is a mode or not
---
 src/lib/ecore_drm2/ecore_drm2_displays.c | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/src/lib/ecore_drm2/ecore_drm2_displays.c b/src/lib/ecore_drm2/ecore_drm2_displays.c
index 5408c81948..4b257eed81 100644
--- a/src/lib/ecore_drm2/ecore_drm2_displays.c
+++ b/src/lib/ecore_drm2/ecore_drm2_displays.c
@@ -680,8 +680,30 @@ ecore_drm2_display_mode_set(Ecore_Drm2_Display *disp, Ecore_Drm2_Display_Mode *m
    crtc_cstate = disp->crtc->state.current;
    crtc_pstate = disp->crtc->state.pending;
 
+   if (mode)
+     {
+	int ret = 0;
+
+	if (mode->id)
+	  sym_drmModeDestroyPropertyBlob(disp->crtc->fd, mode->id);
+
+	ret =
+	  sym_drmModeCreatePropertyBlob(disp->crtc->fd, &mode->info,
+					sizeof(drmModeModeInfo), &mode->id);
+	if (ret < 0)
+	  {
+	     ERR("Failed to create Mode Property Blob: %m");
+	     return;
+	  }
+     }
+
    if (crtc_cstate->mode.value != mode->id)
      {
+	if (mode)
+	  crtc_pstate->active.value = 1;
+	else
+	  crtc_pstate->active.value = 0;
+
         crtc_pstate->mode.value = mode->id;
         crtc_pstate->changes |= ECORE_DRM2_CRTC_STATE_MODE;
      }
@@ -1124,6 +1146,13 @@ ecore_drm2_display_changes_apply(Ecore_Drm2_Display *disp)
 
    EINA_SAFETY_ON_NULL_RETURN_VAL(disp, EINA_FALSE);
    EINA_SAFETY_ON_NULL_RETURN_VAL(disp->crtc, EINA_FALSE);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(disp->conn, EINA_FALSE);
+
+   if (!_ecore_drm2_connectors_changes_apply(disp->conn))
+     return EINA_FALSE;
+
+   if (!_ecore_drm2_crtcs_changes_apply(disp->crtc))
+     return EINA_FALSE;
 
    cstate = disp->state.current;
    pstate = disp->state.pending;
@@ -1171,6 +1200,9 @@ ecore_drm2_display_changes_apply(Ecore_Drm2_Display *disp)
 	pstate->changes &= ~ECORE_DRM2_DISPLAY_STATE_POSITION;
      }
 
+   /* If pstate still has some changes listed, than that means something failed */
+   if (pstate->changes) return EINA_FALSE;
+
    /* copy pending state to current when applying changes is successful */
    memcpy(cstate, pstate, sizeof(Ecore_Drm2_Display_State));
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

Reply via email to