summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDerek Foreman <derekf@osg.samsung.com>2017-04-28 15:30:34 -0500
committerDerek Foreman <derekf@osg.samsung.com>2017-05-04 16:51:18 -0500
commit6bf806a70b1716d14529a7711dfac0952888b1a4 (patch)
treeb6f39ffa249f6a92f2dfaa484621c39af16de41f
parentca0e23221c2b73ad2475539c6a80d0280d9abc0e (diff)
downloadefl-6bf806a70b1716d14529a7711dfac0952888b1a4.tar.gz
ecore_drm2: Add API to update the fb for a plane
-rw-r--r--src/lib/ecore_drm2/Ecore_Drm2.h14
-rw-r--r--src/lib/ecore_drm2/ecore_drm2_plane.c16
2 files changed, 30 insertions, 0 deletions
diff --git a/src/lib/ecore_drm2/Ecore_Drm2.h b/src/lib/ecore_drm2/Ecore_Drm2.h
index 1448500d44..4fa46ce4e6 100644
--- a/src/lib/ecore_drm2/Ecore_Drm2.h
+++ b/src/lib/ecore_drm2/Ecore_Drm2.h
@@ -1032,6 +1032,20 @@ EAPI void ecore_drm2_plane_release(Ecore_Drm2_Plane *plane);
*/
EAPI void ecore_drm2_plane_destination_set(Ecore_Drm2_Plane *plane, int x, int y, int w, int h);
+/**
+ * Set plane frame buffer
+ *
+ * @param plane
+ * @param fb
+ *
+ * @return whether the plane state has been successfully changed or not
+ *
+ * @ingroup Ecore_Drm2_Plane_Group
+ * @since 1.20
+ */
+EAPI Eina_Bool ecore_drm2_plane_fb_set(Ecore_Drm2_Plane *plane, Ecore_Drm2_Fb *fb);
+
+
# endif
#endif
diff --git a/src/lib/ecore_drm2/ecore_drm2_plane.c b/src/lib/ecore_drm2/ecore_drm2_plane.c
index 9ee0bb3a75..a1f0444565 100644
--- a/src/lib/ecore_drm2/ecore_drm2_plane.c
+++ b/src/lib/ecore_drm2/ecore_drm2_plane.c
@@ -142,3 +142,19 @@ ecore_drm2_plane_destination_set(Ecore_Drm2_Plane *plane, int x, int y, int w, i
_fb_atomic_flip_test(plane->output);
}
+
+EAPI Eina_Bool
+ecore_drm2_plane_fb_set(Ecore_Drm2_Plane *plane, Ecore_Drm2_Fb *fb)
+{
+ uint32_t fallback_id;
+
+ EINA_SAFETY_ON_NULL_RETURN_VAL(plane, EINA_FALSE);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(fb, EINA_FALSE);
+
+ fallback_id = plane->state->fid.value;
+ plane->state->fid.value = fb->id;
+ if (_fb_atomic_flip_test(plane->output)) return EINA_TRUE;
+
+ plane->state->fid.value = fallback_id;
+ return EINA_FALSE;
+}