summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2017-11-21 12:09:43 -0500
committerChris Michael <cp.michael@samsung.com>2018-01-31 11:18:03 -0500
commitea0780bfe7d737864529f761af89885c8c6cffc6 (patch)
treeea0ba959c52616aba1fafe837d8deca51810cf9c
parent6f0273f714f7837663d4a38ce6d61cb8d5c60450 (diff)
downloadefl-ea0780bfe7d737864529f761af89885c8c6cffc6.tar.gz
ecore-drm2: Add API function to get/set output relative mode
These API functions will be needed inside Enlightenment in order to determine proper extended screen size based on output relative position. @feature Signed-off-by: Chris Michael <cp.michael@samsung.com>
-rw-r--r--src/lib/ecore_drm2/Ecore_Drm2.h34
-rw-r--r--src/lib/ecore_drm2/ecore_drm2_outputs.c14
-rw-r--r--src/lib/ecore_drm2/ecore_drm2_private.h5
3 files changed, 53 insertions, 0 deletions
diff --git a/src/lib/ecore_drm2/Ecore_Drm2.h b/src/lib/ecore_drm2/Ecore_Drm2.h
index 04c224f6ec..34a614f30b 100644
--- a/src/lib/ecore_drm2/Ecore_Drm2.h
+++ b/src/lib/ecore_drm2/Ecore_Drm2.h
@@ -39,6 +39,17 @@ typedef enum _Ecore_Drm2_Fb_Status
ECORE_DRM2_FB_STATUS_PLANE_RELEASE = 32,
} Ecore_Drm2_Fb_Status;
+typedef enum _Ecore_Drm2_Relative
+{
+ ECORE_DRM2_RELATIVE_UNKNOWN,
+ ECORE_DRM2_RELATIVE_NONE,
+ ECORE_DRM2_RELATIVE_CLONE,
+ ECORE_DRM2_RELATIVE_TO_LEFT,
+ ECORE_DRM2_RELATIVE_TO_RIGHT,
+ ECORE_DRM2_RELATIVE_TO_ABOVE,
+ ECORE_DRM2_RELATIVE_TO_BELOW
+} Ecore_Drm2_Relative;
+
/* opaque structure to represent a drm device */
typedef struct _Ecore_Drm2_Device Ecore_Drm2_Device;
@@ -801,6 +812,29 @@ EAPI void *ecore_drm2_output_user_data_get(Ecore_Drm2_Output *o);
EAPI unsigned int ecore_drm2_output_subpixel_get(const Ecore_Drm2_Output *output);
/**
+ * Set the relative state of the output
+ *
+ * @param output The output
+ * @param relative The relative state to set
+ *
+ * @ingroup Ecore_Drm2_Output_Group
+ * @since 1.21
+ */
+EAPI void ecore_drm2_output_relative_set(Ecore_Drm2_Output *output, Ecore_Drm2_Relative relative);
+
+/**
+ * Get the relative state of the output
+ *
+ * @param output
+ *
+ * @return The relative state
+ *
+ * @ingroup Ecore_Drm2_Output_Group
+ * @since 1.21
+ */
+EAPI Ecore_Drm2_Relative ecore_drm2_output_relative_get(Ecore_Drm2_Output *output);
+
+/**
* @defgroup Ecore_Drm2_Fb_Group Drm framebuffer functions
*
* 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 3089206ebc..985a0975ca 100644
--- a/src/lib/ecore_drm2/ecore_drm2_outputs.c
+++ b/src/lib/ecore_drm2/ecore_drm2_outputs.c
@@ -1655,3 +1655,17 @@ ecore_drm2_output_pending_get(Ecore_Drm2_Output *output)
return EINA_FALSE;
}
+
+EAPI void
+ecore_drm2_output_relative_set(Ecore_Drm2_Output *output, Ecore_Drm2_Relative relative)
+{
+ EINA_SAFETY_ON_NULL_RETURN(output);
+ output->relative.mode = relative;
+}
+
+EAPI Ecore_Drm2_Relative
+ecore_drm2_output_relative_get(Ecore_Drm2_Output *output)
+{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(output, ECORE_DRM2_RELATIVE_UNKNOWN);
+ return output->relative.mode;
+}
diff --git a/src/lib/ecore_drm2/ecore_drm2_private.h b/src/lib/ecore_drm2/ecore_drm2_private.h
index 3c1040d57b..06a9950a93 100644
--- a/src/lib/ecore_drm2/ecore_drm2_private.h
+++ b/src/lib/ecore_drm2/ecore_drm2_private.h
@@ -232,6 +232,11 @@ struct _Ecore_Drm2_Output
Ecore_Drm2_Backlight_Type type;
} backlight;
+ struct
+ {
+ Ecore_Drm2_Relative mode;
+ } relative;
+
drmModeCrtcPtr ocrtc;
/* prep is for state we're preparing and have never