ecore-drm2: Fix atomic dpms setting (round 2)

As it turns out, we still need to enable/disable the output crtc when
we enable/disable dpms in order for the screen itself to turn off, so
this patch "should" finally fix atomic dpms setting.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
Chris Michael 2017-05-19 11:29:47 -04:00
parent b8336030ea
commit 7a3c658759
1 changed files with 15 additions and 0 deletions

View File

@ -417,6 +417,7 @@ static Eina_Bool
_output_dpms_atomic_set(Ecore_Drm2_Output *output, int level)
{
Ecore_Drm2_Connector_State *cstate;
Ecore_Drm2_Crtc_State *rstate;
drmModeAtomicReq *req = NULL;
Eina_Bool ret = EINA_TRUE;
@ -426,6 +427,7 @@ _output_dpms_atomic_set(Ecore_Drm2_Output *output, int level)
sym_drmModeAtomicSetCursor(req, 0);
cstate = output->conn_state;
rstate = output->crtc_state;
if (sym_drmModeAtomicAddProperty(req, cstate->obj_id,
cstate->dpms.id, level) < 0)
@ -435,6 +437,15 @@ _output_dpms_atomic_set(Ecore_Drm2_Output *output, int level)
goto err;
}
if (sym_drmModeAtomicAddProperty(req, rstate->obj_id,
rstate->active.id,
((level == 0) ? 1 : 0)) < 0)
{
ERR("Failed to add crtc active property");
ret = EINA_FALSE;
goto err;
}
if (sym_drmModeAtomicCommit(output->fd, req, 0, NULL))
{
ERR("Could not set dpms property: %m");
@ -442,6 +453,10 @@ _output_dpms_atomic_set(Ecore_Drm2_Output *output, int level)
}
cstate->dpms.value = level;
if (level == 0)
rstate->active.value = 1;
else
rstate->active.value = 0;
err:
sym_drmModeAtomicFree(req);