ecore-drm2: Add API functions to get/set output relative mode
authorChris Michael <cp.michael@samsung.com>
Tue, 6 Feb 2018 14:07:26 +0000 (09:07 -0500)
committerWonki Kim <wonki_.kim@samsung.com>
Thu, 5 Apr 2018 18:05:30 +0000 (03:05 +0900)
These API functions will be used inside Enlightenment in order to
determine the proper extended screen size based on outputs relative
position.

@feature

Signed-off-by: Chris Michael <cp.michael@samsung.com>
src/lib/ecore_drm2/Ecore_Drm2.h
src/lib/ecore_drm2/ecore_drm2_outputs.c
src/lib/ecore_drm2/ecore_drm2_private.h

index bede4e5..7904813 100644 (file)
@@ -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_Mode
+{
+   ECORE_DRM2_RELATIVE_MODE_UNKNOWN,
+   ECORE_DRM2_RELATIVE_MODE_NONE,
+   ECORE_DRM2_RELATIVE_MODE_CLONE,
+   ECORE_DRM2_RELATIVE_MODE_TO_LEFT,
+   ECORE_DRM2_RELATIVE_MODE_TO_RIGHT,
+   ECORE_DRM2_RELATIVE_MODE_TO_ABOVE,
+   ECORE_DRM2_RELATIVE_MODE_TO_BELOW
+} Ecore_Drm2_Relative_Mode;
+
 /* opaque structure to represent a drm device */
 typedef struct _Ecore_Drm2_Device Ecore_Drm2_Device;
 
@@ -791,6 +802,29 @@ EAPI void ecore_drm2_output_user_data_set(Ecore_Drm2_Output *o, void *data);
 EAPI unsigned int ecore_drm2_output_subpixel_get(const Ecore_Drm2_Output *output);
 
 /**
+ * Set the relative mode for an output
+ *
+ * @param output The output to set relative mode
+ * @param relative The relative mode to set
+ *
+ * @ingroup Ecore_Drm2_Output_Group
+ * @since 1.21
+ */
+EAPI void ecore_drm2_output_relative_mode_set(Ecore_Drm2_Output *output, Ecore_Drm2_Relative_Mode mode);
+
+/**
+ * Get the relative mode of an output
+ *
+ * @param output The output to retrieve relative mode for
+ *
+ * @return The relative mode of a given output
+ *
+ * @ingroup Ecore_Drm2_Output_Group
+ * @since 1.21
+ */
+EAPI Ecore_Drm2_Relative_Mode ecore_drm2_output_relative_mode_get(Ecore_Drm2_Output *output);
+
+/**
  * @defgroup Ecore_Drm2_Fb_Group Drm framebuffer functions
  *
  * Functions that deal with setup of framebuffers
index 472c3c5..79a22c5 100644 (file)
@@ -1653,3 +1653,17 @@ ecore_drm2_output_pending_get(Ecore_Drm2_Output *output)
 
    return EINA_FALSE;
 }
+
+EAPI void
+ecore_drm2_output_relative_mode_set(Ecore_Drm2_Output *output, Ecore_Drm2_Relative_Mode mode)
+{
+   EINA_SAFETY_ON_NULL_RETURN(output);
+   output->relative.mode = mode;
+}
+
+EAPI Ecore_Drm2_Relative_Mode
+ecore_drm2_output_relative_mode_get(Ecore_Drm2_Output *output)
+{
+   EINA_SAFETY_ON_NULL_RETURN_VAL(output, ECORE_DRM2_RELATIVE_MODE_UNKNOWN);
+   return output->relative.mode;
+}
index 3c1040d..c2a59e4 100644 (file)
@@ -232,6 +232,11 @@ struct _Ecore_Drm2_Output
         Ecore_Drm2_Backlight_Type type;
      } backlight;
 
+   struct
+     {
+        Ecore_Drm2_Relative_Mode mode;
+     } relative;
+
    drmModeCrtcPtr ocrtc;
 
    /* prep is for state we're preparing and have never