summaryrefslogtreecommitdiff
path: root/src/lib/ecore_drm2/ecore_drm2_device.c
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2017-04-27 09:09:46 -0400
committerDerek Foreman <derekf@osg.samsung.com>2017-05-05 12:53:20 -0500
commit03cb02fa741dea6aba0c5b2bb845f0475a7192e7 (patch)
treeb01b4ae62ffe56f4fcc4e09e94511c37b3bda46f /src/lib/ecore_drm2/ecore_drm2_device.c
parente5de325e9019fd35d0beed1568136c73dbaf2960 (diff)
ecore-drm2: Remove newly added atomic API functions
As we need to do atomic commits on a per-output basis, these 2 newly added API functions can go because these functions did one atomic commit for all outputs 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.c165
1 files changed, 0 insertions, 165 deletions
diff --git a/src/lib/ecore_drm2/ecore_drm2_device.c b/src/lib/ecore_drm2/ecore_drm2_device.c
index 8f26974be9..5ee49038d8 100644
--- a/src/lib/ecore_drm2/ecore_drm2_device.c
+++ b/src/lib/ecore_drm2/ecore_drm2_device.c
@@ -677,14 +677,6 @@ ecore_drm2_device_free(Ecore_Drm2_Device *device)
677 677
678 _drm2_atomic_state_free(device->state); 678 _drm2_atomic_state_free(device->state);
679 679
680#ifdef HAVE_ATOMIC_DRM
681 if (_ecore_drm2_use_atomic)
682 {
683 if (device->atomic_req)
684 sym_drmModeAtomicFree(device->atomic_req);
685 }
686#endif
687
688 ecore_event_handler_del(device->active_hdlr); 680 ecore_event_handler_del(device->active_hdlr);
689 ecore_event_handler_del(device->device_change_hdlr); 681 ecore_event_handler_del(device->device_change_hdlr);
690 eina_stringshare_del(device->path); 682 eina_stringshare_del(device->path);
@@ -854,160 +846,3 @@ ecore_drm2_device_prefer_shadow(Ecore_Drm2_Device *device)
854 else 846 else
855 return EINA_FALSE; 847 return EINA_FALSE;
856} 848}
857
858EAPI Eina_Bool
859ecore_drm2_atomic_commit_test(Ecore_Drm2_Device *device)
860{
861 Eina_Bool res = EINA_FALSE;
862#ifdef HAVE_ATOMIC_DRM
863 int ret = 0;
864 Eina_List *l, *ll;
865 Ecore_Drm2_Output *output;
866 Ecore_Drm2_Plane *plane;
867 Ecore_Drm2_Plane_State *pstate;
868 Ecore_Drm2_Crtc_State *cstate;
869 drmModeAtomicReq *req = NULL;
870 uint32_t flags = DRM_MODE_ATOMIC_NONBLOCK | DRM_MODE_ATOMIC_ALLOW_MODESET |
871 DRM_MODE_ATOMIC_TEST_ONLY;
872#endif
873
874 EINA_SAFETY_ON_NULL_RETURN_VAL(device, EINA_FALSE);
875 EINA_SAFETY_ON_TRUE_RETURN_VAL((device->fd < 0), EINA_FALSE);
876
877#ifdef HAVE_ATOMIC_DRM
878 req = sym_drmModeAtomicAlloc();
879 if (!req) return EINA_FALSE;
880
881 sym_drmModeAtomicSetCursor(req, 0);
882
883 EINA_LIST_FOREACH(device->outputs, l, output)
884 {
885 cstate = output->crtc_state;
886
887 ret =
888 sym_drmModeAtomicAddProperty(req, cstate->obj_id, cstate->mode.id,
889 cstate->mode.value);
890 if (ret < 0) goto err;
891
892 ret =
893 sym_drmModeAtomicAddProperty(req, cstate->obj_id, cstate->active.id,
894 cstate->active.value);
895 if (ret < 0) goto err;
896
897 EINA_LIST_FOREACH(output->planes, ll, plane)
898 {
899 pstate = plane->state;
900
901 ret =
902 sym_drmModeAtomicAddProperty(req, pstate->obj_id,
903 pstate->cid.id, pstate->cid.value);
904 if (ret < 0) goto err;
905
906 ret =
907 sym_drmModeAtomicAddProperty(req, pstate->obj_id,
908 pstate->fid.id, pstate->fid.value);
909 if (ret < 0) goto err;
910
911 ret =
912 sym_drmModeAtomicAddProperty(req, pstate->obj_id,
913 pstate->sx.id, pstate->sx.value);
914 if (ret < 0) goto err;
915
916 ret =
917 sym_drmModeAtomicAddProperty(req, pstate->obj_id,
918 pstate->sy.id, pstate->sy.value);
919 if (ret < 0) goto err;
920
921 ret =
922 sym_drmModeAtomicAddProperty(req, pstate->obj_id,
923 pstate->sw.id, pstate->sw.value);
924 if (ret < 0) goto err;
925
926 ret =
927 sym_drmModeAtomicAddProperty(req, pstate->obj_id,
928 pstate->sh.id, pstate->sh.value);
929 if (ret < 0) goto err;
930
931 ret =
932 sym_drmModeAtomicAddProperty(req, pstate->obj_id,
933 pstate->cx.id, pstate->cx.value);
934 if (ret < 0) goto err;
935
936 ret =
937 sym_drmModeAtomicAddProperty(req, pstate->obj_id,
938 pstate->cy.id, pstate->cy.value);
939 if (ret < 0) goto err;
940
941 ret =
942 sym_drmModeAtomicAddProperty(req, pstate->obj_id,
943 pstate->cw.id, pstate->cw.value);
944 if (ret < 0) goto err;
945
946 ret =
947 sym_drmModeAtomicAddProperty(req, pstate->obj_id,
948 pstate->ch.id, pstate->ch.value);
949 if (ret < 0) goto err;
950 }
951 }
952
953 ret =
954 sym_drmModeAtomicCommit(device->fd, req, flags, NULL);
955 if (ret < 0) ERR("Failed Atomic Commit Test: %m");
956 else res = EINA_TRUE;
957
958 if (res)
959 {
960 if (device->atomic_req)
961 {
962 /* merge this test commit with previous */
963 ret = sym_drmModeAtomicMerge(device->atomic_req, req);
964 if (ret < 0)
965 {
966 /* we failed to merge for some reason. */
967
968 /* clear any previous request */
969 sym_drmModeAtomicFree(device->atomic_req);
970
971 /* just use the new request */
972 device->atomic_req = req;
973 }
974 }
975 else
976 device->atomic_req = req;
977 }
978
979 return res;
980
981err:
982 sym_drmModeAtomicFree(req);
983#endif
984
985 return res;
986}
987
988EAPI Eina_Bool
989ecore_drm2_atomic_commit(Ecore_Drm2_Device *device)
990{
991#ifdef HAVE_ATOMIC_DRM
992 int res = 0;
993 uint32_t flags =
994 DRM_MODE_ATOMIC_NONBLOCK | DRM_MODE_PAGE_FLIP_EVENT |
995 DRM_MODE_ATOMIC_ALLOW_MODESET;
996#endif
997
998 EINA_SAFETY_ON_NULL_RETURN_VAL(device, EINA_FALSE);
999 EINA_SAFETY_ON_TRUE_RETURN_VAL((device->fd < 0), EINA_FALSE);
1000
1001#ifdef HAVE_ATOMIC_DRM
1002 if (!device->atomic_req) return EINA_FALSE;
1003
1004 res =
1005 sym_drmModeAtomicCommit(device->fd, device->atomic_req, flags, NULL);
1006 if (res < 0)
1007 ERR("Failed Atomic Commit Test: %m");
1008 else
1009 return EINA_TRUE;
1010#endif
1011
1012 return EINA_FALSE;
1013}