summaryrefslogtreecommitdiff
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
parent2145cb18c296b4269d52b57c000a9495ce8b71e1 (diff)
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);
869EAPI Ecore_Drm_Output *ecore_drm_output_primary_get(Ecore_Drm_Device *dev); 869EAPI Ecore_Drm_Output *ecore_drm_output_primary_get(Ecore_Drm_Device *dev);
870 870
871/** 871/**
872 * Set a given output as primary
873 *
874 * @param output The Ecore_Drm_Output to set as primary
875 *
876 * @ingroup Ecore_Drm_Output_Group
877 * @since 1.15
878 */
879EAPI void ecore_drm_output_primary_set(Ecore_Drm_Output *output);
880
881/**
872 * Get the size of the crtc for a given output 882 * Get the size of the crtc for a given output
873 * 883 *
874 * @param output The Ecore_Drm_Output to get the crtc size of 884 * @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)
553 Eina_List *l; 553 Eina_List *l;
554 554
555 EINA_SAFETY_ON_NULL_RETURN_VAL(dev, NULL); 555 EINA_SAFETY_ON_NULL_RETURN_VAL(dev, NULL);
556 EINA_SAFETY_ON_TRUE_RETURN_VAL(name, NULL); 556 EINA_SAFETY_ON_NULL_RETURN_VAL(name, NULL);
557 557
558 EINA_LIST_FOREACH(dev->outputs, l, output) 558 EINA_LIST_FOREACH(dev->outputs, l, output)
559 if ((output->name) && (!strcmp(name, output->name))) 559 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)
1265} 1265}
1266 1266
1267EAPI void 1267EAPI void
1268ecore_drm_output_primary_set(Ecore_Drm_Output *output)
1269{
1270 const Eina_List *l;
1271 Ecore_Drm_Output *out;
1272
1273 EINA_SAFETY_ON_NULL_RETURN(output);
1274
1275 /* unmark all outputs as primary */
1276 EINA_LIST_FOREACH(output->dev->outputs, l, out)
1277 out->primary = EINA_FALSE;
1278
1279 /* mark this output as primary */
1280 output->primary = EINA_TRUE;
1281}
1282
1283EAPI void
1268ecore_drm_output_crtc_size_get(Ecore_Drm_Output *output, int *width, int *height) 1284ecore_drm_output_crtc_size_get(Ecore_Drm_Output *output, int *width, int *height)
1269{ 1285{
1270 if (width) *width = 0; 1286 if (width) *width = 0;