summaryrefslogtreecommitdiff
path: root/src/lib/ecore_drm2
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2018-02-21 12:16:31 -0500
committerChris Michael <cp.michael@samsung.com>2018-02-27 09:16:00 -0500
commitfc4f66c6c234d95d807342927044f5ce9276e9a9 (patch)
tree70bb995d4bac7c4ca78a5d1cafae09cf88d85fc6 /src/lib/ecore_drm2
parent9f63fac2d2df7689f3ce7b8a542d36c46cf64689 (diff)
ecore-drm2: Add API to get/set which output is relative to another
In order to know which output we should clone, we need a way to store/retrieve the output which should be cloned. This patch adds a small api we can use in randr config dialog to get/set that value. @feature Signed-off-by: Chris Michael <cp.michael@samsung.com>
Diffstat (limited to 'src/lib/ecore_drm2')
-rw-r--r--src/lib/ecore_drm2/Ecore_Drm2.h23
-rw-r--r--src/lib/ecore_drm2/ecore_drm2_outputs.c14
-rw-r--r--src/lib/ecore_drm2/ecore_drm2_private.h1
3 files changed, 38 insertions, 0 deletions
diff --git a/src/lib/ecore_drm2/Ecore_Drm2.h b/src/lib/ecore_drm2/Ecore_Drm2.h
index 7904813c8c..8b987b920f 100644
--- a/src/lib/ecore_drm2/Ecore_Drm2.h
+++ b/src/lib/ecore_drm2/Ecore_Drm2.h
@@ -825,6 +825,29 @@ EAPI void ecore_drm2_output_relative_mode_set(Ecore_Drm2_Output *output, Ecore_D
825EAPI Ecore_Drm2_Relative_Mode ecore_drm2_output_relative_mode_get(Ecore_Drm2_Output *output); 825EAPI Ecore_Drm2_Relative_Mode ecore_drm2_output_relative_mode_get(Ecore_Drm2_Output *output);
826 826
827/** 827/**
828 * Set which output a given output is relative to
829 *
830 * @param output The output for which to set relative
831 * @param relative The output for which the first output is relative to
832 *
833 * @ingroup Ecore_Drm2_Output_Group
834 * @since 1.21
835 */
836EAPI void ecore_drm2_output_relative_to_set(Ecore_Drm2_Output *output, const char *relative);
837
838/**
839 * Get which output is relative to a given output
840 *
841 * @param output The output for which to retrieve relative
842 *
843 * @return The name of the output which is relative to the given output or NULL
844 *
845 * @ingroup Ecore_Drm2_Output_Group
846 * @since 1.21
847 */
848EAPI const char *ecore_drm2_output_relative_to_get(Ecore_Drm2_Output *output);
849
850/**
828 * @defgroup Ecore_Drm2_Fb_Group Drm framebuffer functions 851 * @defgroup Ecore_Drm2_Fb_Group Drm framebuffer functions
829 * 852 *
830 * Functions that deal with setup of framebuffers 853 * Functions that deal with setup of framebuffers
diff --git a/src/lib/ecore_drm2/ecore_drm2_outputs.c b/src/lib/ecore_drm2/ecore_drm2_outputs.c
index 3bb0ada0ac..d1f7ad0d07 100644
--- a/src/lib/ecore_drm2/ecore_drm2_outputs.c
+++ b/src/lib/ecore_drm2/ecore_drm2_outputs.c
@@ -1668,3 +1668,17 @@ ecore_drm2_output_relative_mode_get(Ecore_Drm2_Output *output)
1668 EINA_SAFETY_ON_NULL_RETURN_VAL(output, ECORE_DRM2_RELATIVE_MODE_UNKNOWN); 1668 EINA_SAFETY_ON_NULL_RETURN_VAL(output, ECORE_DRM2_RELATIVE_MODE_UNKNOWN);
1669 return output->relative.mode; 1669 return output->relative.mode;
1670} 1670}
1671
1672EAPI void
1673ecore_drm2_output_relative_to_set(Ecore_Drm2_Output *output, const char *relative)
1674{
1675 EINA_SAFETY_ON_NULL_RETURN(output);
1676 eina_stringshare_replace(&output->relative.to, relative);
1677}
1678
1679EAPI const char *
1680ecore_drm2_output_relative_to_get(Ecore_Drm2_Output *output)
1681{
1682 EINA_SAFETY_ON_NULL_RETURN_VAL(output, NULL);
1683 return output->relative.to;
1684}
diff --git a/src/lib/ecore_drm2/ecore_drm2_private.h b/src/lib/ecore_drm2/ecore_drm2_private.h
index c2a59e4eee..490f1665e4 100644
--- a/src/lib/ecore_drm2/ecore_drm2_private.h
+++ b/src/lib/ecore_drm2/ecore_drm2_private.h
@@ -234,6 +234,7 @@ struct _Ecore_Drm2_Output
234 234
235 struct 235 struct
236 { 236 {
237 const char *to;
237 Ecore_Drm2_Relative_Mode mode; 238 Ecore_Drm2_Relative_Mode mode;
238 } relative; 239 } relative;
239 240