summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2016-09-22 12:01:38 -0400
committerChris Michael <cp.michael@samsung.com>2016-09-22 13:33:57 -0400
commitd7e013359ef34f726d72ffa084e48b9eab32e7a7 (patch)
tree13b50c761a72782ad2b757a7e3b771db0561a033
parentd99e228e6d5b9c4750b04b74482259a6f4ea8178 (diff)
ecore-drm2: Add code to setup Connector Atomic state for Outputs
Signed-off-by: Chris Michael <cp.michael@samsung.com>
-rw-r--r--src/lib/ecore_drm2/ecore_drm2_outputs.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/lib/ecore_drm2/ecore_drm2_outputs.c b/src/lib/ecore_drm2/ecore_drm2_outputs.c
index d478d03300..99b268b55a 100644
--- a/src/lib/ecore_drm2/ecore_drm2_outputs.c
+++ b/src/lib/ecore_drm2/ecore_drm2_outputs.c
@@ -554,6 +554,35 @@ _output_crtc_state_get(Ecore_Drm2_Atomic_State *state, unsigned int id)
554 554
555 return NULL; 555 return NULL;
556} 556}
557
558static Ecore_Drm2_Connector_State *
559_atomic_state_conn_duplicate(Ecore_Drm2_Connector_State *state)
560{
561 Ecore_Drm2_Connector_State *cstate;
562
563 cstate = calloc(1, sizeof(Ecore_Drm2_Connector_State));
564 if (!cstate) return NULL;
565
566 memcpy(cstate, state, sizeof(Ecore_Drm2_Connector_State));
567
568 return cstate;
569}
570
571static Ecore_Drm2_Connector_State *
572_output_conn_state_get(Ecore_Drm2_Atomic_State *state, unsigned int id)
573{
574 Ecore_Drm2_Connector_State *cstate;
575 int i = 0;
576
577 for (; i < state->conns; i++)
578 {
579 cstate = &state->conn_states[i];
580 if (cstate->obj_id != id) continue;
581 return _atomic_state_conn_duplicate(cstate);
582 }
583
584 return NULL;
585}
557#endif 586#endif
558 587
559static Eina_Bool 588static Eina_Bool
@@ -624,6 +653,8 @@ _output_create(Ecore_Drm2_Device *dev, const drmModeRes *res, const drmModeConne
624 { 653 {
625 output->crtc_state = 654 output->crtc_state =
626 _output_crtc_state_get(dev->state, output->crtc_id); 655 _output_crtc_state_get(dev->state, output->crtc_id);
656 output->conn_state =
657 _output_conn_state_get(dev->state, output->conn_id);
627 } 658 }
628 else 659 else
629#endif 660#endif