aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/ecore_drm
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2015-05-07 11:37:54 -0400
committerChris Michael <cp.michael@samsung.com>2015-05-07 14:39:46 -0400
commit958b15c2077214b3349e9102dd486bc5bef929d7 (patch)
tree7b64e381c7c86adbe871d24ccd19f1091a9783e2 /src/lib/ecore_drm
parentecore-drm: Add API function to find an output given a name (diff)
downloadefl-958b15c2077214b3349e9102dd486bc5bef929d7.tar.gz
ecore-drm: Add new API function to mark an output as primary
Summary: This adds a new API function which we can use to mark a given Ecore_Drm_Output as being the primary output. @feature Signed-off-by: Chris Michael <cp.michael@samsung.com>
Diffstat (limited to 'src/lib/ecore_drm')
-rw-r--r--src/lib/ecore_drm/Ecore_Drm.h10
-rw-r--r--src/lib/ecore_drm/ecore_drm_device.c2
-rw-r--r--src/lib/ecore_drm/ecore_drm_output.c16
3 files changed, 27 insertions, 1 deletions
diff --git a/src/lib/ecore_drm/Ecore_Drm.h b/src/lib/ecore_drm/Ecore_Drm.h
index ad2ae4a9dd..481da42f15 100644
--- a/src/lib/ecore_drm/Ecore_Drm.h
+++ b/src/lib/ecore_drm/Ecore_Drm.h
@@ -869,6 +869,16 @@ EAPI Eina_List *ecore_drm_output_modes_get(Ecore_Drm_Output *output);
EAPI Ecore_Drm_Output *ecore_drm_output_primary_get(Ecore_Drm_Device *dev);
/**
+ * Set a given output as primary
+ *
+ * @param output The Ecore_Drm_Output to set as primary
+ *
+ * @ingroup Ecore_Drm_Output_Group
+ * @since 1.15
+ */
+EAPI void ecore_drm_output_primary_set(Ecore_Drm_Output *output);
+
+/**
* Get the size of the crtc for a given output
*
* @param output The Ecore_Drm_Output to get the crtc size of
diff --git a/src/lib/ecore_drm/ecore_drm_device.c b/src/lib/ecore_drm/ecore_drm_device.c
index 2a29b0e758..b902c19d34 100644
--- a/src/lib/ecore_drm/ecore_drm_device.c
+++ b/src/lib/ecore_drm/ecore_drm_device.c
@@ -553,7 +553,7 @@ ecore_drm_device_output_name_find(Ecore_Drm_Device *dev, const char *name)
Eina_List *l;
EINA_SAFETY_ON_NULL_RETURN_VAL(dev, NULL);
- EINA_SAFETY_ON_TRUE_RETURN_VAL(name, NULL);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(name, NULL);
EINA_LIST_FOREACH(dev->outputs, l, output)
if ((output->name) && (!strcmp(name, output->name)))
diff --git a/src/lib/ecore_drm/ecore_drm_output.c b/src/lib/ecore_drm/ecore_drm_output.c
index 8b4369ec4c..25965383c5 100644
--- a/src/lib/ecore_drm/ecore_drm_output.c
+++ b/src/lib/ecore_drm/ecore_drm_output.c
@@ -1265,6 +1265,22 @@ ecore_drm_output_primary_get(Ecore_Drm_Device *dev)
}
EAPI void
+ecore_drm_output_primary_set(Ecore_Drm_Output *output)
+{
+ const Eina_List *l;
+ Ecore_Drm_Output *out;
+
+ EINA_SAFETY_ON_NULL_RETURN(output);
+
+ /* unmark all outputs as primary */
+ EINA_LIST_FOREACH(output->dev->outputs, l, out)
+ out->primary = EINA_FALSE;
+
+ /* mark this output as primary */
+ output->primary = EINA_TRUE;
+}
+
+EAPI void
ecore_drm_output_crtc_size_get(Ecore_Drm_Output *output, int *width, int *height)
{
if (width) *width = 0;