summaryrefslogtreecommitdiff
path: root/src/lib/ecore_drm2/ecore_drm2_device.c
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2017-05-30 11:01:22 -0400
committerChris Michael <cp.michael@samsung.com>2017-05-30 11:01:22 -0400
commitbd189f69f2926b479b334c30650606645d7fa245 (patch)
tree0dce6c1b78fd38a1e2cb4875833e7934b5f39932 /src/lib/ecore_drm2/ecore_drm2_device.c
parentba4042da1e25ee8ff0f95be242b5a865a0141669 (diff)
ecore-drm2: Don't fill device atomic state if atomic is disabled
If atomic support is disabled (via kernel or env var), then we do not need to fill device atomic state as it will not be used anyway. @fix Signed-off-by: Chris Michael <cp.michael@samsung.com>
Diffstat (limited to 'src/lib/ecore_drm2/ecore_drm2_device.c')
-rw-r--r--src/lib/ecore_drm2/ecore_drm2_device.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/lib/ecore_drm2/ecore_drm2_device.c b/src/lib/ecore_drm2/ecore_drm2_device.c
index 73805c82b4..41d2128604 100644
--- a/src/lib/ecore_drm2/ecore_drm2_device.c
+++ b/src/lib/ecore_drm2/ecore_drm2_device.c
@@ -639,9 +639,12 @@ ecore_drm2_device_open(Ecore_Drm2_Device *device)
639 } 639 }
640 } 640 }
641 641
642 device->state = calloc(1, sizeof(Ecore_Drm2_Atomic_State)); 642 if (_ecore_drm2_use_atomic)
643 if (device->state) 643 {
644 _drm2_atomic_state_fill(device->state, device->fd); 644 device->state = calloc(1, sizeof(Ecore_Drm2_Atomic_State));
645 if (device->state)
646 _drm2_atomic_state_fill(device->state, device->fd);
647 }
645 648
646 device->active_hdlr = 649 device->active_hdlr =
647 ecore_event_handler_add(ELPUT_EVENT_SESSION_ACTIVE, 650 ecore_event_handler_add(ELPUT_EVENT_SESSION_ACTIVE,
@@ -674,7 +677,8 @@ ecore_drm2_device_free(Ecore_Drm2_Device *device)
674{ 677{
675 EINA_SAFETY_ON_NULL_RETURN(device); 678 EINA_SAFETY_ON_NULL_RETURN(device);
676 679
677 _drm2_atomic_state_free(device->state); 680 if (_ecore_drm2_use_atomic)
681 _drm2_atomic_state_free(device->state);
678 682
679 ecore_event_handler_del(device->active_hdlr); 683 ecore_event_handler_del(device->active_hdlr);
680 ecore_event_handler_del(device->device_change_hdlr); 684 ecore_event_handler_del(device->device_change_hdlr);