summaryrefslogtreecommitdiff
path: root/src/lib/ecore_drm2
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2018-02-06 09:07:26 -0500
committerChris Michael <cp.michael@samsung.com>2018-02-13 11:44:11 -0500
commita78dc2d8164692e984ad162f603f8b0d052934e9 (patch)
treecbdadec4973cddd1944570de03323483835816de /src/lib/ecore_drm2
parent45bffff5357634dcb46db0bc582c9016770c2bab (diff)
ecore-drm2: Add API functions to get/set output relative mode
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>
Diffstat (limited to 'src/lib/ecore_drm2')
-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 bede4e5406..7904813c8c 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
39 ECORE_DRM2_FB_STATUS_PLANE_RELEASE = 32, 39 ECORE_DRM2_FB_STATUS_PLANE_RELEASE = 32,
40} Ecore_Drm2_Fb_Status; 40} Ecore_Drm2_Fb_Status;
41 41
42typedef enum _Ecore_Drm2_Relative_Mode
43{
44 ECORE_DRM2_RELATIVE_MODE_UNKNOWN,
45 ECORE_DRM2_RELATIVE_MODE_NONE,
46 ECORE_DRM2_RELATIVE_MODE_CLONE,
47 ECORE_DRM2_RELATIVE_MODE_TO_LEFT,
48 ECORE_DRM2_RELATIVE_MODE_TO_RIGHT,
49 ECORE_DRM2_RELATIVE_MODE_TO_ABOVE,
50 ECORE_DRM2_RELATIVE_MODE_TO_BELOW
51} Ecore_Drm2_Relative_Mode;
52
42/* opaque structure to represent a drm device */ 53/* opaque structure to represent a drm device */
43typedef struct _Ecore_Drm2_Device Ecore_Drm2_Device; 54typedef struct _Ecore_Drm2_Device Ecore_Drm2_Device;
44 55
@@ -791,6 +802,29 @@ EAPI void ecore_drm2_output_user_data_set(Ecore_Drm2_Output *o, void *data);
791EAPI unsigned int ecore_drm2_output_subpixel_get(const Ecore_Drm2_Output *output); 802EAPI unsigned int ecore_drm2_output_subpixel_get(const Ecore_Drm2_Output *output);
792 803
793/** 804/**
805 * Set the relative mode for an output
806 *
807 * @param output The output to set relative mode
808 * @param relative The relative mode to set
809 *
810 * @ingroup Ecore_Drm2_Output_Group
811 * @since 1.21
812 */
813EAPI void ecore_drm2_output_relative_mode_set(Ecore_Drm2_Output *output, Ecore_Drm2_Relative_Mode mode);
814
815/**
816 * Get the relative mode of an output
817 *
818 * @param output The output to retrieve relative mode for
819 *
820 * @return The relative mode of a given output
821 *
822 * @ingroup Ecore_Drm2_Output_Group
823 * @since 1.21
824 */
825EAPI Ecore_Drm2_Relative_Mode ecore_drm2_output_relative_mode_get(Ecore_Drm2_Output *output);
826
827/**
794 * @defgroup Ecore_Drm2_Fb_Group Drm framebuffer functions 828 * @defgroup Ecore_Drm2_Fb_Group Drm framebuffer functions
795 * 829 *
796 * Functions that deal with setup of framebuffers 830 * 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 472c3c5f6b..79a22c5363 100644
--- a/src/lib/ecore_drm2/ecore_drm2_outputs.c
+++ b/src/lib/ecore_drm2/ecore_drm2_outputs.c
@@ -1653,3 +1653,17 @@ ecore_drm2_output_pending_get(Ecore_Drm2_Output *output)
1653 1653
1654 return EINA_FALSE; 1654 return EINA_FALSE;
1655} 1655}
1656
1657EAPI void
1658ecore_drm2_output_relative_mode_set(Ecore_Drm2_Output *output, Ecore_Drm2_Relative_Mode mode)
1659{
1660 EINA_SAFETY_ON_NULL_RETURN(output);
1661 output->relative.mode = mode;
1662}
1663
1664EAPI Ecore_Drm2_Relative_Mode
1665ecore_drm2_output_relative_mode_get(Ecore_Drm2_Output *output)
1666{
1667 EINA_SAFETY_ON_NULL_RETURN_VAL(output, ECORE_DRM2_RELATIVE_MODE_UNKNOWN);
1668 return output->relative.mode;
1669}
diff --git a/src/lib/ecore_drm2/ecore_drm2_private.h b/src/lib/ecore_drm2/ecore_drm2_private.h
index 3c1040d57b..c2a59e4eee 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
232 Ecore_Drm2_Backlight_Type type; 232 Ecore_Drm2_Backlight_Type type;
233 } backlight; 233 } backlight;
234 234
235 struct
236 {
237 Ecore_Drm2_Relative_Mode mode;
238 } relative;
239
235 drmModeCrtcPtr ocrtc; 240 drmModeCrtcPtr ocrtc;
236 241
237 /* prep is for state we're preparing and have never 242 /* prep is for state we're preparing and have never