summaryrefslogtreecommitdiff
path: root/src/lib/ecore_drm
diff options
context:
space:
mode:
authorDuna Oh <duna.oh@samsung.com>2016-02-15 08:44:55 -0500
committerChris Michael <cpmichael@osg.samsung.com>2016-02-15 08:46:08 -0500
commit5ae5aade0aa291392bfe5f4e57a4cdc99f8fa605 (patch)
treeca4baa3d9fba00f91101ad0f1575b053869a8092 /src/lib/ecore_drm
parentb85ae776335e2e4d8c232c263eba94ecbc309ec5 (diff)
ecore-drm: Make ecore_drm_output_rotation_set fail properly
When trying to set a rotation on a given output, we would previously always be returning EINA_TRUE. We should be returning EINA_FALSE when the rotation_set fails. @fix Summary: ecore_drm_output_rotation_set should be returning EINA_FALSE when the output doesn't have a plane of requested type. Test Plan: 1. call ecore_drm_output_rotation_set() with ECORE_DRM_PLANE_TYPE_CURSOR 2. If output doesn't have a plane of ECORE_DRM_PLANE_TYPE_CURSOR, the for statement does nothing. But return value is TRUE; Reviewers: raster, stefan_schmidt, gwanglim, devilhorns, zmike Subscribers: input.hacker, cedric, JHyun, ManMower, jpeg Differential Revision: https://phab.enlightenment.org/D3678
Diffstat (limited to 'src/lib/ecore_drm')
-rw-r--r--src/lib/ecore_drm/ecore_drm_output.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/lib/ecore_drm/ecore_drm_output.c b/src/lib/ecore_drm/ecore_drm_output.c
index 1ac8f9a..9322ab9 100644
--- a/src/lib/ecore_drm/ecore_drm_output.c
+++ b/src/lib/ecore_drm/ecore_drm_output.c
@@ -1510,6 +1510,7 @@ ecore_drm_output_rotation_set(Ecore_Drm_Output *output, Ecore_Drm_Plane_Type typ
1510{ 1510{
1511 Ecore_Drm_Plane *plane; 1511 Ecore_Drm_Plane *plane;
1512 Eina_List *l; 1512 Eina_List *l;
1513 Eina_Bool ret = EINA_FALSE;
1513 1514
1514 EINA_SAFETY_ON_NULL_RETURN_VAL(output, EINA_FALSE); 1515 EINA_SAFETY_ON_NULL_RETURN_VAL(output, EINA_FALSE);
1515 1516
@@ -1522,13 +1523,18 @@ ecore_drm_output_rotation_set(Ecore_Drm_Output *output, Ecore_Drm_Plane_Type typ
1522 return EINA_FALSE; 1523 return EINA_FALSE;
1523 } 1524 }
1524 1525
1525 drmModeObjectSetProperty(output->dev->drm.fd, 1526 if (drmModeObjectSetProperty(output->dev->drm.fd,
1526 output->primary_plane_id, 1527 output->primary_plane_id,
1527 DRM_MODE_OBJECT_PLANE, 1528 DRM_MODE_OBJECT_PLANE,
1528 output->rotation_prop_id, 1529 output->rotation_prop_id,
1529 plane->rotation_map[ffs(rotation)]); 1530 plane->rotation_map[ffs(rotation)]) < 0)
1531 {
1532 WRN("Failed to set Rotation");
1533 return EINA_FALSE;
1534 }
1535 ret = EINA_TRUE;
1530 break; 1536 break;
1531 } 1537 }
1532 1538
1533 return EINA_TRUE; 1539 return ret;
1534} 1540}